Active segment: {segment}
\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)\n */ function useSelectedLayoutSegment(parallelRouteKey) {\n if (parallelRouteKey === void 0) parallelRouteKey = \"children\";\n const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);\n if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {\n return null;\n }\n const selectedLayoutSegment = parallelRouteKey === \"children\" ? selectedLayoutSegments[0] : selectedLayoutSegments[selectedLayoutSegments.length - 1];\n // if the default slot is showing, we return null since it's not technically \"selected\" (it's a fallback)\n // and returning an internal value like `__DEFAULT__` would be confusing.\n return selectedLayoutSegment === _segment.DEFAULT_SEGMENT_KEY ? null : selectedLayoutSegment;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=navigation.js.map","/** @internal */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n ReadonlyURLSearchParams: null,\n RedirectType: null,\n notFound: null,\n permanentRedirect: null,\n redirect: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ReadonlyURLSearchParams: function() {\n return ReadonlyURLSearchParams;\n },\n RedirectType: function() {\n return _redirect.RedirectType;\n },\n notFound: function() {\n return _notfound.notFound;\n },\n permanentRedirect: function() {\n return _redirect.permanentRedirect;\n },\n redirect: function() {\n return _redirect.redirect;\n }\n});\nconst _redirect = require(\"./redirect\");\nconst _notfound = require(\"./not-found\");\nclass ReadonlyURLSearchParamsError extends Error {\n constructor(){\n super(\"Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams\");\n }\n}\nclass ReadonlyURLSearchParams extends URLSearchParams {\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ append() {\n throw new ReadonlyURLSearchParamsError();\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ delete() {\n throw new ReadonlyURLSearchParamsError();\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ set() {\n throw new ReadonlyURLSearchParamsError();\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ sort() {\n throw new ReadonlyURLSearchParamsError();\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=navigation.react-server.js.map","\"use client\";\n\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"NotFoundBoundary\", {\n enumerable: true,\n get: function() {\n return NotFoundBoundary;\n }\n});\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _navigation = require(\"./navigation\");\nconst _notfound = require(\"./not-found\");\nconst _warnonce = require(\"../../shared/lib/utils/warn-once\");\nconst _approutercontextsharedruntime = require(\"../../shared/lib/app-router-context.shared-runtime\");\nclass NotFoundErrorBoundary extends _react.default.Component {\n componentDidCatch() {\n if (process.env.NODE_ENV === \"development\" && // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has(\"children\")) {\n let warningMessage = \"No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n\" + \"Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n\";\n if (this.props.missingSlots.size > 0) {\n const formattedSlots = Array.from(this.props.missingSlots).sort((a, b)=>a.localeCompare(b)).map((slot)=>\"@\" + slot).join(\", \");\n warningMessage += \"Missing slots: \" + formattedSlots;\n }\n (0, _warnonce.warnOnce)(warningMessage);\n }\n }\n static getDerivedStateFromError(error) {\n if ((0, _notfound.isNotFoundError)(error)) {\n return {\n notFoundTriggered: true\n };\n }\n // Re-throw if error is not for 404\n throw error;\n }\n static getDerivedStateFromProps(props, state) {\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 */ if (props.pathname !== state.previousPathname && state.notFoundTriggered) {\n return {\n notFoundTriggered: false,\n previousPathname: props.pathname\n };\n }\n return {\n notFoundTriggered: state.notFoundTriggered,\n previousPathname: props.pathname\n };\n }\n render() {\n if (this.state.notFoundTriggered) {\n return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {\n children: [\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"meta\", {\n name: \"robots\",\n content: \"noindex\"\n }),\n process.env.NODE_ENV === \"development\" && /*#__PURE__*/ (0, _jsxruntime.jsx)(\"meta\", {\n name: \"next-error\",\n content: \"not-found\"\n }),\n this.props.notFoundStyles,\n this.props.notFound\n ]\n });\n }\n return this.props.children;\n }\n constructor(props){\n super(props);\n this.state = {\n notFoundTriggered: !!props.asNotFound,\n previousPathname: props.pathname\n };\n }\n}\nfunction NotFoundBoundary(param) {\n let { notFound, notFoundStyles, asNotFound, children } = param;\n const pathname = (0, _navigation.usePathname)();\n const missingSlots = (0, _react.useContext)(_approutercontextsharedruntime.MissingSlotContext);\n return notFound ? /*#__PURE__*/ (0, _jsxruntime.jsx)(NotFoundErrorBoundary, {\n pathname: pathname,\n notFound: notFound,\n notFoundStyles: notFoundStyles,\n asNotFound: asNotFound,\n missingSlots: missingSlots,\n children: children\n }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {\n children: children\n });\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=not-found-boundary.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n isNotFoundError: null,\n notFound: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n isNotFoundError: function() {\n return isNotFoundError;\n },\n notFound: function() {\n return notFound;\n }\n});\nconst NOT_FOUND_ERROR_CODE = \"NEXT_NOT_FOUND\";\nfunction notFound() {\n // eslint-disable-next-line no-throw-literal\n const error = new Error(NOT_FOUND_ERROR_CODE);\n error.digest = NOT_FOUND_ERROR_CODE;\n throw error;\n}\nfunction isNotFoundError(error) {\n if (typeof error !== \"object\" || error === null || !(\"digest\" in error)) {\n return false;\n }\n return error.digest === NOT_FOUND_ERROR_CODE;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=not-found.js.map","/*\n This is a simple promise queue that allows you to limit the number of concurrent promises\n that are running at any given time. It's used to limit the number of concurrent\n prefetch requests that are being made to the server but could be used for other\n things as well.\n*/ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"PromiseQueue\", {\n enumerable: true,\n get: function() {\n return PromiseQueue;\n }\n});\nconst _class_private_field_loose_base = require(\"@swc/helpers/_/_class_private_field_loose_base\");\nconst _class_private_field_loose_key = require(\"@swc/helpers/_/_class_private_field_loose_key\");\nvar _maxConcurrency = /*#__PURE__*/ _class_private_field_loose_key._(\"_maxConcurrency\"), _runningCount = /*#__PURE__*/ _class_private_field_loose_key._(\"_runningCount\"), _queue = /*#__PURE__*/ _class_private_field_loose_key._(\"_queue\"), _processNext = /*#__PURE__*/ _class_private_field_loose_key._(\"_processNext\");\nclass PromiseQueue {\n enqueue(promiseFn) {\n let taskResolve;\n let taskReject;\n const taskPromise = new Promise((resolve, reject)=>{\n taskResolve = resolve;\n taskReject = reject;\n });\n const task = async ()=>{\n try {\n _class_private_field_loose_base._(this, _runningCount)[_runningCount]++;\n const result = await promiseFn();\n taskResolve(result);\n } catch (error) {\n taskReject(error);\n } finally{\n _class_private_field_loose_base._(this, _runningCount)[_runningCount]--;\n _class_private_field_loose_base._(this, _processNext)[_processNext]();\n }\n };\n const enqueueResult = {\n promiseFn: taskPromise,\n task\n };\n // wonder if we should take a LIFO approach here\n _class_private_field_loose_base._(this, _queue)[_queue].push(enqueueResult);\n _class_private_field_loose_base._(this, _processNext)[_processNext]();\n return taskPromise;\n }\n bump(promiseFn) {\n const index = _class_private_field_loose_base._(this, _queue)[_queue].findIndex((item)=>item.promiseFn === promiseFn);\n if (index > -1) {\n const bumpedItem = _class_private_field_loose_base._(this, _queue)[_queue].splice(index, 1)[0];\n _class_private_field_loose_base._(this, _queue)[_queue].unshift(bumpedItem);\n _class_private_field_loose_base._(this, _processNext)[_processNext](true);\n }\n }\n constructor(maxConcurrency = 5){\n Object.defineProperty(this, _processNext, {\n value: processNext\n });\n Object.defineProperty(this, _maxConcurrency, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _runningCount, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _queue, {\n writable: true,\n value: void 0\n });\n _class_private_field_loose_base._(this, _maxConcurrency)[_maxConcurrency] = maxConcurrency;\n _class_private_field_loose_base._(this, _runningCount)[_runningCount] = 0;\n _class_private_field_loose_base._(this, _queue)[_queue] = [];\n }\n}\nfunction processNext(forced) {\n if (forced === void 0) forced = false;\n if ((_class_private_field_loose_base._(this, _runningCount)[_runningCount] < _class_private_field_loose_base._(this, _maxConcurrency)[_maxConcurrency] || forced) && _class_private_field_loose_base._(this, _queue)[_queue].length > 0) {\n var _class_private_field_loose_base__queue_shift;\n (_class_private_field_loose_base__queue_shift = _class_private_field_loose_base._(this, _queue)[_queue].shift()) == null ? void 0 : _class_private_field_loose_base__queue_shift.task();\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=promise-queue.js.map","\"use client\";\n\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n RedirectBoundary: null,\n RedirectErrorBoundary: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n RedirectBoundary: function() {\n return RedirectBoundary;\n },\n RedirectErrorBoundary: function() {\n return RedirectErrorBoundary;\n }\n});\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _navigation = require(\"./navigation\");\nconst _redirect = require(\"./redirect\");\nfunction HandleRedirect(param) {\n let { redirect, reset, redirectType } = param;\n const router = (0, _navigation.useRouter)();\n (0, _react.useEffect)(()=>{\n _react.default.startTransition(()=>{\n if (redirectType === _redirect.RedirectType.push) {\n router.push(redirect, {});\n } else {\n router.replace(redirect, {});\n }\n reset();\n });\n }, [\n redirect,\n redirectType,\n reset,\n router\n ]);\n return null;\n}\nclass RedirectErrorBoundary extends _react.default.Component {\n static getDerivedStateFromError(error) {\n if ((0, _redirect.isRedirectError)(error)) {\n const url = (0, _redirect.getURLFromRedirectError)(error);\n const redirectType = (0, _redirect.getRedirectTypeFromError)(error);\n return {\n redirect: url,\n redirectType\n };\n }\n // Re-throw if error is not for redirect\n throw error;\n }\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific the the `@types/react` version.\n render() {\n const { redirect, redirectType } = this.state;\n if (redirect !== null && redirectType !== null) {\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(HandleRedirect, {\n redirect: redirect,\n redirectType: redirectType,\n reset: ()=>this.setState({\n redirect: null\n })\n });\n }\n return this.props.children;\n }\n constructor(props){\n super(props);\n this.state = {\n redirect: null,\n redirectType: null\n };\n }\n}\nfunction RedirectBoundary(param) {\n let { children } = param;\n const router = (0, _navigation.useRouter)();\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(RedirectErrorBoundary, {\n router: router,\n children: children\n });\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=redirect-boundary.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"RedirectStatusCode\", {\n enumerable: true,\n get: function() {\n return RedirectStatusCode;\n }\n});\nvar RedirectStatusCode;\n(function(RedirectStatusCode) {\n RedirectStatusCode[RedirectStatusCode[\"SeeOther\"] = 303] = \"SeeOther\";\n RedirectStatusCode[RedirectStatusCode[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n RedirectStatusCode[RedirectStatusCode[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n})(RedirectStatusCode || (RedirectStatusCode = {}));\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=redirect-status-code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n RedirectType: null,\n getRedirectError: null,\n getRedirectStatusCodeFromError: null,\n getRedirectTypeFromError: null,\n getURLFromRedirectError: null,\n isRedirectError: null,\n permanentRedirect: null,\n redirect: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n RedirectType: function() {\n return RedirectType;\n },\n getRedirectError: function() {\n return getRedirectError;\n },\n getRedirectStatusCodeFromError: function() {\n return getRedirectStatusCodeFromError;\n },\n getRedirectTypeFromError: function() {\n return getRedirectTypeFromError;\n },\n getURLFromRedirectError: function() {\n return getURLFromRedirectError;\n },\n isRedirectError: function() {\n return isRedirectError;\n },\n permanentRedirect: function() {\n return permanentRedirect;\n },\n redirect: function() {\n return redirect;\n }\n});\nconst _requestasyncstorageexternal = require(\"./request-async-storage.external\");\nconst _actionasyncstorageexternal = require(\"./action-async-storage.external\");\nconst _redirectstatuscode = require(\"./redirect-status-code\");\nconst REDIRECT_ERROR_CODE = \"NEXT_REDIRECT\";\nvar RedirectType;\n(function(RedirectType) {\n RedirectType[\"push\"] = \"push\";\n RedirectType[\"replace\"] = \"replace\";\n})(RedirectType || (RedirectType = {}));\nfunction getRedirectError(url, type, statusCode) {\n if (statusCode === void 0) statusCode = _redirectstatuscode.RedirectStatusCode.TemporaryRedirect;\n const error = new Error(REDIRECT_ERROR_CODE);\n error.digest = REDIRECT_ERROR_CODE + \";\" + type + \";\" + url + \";\" + statusCode + \";\";\n const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore();\n if (requestStore) {\n error.mutableCookies = requestStore.mutableCookies;\n }\n return error;\n}\nfunction redirect(/** The URL to redirect to */ url, type) {\n if (type === void 0) type = \"replace\";\n const actionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore();\n throw getRedirectError(url, type, // If we're in an action, we want to use a 303 redirect\n // as we don't want the POST request to follow the redirect,\n // as it could result in erroneous re-submissions.\n (actionStore == null ? void 0 : actionStore.isAction) ? _redirectstatuscode.RedirectStatusCode.SeeOther : _redirectstatuscode.RedirectStatusCode.TemporaryRedirect);\n}\nfunction permanentRedirect(/** The URL to redirect to */ url, type) {\n if (type === void 0) type = \"replace\";\n const actionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore();\n throw getRedirectError(url, type, // If we're in an action, we want to use a 303 redirect\n // as we don't want the POST request to follow the redirect,\n // as it could result in erroneous re-submissions.\n (actionStore == null ? void 0 : actionStore.isAction) ? _redirectstatuscode.RedirectStatusCode.SeeOther : _redirectstatuscode.RedirectStatusCode.PermanentRedirect);\n}\nfunction isRedirectError(error) {\n if (typeof error !== \"object\" || error === null || !(\"digest\" in error) || typeof error.digest !== \"string\") {\n return false;\n }\n const [errorCode, type, destination, status] = error.digest.split(\";\", 4);\n const statusCode = Number(status);\n return errorCode === REDIRECT_ERROR_CODE && (type === \"replace\" || type === \"push\") && typeof destination === \"string\" && !isNaN(statusCode) && statusCode in _redirectstatuscode.RedirectStatusCode;\n}\nfunction getURLFromRedirectError(error) {\n if (!isRedirectError(error)) return null;\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(\";\", 3)[2];\n}\nfunction getRedirectTypeFromError(error) {\n if (!isRedirectError(error)) {\n throw new Error(\"Not a redirect error\");\n }\n return error.digest.split(\";\", 2)[1];\n}\nfunction getRedirectStatusCodeFromError(error) {\n if (!isRedirectError(error)) {\n throw new Error(\"Not a redirect error\");\n }\n return Number(error.digest.split(\";\", 4)[3]);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=redirect.js.map","\"use client\";\n\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return RenderFromTemplateContext;\n }\n});\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _approutercontextsharedruntime = require(\"../../shared/lib/app-router-context.shared-runtime\");\nfunction RenderFromTemplateContext() {\n const children = (0, _react.useContext)(_approutercontextsharedruntime.TemplateContext);\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {\n children: children\n });\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=render-from-template-context.js.map","\"TURBOPACK { transition: next-shared }\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n getExpectedRequestStore: null,\n requestAsyncStorage: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n getExpectedRequestStore: function() {\n return getExpectedRequestStore;\n },\n requestAsyncStorage: function() {\n return _requestasyncstorageinstance.requestAsyncStorage;\n }\n});\nconst _requestasyncstorageinstance = require(\"./request-async-storage-instance\");\nfunction getExpectedRequestStore(callingExpression) {\n const store = _requestasyncstorageinstance.requestAsyncStorage.getStore();\n if (store) return store;\n throw new Error(\"`\" + callingExpression + \"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context\");\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=request-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"applyFlightData\", {\n enumerable: true,\n get: function() {\n return applyFlightData;\n }\n});\nconst _filllazyitemstillleafwithhead = require(\"./fill-lazy-items-till-leaf-with-head\");\nconst _fillcachewithnewsubtreedata = require(\"./fill-cache-with-new-subtree-data\");\nfunction applyFlightData(existingCache, cache, flightDataPath, prefetchEntry) {\n // The one before last item is the router state tree patch\n const [treePatch, cacheNodeSeedData, head] = flightDataPath.slice(-3);\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (cacheNodeSeedData === null) {\n return false;\n }\n if (flightDataPath.length === 3) {\n const rsc = cacheNodeSeedData[2];\n const loading = cacheNodeSeedData[3];\n cache.loading = loading;\n cache.rsc = rsc;\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 cache.prefetchRsc = null;\n (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(cache, existingCache, treePatch, cacheNodeSeedData, head, prefetchEntry);\n } else {\n // Copy rsc for the root node of the cache.\n cache.rsc = existingCache.rsc;\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n cache.prefetchRsc = existingCache.prefetchRsc;\n cache.parallelRoutes = new Map(existingCache.parallelRoutes);\n cache.loading = existingCache.loading;\n // Create a copy of the existing cache with the rsc applied.\n (0, _fillcachewithnewsubtreedata.fillCacheWithNewSubTreeData)(cache, existingCache, flightDataPath, prefetchEntry);\n }\n return true;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=apply-flight-data.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"applyRouterStatePatchToTree\", {\n enumerable: true,\n get: function() {\n return applyRouterStatePatchToTree;\n }\n});\nconst _segment = require(\"../../../shared/lib/segment\");\nconst _matchsegments = require(\"../match-segments\");\nconst _refetchinactiveparallelsegments = require(\"./refetch-inactive-parallel-segments\");\n/**\n * Deep merge of the two router states. Parallel route keys are preserved if the patch doesn't have them.\n */ function applyPatch(initialTree, patchTree, flightSegmentPath) {\n const [initialSegment, initialParallelRoutes] = initialTree;\n const [patchSegment, patchParallelRoutes] = patchTree;\n // if the applied patch segment is __DEFAULT__ then it can be ignored in favor of the initial tree\n // this is because the __DEFAULT__ segment is used as a placeholder on navigation\n if (patchSegment === _segment.DEFAULT_SEGMENT_KEY && initialSegment !== _segment.DEFAULT_SEGMENT_KEY) {\n return initialTree;\n }\n if ((0, _matchsegments.matchSegment)(initialSegment, patchSegment)) {\n const newParallelRoutes = {};\n for(const key in initialParallelRoutes){\n const isInPatchTreeParallelRoutes = typeof patchParallelRoutes[key] !== \"undefined\";\n if (isInPatchTreeParallelRoutes) {\n newParallelRoutes[key] = applyPatch(initialParallelRoutes[key], patchParallelRoutes[key], flightSegmentPath);\n } else {\n newParallelRoutes[key] = initialParallelRoutes[key];\n }\n }\n for(const key in patchParallelRoutes){\n if (newParallelRoutes[key]) {\n continue;\n }\n newParallelRoutes[key] = patchParallelRoutes[key];\n }\n const tree = [\n initialSegment,\n newParallelRoutes\n ];\n // Copy over the existing tree\n if (initialTree[2]) {\n tree[2] = initialTree[2];\n }\n if (initialTree[3]) {\n tree[3] = initialTree[3];\n }\n if (initialTree[4]) {\n tree[4] = initialTree[4];\n }\n return tree;\n }\n return patchTree;\n}\nfunction applyRouterStatePatchToTree(flightSegmentPath, flightRouterState, treePatch, path) {\n const [segment, parallelRoutes, url, refetch, isRootLayout] = flightRouterState;\n // Root refresh\n if (flightSegmentPath.length === 1) {\n const tree = applyPatch(flightRouterState, treePatch, flightSegmentPath);\n (0, _refetchinactiveparallelsegments.addRefreshMarkerToActiveParallelSegments)(tree, path);\n return tree;\n }\n const [currentSegment, parallelRouteKey] = flightSegmentPath;\n // Tree path returned from the server should always match up with the current tree in the browser\n if (!(0, _matchsegments.matchSegment)(currentSegment, segment)) {\n return null;\n }\n const lastSegment = flightSegmentPath.length === 2;\n let parallelRoutePatch;\n if (lastSegment) {\n parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch, flightSegmentPath);\n } else {\n parallelRoutePatch = applyRouterStatePatchToTree(flightSegmentPath.slice(2), parallelRoutes[parallelRouteKey], treePatch, path);\n if (parallelRoutePatch === null) {\n return null;\n }\n }\n const tree = [\n flightSegmentPath[0],\n {\n ...parallelRoutes,\n [parallelRouteKey]: parallelRoutePatch\n },\n url,\n refetch\n ];\n // Current segment is the root layout\n if (isRootLayout) {\n tree[4] = true;\n }\n (0, _refetchinactiveparallelsegments.addRefreshMarkerToActiveParallelSegments)(tree, path);\n return tree;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=apply-router-state-patch-to-tree.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"clearCacheNodeDataForSegmentPath\", {\n enumerable: true,\n get: function() {\n return clearCacheNodeDataForSegmentPath;\n }\n});\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nfunction clearCacheNodeDataForSegmentPath(newCache, existingCache, flightSegmentPath) {\n const isLastEntry = flightSegmentPath.length <= 2;\n const [parallelRouteKey, segment] = flightSegmentPath;\n const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(segment);\n const existingChildSegmentMap = existingCache.parallelRoutes.get(parallelRouteKey);\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey);\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap);\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap);\n }\n const existingChildCacheNode = existingChildSegmentMap == null ? void 0 : existingChildSegmentMap.get(cacheKey);\n let childCacheNode = childSegmentMap.get(cacheKey);\n // In case of last segment start off the fetch at this level and don't copy further down.\n if (isLastEntry) {\n if (!childCacheNode || !childCacheNode.lazyData || childCacheNode === existingChildCacheNode) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n lazyDataResolved: false,\n loading: null\n });\n }\n return;\n }\n if (!childCacheNode || !existingChildCacheNode) {\n // Start fetch in the place where the existing cache doesn't have the data yet.\n if (!childCacheNode) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n lazyDataResolved: false,\n loading: null\n });\n }\n return;\n }\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n lazyDataResolved: childCacheNode.lazyDataResolved,\n loading: childCacheNode.loading\n };\n childSegmentMap.set(cacheKey, childCacheNode);\n }\n return clearCacheNodeDataForSegmentPath(childCacheNode, existingChildCacheNode, flightSegmentPath.slice(2));\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=clear-cache-node-data-for-segment-path.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n computeChangedPath: null,\n extractPathFromFlightRouterState: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n computeChangedPath: function() {\n return computeChangedPath;\n },\n extractPathFromFlightRouterState: function() {\n return extractPathFromFlightRouterState;\n }\n});\nconst _interceptionroutes = require(\"../../../server/future/helpers/interception-routes\");\nconst _segment = require(\"../../../shared/lib/segment\");\nconst _matchsegments = require(\"../match-segments\");\nconst removeLeadingSlash = (segment)=>{\n return segment[0] === \"/\" ? segment.slice(1) : segment;\n};\nconst segmentToPathname = (segment)=>{\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 return segment;\n }\n return segment[1];\n};\nfunction normalizeSegments(segments) {\n return segments.reduce((acc, segment)=>{\n segment = removeLeadingSlash(segment);\n if (segment === \"\" || (0, _segment.isGroupSegment)(segment)) {\n return acc;\n }\n return acc + \"/\" + segment;\n }, \"\") || \"/\";\n}\nfunction extractPathFromFlightRouterState(flightRouterState) {\n const segment = Array.isArray(flightRouterState[0]) ? flightRouterState[0][1] : flightRouterState[0];\n if (segment === _segment.DEFAULT_SEGMENT_KEY || _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m))) return undefined;\n if (segment.startsWith(_segment.PAGE_SEGMENT_KEY)) return \"\";\n const segments = [\n segmentToPathname(segment)\n ];\n var _flightRouterState_;\n const parallelRoutes = (_flightRouterState_ = flightRouterState[1]) != null ? _flightRouterState_ : {};\n const childrenPath = parallelRoutes.children ? extractPathFromFlightRouterState(parallelRoutes.children) : undefined;\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 const childPath = extractPathFromFlightRouterState(value);\n if (childPath !== undefined) {\n segments.push(childPath);\n }\n }\n }\n return normalizeSegments(segments);\n}\nfunction computeChangedPathImpl(treeA, treeB) {\n const [segmentA, parallelRoutesA] = treeA;\n const [segmentB, parallelRoutesB] = treeB;\n const normalizedSegmentA = segmentToPathname(segmentA);\n const normalizedSegmentB = segmentToPathname(segmentB);\n if (_interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m))) {\n return \"\";\n }\n if (!(0, _matchsegments.matchSegment)(segmentA, segmentB)) {\n var _extractPathFromFlightRouterState;\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return (_extractPathFromFlightRouterState = extractPathFromFlightRouterState(treeB)) != null ? _extractPathFromFlightRouterState : \"\";\n }\n for(const parallelRouterKey in parallelRoutesA){\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(parallelRoutesA[parallelRouterKey], parallelRoutesB[parallelRouterKey]);\n if (changedPath !== null) {\n return segmentToPathname(segmentB) + \"/\" + changedPath;\n }\n }\n }\n return null;\n}\nfunction computeChangedPath(treeA, treeB) {\n const changedPath = computeChangedPathImpl(treeA, treeB);\n if (changedPath == null || changedPath === \"/\") {\n return changedPath;\n }\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split(\"/\"));\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=compute-changed-path.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createHrefFromUrl\", {\n enumerable: true,\n get: function() {\n return createHrefFromUrl;\n }\n});\nfunction createHrefFromUrl(url, includeHash) {\n if (includeHash === void 0) includeHash = true;\n return url.pathname + url.search + (includeHash ? url.hash : \"\");\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=create-href-from-url.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createInitialRouterState\", {\n enumerable: true,\n get: function() {\n return createInitialRouterState;\n }\n});\nconst _createhreffromurl = require(\"./create-href-from-url\");\nconst _filllazyitemstillleafwithhead = require(\"./fill-lazy-items-till-leaf-with-head\");\nconst _computechangedpath = require(\"./compute-changed-path\");\nconst _prefetchcacheutils = require(\"./prefetch-cache-utils\");\nconst _routerreducertypes = require(\"./router-reducer-types\");\nconst _refetchinactiveparallelsegments = require(\"./refetch-inactive-parallel-segments\");\nfunction createInitialRouterState(param) {\n let { buildId, initialTree, initialSeedData, urlParts, initialParallelRoutes, location, initialHead, couldBeIntercepted } = param;\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 = urlParts.join(\"/\");\n const isServer = !location;\n const rsc = initialSeedData[2];\n const cache = {\n lazyData: null,\n rsc: 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: isServer ? new Map() : initialParallelRoutes,\n lazyDataResolved: false,\n loading: initialSeedData[3]\n };\n const canonicalUrl = // 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 ? (0, _createhreffromurl.createHrefFromUrl)(location) : initialCanonicalUrl;\n (0, _refetchinactiveparallelsegments.addRefreshMarkerToActiveParallelSegments)(initialTree, canonicalUrl);\n const prefetchCache = new Map();\n // When the cache hasn't been seeded yet we fill the cache with the head.\n if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {\n (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(cache, undefined, initialTree, initialSeedData, initialHead);\n }\n var // the || operator is intentional, the pathname can be an empty string\n _ref;\n const initialState = {\n buildId,\n tree: initialTree,\n cache,\n prefetchCache,\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 nextUrl: (_ref = (0, _computechangedpath.extractPathFromFlightRouterState)(initialTree) || (location == null ? void 0 : location.pathname)) != null ? _ref : null\n };\n if (location) {\n // Seed the prefetch cache with this page's data.\n // This is to prevent needlessly re-prefetching a page that is already reusable,\n // and will avoid triggering a loading state/data fetch stall when navigating back to the page.\n const url = new URL(\"\" + location.pathname + location.search, location.origin);\n const initialFlightData = [\n [\n \"\",\n initialTree,\n null,\n null\n ]\n ];\n (0, _prefetchcacheutils.createPrefetchCacheEntryForInitialLoad)({\n url,\n kind: _routerreducertypes.PrefetchKind.AUTO,\n data: [\n initialFlightData,\n undefined,\n false,\n couldBeIntercepted\n ],\n tree: initialState.tree,\n prefetchCache: initialState.prefetchCache,\n nextUrl: initialState.nextUrl\n });\n }\n return initialState;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=create-initial-router-state.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createRouterCacheKey\", {\n enumerable: true,\n get: function() {\n return createRouterCacheKey;\n }\n});\nconst _segment = require(\"../../../shared/lib/segment\");\nfunction createRouterCacheKey(segment, withoutSearchParameters) {\n if (withoutSearchParameters === void 0) withoutSearchParameters = false;\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 // 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(_segment.PAGE_SEGMENT_KEY)) {\n return _segment.PAGE_SEGMENT_KEY;\n }\n return segment;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=create-router-cache-key.js.map","\"use client\";\n\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"fetchServerResponse\", {\n enumerable: true,\n get: function() {\n return fetchServerResponse;\n }\n});\nconst _approuterheaders = require(\"../app-router-headers\");\nconst _approuter = require(\"../app-router\");\nconst _appcallserver = require(\"../../app-call-server\");\nconst _routerreducertypes = require(\"./router-reducer-types\");\nconst _hash = require(\"../../../shared/lib/hash\");\n// @ts-ignore\n// eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromFetch } from 'react-server-dom-webpack/client'\nconst { createFromFetch } = !!process.env.NEXT_RUNTIME ? require(\"react-server-dom-webpack/client.edge\") : require(\"react-server-dom-webpack/client\");\nfunction doMpaNavigation(url) {\n return [\n (0, _approuter.urlToUrlWithoutFlightMarker)(url).toString(),\n undefined,\n false,\n false\n ];\n}\nasync function fetchServerResponse(url, flightRouterState, nextUrl, currentBuildId, prefetchKind) {\n const headers = {\n // Enable flight response\n [_approuterheaders.RSC_HEADER]: \"1\",\n // Provide the current router state\n [_approuterheaders.NEXT_ROUTER_STATE_TREE]: encodeURIComponent(JSON.stringify(flightRouterState))\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 */ if (prefetchKind === _routerreducertypes.PrefetchKind.AUTO) {\n headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = \"1\";\n }\n if (nextUrl) {\n headers[_approuterheaders.NEXT_URL] = nextUrl;\n }\n if (process.env.NEXT_DEPLOYMENT_ID) {\n headers[\"x-deployment-id\"] = process.env.NEXT_DEPLOYMENT_ID;\n }\n const uniqueCacheQuery = (0, _hash.hexHash)([\n headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] || \"0\",\n headers[_approuterheaders.NEXT_ROUTER_STATE_TREE],\n headers[_approuterheaders.NEXT_URL]\n ].join(\",\"));\n try {\n var _res_headers_get;\n let fetchUrl = new URL(url);\n if (process.env.NODE_ENV === \"production\") {\n if (process.env.__NEXT_CONFIG_OUTPUT === \"export\") {\n if (fetchUrl.pathname.endsWith(\"/\")) {\n fetchUrl.pathname += \"index.txt\";\n } else {\n fetchUrl.pathname += \".txt\";\n }\n }\n }\n // Add unique cache query to avoid caching conflicts on CDN which don't respect to Vary header\n fetchUrl.searchParams.set(_approuterheaders.NEXT_RSC_UNION_QUERY, uniqueCacheQuery);\n const res = await fetch(fetchUrl, {\n // Backwards compat for older browsers. `same-origin` is the default in modern browsers.\n credentials: \"same-origin\",\n headers\n });\n const responseUrl = (0, _approuter.urlToUrlWithoutFlightMarker)(res.url);\n const canonicalUrl = res.redirected ? responseUrl : undefined;\n const contentType = res.headers.get(\"content-type\") || \"\";\n const postponed = !!res.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER);\n const interception = !!((_res_headers_get = res.headers.get(\"vary\")) == null ? void 0 : _res_headers_get.includes(_approuterheaders.NEXT_URL));\n let isFlightResponse = contentType === _approuterheaders.RSC_CONTENT_TYPE_HEADER;\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 // 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) {\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 return doMpaNavigation(responseUrl.toString());\n }\n // Handle the `fetch` readable stream that can be unwrapped by `React.use`.\n const [buildId, flightData] = await createFromFetch(Promise.resolve(res), {\n callServer: _appcallserver.callServer\n });\n if (currentBuildId !== buildId) {\n return doMpaNavigation(res.url);\n }\n return [\n flightData,\n canonicalUrl,\n postponed,\n interception\n ];\n } catch (err) {\n console.error(\"Failed to fetch RSC payload for \" + url + \". Falling back to browser navigation.\", err);\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 [\n url.toString(),\n undefined,\n false,\n false\n ];\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=fetch-server-response.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"fillCacheWithNewSubTreeData\", {\n enumerable: true,\n get: function() {\n return fillCacheWithNewSubTreeData;\n }\n});\nconst _invalidatecachebyrouterstate = require(\"./invalidate-cache-by-router-state\");\nconst _filllazyitemstillleafwithhead = require(\"./fill-lazy-items-till-leaf-with-head\");\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nfunction fillCacheWithNewSubTreeData(newCache, existingCache, flightDataPath, prefetchEntry) {\n const isLastEntry = flightDataPath.length <= 5;\n const [parallelRouteKey, segment] = flightDataPath;\n const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(segment);\n const existingChildSegmentMap = existingCache.parallelRoutes.get(parallelRouteKey);\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return;\n }\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey);\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap);\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap);\n }\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey);\n let childCacheNode = childSegmentMap.get(cacheKey);\n if (isLastEntry) {\n if (!childCacheNode || !childCacheNode.lazyData || childCacheNode === existingChildCacheNode) {\n const seedData = flightDataPath[3];\n const rsc = seedData[2];\n const loading = seedData[3];\n childCacheNode = {\n lazyData: null,\n rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n // Ensure segments other than the one we got data for are preserved.\n parallelRoutes: existingChildCacheNode ? new Map(existingChildCacheNode.parallelRoutes) : new Map(),\n lazyDataResolved: false\n };\n if (existingChildCacheNode) {\n (0, _invalidatecachebyrouterstate.invalidateCacheByRouterState)(childCacheNode, existingChildCacheNode, flightDataPath[2]);\n }\n (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(childCacheNode, existingChildCacheNode, flightDataPath[2], seedData, flightDataPath[4], prefetchEntry);\n childSegmentMap.set(cacheKey, childCacheNode);\n }\n return;\n }\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return;\n }\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n lazyDataResolved: false,\n loading: childCacheNode.loading\n };\n childSegmentMap.set(cacheKey, childCacheNode);\n }\n fillCacheWithNewSubTreeData(childCacheNode, existingChildCacheNode, flightDataPath.slice(2), prefetchEntry);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=fill-cache-with-new-subtree-data.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"fillLazyItemsTillLeafWithHead\", {\n enumerable: true,\n get: function() {\n return fillLazyItemsTillLeafWithHead;\n }\n});\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nconst _routerreducertypes = require(\"./router-reducer-types\");\nfunction fillLazyItemsTillLeafWithHead(newCache, existingCache, routerState, cacheNodeSeedData, head, prefetchEntry) {\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 = (0, _createroutercachekey.createRouterCacheKey)(segmentForParallelRoute);\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 = cacheNodeSeedData !== null && cacheNodeSeedData[1][key] !== undefined ? cacheNodeSeedData[1][key] : null;\n if (existingCache) {\n const existingParallelRoutesCacheNode = existingCache.parallelRoutes.get(key);\n if (existingParallelRoutesCacheNode) {\n const hasReusablePrefetch = (prefetchEntry == null ? void 0 : prefetchEntry.kind) === \"auto\" && prefetchEntry.status === _routerreducertypes.PrefetchCacheEntryStatus.reusable;\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode);\n const existingCacheNode = parallelRouteCacheNode.get(cacheKey);\n let newCacheNode;\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[2];\n const loading = parallelSeedData[3];\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 == null ? void 0 : existingCacheNode.parallelRoutes),\n lazyDataResolved: false\n };\n } else if (hasReusablePrefetch && existingCacheNode) {\n // No new data was sent from the server, but the existing cache node\n // was prefetched, so we should reuse that.\n newCacheNode = {\n lazyData: existingCacheNode.lazyData,\n rsc: existingCacheNode.rsc,\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n prefetchRsc: existingCacheNode.prefetchRsc,\n head: existingCacheNode.head,\n prefetchHead: existingCacheNode.prefetchHead,\n parallelRoutes: new Map(existingCacheNode.parallelRoutes),\n lazyDataResolved: existingCacheNode.lazyDataResolved,\n loading: existingCacheNode.loading\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 == null ? void 0 : existingCacheNode.parallelRoutes),\n lazyDataResolved: false,\n loading: null\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(newCacheNode, existingCacheNode, parallelRouteState, parallelSeedData ? parallelSeedData : null, head, prefetchEntry);\n newCache.parallelRoutes.set(key, parallelRouteCacheNode);\n continue;\n }\n }\n let newCacheNode;\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[2];\n const loading = parallelSeedData[3];\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n lazyDataResolved: false,\n loading\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 lazyDataResolved: false,\n loading: null\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([\n [\n cacheKey,\n newCacheNode\n ]\n ]));\n }\n fillLazyItemsTillLeafWithHead(newCacheNode, undefined, parallelRouteState, parallelSeedData, head, prefetchEntry);\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=fill-lazy-items-till-leaf-with-head.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"handleMutable\", {\n enumerable: true,\n get: function() {\n return handleMutable;\n }\n});\nconst _computechangedpath = require(\"./compute-changed-path\");\nfunction isNotUndefined(value) {\n return typeof value !== \"undefined\";\n}\nfunction handleMutable(state, mutable) {\n var _mutable_canonicalUrl;\n var _mutable_shouldScroll;\n // shouldScroll is true by default, can override to false.\n const shouldScroll = (_mutable_shouldScroll = mutable.shouldScroll) != null ? _mutable_shouldScroll : true;\n let nextUrl = state.nextUrl;\n if (isNotUndefined(mutable.patchedTree)) {\n // If we received a patched tree, we need to compute the changed path.\n const changedPath = (0, _computechangedpath.computeChangedPath)(state.tree, mutable.patchedTree);\n if (changedPath) {\n // If the tree changed, we need to update the nextUrl\n nextUrl = changedPath;\n } else if (!nextUrl) {\n // if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl\n nextUrl = state.canonicalUrl;\n }\n // otherwise this will be a no-op and continue to use the existing nextUrl\n }\n var _mutable_scrollableSegments;\n return {\n buildId: state.buildId,\n // Set href.\n canonicalUrl: isNotUndefined(mutable.canonicalUrl) ? mutable.canonicalUrl === state.canonicalUrl ? state.canonicalUrl : mutable.canonicalUrl : state.canonicalUrl,\n pushRef: {\n pendingPush: isNotUndefined(mutable.pendingPush) ? mutable.pendingPush : state.pushRef.pendingPush,\n mpaNavigation: isNotUndefined(mutable.mpaNavigation) ? mutable.mpaNavigation : state.pushRef.mpaNavigation,\n preserveCustomHistoryState: isNotUndefined(mutable.preserveCustomHistoryState) ? mutable.preserveCustomHistoryState : state.pushRef.preserveCustomHistoryState\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: shouldScroll ? isNotUndefined(mutable == null ? void 0 : mutable.scrollableSegments) ? true : state.focusAndScrollRef.apply : false,\n onlyHashChange: !!mutable.hashFragment && state.canonicalUrl.split(\"#\", 1)[0] === ((_mutable_canonicalUrl = mutable.canonicalUrl) == null ? void 0 : _mutable_canonicalUrl.split(\"#\", 1)[0]),\n hashFragment: shouldScroll ? // #top is handled in layout-router.\n mutable.hashFragment && mutable.hashFragment !== \"\" ? decodeURIComponent(mutable.hashFragment.slice(1)) : state.focusAndScrollRef.hashFragment : null,\n segmentPaths: shouldScroll ? (_mutable_scrollableSegments = mutable == null ? void 0 : mutable.scrollableSegments) != null ? _mutable_scrollableSegments : state.focusAndScrollRef.segmentPaths : []\n },\n // Apply cache.\n cache: mutable.cache ? mutable.cache : state.cache,\n prefetchCache: mutable.prefetchCache ? mutable.prefetchCache : state.prefetchCache,\n // Apply patched router state.\n tree: isNotUndefined(mutable.patchedTree) ? mutable.patchedTree : state.tree,\n nextUrl\n };\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=handle-mutable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"handleSegmentMismatch\", {\n enumerable: true,\n get: function() {\n return handleSegmentMismatch;\n }\n});\nconst _navigatereducer = require(\"./reducers/navigate-reducer\");\nfunction handleSegmentMismatch(state, action, treePatch) {\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"Performing hard navigation because your application experienced an unrecoverable error. If this keeps occurring, please file a Next.js issue.\\n\\n\" + \"Reason: Segment mismatch\\n\" + (\"Last Action: \" + action.type + \"\\n\\n\") + (\"Current Tree: \" + JSON.stringify(state.tree) + \"\\n\\n\") + (\"Tree Patch Payload: \" + JSON.stringify(treePatch)));\n }\n return (0, _navigatereducer.handleExternalUrl)(state, {}, state.canonicalUrl, true);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=handle-segment-mismatch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"invalidateCacheBelowFlightSegmentPath\", {\n enumerable: true,\n get: function() {\n return invalidateCacheBelowFlightSegmentPath;\n }\n});\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nfunction invalidateCacheBelowFlightSegmentPath(newCache, existingCache, flightSegmentPath) {\n const isLastEntry = flightSegmentPath.length <= 2;\n const [parallelRouteKey, segment] = flightSegmentPath;\n const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(segment);\n const existingChildSegmentMap = existingCache.parallelRoutes.get(parallelRouteKey);\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return;\n }\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey);\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap);\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap);\n }\n // In case of last entry don't copy further down.\n if (isLastEntry) {\n childSegmentMap.delete(cacheKey);\n return;\n }\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey);\n let childCacheNode = childSegmentMap.get(cacheKey);\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return;\n }\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n lazyDataResolved: childCacheNode.lazyDataResolved\n };\n childSegmentMap.set(cacheKey, childCacheNode);\n }\n invalidateCacheBelowFlightSegmentPath(childCacheNode, existingChildCacheNode, flightSegmentPath.slice(2));\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=invalidate-cache-below-flight-segmentpath.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"invalidateCacheByRouterState\", {\n enumerable: true,\n get: function() {\n return invalidateCacheByRouterState;\n }\n});\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nfunction invalidateCacheByRouterState(newCache, existingCache, routerState) {\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 segmentForParallelRoute = routerState[1][key][0];\n const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(segmentForParallelRoute);\n const existingParallelRoutesCacheNode = existingCache.parallelRoutes.get(key);\n if (existingParallelRoutesCacheNode) {\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode);\n parallelRouteCacheNode.delete(cacheKey);\n newCache.parallelRoutes.set(key, parallelRouteCacheNode);\n }\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=invalidate-cache-by-router-state.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isNavigatingToNewRootLayout\", {\n enumerable: true,\n get: function() {\n return isNavigatingToNewRootLayout;\n }\n});\nfunction isNavigatingToNewRootLayout(currentTree, nextTree) {\n // Compare segments\n const currentTreeSegment = currentTree[0];\n const nextTreeSegment = nextTree[0];\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 (currentTreeSegment[0] !== nextTreeSegment[0] || currentTreeSegment[2] !== nextTreeSegment[2]) {\n return true;\n }\n } else if (currentTreeSegment !== nextTreeSegment) {\n return true;\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\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=is-navigating-to-new-root-layout.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n abortTask: null,\n listenForDynamicRequest: null,\n updateCacheNodeOnNavigation: null,\n updateCacheNodeOnPopstateRestoration: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n abortTask: function() {\n return abortTask;\n },\n listenForDynamicRequest: function() {\n return listenForDynamicRequest;\n },\n updateCacheNodeOnNavigation: function() {\n return updateCacheNodeOnNavigation;\n },\n updateCacheNodeOnPopstateRestoration: function() {\n return updateCacheNodeOnPopstateRestoration;\n }\n});\nconst _segment = require(\"../../../shared/lib/segment\");\nconst _matchsegments = require(\"../match-segments\");\nconst _createroutercachekey = require(\"./create-router-cache-key\");\nfunction updateCacheNodeOnNavigation(oldCacheNode, oldRouterState, newRouterState, prefetchData, prefetchHead) {\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[1];\n const oldParallelRoutes = oldCacheNode.parallelRoutes;\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 // 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 let taskChildren = null;\n for(let parallelRouteKey in newRouterStateChildren){\n const newRouterStateChild = newRouterStateChildren[parallelRouteKey];\n const oldRouterStateChild = oldRouterStateChildren[parallelRouteKey];\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey);\n const prefetchDataChild = prefetchDataChildren[parallelRouteKey];\n const newSegmentChild = newRouterStateChild[0];\n const newSegmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(newSegmentChild);\n const oldSegmentChild = oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined;\n const oldCacheNodeChild = oldSegmentMapChild !== undefined ? oldSegmentMapChild.get(newSegmentKeyChild) : undefined;\n let taskChild;\n if (newSegmentChild === _segment.PAGE_SEGMENT_KEY) {\n // This is a leaf segment — a page, not a shared layout. We always apply\n // its data.\n taskChild = spawnPendingTask(newRouterStateChild, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead);\n } else if (newSegmentChild === _segment.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 = spawnReusedTask(oldRouterStateChild);\n } else {\n // There's no currently active segment. Switch to the \"create\" path.\n taskChild = spawnPendingTask(newRouterStateChild, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead);\n }\n } else if (oldSegmentChild !== undefined && (0, _matchsegments.matchSegment)(newSegmentChild, oldSegmentChild)) {\n if (oldCacheNodeChild !== undefined && oldRouterStateChild !== undefined) {\n // This segment exists in both the old and new trees.\n if (prefetchDataChild !== undefined && prefetchDataChild !== null) {\n // Recursively update the children.\n taskChild = updateCacheNodeOnNavigation(oldCacheNodeChild, oldRouterStateChild, newRouterStateChild, prefetchDataChild, prefetchHead);\n } else {\n // The server didn't send any prefetch data for this segment. This\n // shouldn't happen because the Route Tree and the Seed Data tree\n // should always be the same shape, but until we unify those types\n // it's still possible. For now we're going to deopt and trigger a\n // lazy fetch during render.\n taskChild = spawnTaskForMissingData(newRouterStateChild);\n }\n } else {\n // Either there's no existing Cache Node for this segment, or this\n // segment doesn't exist in the old Router State tree. Switch to the\n // \"create\" path.\n taskChild = spawnPendingTask(newRouterStateChild, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead);\n }\n } else {\n // This is a new tree. Switch to the \"create\" path.\n taskChild = spawnPendingTask(newRouterStateChild, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead);\n }\n if (taskChild !== null) {\n // Something changed in the child tree. Keep track of the child task.\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 = new Map(oldSegmentMapChild);\n newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild);\n prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild);\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 patchedRouterStateChildren[parallelRouteKey] = taskChild.route;\n } else {\n // The child didn't change. We can use the prefetched router state.\n patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild;\n }\n }\n if (taskChildren === null) {\n // No new tasks were spawned.\n return null;\n }\n const newCacheNode = {\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 // Everything is cloned except for the children, which we computed above.\n parallelRoutes: prefetchParallelRoutes,\n lazyDataResolved: false\n };\n return {\n // Return a cloned copy of the router state with updated children.\n route: patchRouterStateWithNewChildren(newRouterState, patchedRouterStateChildren),\n node: newCacheNode,\n children: taskChildren\n };\n}\nfunction patchRouterStateWithNewChildren(baseRouterState, newChildren) {\n const clone = [\n baseRouterState[0],\n newChildren\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 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}\nfunction spawnPendingTask(routerState, prefetchData, prefetchHead) {\n // Create a task that will later be fulfilled by data from the server.\n const pendingCacheNode = createPendingCacheNode(routerState, prefetchData, prefetchHead);\n return {\n route: routerState,\n node: pendingCacheNode,\n children: null\n };\n}\nfunction spawnReusedTask(reusedRouterState) {\n // Create a task that reuses an existing segment, e.g. when reusing\n // the current active segment in place of a default route.\n return {\n route: reusedRouterState,\n node: null,\n children: null\n };\n}\nfunction spawnTaskForMissingData(routerState) {\n // Create a task for a new subtree that wasn't prefetched by the server.\n // This shouldn't really ever happen but it's here just in case the Seed Data\n // Tree and the Router State Tree disagree unexpectedly.\n const pendingCacheNode = createPendingCacheNode(routerState, null, null);\n return {\n route: routerState,\n node: pendingCacheNode,\n children: null\n };\n}\nfunction listenForDynamicRequest(task, responsePromise) {\n responsePromise.then((response)=>{\n const flightData = response[0];\n for (const flightDataPath of flightData){\n const segmentPath = flightDataPath.slice(0, -3);\n const serverRouterState = flightDataPath[flightDataPath.length - 3];\n const dynamicData = flightDataPath[flightDataPath.length - 2];\n const dynamicHead = flightDataPath[flightDataPath.length - 1];\n if (typeof segmentPath === \"string\") {\n continue;\n }\n writeDynamicDataIntoPendingTask(task, segmentPath, serverRouterState, dynamicData, dynamicHead);\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);\n }, (error)=>{\n // This will trigger an error during render\n abortTask(task, error);\n });\n}\nfunction writeDynamicDataIntoPendingTask(rootTask, segmentPath, serverRouterState, dynamicData, dynamicHead) {\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 = segmentPath[i];\n const 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 ((0, _matchsegments.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 finishTaskUsingDynamicDataPayload(task, serverRouterState, dynamicData, dynamicHead);\n}\nfunction finishTaskUsingDynamicDataPayload(task, serverRouterState, dynamicData, dynamicHead) {\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(taskNode, task.route, serverRouterState, dynamicData, dynamicHead);\n // Null this out to indicate that the task is complete.\n task.node = 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 for(const parallelRouteKey in serverRouterState){\n const serverRouterStateChild = serverChildren[parallelRouteKey];\n const dynamicDataChild = dynamicDataChildren[parallelRouteKey];\n const taskChild = taskChildren.get(parallelRouteKey);\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0];\n if ((0, _matchsegments.matchSegment)(serverRouterStateChild[0], taskSegment) && dynamicDataChild !== null && dynamicDataChild !== undefined) {\n // Found a match for this task. Keep traversing down the task tree.\n return finishTaskUsingDynamicDataPayload(taskChild, serverRouterStateChild, dynamicDataChild, dynamicHead);\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}\nfunction createPendingCacheNode(routerState, prefetchData, prefetchHead) {\n const routerStateChildren = routerState[1];\n const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null;\n const parallelRoutes = new Map();\n for(let parallelRouteKey in routerStateChildren){\n const routerStateChild = routerStateChildren[parallelRouteKey];\n const prefetchDataChild = prefetchDataChildren !== null ? prefetchDataChildren[parallelRouteKey] : null;\n const segmentChild = routerStateChild[0];\n const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);\n const newCacheNodeChild = createPendingCacheNode(routerStateChild, prefetchDataChild === undefined ? null : prefetchDataChild, prefetchHead);\n const newSegmentMapChild = new Map();\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild);\n parallelRoutes.set(parallelRouteKey, newSegmentMapChild);\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 const maybePrefetchRsc = prefetchData !== null ? prefetchData[2] : null;\n const maybePrefetchLoading = prefetchData !== null ? prefetchData[3] : null;\n return {\n lazyData: null,\n parallelRoutes: parallelRoutes,\n prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,\n prefetchHead: isLeafSegment ? prefetchHead : null,\n loading: maybePrefetchLoading !== undefined ? maybePrefetchLoading : null,\n // Create a deferred promise. This will be fulfilled once the dynamic\n // response is received from the server.\n rsc: createDeferredRsc(),\n head: isLeafSegment ? createDeferredRsc() : null,\n lazyDataResolved: false\n };\n}\nfunction finishPendingCacheNode(cacheNode, taskState, serverState, dynamicData, dynamicHead) {\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 // 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 = taskStateChildren[parallelRouteKey];\n const serverStateChild = serverStateChildren[parallelRouteKey];\n const dataChild = dataChildren[parallelRouteKey];\n const segmentMapChild = parallelRoutes.get(parallelRouteKey);\n const taskSegmentChild = taskStateChild[0];\n const taskSegmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(taskSegmentChild);\n const cacheNodeChild = segmentMapChild !== undefined ? segmentMapChild.get(taskSegmentKeyChild) : undefined;\n if (cacheNodeChild !== undefined) {\n if (serverStateChild !== undefined && (0, _matchsegments.matchSegment)(taskSegmentChild, serverStateChild[0])) {\n if (dataChild !== undefined && dataChild !== null) {\n // This is the happy path. Recursively update all the children.\n finishPendingCacheNode(cacheNodeChild, taskStateChild, serverStateChild, dataChild, dynamicHead);\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);\n }\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null);\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 // 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[2];\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);\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 // 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);\n }\n}\nfunction abortTask(task, error) {\n const cacheNode = task.node;\n if (cacheNode === null) {\n // This indicates the task is already complete.\n return;\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);\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);\n }\n }\n // Null this out to indicate that the task is complete.\n task.node = null;\n}\nfunction abortPendingCacheNode(routerState, cacheNode, error) {\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 = routerStateChildren[parallelRouteKey];\n const segmentMapChild = parallelRoutes.get(parallelRouteKey);\n if (segmentMapChild === undefined) {\n continue;\n }\n const segmentChild = routerStateChild[0];\n const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);\n const cacheNodeChild = segmentMapChild.get(segmentKeyChild);\n if (cacheNodeChild !== undefined) {\n abortPendingCacheNode(routerStateChild, cacheNodeChild, error);\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 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);\n } else {\n // This will trigger an error during rendering.\n rsc.reject(error);\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);\n }\n}\nfunction updateCacheNodeOnPopstateRestoration(oldCacheNode, routerState) {\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 const routerStateChildren = routerState[1];\n const oldParallelRoutes = oldCacheNode.parallelRoutes;\n const newParallelRoutes = new Map(oldParallelRoutes);\n for(let parallelRouteKey in routerStateChildren){\n const routerStateChild = routerStateChildren[parallelRouteKey];\n const segmentChild = routerStateChild[0];\n const segmentKeyChild = (0, _createroutercachekey.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(oldCacheNodeChild, routerStateChild);\n const newSegmentMapChild = new Map(oldSegmentMapChild);\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild);\n newParallelRoutes.set(parallelRouteKey, newSegmentMapChild);\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 return {\n lazyData: null,\n rsc,\n head: oldCacheNode.head,\n prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : null,\n prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,\n loading: shouldUsePrefetch ? oldCacheNode.loading : null,\n // These are the cloned children we computed above\n parallelRoutes: newParallelRoutes,\n lazyDataResolved: false\n };\n}\nconst DEFERRED = Symbol();\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) {\n return value && value.tag === DEFERRED;\n}\nfunction createDeferredRsc() {\n let resolve;\n let reject;\n const pendingRsc = new Promise((res, rej)=>{\n resolve = res;\n reject = rej;\n });\n pendingRsc.status = \"pending\";\n pendingRsc.resolve = (value)=>{\n if (pendingRsc.status === \"pending\") {\n const fulfilledRsc = pendingRsc;\n fulfilledRsc.status = \"fulfilled\";\n fulfilledRsc.value = value;\n resolve(value);\n }\n };\n pendingRsc.reject = (error)=>{\n if (pendingRsc.status === \"pending\") {\n const rejectedRsc = pendingRsc;\n rejectedRsc.status = \"rejected\";\n rejectedRsc.reason = error;\n reject(error);\n }\n };\n pendingRsc.tag = DEFERRED;\n return pendingRsc;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=ppr-navigations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createPrefetchCacheEntryForInitialLoad: null,\n getOrCreatePrefetchCacheEntry: null,\n prunePrefetchCache: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createPrefetchCacheEntryForInitialLoad: function() {\n return createPrefetchCacheEntryForInitialLoad;\n },\n getOrCreatePrefetchCacheEntry: function() {\n return getOrCreatePrefetchCacheEntry;\n },\n prunePrefetchCache: function() {\n return prunePrefetchCache;\n }\n});\nconst _createhreffromurl = require(\"./create-href-from-url\");\nconst _fetchserverresponse = require(\"./fetch-server-response\");\nconst _routerreducertypes = require(\"./router-reducer-types\");\nconst _prefetchreducer = require(\"./reducers/prefetch-reducer\");\n/**\n * Creates a cache key for the router prefetch cache\n *\n * @param url - The URL being navigated to\n * @param nextUrl - an internal URL, primarily used for handling rewrites. Defaults to '/'.\n * @return The generated prefetch cache key.\n */ function createPrefetchCacheKey(url, nextUrl) {\n const pathnameFromUrl = (0, _createhreffromurl.createHrefFromUrl)(url, // Ensures the hash is not part of the cache key as it does not impact the server fetch\n false);\n // nextUrl is used as a cache key delimiter since entries can vary based on the Next-URL header\n if (nextUrl) {\n return nextUrl + \"%\" + pathnameFromUrl;\n }\n return pathnameFromUrl;\n}\nfunction getOrCreatePrefetchCacheEntry(param) {\n let { url, nextUrl, tree, buildId, prefetchCache, kind } = param;\n let existingCacheEntry = undefined;\n // We first check if there's a more specific interception route prefetch entry\n // This is because when we detect a prefetch that corresponds with an interception route, we prefix it with nextUrl (see `createPrefetchCacheKey`)\n // to avoid conflicts with other pages that may have the same URL but render different things depending on the `Next-URL` header.\n const interceptionCacheKey = createPrefetchCacheKey(url, nextUrl);\n const interceptionData = prefetchCache.get(interceptionCacheKey);\n if (interceptionData) {\n existingCacheEntry = interceptionData;\n } else {\n // If we dont find a more specific interception route prefetch entry, we check for a regular prefetch entry\n const prefetchCacheKey = createPrefetchCacheKey(url);\n const prefetchData = prefetchCache.get(prefetchCacheKey);\n if (prefetchData) {\n existingCacheEntry = prefetchData;\n }\n }\n if (existingCacheEntry) {\n // Grab the latest status of the cache entry and update it\n existingCacheEntry.status = getPrefetchEntryCacheStatus(existingCacheEntry);\n // when `kind` is provided, an explicit prefetch was requested.\n // if the requested prefetch is \"full\" and the current cache entry wasn't, we want to re-prefetch with the new intent\n const switchedToFullPrefetch = existingCacheEntry.kind !== _routerreducertypes.PrefetchKind.FULL && kind === _routerreducertypes.PrefetchKind.FULL;\n if (switchedToFullPrefetch) {\n return createLazyPrefetchEntry({\n tree,\n url,\n buildId,\n nextUrl,\n prefetchCache,\n // If we didn't get an explicit prefetch kind, we want to set a temporary kind\n // rather than assuming the same intent as the previous entry, to be consistent with how we\n // lazily create prefetch entries when intent is left unspecified.\n kind: kind != null ? kind : _routerreducertypes.PrefetchKind.TEMPORARY\n });\n }\n // If the existing cache entry was marked as temporary, it means it was lazily created when attempting to get an entry,\n // where we didn't have the prefetch intent. Now that we have the intent (in `kind`), we want to update the entry to the more accurate kind.\n if (kind && existingCacheEntry.kind === _routerreducertypes.PrefetchKind.TEMPORARY) {\n existingCacheEntry.kind = kind;\n }\n // We've determined that the existing entry we found is still valid, so we return it.\n return existingCacheEntry;\n }\n // If we didn't return an entry, create a new one.\n return createLazyPrefetchEntry({\n tree,\n url,\n buildId,\n nextUrl,\n prefetchCache,\n kind: kind || // in dev, there's never gonna be a prefetch entry so we want to prefetch here\n (process.env.NODE_ENV === \"development\" ? _routerreducertypes.PrefetchKind.AUTO : _routerreducertypes.PrefetchKind.TEMPORARY)\n });\n}\n/*\n * Used to take an existing cache entry and prefix it with the nextUrl, if it exists.\n * This ensures that we don't have conflicting cache entries for the same URL (as is the case with route interception).\n */ function prefixExistingPrefetchCacheEntry(param) {\n let { url, nextUrl, prefetchCache } = param;\n const existingCacheKey = createPrefetchCacheKey(url);\n const existingCacheEntry = prefetchCache.get(existingCacheKey);\n if (!existingCacheEntry) {\n // no-op -- there wasn't an entry to move\n return;\n }\n const newCacheKey = createPrefetchCacheKey(url, nextUrl);\n prefetchCache.set(newCacheKey, existingCacheEntry);\n prefetchCache.delete(existingCacheKey);\n}\nfunction createPrefetchCacheEntryForInitialLoad(param) {\n let { nextUrl, tree, prefetchCache, url, kind, data } = param;\n const [, , , intercept] = data;\n // if the prefetch corresponds with an interception route, we use the nextUrl to prefix the cache key\n const prefetchCacheKey = intercept ? createPrefetchCacheKey(url, nextUrl) : createPrefetchCacheKey(url);\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data: Promise.resolve(data),\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: Date.now(),\n key: prefetchCacheKey,\n status: _routerreducertypes.PrefetchCacheEntryStatus.fresh\n };\n prefetchCache.set(prefetchCacheKey, prefetchEntry);\n return prefetchEntry;\n}\n/**\n * Creates a prefetch entry entry and enqueues a fetch request to retrieve the data.\n */ function createLazyPrefetchEntry(param) {\n let { url, kind, tree, nextUrl, buildId, prefetchCache } = param;\n const prefetchCacheKey = createPrefetchCacheKey(url);\n // initiates the fetch request for the prefetch and attaches a listener\n // to the promise to update the prefetch cache entry when the promise resolves (if necessary)\n const data = _prefetchreducer.prefetchQueue.enqueue(()=>(0, _fetchserverresponse.fetchServerResponse)(url, tree, nextUrl, buildId, kind).then((prefetchResponse)=>{\n // TODO: `fetchServerResponse` should be more tighly coupled to these prefetch cache operations\n // to avoid drift between this cache key prefixing logic\n // (which is currently directly influenced by the server response)\n const [, , , intercepted] = prefetchResponse;\n if (intercepted) {\n prefixExistingPrefetchCacheEntry({\n url,\n nextUrl,\n prefetchCache\n });\n }\n return prefetchResponse;\n }));\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data,\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: null,\n key: prefetchCacheKey,\n status: _routerreducertypes.PrefetchCacheEntryStatus.fresh\n };\n prefetchCache.set(prefetchCacheKey, prefetchEntry);\n return prefetchEntry;\n}\nfunction prunePrefetchCache(prefetchCache) {\n for (const [href, prefetchCacheEntry] of prefetchCache){\n if (getPrefetchEntryCacheStatus(prefetchCacheEntry) === _routerreducertypes.PrefetchCacheEntryStatus.expired) {\n prefetchCache.delete(href);\n }\n }\n}\n// These values are set by `define-env-plugin` (based on `nextConfig.experimental.staleTimes`)\n// and default to 5 minutes (static) / 30 seconds (dynamic)\nconst DYNAMIC_STALETIME_MS = Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000;\nconst STATIC_STALETIME_MS = Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME) * 1000;\nfunction getPrefetchEntryCacheStatus(param) {\n let { kind, prefetchTime, lastUsedTime } = param;\n // We will re-use the cache entry data for up to the `dynamic` staletime window.\n if (Date.now() < (lastUsedTime != null ? lastUsedTime : prefetchTime) + DYNAMIC_STALETIME_MS) {\n return lastUsedTime ? _routerreducertypes.PrefetchCacheEntryStatus.reusable : _routerreducertypes.PrefetchCacheEntryStatus.fresh;\n }\n // For \"auto\" prefetching, we'll re-use only the loading boundary for up to `static` staletime window.\n // A stale entry will only re-use the `loading` boundary, not the full data.\n // This will trigger a \"lazy fetch\" for the full data.\n if (kind === \"auto\") {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return _routerreducertypes.PrefetchCacheEntryStatus.stale;\n }\n }\n // for \"full\" prefetching, we'll re-use the cache entry data for up to `static` staletime window.\n if (kind === \"full\") {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return _routerreducertypes.PrefetchCacheEntryStatus.reusable;\n }\n }\n return _routerreducertypes.PrefetchCacheEntryStatus.expired;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=prefetch-cache-utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"fastRefreshReducer\", {\n enumerable: true,\n get: function() {\n return fastRefreshReducer;\n }\n});\nconst _fetchserverresponse = require(\"../fetch-server-response\");\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _applyrouterstatepatchtotree = require(\"../apply-router-state-patch-to-tree\");\nconst _isnavigatingtonewrootlayout = require(\"../is-navigating-to-new-root-layout\");\nconst _navigatereducer = require(\"./navigate-reducer\");\nconst _handlemutable = require(\"../handle-mutable\");\nconst _applyflightdata = require(\"../apply-flight-data\");\nconst _approuter = require(\"../../app-router\");\nconst _handlesegmentmismatch = require(\"../handle-segment-mismatch\");\nconst _hasinterceptionrouteincurrenttree = require(\"./has-interception-route-in-current-tree\");\n// A version of refresh reducer that keeps the cache around instead of wiping all of it.\nfunction fastRefreshReducerImpl(state, action) {\n const { origin } = action;\n const mutable = {};\n const href = state.canonicalUrl;\n mutable.preserveCustomHistoryState = false;\n const cache = (0, _approuter.createEmptyCacheNode)();\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree);\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(href, origin), [\n state.tree[0],\n state.tree[1],\n state.tree[2],\n \"refetch\"\n ], includeNextUrl ? state.nextUrl : null, state.buildId);\n return cache.lazyData.then((param)=>{\n let [flightData, canonicalUrlOverride] = param;\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === \"string\") {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, flightData, state.pushRef.pendingPush);\n }\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null;\n let currentTree = state.tree;\n let currentCache = state.cache;\n for (const flightDataPath of flightData){\n // FlightDataPath with more than two items means unexpected Flight data was returned\n if (flightDataPath.length !== 3) {\n // TODO-APP: handle this case better\n console.log(\"REFRESH FAILED\");\n return state;\n }\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const [treePatch] = flightDataPath;\n const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n [\n \"\"\n ], currentTree, treePatch, state.canonicalUrl);\n if (newTree === null) {\n return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);\n }\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? (0, _createhreffromurl.createHrefFromUrl)(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref;\n }\n const applied = (0, _applyflightdata.applyFlightData)(currentCache, cache, flightDataPath);\n if (applied) {\n mutable.cache = cache;\n currentCache = cache;\n }\n mutable.patchedTree = newTree;\n mutable.canonicalUrl = href;\n currentTree = newTree;\n }\n return (0, _handlemutable.handleMutable)(state, mutable);\n }, ()=>state);\n}\nfunction fastRefreshReducerNoop(state, _action) {\n return state;\n}\nconst fastRefreshReducer = process.env.NODE_ENV === \"production\" ? fastRefreshReducerNoop : fastRefreshReducerImpl;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=fast-refresh-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"findHeadInCache\", {\n enumerable: true,\n get: function() {\n return findHeadInCache;\n }\n});\nconst _createroutercachekey = require(\"../create-router-cache-key\");\nfunction findHeadInCache(cache, parallelRoutes) {\n return findHeadInCacheImpl(cache, parallelRoutes, \"\");\n}\nfunction findHeadInCacheImpl(cache, parallelRoutes, keyPrefix) {\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 [\n cache,\n keyPrefix\n ];\n }\n for(const key in parallelRoutes){\n const [segment, childParallelRoutes] = parallelRoutes[key];\n const childSegmentMap = cache.parallelRoutes.get(key);\n if (!childSegmentMap) {\n continue;\n }\n const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(segment);\n const cacheNode = childSegmentMap.get(cacheKey);\n if (!cacheNode) {\n continue;\n }\n const item = findHeadInCacheImpl(cacheNode, childParallelRoutes, keyPrefix + \"/\" + cacheKey);\n if (item) {\n return item;\n }\n }\n return null;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=find-head-in-cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getSegmentValue\", {\n enumerable: true,\n get: function() {\n return getSegmentValue;\n }\n});\nfunction getSegmentValue(segment) {\n return Array.isArray(segment) ? segment[1] : segment;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=get-segment-value.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"hasInterceptionRouteInCurrentTree\", {\n enumerable: true,\n get: function() {\n return hasInterceptionRouteInCurrentTree;\n }\n});\nconst _interceptionroutes = require(\"../../../../server/future/helpers/interception-routes\");\nfunction hasInterceptionRouteInCurrentTree(param) {\n let [segment, parallelRoutes] = param;\n // If we have a dynamic segment, it's marked as an interception route by the presence of the `i` suffix.\n if (Array.isArray(segment) && (segment[2] === \"di\" || segment[2] === \"ci\")) {\n return true;\n }\n // If segment is not an array, apply the existing string-based check\n if (typeof segment === \"string\" && (0, _interceptionroutes.isInterceptionRouteAppPath)(segment)) {\n return true;\n }\n // Iterate through parallelRoutes if they exist\n if (parallelRoutes) {\n for(const key in parallelRoutes){\n if (hasInterceptionRouteInCurrentTree(parallelRoutes[key])) {\n return true;\n }\n }\n }\n return false;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=has-interception-route-in-current-tree.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n handleExternalUrl: null,\n navigateReducer: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n handleExternalUrl: function() {\n return handleExternalUrl;\n },\n navigateReducer: function() {\n return navigateReducer;\n }\n});\nconst _fetchserverresponse = require(\"../fetch-server-response\");\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _invalidatecachebelowflightsegmentpath = require(\"../invalidate-cache-below-flight-segmentpath\");\nconst _applyrouterstatepatchtotree = require(\"../apply-router-state-patch-to-tree\");\nconst _shouldhardnavigate = require(\"../should-hard-navigate\");\nconst _isnavigatingtonewrootlayout = require(\"../is-navigating-to-new-root-layout\");\nconst _routerreducertypes = require(\"../router-reducer-types\");\nconst _handlemutable = require(\"../handle-mutable\");\nconst _applyflightdata = require(\"../apply-flight-data\");\nconst _prefetchreducer = require(\"./prefetch-reducer\");\nconst _approuter = require(\"../../app-router\");\nconst _segment = require(\"../../../../shared/lib/segment\");\nconst _pprnavigations = require(\"../ppr-navigations\");\nconst _prefetchcacheutils = require(\"../prefetch-cache-utils\");\nconst _clearcachenodedataforsegmentpath = require(\"../clear-cache-node-data-for-segment-path\");\nfunction handleExternalUrl(state, mutable, url, pendingPush) {\n mutable.mpaNavigation = true;\n mutable.canonicalUrl = url;\n mutable.pendingPush = pendingPush;\n mutable.scrollableSegments = undefined;\n return (0, _handlemutable.handleMutable)(state, mutable);\n}\nfunction generateSegmentsFromPatch(flightRouterPatch) {\n const segments = [];\n const [segment, parallelRoutes] = flightRouterPatch;\n if (Object.keys(parallelRoutes).length === 0) {\n return [\n [\n segment\n ]\n ];\n }\n for (const [parallelRouteKey, parallelRoute] of Object.entries(parallelRoutes)){\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([\n parallelRouteKey,\n ...childSegment\n ]);\n } else {\n segments.push([\n segment,\n parallelRouteKey,\n ...childSegment\n ]);\n }\n }\n }\n return segments;\n}\nfunction triggerLazyFetchForLeafSegments(newCache, currentCache, flightSegmentPath, treePatch) {\n let appliedPatch = false;\n newCache.rsc = currentCache.rsc;\n newCache.prefetchRsc = currentCache.prefetchRsc;\n newCache.loading = currentCache.loading;\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes);\n const segmentPathsToFill = generateSegmentsFromPatch(treePatch).map((segment)=>[\n ...flightSegmentPath,\n ...segment\n ]);\n for (const segmentPaths of segmentPathsToFill){\n (0, _clearcachenodedataforsegmentpath.clearCacheNodeDataForSegmentPath)(newCache, currentCache, segmentPaths);\n appliedPatch = true;\n }\n return appliedPatch;\n}\nconst navigateReducer = process.env.__NEXT_PPR ? navigateReducer_PPR : navigateReducer_noPPR;\n// This is the implementation when PPR is disabled. We can assume its behavior\n// is relatively stable because it's been running in production for a while.\nfunction navigateReducer_noPPR(state, action) {\n const { url, isExternalUrl, navigateType, shouldScroll } = action;\n const mutable = {};\n const { hash } = url;\n const href = (0, _createhreffromurl.createHrefFromUrl)(url);\n const pendingPush = navigateType === \"push\";\n // we want to prune the prefetch cache on every navigation to avoid it growing too large\n (0, _prefetchcacheutils.prunePrefetchCache)(state.prefetchCache);\n mutable.preserveCustomHistoryState = false;\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush);\n }\n const prefetchValues = (0, _prefetchcacheutils.getOrCreatePrefetchCacheEntry)({\n url,\n nextUrl: state.nextUrl,\n tree: state.tree,\n buildId: state.buildId,\n prefetchCache: state.prefetchCache\n });\n const { treeAtTimeOfPrefetch, data } = prefetchValues;\n _prefetchreducer.prefetchQueue.bump(data);\n return data.then((param)=>{\n let [flightData, canonicalUrlOverride] = param;\n let isFirstRead = false;\n // we only want to mark this once\n if (!prefetchValues.lastUsedTime) {\n // important: we should only mark the cache node as dirty after we unsuspend from the call above\n prefetchValues.lastUsedTime = Date.now();\n isFirstRead = true;\n }\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === \"string\") {\n return handleExternalUrl(state, mutable, flightData, pendingPush);\n }\n // Handles case where `` 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 let currentTree = state.tree;\n let currentCache = state.cache;\n let scrollableSegments = [];\n for (const flightDataPath of flightData){\n const flightSegmentPath = flightDataPath.slice(0, -4);\n // The one before last item is the router state tree patch\n const treePatch = flightDataPath.slice(-3)[0];\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = [\n \"\",\n ...flightSegmentPath\n ];\n // Create new tree based on the flightSegmentPath and router state patch\n let newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, currentTree, treePatch, href);\n // If the tree patch can't be applied to the current tree then we use the tree at time of prefetch\n // TODO-APP: This should instead fill in the missing pieces in `currentTree` with the data from `treeAtTimeOfPrefetch`, then apply the patch.\n if (newTree === null) {\n newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, treeAtTimeOfPrefetch, treePatch, href);\n }\n if (newTree !== null) {\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return handleExternalUrl(state, mutable, href, pendingPush);\n }\n const cache = (0, _approuter.createEmptyCacheNode)();\n let applied = false;\n if (prefetchValues.status === _routerreducertypes.PrefetchCacheEntryStatus.stale && !isFirstRead) {\n // When we have a stale prefetch entry, we only want to re-use the loading state of the route we're navigating to, to support instant loading navigations\n // this will trigger a lazy fetch for the actual page data by nulling the `rsc` and `prefetchRsc` values for page data,\n // while copying over the `loading` for the segment that contains the page data.\n // We only do this on subsequent reads, as otherwise there'd be no loading data to re-use.\n applied = triggerLazyFetchForLeafSegments(cache, currentCache, flightSegmentPath, treePatch);\n // since we re-used the stale cache's loading state & refreshed the data,\n // update the `lastUsedTime` so that it can continue to be re-used for the next 30s\n prefetchValues.lastUsedTime = Date.now();\n } else {\n applied = (0, _applyflightdata.applyFlightData)(currentCache, cache, flightDataPath, prefetchValues);\n }\n const hardNavigate = (0, _shouldhardnavigate.shouldHardNavigate)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, currentTree);\n if (hardNavigate) {\n // Copy rsc for the root node of the cache.\n cache.rsc = currentCache.rsc;\n cache.prefetchRsc = currentCache.prefetchRsc;\n (0, _invalidatecachebelowflightsegmentpath.invalidateCacheBelowFlightSegmentPath)(cache, currentCache, flightSegmentPath);\n // Ensure the existing cache value is used when the cache was not invalidated.\n mutable.cache = cache;\n } else if (applied) {\n mutable.cache = cache;\n // If we applied the cache, we update the \"current cache\" value so any other\n // segments in the FlightDataPath will be able to reference the updated cache.\n currentCache = cache;\n }\n currentTree = newTree;\n for (const subSegment of generateSegmentsFromPatch(treePatch)){\n const scrollableSegmentPath = [\n ...flightSegmentPath,\n ...subSegment\n ];\n // Filter out the __DEFAULT__ paths as they shouldn't be scrolled to in this case.\n if (scrollableSegmentPath[scrollableSegmentPath.length - 1] !== _segment.DEFAULT_SEGMENT_KEY) {\n scrollableSegments.push(scrollableSegmentPath);\n }\n }\n }\n }\n mutable.patchedTree = currentTree;\n mutable.canonicalUrl = canonicalUrlOverride ? (0, _createhreffromurl.createHrefFromUrl)(canonicalUrlOverride) : href;\n mutable.pendingPush = pendingPush;\n mutable.scrollableSegments = scrollableSegments;\n mutable.hashFragment = hash;\n mutable.shouldScroll = shouldScroll;\n return (0, _handlemutable.handleMutable)(state, mutable);\n }, ()=>state);\n}\n// This is the experimental PPR implementation. It's closer to the behavior we\n// want, but is likelier to include accidental regressions because it rewrites\n// existing functionality.\nfunction navigateReducer_PPR(state, action) {\n const { url, isExternalUrl, navigateType, shouldScroll } = action;\n const mutable = {};\n const { hash } = url;\n const href = (0, _createhreffromurl.createHrefFromUrl)(url);\n const pendingPush = navigateType === \"push\";\n // we want to prune the prefetch cache on every navigation to avoid it growing too large\n (0, _prefetchcacheutils.prunePrefetchCache)(state.prefetchCache);\n mutable.preserveCustomHistoryState = false;\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush);\n }\n const prefetchValues = (0, _prefetchcacheutils.getOrCreatePrefetchCacheEntry)({\n url,\n nextUrl: state.nextUrl,\n tree: state.tree,\n buildId: state.buildId,\n prefetchCache: state.prefetchCache\n });\n const { treeAtTimeOfPrefetch, data } = prefetchValues;\n _prefetchreducer.prefetchQueue.bump(data);\n return data.then((param)=>{\n let [flightData, canonicalUrlOverride, _postponed] = param;\n let isFirstRead = false;\n // we only want to mark this once\n if (!prefetchValues.lastUsedTime) {\n // important: we should only mark the cache node as dirty after we unsuspend from the call above\n prefetchValues.lastUsedTime = Date.now();\n isFirstRead = true;\n }\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === \"string\") {\n return handleExternalUrl(state, mutable, flightData, pendingPush);\n }\n // Handles case where `` 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 let currentTree = state.tree;\n let currentCache = state.cache;\n let scrollableSegments = [];\n // TODO: In practice, this is always a single item array. We probably\n // aren't going to every send multiple segments, at least not in this\n // format. So we could remove the extra wrapper for now until\n // that settles.\n for (const flightDataPath of flightData){\n const flightSegmentPath = flightDataPath.slice(0, -4);\n // The one before last item is the router state tree patch\n const treePatch = flightDataPath.slice(-3)[0];\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = [\n \"\",\n ...flightSegmentPath\n ];\n // Create new tree based on the flightSegmentPath and router state patch\n let newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, currentTree, treePatch, href);\n // If the tree patch can't be applied to the current tree then we use the tree at time of prefetch\n // TODO-APP: This should instead fill in the missing pieces in `currentTree` with the data from `treeAtTimeOfPrefetch`, then apply the patch.\n if (newTree === null) {\n newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, treeAtTimeOfPrefetch, treePatch, href);\n }\n if (newTree !== null) {\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return handleExternalUrl(state, mutable, href, pendingPush);\n }\n if (// This is just a paranoid check. When PPR is enabled, the server\n // will always send back a static response that's rendered from\n // the root. If for some reason it doesn't, we fall back to the\n // non-PPR implementation.\n // TODO: We should get rid of the else branch and do all navigations\n // via updateCacheNodeOnNavigation. The current structure is just\n // an incremental step.\n flightDataPath.length === 3) {\n const prefetchedTree = flightDataPath[0];\n const seedData = flightDataPath[1];\n const head = flightDataPath[2];\n const task = (0, _pprnavigations.updateCacheNodeOnNavigation)(currentCache, currentTree, prefetchedTree, seedData, head);\n if (task !== null && task.node !== null) {\n // We've created a new Cache Node tree that contains a prefetched\n // version of the next page. This can be rendered instantly.\n // Use the tree computed by updateCacheNodeOnNavigation instead\n // of the one computed by applyRouterStatePatchToTree.\n // TODO: We should remove applyRouterStatePatchToTree\n // from the PPR path entirely.\n const patchedRouterState = task.route;\n newTree = patchedRouterState;\n const newCache = task.node;\n // The prefetched tree has dynamic holes in it. We initiate a\n // dynamic request to fill them in.\n //\n // Do not block on the result. We'll immediately render the Cache\n // Node tree and suspend on the dynamic parts. When the request\n // comes in, we'll fill in missing data and ping React to\n // re-render. Unlike the lazy fetching model in the non-PPR\n // implementation, this is modeled as a single React update +\n // streaming, rather than multiple top-level updates. (However,\n // even in the new model, we'll still need to sometimes update the\n // root multiple times per navigation, like if the server sends us\n // a different response than we expected. For now, we revert back\n // to the lazy fetching mechanism in that case.)\n (0, _pprnavigations.listenForDynamicRequest)(task, (0, _fetchserverresponse.fetchServerResponse)(url, currentTree, state.nextUrl, state.buildId));\n mutable.cache = newCache;\n } else {\n // Nothing changed, so reuse the old cache.\n // TODO: What if the head changed but not any of the segment data?\n // Is that possible? If so, we should clone the whole tree and\n // update the head.\n newTree = prefetchedTree;\n }\n } else {\n // The static response does not include any dynamic holes, so\n // there's no need to do a second request.\n // TODO: As an incremental step this just reverts back to the\n // non-PPR implementation. We can simplify this branch further,\n // given that PPR prefetches are always static and return the whole\n // tree. Or in the meantime we could factor it out into a\n // separate function.\n const cache = (0, _approuter.createEmptyCacheNode)();\n let applied = false;\n if (prefetchValues.status === _routerreducertypes.PrefetchCacheEntryStatus.stale && !isFirstRead) {\n // When we have a stale prefetch entry, we only want to re-use the loading state of the route we're navigating to, to support instant loading navigations\n // this will trigger a lazy fetch for the actual page data by nulling the `rsc` and `prefetchRsc` values for page data,\n // while copying over the `loading` for the segment that contains the page data.\n // We only do this on subsequent reads, as otherwise there'd be no loading data to re-use.\n applied = triggerLazyFetchForLeafSegments(cache, currentCache, flightSegmentPath, treePatch);\n // since we re-used the stale cache's loading state & refreshed the data,\n // update the `lastUsedTime` so that it can continue to be re-used for the next 30s\n prefetchValues.lastUsedTime = Date.now();\n } else {\n applied = (0, _applyflightdata.applyFlightData)(currentCache, cache, flightDataPath, prefetchValues);\n }\n const hardNavigate = (0, _shouldhardnavigate.shouldHardNavigate)(// TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty, currentTree);\n if (hardNavigate) {\n // Copy rsc for the root node of the cache.\n cache.rsc = currentCache.rsc;\n cache.prefetchRsc = currentCache.prefetchRsc;\n (0, _invalidatecachebelowflightsegmentpath.invalidateCacheBelowFlightSegmentPath)(cache, currentCache, flightSegmentPath);\n // Ensure the existing cache value is used when the cache was not invalidated.\n mutable.cache = cache;\n } else if (applied) {\n mutable.cache = cache;\n // If we applied the cache, we update the \"current cache\" value so any other\n // segments in the FlightDataPath will be able to reference the updated cache.\n currentCache = cache;\n }\n }\n currentTree = newTree;\n for (const subSegment of generateSegmentsFromPatch(treePatch)){\n const scrollableSegmentPath = [\n ...flightSegmentPath,\n ...subSegment\n ];\n // Filter out the __DEFAULT__ paths as they shouldn't be scrolled to in this case.\n if (scrollableSegmentPath[scrollableSegmentPath.length - 1] !== _segment.DEFAULT_SEGMENT_KEY) {\n scrollableSegments.push(scrollableSegmentPath);\n }\n }\n }\n }\n mutable.patchedTree = currentTree;\n mutable.canonicalUrl = canonicalUrlOverride ? (0, _createhreffromurl.createHrefFromUrl)(canonicalUrlOverride) : href;\n mutable.pendingPush = pendingPush;\n mutable.scrollableSegments = scrollableSegments;\n mutable.hashFragment = hash;\n mutable.shouldScroll = shouldScroll;\n return (0, _handlemutable.handleMutable)(state, mutable);\n }, ()=>state);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=navigate-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n prefetchQueue: null,\n prefetchReducer: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n prefetchQueue: function() {\n return prefetchQueue;\n },\n prefetchReducer: function() {\n return prefetchReducer;\n }\n});\nconst _approuterheaders = require(\"../../app-router-headers\");\nconst _promisequeue = require(\"../../promise-queue\");\nconst _prefetchcacheutils = require(\"../prefetch-cache-utils\");\nconst prefetchQueue = new _promisequeue.PromiseQueue(5);\nfunction prefetchReducer(state, action) {\n // let's prune the prefetch cache before we do anything else\n (0, _prefetchcacheutils.prunePrefetchCache)(state.prefetchCache);\n const { url } = action;\n url.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY);\n (0, _prefetchcacheutils.getOrCreatePrefetchCacheEntry)({\n url,\n nextUrl: state.nextUrl,\n prefetchCache: state.prefetchCache,\n kind: action.kind,\n tree: state.tree,\n buildId: state.buildId\n });\n return state;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=prefetch-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"refreshReducer\", {\n enumerable: true,\n get: function() {\n return refreshReducer;\n }\n});\nconst _fetchserverresponse = require(\"../fetch-server-response\");\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _applyrouterstatepatchtotree = require(\"../apply-router-state-patch-to-tree\");\nconst _isnavigatingtonewrootlayout = require(\"../is-navigating-to-new-root-layout\");\nconst _navigatereducer = require(\"./navigate-reducer\");\nconst _handlemutable = require(\"../handle-mutable\");\nconst _filllazyitemstillleafwithhead = require(\"../fill-lazy-items-till-leaf-with-head\");\nconst _approuter = require(\"../../app-router\");\nconst _handlesegmentmismatch = require(\"../handle-segment-mismatch\");\nconst _hasinterceptionrouteincurrenttree = require(\"./has-interception-route-in-current-tree\");\nconst _refetchinactiveparallelsegments = require(\"../refetch-inactive-parallel-segments\");\nfunction refreshReducer(state, action) {\n const { origin } = action;\n const mutable = {};\n const href = state.canonicalUrl;\n let currentTree = state.tree;\n mutable.preserveCustomHistoryState = false;\n const cache = (0, _approuter.createEmptyCacheNode)();\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree);\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(href, origin), [\n currentTree[0],\n currentTree[1],\n currentTree[2],\n \"refetch\"\n ], includeNextUrl ? state.nextUrl : null, state.buildId);\n return cache.lazyData.then(async (param)=>{\n let [flightData, canonicalUrlOverride] = param;\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === \"string\") {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, flightData, state.pushRef.pendingPush);\n }\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null;\n for (const flightDataPath of flightData){\n // FlightDataPath with more than two items means unexpected Flight data was returned\n if (flightDataPath.length !== 3) {\n // TODO-APP: handle this case better\n console.log(\"REFRESH FAILED\");\n return state;\n }\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const [treePatch] = flightDataPath;\n const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n [\n \"\"\n ], currentTree, treePatch, state.canonicalUrl);\n if (newTree === null) {\n return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);\n }\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? (0, _createhreffromurl.createHrefFromUrl)(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref;\n }\n // The one before last item is the router state tree patch\n const [cacheNodeSeedData, head] = flightDataPath.slice(-2);\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[2];\n cache.rsc = rsc;\n cache.prefetchRsc = null;\n (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(cache, // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.\n undefined, treePatch, cacheNodeSeedData, head);\n mutable.prefetchCache = new Map();\n }\n await (0, _refetchinactiveparallelsegments.refreshInactiveParallelSegments)({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl,\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl\n });\n mutable.cache = cache;\n mutable.patchedTree = newTree;\n mutable.canonicalUrl = href;\n currentTree = newTree;\n }\n return (0, _handlemutable.handleMutable)(state, mutable);\n }, ()=>state);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=refresh-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"restoreReducer\", {\n enumerable: true,\n get: function() {\n return restoreReducer;\n }\n});\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _computechangedpath = require(\"../compute-changed-path\");\nconst _pprnavigations = require(\"../ppr-navigations\");\nfunction restoreReducer(state, action) {\n const { url, tree } = action;\n const href = (0, _createhreffromurl.createHrefFromUrl)(url);\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n const treeToRestore = tree || state.tree;\n const oldCache = state.cache;\n const newCache = process.env.__NEXT_PPR ? // data for any segment whose dynamic data was already received. This\n // prevents an unnecessary flash back to PPR state during a\n // back/forward navigation.\n (0, _pprnavigations.updateCacheNodeOnPopstateRestoration)(oldCache, treeToRestore) : oldCache;\n var _extractPathFromFlightRouterState;\n return {\n buildId: state.buildId,\n // Set canonical url\n canonicalUrl: href,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache: newCache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: treeToRestore,\n nextUrl: (_extractPathFromFlightRouterState = (0, _computechangedpath.extractPathFromFlightRouterState)(treeToRestore)) != null ? _extractPathFromFlightRouterState : url.pathname\n };\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=restore-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"serverActionReducer\", {\n enumerable: true,\n get: function() {\n return serverActionReducer;\n }\n});\nconst _appcallserver = require(\"../../../app-call-server\");\nconst _approuterheaders = require(\"../../app-router-headers\");\nconst _addbasepath = require(\"../../../add-base-path\");\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _navigatereducer = require(\"./navigate-reducer\");\nconst _applyrouterstatepatchtotree = require(\"../apply-router-state-patch-to-tree\");\nconst _isnavigatingtonewrootlayout = require(\"../is-navigating-to-new-root-layout\");\nconst _handlemutable = require(\"../handle-mutable\");\nconst _filllazyitemstillleafwithhead = require(\"../fill-lazy-items-till-leaf-with-head\");\nconst _approuter = require(\"../../app-router\");\nconst _hasinterceptionrouteincurrenttree = require(\"./has-interception-route-in-current-tree\");\nconst _handlesegmentmismatch = require(\"../handle-segment-mismatch\");\nconst _refetchinactiveparallelsegments = require(\"../refetch-inactive-parallel-segments\");\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromFetch } from 'react-server-dom-webpack/client'\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { encodeReply } from 'react-server-dom-webpack/client'\nconst { createFromFetch, encodeReply } = !!process.env.NEXT_RUNTIME ? require(\"react-server-dom-webpack/client.edge\") : require(\"react-server-dom-webpack/client\");\nasync function fetchServerAction(state, nextUrl, param) {\n let { actionId, actionArgs } = param;\n const body = await encodeReply(actionArgs);\n const res = await fetch(\"\", {\n method: \"POST\",\n headers: {\n Accept: _approuterheaders.RSC_CONTENT_TYPE_HEADER,\n [_approuterheaders.ACTION]: actionId,\n [_approuterheaders.NEXT_ROUTER_STATE_TREE]: encodeURIComponent(JSON.stringify(state.tree)),\n ...process.env.NEXT_DEPLOYMENT_ID ? {\n \"x-deployment-id\": process.env.NEXT_DEPLOYMENT_ID\n } : {},\n ...nextUrl ? {\n [_approuterheaders.NEXT_URL]: nextUrl\n } : {}\n },\n body\n });\n const location = res.headers.get(\"x-action-redirect\");\n let revalidatedParts;\n try {\n const revalidatedHeader = JSON.parse(res.headers.get(\"x-action-revalidated\") || \"[[],0,0]\");\n revalidatedParts = {\n paths: revalidatedHeader[0] || [],\n tag: !!revalidatedHeader[1],\n cookie: revalidatedHeader[2]\n };\n } catch (e) {\n revalidatedParts = {\n paths: [],\n tag: false,\n cookie: false\n };\n }\n const redirectLocation = location ? new URL((0, _addbasepath.addBasePath)(location), // Ensure relative redirects in Server Actions work, e.g. redirect('./somewhere-else')\n new URL(state.canonicalUrl, window.location.href)) : undefined;\n let isFlightResponse = res.headers.get(\"content-type\") === _approuterheaders.RSC_CONTENT_TYPE_HEADER;\n if (isFlightResponse) {\n const response = await createFromFetch(Promise.resolve(res), {\n callServer: _appcallserver.callServer\n });\n if (location) {\n // if it was a redirection, then result is just a regular RSC payload\n const [, actionFlightData] = response != null ? response : [];\n return {\n actionFlightData: actionFlightData,\n redirectLocation,\n revalidatedParts\n };\n }\n // otherwise it's a tuple of [actionResult, actionFlightData]\n const [actionResult, [, actionFlightData]] = response != null ? response : [];\n return {\n actionResult,\n actionFlightData,\n redirectLocation,\n revalidatedParts\n };\n }\n return {\n redirectLocation,\n revalidatedParts\n };\n}\nfunction serverActionReducer(state, action) {\n const { resolve, reject } = action;\n const mutable = {};\n const href = state.canonicalUrl;\n let currentTree = state.tree;\n mutable.preserveCustomHistoryState = false;\n // only pass along the `nextUrl` param (used for interception routes) if the current route was intercepted.\n // If the route has been intercepted, the action should be as well.\n // Otherwise the server action might be intercepted with the wrong action id\n // (ie, one that corresponds with the intercepted route)\n const nextUrl = state.nextUrl && (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree) ? state.nextUrl : null;\n mutable.inFlightServerAction = fetchServerAction(state, nextUrl, action);\n return mutable.inFlightServerAction.then(async (param)=>{\n let { actionResult, actionFlightData: flightData, redirectLocation } = param;\n // Make sure the redirection is a push instead of a replace.\n // Issue: https://github.com/vercel/next.js/issues/53911\n if (redirectLocation) {\n state.pushRef.pendingPush = true;\n mutable.pendingPush = true;\n }\n if (!flightData) {\n resolve(actionResult);\n // If there is a redirect but no flight data we need to do a mpaNavigation.\n if (redirectLocation) {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, redirectLocation.href, state.pushRef.pendingPush);\n }\n return state;\n }\n if (typeof flightData === \"string\") {\n // Handle case when navigating to page in `pages` from `app`\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, flightData, state.pushRef.pendingPush);\n }\n // Remove cache.data as it has been resolved at this point.\n mutable.inFlightServerAction = null;\n if (redirectLocation) {\n const newHref = (0, _createhreffromurl.createHrefFromUrl)(redirectLocation, false);\n mutable.canonicalUrl = newHref;\n }\n for (const flightDataPath of flightData){\n // FlightDataPath with more than two items means unexpected Flight data was returned\n if (flightDataPath.length !== 3) {\n // TODO-APP: handle this case better\n console.log(\"SERVER ACTION APPLY FAILED\");\n return state;\n }\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const [treePatch] = flightDataPath;\n const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n [\n \"\"\n ], currentTree, treePatch, redirectLocation ? (0, _createhreffromurl.createHrefFromUrl)(redirectLocation) : state.canonicalUrl);\n if (newTree === null) {\n return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);\n }\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);\n }\n // The one before last item is the router state tree patch\n const [cacheNodeSeedData, head] = flightDataPath.slice(-2);\n const rsc = cacheNodeSeedData !== null ? cacheNodeSeedData[2] : null;\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (rsc !== null) {\n const cache = (0, _approuter.createEmptyCacheNode)();\n cache.rsc = rsc;\n cache.prefetchRsc = null;\n (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(cache, // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.\n undefined, treePatch, cacheNodeSeedData, head);\n await (0, _refetchinactiveparallelsegments.refreshInactiveParallelSegments)({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl: Boolean(nextUrl),\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl\n });\n mutable.cache = cache;\n mutable.prefetchCache = new Map();\n }\n mutable.patchedTree = newTree;\n currentTree = newTree;\n }\n resolve(actionResult);\n return (0, _handlemutable.handleMutable)(state, mutable);\n }, (e)=>{\n // When the server action is rejected we don't update the state and instead call the reject handler of the promise.\n reject(e);\n return state;\n });\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=server-action-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"serverPatchReducer\", {\n enumerable: true,\n get: function() {\n return serverPatchReducer;\n }\n});\nconst _createhreffromurl = require(\"../create-href-from-url\");\nconst _applyrouterstatepatchtotree = require(\"../apply-router-state-patch-to-tree\");\nconst _isnavigatingtonewrootlayout = require(\"../is-navigating-to-new-root-layout\");\nconst _navigatereducer = require(\"./navigate-reducer\");\nconst _applyflightdata = require(\"../apply-flight-data\");\nconst _handlemutable = require(\"../handle-mutable\");\nconst _approuter = require(\"../../app-router\");\nconst _handlesegmentmismatch = require(\"../handle-segment-mismatch\");\nfunction serverPatchReducer(state, action) {\n const { serverResponse } = action;\n const [flightData, overrideCanonicalUrl] = serverResponse;\n const mutable = {};\n mutable.preserveCustomHistoryState = false;\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === \"string\") {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, flightData, state.pushRef.pendingPush);\n }\n let currentTree = state.tree;\n let currentCache = state.cache;\n for (const flightDataPath of flightData){\n // Slices off the last segment (which is at -4) as it doesn't exist in the tree yet\n const flightSegmentPath = flightDataPath.slice(0, -4);\n const [treePatch] = flightDataPath.slice(-3, -2);\n const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''\n [\n \"\",\n ...flightSegmentPath\n ], currentTree, treePatch, state.canonicalUrl);\n if (newTree === null) {\n return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);\n }\n if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {\n return (0, _navigatereducer.handleExternalUrl)(state, mutable, state.canonicalUrl, state.pushRef.pendingPush);\n }\n const canonicalUrlOverrideHref = overrideCanonicalUrl ? (0, _createhreffromurl.createHrefFromUrl)(overrideCanonicalUrl) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrl = canonicalUrlOverrideHref;\n }\n const cache = (0, _approuter.createEmptyCacheNode)();\n (0, _applyflightdata.applyFlightData)(currentCache, cache, flightDataPath);\n mutable.patchedTree = newTree;\n mutable.cache = cache;\n currentCache = cache;\n currentTree = newTree;\n }\n return (0, _handlemutable.handleMutable)(state, mutable);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=server-patch-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n addRefreshMarkerToActiveParallelSegments: null,\n refreshInactiveParallelSegments: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n addRefreshMarkerToActiveParallelSegments: function() {\n return addRefreshMarkerToActiveParallelSegments;\n },\n refreshInactiveParallelSegments: function() {\n return refreshInactiveParallelSegments;\n }\n});\nconst _applyflightdata = require(\"./apply-flight-data\");\nconst _fetchserverresponse = require(\"./fetch-server-response\");\nconst _segment = require(\"../../../shared/lib/segment\");\nasync function refreshInactiveParallelSegments(options) {\n const fetchedSegments = new Set();\n await refreshInactiveParallelSegmentsImpl({\n ...options,\n rootTree: options.updatedTree,\n fetchedSegments\n });\n}\nasync function refreshInactiveParallelSegmentsImpl(param) {\n let { state, updatedTree, updatedCache, includeNextUrl, fetchedSegments, rootTree = updatedTree, canonicalUrl } = param;\n const [, parallelRoutes, refetchPath, refetchMarker] = updatedTree;\n const fetchPromises = [];\n if (refetchPath && refetchPath !== canonicalUrl && refetchMarker === \"refresh\" && // 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 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 = (0, _fetchserverresponse.fetchServerResponse)(new URL(refetchPath, location.origin), // 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 [\n rootTree[0],\n rootTree[1],\n rootTree[2],\n \"refetch\"\n ], includeNextUrl ? state.nextUrl : null, state.buildId).then((fetchResponse)=>{\n const flightData = fetchResponse[0];\n if (typeof flightData !== \"string\") {\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 (0, _applyflightdata.applyFlightData)(updatedCache, updatedCache, flightDataPath);\n }\n } else {\n // When flightData 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 fetchPromises.push(fetchPromise);\n }\n for(const key in parallelRoutes){\n const parallelFetchPromise = refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree: parallelRoutes[key],\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree,\n canonicalUrl\n });\n fetchPromises.push(parallelFetchPromise);\n }\n await Promise.all(fetchPromises);\n}\nfunction addRefreshMarkerToActiveParallelSegments(tree, path) {\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(_segment.PAGE_SEGMENT_KEY) && refetchMarker !== \"refresh\") {\n tree[2] = path;\n tree[3] = \"refresh\";\n }\n for(const key in parallelRoutes){\n addRefreshMarkerToActiveParallelSegments(parallelRoutes[key], path);\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=refetch-inactive-parallel-segments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n ACTION_FAST_REFRESH: null,\n ACTION_NAVIGATE: null,\n ACTION_PREFETCH: null,\n ACTION_REFRESH: null,\n ACTION_RESTORE: null,\n ACTION_SERVER_ACTION: null,\n ACTION_SERVER_PATCH: null,\n PrefetchCacheEntryStatus: null,\n PrefetchKind: null,\n isThenable: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ACTION_FAST_REFRESH: function() {\n return ACTION_FAST_REFRESH;\n },\n ACTION_NAVIGATE: function() {\n return ACTION_NAVIGATE;\n },\n ACTION_PREFETCH: function() {\n return ACTION_PREFETCH;\n },\n ACTION_REFRESH: function() {\n return ACTION_REFRESH;\n },\n ACTION_RESTORE: function() {\n return ACTION_RESTORE;\n },\n ACTION_SERVER_ACTION: function() {\n return ACTION_SERVER_ACTION;\n },\n ACTION_SERVER_PATCH: function() {\n return ACTION_SERVER_PATCH;\n },\n PrefetchCacheEntryStatus: function() {\n return PrefetchCacheEntryStatus;\n },\n PrefetchKind: function() {\n return PrefetchKind;\n },\n isThenable: function() {\n return isThenable;\n }\n});\nconst ACTION_REFRESH = \"refresh\";\nconst ACTION_NAVIGATE = \"navigate\";\nconst ACTION_RESTORE = \"restore\";\nconst ACTION_SERVER_PATCH = \"server-patch\";\nconst ACTION_PREFETCH = \"prefetch\";\nconst ACTION_FAST_REFRESH = \"fast-refresh\";\nconst ACTION_SERVER_ACTION = \"server-action\";\nvar PrefetchKind;\n(function(PrefetchKind) {\n PrefetchKind[\"AUTO\"] = \"auto\";\n PrefetchKind[\"FULL\"] = \"full\";\n PrefetchKind[\"TEMPORARY\"] = \"temporary\";\n})(PrefetchKind || (PrefetchKind = {}));\nvar PrefetchCacheEntryStatus;\n(function(PrefetchCacheEntryStatus) {\n PrefetchCacheEntryStatus[\"fresh\"] = \"fresh\";\n PrefetchCacheEntryStatus[\"reusable\"] = \"reusable\";\n PrefetchCacheEntryStatus[\"expired\"] = \"expired\";\n PrefetchCacheEntryStatus[\"stale\"] = \"stale\";\n})(PrefetchCacheEntryStatus || (PrefetchCacheEntryStatus = {}));\nfunction isThenable(value) {\n // TODO: We don't gain anything from this abstraction. It's unsound, and only\n // makes sense in the specific places where we use it. So it's better to keep\n // the type coercion inline, instead of leaking this to other places in\n // the codebase.\n return value && (typeof value === \"object\" || typeof value === \"function\") && typeof value.then === \"function\";\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=router-reducer-types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"reducer\", {\n enumerable: true,\n get: function() {\n return reducer;\n }\n});\nconst _routerreducertypes = require(\"./router-reducer-types\");\nconst _navigatereducer = require(\"./reducers/navigate-reducer\");\nconst _serverpatchreducer = require(\"./reducers/server-patch-reducer\");\nconst _restorereducer = require(\"./reducers/restore-reducer\");\nconst _refreshreducer = require(\"./reducers/refresh-reducer\");\nconst _prefetchreducer = require(\"./reducers/prefetch-reducer\");\nconst _fastrefreshreducer = require(\"./reducers/fast-refresh-reducer\");\nconst _serveractionreducer = require(\"./reducers/server-action-reducer\");\n/**\n * Reducer that handles the app-router state updates.\n */ function clientReducer(state, action) {\n switch(action.type){\n case _routerreducertypes.ACTION_NAVIGATE:\n {\n return (0, _navigatereducer.navigateReducer)(state, action);\n }\n case _routerreducertypes.ACTION_SERVER_PATCH:\n {\n return (0, _serverpatchreducer.serverPatchReducer)(state, action);\n }\n case _routerreducertypes.ACTION_RESTORE:\n {\n return (0, _restorereducer.restoreReducer)(state, action);\n }\n case _routerreducertypes.ACTION_REFRESH:\n {\n return (0, _refreshreducer.refreshReducer)(state, action);\n }\n case _routerreducertypes.ACTION_FAST_REFRESH:\n {\n return (0, _fastrefreshreducer.fastRefreshReducer)(state, action);\n }\n case _routerreducertypes.ACTION_PREFETCH:\n {\n return (0, _prefetchreducer.prefetchReducer)(state, action);\n }\n case _routerreducertypes.ACTION_SERVER_ACTION:\n {\n return (0, _serveractionreducer.serverActionReducer)(state, action);\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error(\"Unknown action\");\n }\n}\nfunction serverReducer(state, _action) {\n return state;\n}\nconst reducer = typeof window === \"undefined\" ? serverReducer : clientReducer;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=router-reducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"shouldHardNavigate\", {\n enumerable: true,\n get: function() {\n return shouldHardNavigate;\n }\n});\nconst _matchsegments = require(\"../match-segments\");\nfunction shouldHardNavigate(flightSegmentPath, flightRouterState) {\n const [segment, parallelRoutes] = flightRouterState;\n // TODO-APP: Check if `as` can be replaced.\n const [currentSegment, parallelRouteKey] = flightSegmentPath;\n // Check if current segment matches the existing segment.\n if (!(0, _matchsegments.matchSegment)(currentSegment, segment)) {\n // If dynamic parameter in tree doesn't match up with segment path a hard navigation is triggered.\n if (Array.isArray(currentSegment)) {\n return true;\n }\n // If the existing segment did not match soft navigation is triggered.\n return false;\n }\n const lastSegment = flightSegmentPath.length <= 2;\n if (lastSegment) {\n return false;\n }\n return shouldHardNavigate(flightSegmentPath.slice(2), parallelRoutes[parallelRouteKey]);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=should-hard-navigate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createDynamicallyTrackedSearchParams: null,\n createUntrackedSearchParams: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createDynamicallyTrackedSearchParams: function() {\n return createDynamicallyTrackedSearchParams;\n },\n createUntrackedSearchParams: function() {\n return createUntrackedSearchParams;\n }\n});\nconst _staticgenerationasyncstorageexternal = require(\"./static-generation-async-storage.external\");\nconst _dynamicrendering = require(\"../../server/app-render/dynamic-rendering\");\nconst _reflect = require(\"../../server/web/spec-extension/adapters/reflect\");\nfunction createUntrackedSearchParams(searchParams) {\n const store = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();\n if (store && store.forceStatic) {\n return {};\n } else {\n return searchParams;\n }\n}\nfunction createDynamicallyTrackedSearchParams(searchParams) {\n const store = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();\n if (!store) {\n // we assume we are in a route handler or page render. just return the searchParams\n return searchParams;\n } else if (store.forceStatic) {\n // If we forced static we omit searchParams entirely. This is true both during SSR\n // and browser render because we need there to be parity between these environments\n return {};\n } else if (!store.isStaticGeneration && !store.dynamicShouldError) {\n // during dynamic renders we don't actually have to track anything so we just return\n // the searchParams directly. However if dynamic data access should error then we\n // still want to track access. This covers the case in Dev where all renders are dynamic\n // but we still want to error if you use a dynamic data source because it will fail the build\n // or revalidate if you do.\n return searchParams;\n } else {\n // We need to track dynamic access with a Proxy. We implement get, has, and ownKeys because\n // these can all be used to exfiltrate information about searchParams.\n return new Proxy({}, {\n get (target, prop, receiver) {\n if (typeof prop === \"string\") {\n (0, _dynamicrendering.trackDynamicDataAccessed)(store, \"searchParams.\" + prop);\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n has (target, prop) {\n if (typeof prop === \"string\") {\n (0, _dynamicrendering.trackDynamicDataAccessed)(store, \"searchParams.\" + prop);\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n (0, _dynamicrendering.trackDynamicDataAccessed)(store, \"searchParams\");\n return Reflect.ownKeys(target);\n }\n });\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=search-params.js.map","\"TURBOPACK { transition: next-shared }\";\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"staticGenerationAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _staticgenerationasyncstorageinstance.staticGenerationAsyncStorage;\n }\n});\nconst _staticgenerationasyncstorageinstance = require(\"./static-generation-async-storage-instance\");\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=static-generation-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n StaticGenBailoutError: null,\n isStaticGenBailoutError: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n StaticGenBailoutError: function() {\n return StaticGenBailoutError;\n },\n isStaticGenBailoutError: function() {\n return isStaticGenBailoutError;\n }\n});\nconst NEXT_STATIC_GEN_BAILOUT = \"NEXT_STATIC_GEN_BAILOUT\";\nclass StaticGenBailoutError extends Error {\n constructor(...args){\n super(...args);\n this.code = NEXT_STATIC_GEN_BAILOUT;\n }\n}\nfunction isStaticGenBailoutError(error) {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error)) {\n return false;\n }\n return error.code === NEXT_STATIC_GEN_BAILOUT;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=static-generation-bailout.js.map","/**\n * Create a \"Thenable\" that does not resolve. This is used to suspend indefinitely when data is not available yet.\n */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"unresolvedThenable\", {\n enumerable: true,\n get: function() {\n return unresolvedThenable;\n }\n});\nconst unresolvedThenable = {\n then: ()=>{}\n};\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=unresolved-thenable.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n useReducerWithReduxDevtools: null,\n useUnwrapState: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n useReducerWithReduxDevtools: function() {\n return useReducerWithReduxDevtools;\n },\n useUnwrapState: function() {\n return useUnwrapState;\n }\n});\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _routerreducertypes = require(\"./router-reducer/router-reducer-types\");\nconst _actionqueue = require(\"../../shared/lib/router/action-queue\");\nfunction normalizeRouterState(val) {\n if (val instanceof Map) {\n const obj = {};\n for (const [key, value] of val.entries()){\n if (typeof value === \"function\") {\n obj[key] = \"fn()\";\n continue;\n }\n if (typeof value === \"object\" && value !== null) {\n if (value.$$typeof) {\n obj[key] = value.$$typeof.toString();\n continue;\n }\n if (value._bundlerConfig) {\n obj[key] = \"FlightData\";\n continue;\n }\n }\n obj[key] = normalizeRouterState(value);\n }\n return obj;\n }\n if (typeof val === \"object\" && val !== null) {\n const obj = {};\n for(const key in val){\n const value = val[key];\n if (typeof value === \"function\") {\n obj[key] = \"fn()\";\n continue;\n }\n if (typeof value === \"object\" && value !== null) {\n if (value.$$typeof) {\n obj[key] = value.$$typeof.toString();\n continue;\n }\n if (value.hasOwnProperty(\"_bundlerConfig\")) {\n obj[key] = \"FlightData\";\n continue;\n }\n }\n obj[key] = normalizeRouterState(value);\n }\n return obj;\n }\n if (Array.isArray(val)) {\n return val.map(normalizeRouterState);\n }\n return val;\n}\nfunction useUnwrapState(state) {\n // reducer actions can be async, so sometimes we need to suspend until the state is resolved\n if ((0, _routerreducertypes.isThenable)(state)) {\n const result = (0, _react.use)(state);\n return result;\n }\n return state;\n}\nfunction useReducerWithReduxDevtoolsNoop(initialState) {\n return [\n initialState,\n ()=>{},\n ()=>{}\n ];\n}\nfunction useReducerWithReduxDevtoolsImpl(initialState) {\n const [state, setState] = _react.default.useState(initialState);\n const actionQueue = (0, _react.useContext)(_actionqueue.ActionQueueContext);\n if (!actionQueue) {\n throw new Error(\"Invariant: Missing ActionQueueContext\");\n }\n const devtoolsConnectionRef = (0, _react.useRef)();\n const enabledRef = (0, _react.useRef)();\n (0, _react.useEffect)(()=>{\n if (devtoolsConnectionRef.current || enabledRef.current === false) {\n return;\n }\n if (enabledRef.current === undefined && typeof window.__REDUX_DEVTOOLS_EXTENSION__ === \"undefined\") {\n enabledRef.current = false;\n return;\n }\n devtoolsConnectionRef.current = window.__REDUX_DEVTOOLS_EXTENSION__.connect({\n instanceId: 8000,\n name: \"next-router\"\n });\n if (devtoolsConnectionRef.current) {\n devtoolsConnectionRef.current.init(normalizeRouterState(initialState));\n if (actionQueue) {\n actionQueue.devToolsInstance = devtoolsConnectionRef.current;\n }\n }\n return ()=>{\n devtoolsConnectionRef.current = undefined;\n };\n }, [\n initialState,\n actionQueue\n ]);\n const dispatch = (0, _react.useCallback)((action)=>{\n if (!actionQueue.state) {\n // we lazy initialize the mutable action queue state since the data needed\n // to generate the state is not available when the actionQueue context is created\n actionQueue.state = initialState;\n }\n actionQueue.dispatch(action, setState);\n }, [\n actionQueue,\n initialState\n ]);\n // Sync is called after a state update in the HistoryUpdater,\n // for debugging purposes. Since the reducer state may be a Promise,\n // we let the app router use() it and sync on the resolved value if\n // something changed.\n // Using the `state` here would be referentially unstable and cause\n // undesirable re-renders and history updates.\n const sync = (0, _react.useCallback)((resolvedState)=>{\n if (devtoolsConnectionRef.current) {\n devtoolsConnectionRef.current.send({\n type: \"RENDER_SYNC\"\n }, normalizeRouterState(resolvedState));\n }\n }, []);\n return [\n state,\n dispatch,\n sync\n ];\n}\nconst useReducerWithReduxDevtools = typeof window !== \"undefined\" ? useReducerWithReduxDevtoolsImpl : useReducerWithReduxDevtoolsNoop;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=use-reducer-with-devtools.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"hasBasePath\", {\n enumerable: true,\n get: function() {\n return hasBasePath;\n }\n});\nconst _pathhasprefix = require(\"../shared/lib/router/utils/path-has-prefix\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || \"\";\nfunction hasBasePath(path) {\n return (0, _pathhasprefix.pathHasPrefix)(path, basePath);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=has-base-path.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"normalizePathTrailingSlash\", {\n enumerable: true,\n get: function() {\n return normalizePathTrailingSlash;\n }\n});\nconst _removetrailingslash = require(\"../shared/lib/router/utils/remove-trailing-slash\");\nconst _parsepath = require(\"../shared/lib/router/utils/parse-path\");\nconst normalizePathTrailingSlash = (path)=>{\n if (!path.startsWith(\"/\") || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path;\n }\n const { pathname, query, hash } = (0, _parsepath.parsePath)(path);\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return \"\" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;\n } else if (pathname.endsWith(\"/\")) {\n return \"\" + pathname + query + hash;\n } else {\n return pathname + \"/\" + query + hash;\n }\n }\n return \"\" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;\n};\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=normalize-trailing-slash.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return onRecoverableError;\n }\n});\nconst _bailouttocsr = require(\"../shared/lib/lazy-dynamic/bailout-to-csr\");\nfunction onRecoverableError(err) {\n // Using default react onRecoverableError\n // x-ref: https://github.com/facebook/react/blob/d4bc16a7d69eb2ea38a88c8ac0b461d5f72cdcab/packages/react-dom/src/client/ReactDOMRoot.js#L83\n const defaultOnRecoverableError = typeof reportError === \"function\" ? // emulating an uncaught JavaScript error.\n reportError : (error)=>{\n window.console.error(error);\n };\n // Skip certain custom errors which are not expected to be reported on client\n if ((0, _bailouttocsr.isBailoutToCSRError)(err)) return;\n defaultOnRecoverableError(err);\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=on-recoverable-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"removeBasePath\", {\n enumerable: true,\n get: function() {\n return removeBasePath;\n }\n});\nconst _hasbasepath = require(\"./has-base-path\");\nconst basePath = process.env.__NEXT_ROUTER_BASEPATH || \"\";\nfunction removeBasePath(path) {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!(0, _hasbasepath.hasBasePath)(path)) {\n return path;\n }\n }\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path;\n path = path.slice(basePath.length);\n if (!path.startsWith(\"/\")) path = \"/\" + path;\n return path;\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=remove-base-path.js.map","/*\n React\n scheduler.production.min.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'use strict';function f(a,c){var b=a.length;a.push(c);a:for(;0>>1,e=a[d];if(0n.length&&(p=-1)}var q=n.byteOffset+g;if(-1