Auto-commit 2026-04-29 16:31
This commit is contained in:
8
node_modules/next/dist/esm/client/add-base-path.js
generated
vendored
Normal file
8
node_modules/next/dist/esm/client/add-base-path.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix';
|
||||
import { normalizePathTrailingSlash } from './normalize-trailing-slash';
|
||||
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
|
||||
export function addBasePath(path, required) {
|
||||
return normalizePathTrailingSlash(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : addPathPrefix(path, basePath));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=add-base-path.js.map
|
||||
1
node_modules/next/dist/esm/client/add-base-path.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/add-base-path.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/add-base-path.ts"],"sourcesContent":["import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function addBasePath(path: string, required?: boolean): string {\n return normalizePathTrailingSlash(\n process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required\n ? path\n : addPathPrefix(path, basePath)\n )\n}\n"],"names":["addPathPrefix","normalizePathTrailingSlash","basePath","process","env","__NEXT_ROUTER_BASEPATH","addBasePath","path","required","__NEXT_MANUAL_CLIENT_BASE_PATH"],"mappings":"AAAA,SAASA,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,0BAA0B,QAAQ,6BAA4B;AAEvE,MAAMC,WAAW,AAACC,QAAQC,GAAG,CAACC,sBAAsB,IAAe;AAEnE,OAAO,SAASC,YAAYC,IAAY,EAAEC,QAAkB;IAC1D,OAAOP,2BACLE,QAAQC,GAAG,CAACK,8BAA8B,IAAI,CAACD,WAC3CD,OACAP,cAAcO,MAAML;AAE5B","ignoreList":[0]}
|
||||
9
node_modules/next/dist/esm/client/add-locale.js
generated
vendored
Normal file
9
node_modules/next/dist/esm/client/add-locale.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { normalizePathTrailingSlash } from './normalize-trailing-slash';
|
||||
export const addLocale = (path, ...args)=>{
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
return normalizePathTrailingSlash(require('../shared/lib/router/utils/add-locale').addLocale(path, ...args));
|
||||
}
|
||||
return path;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=add-locale.js.map
|
||||
1
node_modules/next/dist/esm/client/add-locale.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/add-locale.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/add-locale.ts"],"sourcesContent":["import type { addLocale as Fn } from '../shared/lib/router/utils/add-locale'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nexport const addLocale: typeof Fn = (path, ...args) => {\n if (process.env.__NEXT_I18N_SUPPORT) {\n return normalizePathTrailingSlash(\n (\n require('../shared/lib/router/utils/add-locale') as typeof import('../shared/lib/router/utils/add-locale')\n ).addLocale(path, ...args)\n )\n }\n return path\n}\n"],"names":["normalizePathTrailingSlash","addLocale","path","args","process","env","__NEXT_I18N_SUPPORT","require"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,6BAA4B;AAEvE,OAAO,MAAMC,YAAuB,CAACC,MAAM,GAAGC;IAC5C,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACnC,OAAON,2BACL,AACEO,QAAQ,yCACRN,SAAS,CAACC,SAASC;IAEzB;IACA,OAAOD;AACT,EAAC","ignoreList":[0]}
|
||||
60
node_modules/next/dist/esm/client/app-bootstrap.js
generated
vendored
Normal file
60
node_modules/next/dist/esm/client/app-bootstrap.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Before starting the Next.js runtime and requiring any module, we need to make
|
||||
* sure the following scripts are executed in the correct order:
|
||||
* - Polyfills
|
||||
* - next/script with `beforeInteractive` strategy
|
||||
*/ import { getAssetPrefix } from './asset-prefix';
|
||||
import { setAttributesFromProps } from './set-attributes-from-props';
|
||||
const version = "16.2.4";
|
||||
window.next = {
|
||||
version,
|
||||
appDir: true
|
||||
};
|
||||
function loadScriptsInSequence(scripts, hydrate) {
|
||||
if (!scripts || !scripts.length) {
|
||||
return hydrate();
|
||||
}
|
||||
return scripts.reduce((promise, [src, props])=>{
|
||||
return promise.then(()=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
const el = document.createElement('script');
|
||||
if (props) {
|
||||
setAttributesFromProps(el, props);
|
||||
}
|
||||
if (src) {
|
||||
el.src = src;
|
||||
el.onload = ()=>resolve();
|
||||
el.onerror = reject;
|
||||
} else if (props) {
|
||||
el.innerHTML = props.children;
|
||||
setTimeout(resolve);
|
||||
}
|
||||
document.head.appendChild(el);
|
||||
});
|
||||
});
|
||||
}, Promise.resolve()).catch((err)=>{
|
||||
console.error(err);
|
||||
// Still try to hydrate even if there's an error.
|
||||
}).then(()=>{
|
||||
hydrate();
|
||||
});
|
||||
}
|
||||
export function appBootstrap(hydrate) {
|
||||
const assetPrefix = getAssetPrefix();
|
||||
loadScriptsInSequence(self.__next_s, ()=>{
|
||||
// If the static shell is being debugged, skip hydration if the
|
||||
// `__nextppronly` query is present. This is only enabled when the
|
||||
// environment variable `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` is
|
||||
// set to `1`. Otherwise the following is optimized out.
|
||||
if (process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1') {
|
||||
const search = new URLSearchParams(window.location.search);
|
||||
if (search.get('__nextppronly') === 'fallback' || search.get('__nextppronly') === '1') {
|
||||
console.warn(`Skipping hydration due to __nextppronly=${search.get('__nextppronly')}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
hydrate(assetPrefix);
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-bootstrap.js.map
|
||||
1
node_modules/next/dist/esm/client/app-bootstrap.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-bootstrap.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-bootstrap.ts"],"sourcesContent":["/**\n * Before starting the Next.js runtime and requiring any module, we need to make\n * sure the following scripts are executed in the correct order:\n * - Polyfills\n * - next/script with `beforeInteractive` strategy\n */\n\nimport { getAssetPrefix } from './asset-prefix'\nimport { setAttributesFromProps } from './set-attributes-from-props'\n\nconst version = process.env.__NEXT_VERSION\n\nwindow.next = {\n version,\n appDir: true,\n}\n\nfunction loadScriptsInSequence(\n scripts: [src: string, props: { [prop: string]: any }][],\n hydrate: () => void\n) {\n if (!scripts || !scripts.length) {\n return hydrate()\n }\n\n return scripts\n .reduce((promise, [src, props]) => {\n return promise.then(() => {\n return new Promise<void>((resolve, reject) => {\n const el = document.createElement('script')\n\n if (props) {\n setAttributesFromProps(el, props)\n }\n\n if (src) {\n el.src = src\n el.onload = () => resolve()\n el.onerror = reject\n } else if (props) {\n el.innerHTML = props.children\n setTimeout(resolve)\n }\n\n document.head.appendChild(el)\n })\n })\n }, Promise.resolve())\n .catch((err: Error) => {\n console.error(err)\n // Still try to hydrate even if there's an error.\n })\n .then(() => {\n hydrate()\n })\n}\n\nexport function appBootstrap(hydrate: (assetPrefix: string) => void) {\n const assetPrefix = getAssetPrefix()\n\n loadScriptsInSequence((self as any).__next_s, () => {\n // If the static shell is being debugged, skip hydration if the\n // `__nextppronly` query is present. This is only enabled when the\n // environment variable `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` is\n // set to `1`. Otherwise the following is optimized out.\n if (process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1') {\n const search = new URLSearchParams(window.location.search)\n if (\n search.get('__nextppronly') === 'fallback' ||\n search.get('__nextppronly') === '1'\n ) {\n console.warn(\n `Skipping hydration due to __nextppronly=${search.get('__nextppronly')}`\n )\n return\n }\n }\n\n hydrate(assetPrefix)\n })\n}\n"],"names":["getAssetPrefix","setAttributesFromProps","version","process","env","__NEXT_VERSION","window","next","appDir","loadScriptsInSequence","scripts","hydrate","length","reduce","promise","src","props","then","Promise","resolve","reject","el","document","createElement","onload","onerror","innerHTML","children","setTimeout","head","appendChild","catch","err","console","error","appBootstrap","assetPrefix","self","__next_s","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","search","URLSearchParams","location","get","warn"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,cAAc,QAAQ,iBAAgB;AAC/C,SAASC,sBAAsB,QAAQ,8BAA6B;AAEpE,MAAMC,UAAUC,QAAQC,GAAG,CAACC,cAAc;AAE1CC,OAAOC,IAAI,GAAG;IACZL;IACAM,QAAQ;AACV;AAEA,SAASC,sBACPC,OAAwD,EACxDC,OAAmB;IAEnB,IAAI,CAACD,WAAW,CAACA,QAAQE,MAAM,EAAE;QAC/B,OAAOD;IACT;IAEA,OAAOD,QACJG,MAAM,CAAC,CAACC,SAAS,CAACC,KAAKC,MAAM;QAC5B,OAAOF,QAAQG,IAAI,CAAC;YAClB,OAAO,IAAIC,QAAc,CAACC,SAASC;gBACjC,MAAMC,KAAKC,SAASC,aAAa,CAAC;gBAElC,IAAIP,OAAO;oBACTf,uBAAuBoB,IAAIL;gBAC7B;gBAEA,IAAID,KAAK;oBACPM,GAAGN,GAAG,GAAGA;oBACTM,GAAGG,MAAM,GAAG,IAAML;oBAClBE,GAAGI,OAAO,GAAGL;gBACf,OAAO,IAAIJ,OAAO;oBAChBK,GAAGK,SAAS,GAAGV,MAAMW,QAAQ;oBAC7BC,WAAWT;gBACb;gBAEAG,SAASO,IAAI,CAACC,WAAW,CAACT;YAC5B;QACF;IACF,GAAGH,QAAQC,OAAO,IACjBY,KAAK,CAAC,CAACC;QACNC,QAAQC,KAAK,CAACF;IACd,iDAAiD;IACnD,GACCf,IAAI,CAAC;QACJN;IACF;AACJ;AAEA,OAAO,SAASwB,aAAaxB,OAAsC;IACjE,MAAMyB,cAAcpC;IAEpBS,sBAAsB,AAAC4B,KAAaC,QAAQ,EAAE;QAC5C,+DAA+D;QAC/D,kEAAkE;QAClE,uEAAuE;QACvE,wDAAwD;QACxD,IAAInC,QAAQC,GAAG,CAACmC,0CAA0C,KAAK,KAAK;YAClE,MAAMC,SAAS,IAAIC,gBAAgBnC,OAAOoC,QAAQ,CAACF,MAAM;YACzD,IACEA,OAAOG,GAAG,CAAC,qBAAqB,cAChCH,OAAOG,GAAG,CAAC,qBAAqB,KAChC;gBACAV,QAAQW,IAAI,CACV,CAAC,wCAAwC,EAAEJ,OAAOG,GAAG,CAAC,kBAAkB;gBAE1E;YACF;QACF;QAEAhC,QAAQyB;IACV;AACF","ignoreList":[0]}
|
||||
18
node_modules/next/dist/esm/client/app-call-server.js
generated
vendored
Normal file
18
node_modules/next/dist/esm/client/app-call-server.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { startTransition } from 'react';
|
||||
import { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types';
|
||||
import { dispatchAppRouterAction } from './components/use-action-queue';
|
||||
export async function callServer(actionId, actionArgs) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
startTransition(()=>{
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_SERVER_ACTION,
|
||||
actionId,
|
||||
actionArgs,
|
||||
resolve,
|
||||
reject
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-call-server.js.map
|
||||
1
node_modules/next/dist/esm/client/app-call-server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-call-server.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-call-server.ts"],"sourcesContent":["import { startTransition } from 'react'\nimport { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types'\nimport { dispatchAppRouterAction } from './components/use-action-queue'\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n return new Promise((resolve, reject) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_ACTION,\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n })\n}\n"],"names":["startTransition","ACTION_SERVER_ACTION","dispatchAppRouterAction","callServer","actionId","actionArgs","Promise","resolve","reject","type"],"mappings":"AAAA,SAASA,eAAe,QAAQ,QAAO;AACvC,SAASC,oBAAoB,QAAQ,mDAAkD;AACvF,SAASC,uBAAuB,QAAQ,gCAA+B;AAEvE,OAAO,eAAeC,WAAWC,QAAgB,EAAEC,UAAiB;IAClE,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BR,gBAAgB;YACdE,wBAAwB;gBACtBO,MAAMR;gBACNG;gBACAC;gBACAE;gBACAC;YACF;QACF;IACF;AACF","ignoreList":[0]}
|
||||
142
node_modules/next/dist/esm/client/app-dir/form.js
generated
vendored
Normal file
142
node_modules/next/dist/esm/client/app-dir/form.js
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { useCallback, useContext } from 'react';
|
||||
import { addBasePath } from '../add-base-path';
|
||||
import { useMergedRef } from '../use-merged-ref';
|
||||
import { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { checkFormActionUrl, createFormSubmitDestinationUrl, DISALLOWED_FORM_PROPS, hasReactClientActionAttributes, hasUnsupportedSubmitterAttributes } from '../form-shared';
|
||||
import { mountFormInstance, unmountPrefetchableInstance } from '../components/links';
|
||||
import { FetchStrategy } from '../components/segment-cache/types';
|
||||
export default function Form({ replace, scroll, prefetch: prefetchProp, ref: externalRef, ...props }) {
|
||||
const router = useContext(AppRouterContext);
|
||||
const actionProp = props.action;
|
||||
const isNavigatingForm = typeof actionProp === 'string';
|
||||
// Validate `action`
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (isNavigatingForm) {
|
||||
checkFormActionUrl(actionProp, 'action');
|
||||
}
|
||||
}
|
||||
// Validate `prefetch`
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (!(prefetchProp === undefined || prefetchProp === false || prefetchProp === null)) {
|
||||
console.error('The `prefetch` prop of <Form> must be `false` or `null`');
|
||||
}
|
||||
if (prefetchProp !== undefined && !isNavigatingForm) {
|
||||
console.error('Passing `prefetch` to a <Form> whose `action` is a function has no effect.');
|
||||
}
|
||||
}
|
||||
// TODO(runtime-ppr): allow runtime prefetches in Form
|
||||
const prefetch = prefetchProp === false || prefetchProp === null ? prefetchProp : null;
|
||||
// Validate `scroll` and `replace`
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (!isNavigatingForm && (replace !== undefined || scroll !== undefined)) {
|
||||
console.error('Passing `replace` or `scroll` to a <Form> whose `action` is a function has no effect.\n' + 'See the relevant docs to learn how to control this behavior for navigations triggered from actions:\n' + ' `redirect()` - https://nextjs.org/docs/app/api-reference/functions/redirect#parameters\n' + ' `router.replace()` - https://nextjs.org/docs/app/api-reference/functions/use-router#userouter\n');
|
||||
}
|
||||
}
|
||||
// Clean up any unsupported form props (and warn if present)
|
||||
for (const key of DISALLOWED_FORM_PROPS){
|
||||
if (key in props) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.error(`<Form> does not support changing \`${key}\`. ` + (isNavigatingForm ? `If you'd like to use it to perform a mutation, consider making \`action\` a function instead.\n` + `Learn more: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations` : ''));
|
||||
}
|
||||
delete props[key];
|
||||
}
|
||||
}
|
||||
const isPrefetchEnabled = // if we don't have an action path, we can't prefetch anything.
|
||||
!!router && isNavigatingForm && prefetch === null;
|
||||
const observeFormVisibilityOnMount = useCallback((element)=>{
|
||||
if (isPrefetchEnabled && router !== null) {
|
||||
mountFormInstance(element, actionProp, router, // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.
|
||||
FetchStrategy.PPR);
|
||||
}
|
||||
return ()=>{
|
||||
unmountPrefetchableInstance(element);
|
||||
};
|
||||
}, [
|
||||
isPrefetchEnabled,
|
||||
actionProp,
|
||||
router
|
||||
]);
|
||||
const mergedRef = useMergedRef(observeFormVisibilityOnMount, externalRef ?? null);
|
||||
if (!isNavigatingForm) {
|
||||
return /*#__PURE__*/ _jsx("form", {
|
||||
...props,
|
||||
ref: mergedRef
|
||||
});
|
||||
}
|
||||
const actionHref = addBasePath(actionProp);
|
||||
return /*#__PURE__*/ _jsx("form", {
|
||||
...props,
|
||||
ref: mergedRef,
|
||||
action: actionHref,
|
||||
onSubmit: (event)=>onFormSubmit(event, {
|
||||
router,
|
||||
actionHref,
|
||||
replace,
|
||||
scroll,
|
||||
onSubmit: props.onSubmit
|
||||
})
|
||||
});
|
||||
}
|
||||
function onFormSubmit(event, { actionHref, onSubmit, replace, scroll, router }) {
|
||||
if (typeof onSubmit === 'function') {
|
||||
onSubmit(event);
|
||||
// if the user called event.preventDefault(), do nothing.
|
||||
// (this matches what Link does for `onClick`)
|
||||
if (event.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!router) {
|
||||
// Form was somehow used outside of the router (but not in pages, the implementation is forked!).
|
||||
// We can't perform a soft navigation, so let the native submit handling do its thing.
|
||||
return;
|
||||
}
|
||||
const formElement = event.currentTarget;
|
||||
const submitter = event.nativeEvent.submitter;
|
||||
let action = actionHref;
|
||||
if (submitter) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// the way server actions are encoded (e.g. `formMethod="post")
|
||||
// causes some unnecessary dev-mode warnings from `hasUnsupportedSubmitterAttributes`.
|
||||
// we'd bail out anyway, but we just do it silently.
|
||||
if (hasReactServerActionAttributes(submitter)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (hasUnsupportedSubmitterAttributes(submitter)) {
|
||||
return;
|
||||
}
|
||||
// client actions have `formAction="javascript:..."`. We obviously can't prefetch/navigate to that.
|
||||
if (hasReactClientActionAttributes(submitter)) {
|
||||
return;
|
||||
}
|
||||
// If the submitter specified an alternate formAction,
|
||||
// use that URL instead -- this is what a native form would do.
|
||||
// NOTE: `submitter.formAction` is unreliable, because it will give us `location.href` if it *wasn't* set
|
||||
// NOTE: this should not have `basePath` added, because we can't add it before hydration
|
||||
const submitterFormAction = submitter.getAttribute('formAction');
|
||||
if (submitterFormAction !== null) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
checkFormActionUrl(submitterFormAction, 'formAction');
|
||||
}
|
||||
action = submitterFormAction;
|
||||
}
|
||||
}
|
||||
const targetUrl = createFormSubmitDestinationUrl(action, formElement);
|
||||
// Finally, no more reasons for bailing out.
|
||||
event.preventDefault();
|
||||
const method = replace ? 'replace' : 'push';
|
||||
const targetHref = targetUrl.href;
|
||||
router[method](targetHref, {
|
||||
scroll
|
||||
});
|
||||
}
|
||||
function hasReactServerActionAttributes(submitter) {
|
||||
// https://github.com/facebook/react/blob/942eb80381b96f8410eab1bef1c539bed1ab0eb1/packages/react-client/src/ReactFlightReplyClient.js#L931-L934
|
||||
const name = submitter.getAttribute('name');
|
||||
return name && (name.startsWith('$ACTION_ID_') || name.startsWith('$ACTION_REF_'));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=form.js.map
|
||||
1
node_modules/next/dist/esm/client/app-dir/form.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-dir/form.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
379
node_modules/next/dist/esm/client/app-dir/link.js
generated
vendored
Normal file
379
node_modules/next/dist/esm/client/app-dir/link.js
generated
vendored
Normal file
@@ -0,0 +1,379 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React, { createContext, useContext, useOptimistic, useRef } from 'react';
|
||||
import { formatUrl } from '../../shared/lib/router/utils/format-url';
|
||||
import { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { useMergedRef } from '../use-merged-ref';
|
||||
import { isAbsoluteUrl } from '../../shared/lib/utils';
|
||||
import { addBasePath } from '../add-base-path';
|
||||
import { warnOnce } from '../../shared/lib/utils/warn-once';
|
||||
import { ScrollBehavior } from '../components/router-reducer/router-reducer-types';
|
||||
import { IDLE_LINK_STATUS, mountLinkInstance, onNavigationIntent, unmountLinkForCurrentNavigation, unmountPrefetchableInstance } from '../components/links';
|
||||
import { isLocalURL } from '../../shared/lib/router/utils/is-local-url';
|
||||
import { FetchStrategy } from '../components/segment-cache/types';
|
||||
import { errorOnce } from '../../shared/lib/utils/error-once';
|
||||
function isModifiedEvent(event) {
|
||||
const eventTarget = event.currentTarget;
|
||||
const target = eventTarget.getAttribute('target');
|
||||
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
|
||||
event.nativeEvent && event.nativeEvent.which === 2;
|
||||
}
|
||||
function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes) {
|
||||
if (typeof window !== 'undefined') {
|
||||
const { nodeName } = e.currentTarget;
|
||||
// anchors inside an svg have a lowercase nodeName
|
||||
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
|
||||
if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute('download')) {
|
||||
// ignore click for browser’s default behavior
|
||||
return;
|
||||
}
|
||||
if (!isLocalURL(href)) {
|
||||
if (replace) {
|
||||
// browser default behavior does not replace the history state
|
||||
// so we need to do it manually
|
||||
e.preventDefault();
|
||||
location.replace(href);
|
||||
}
|
||||
// ignore click for browser’s default behavior
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
if (onNavigate) {
|
||||
let isDefaultPrevented = false;
|
||||
onNavigate({
|
||||
preventDefault: ()=>{
|
||||
isDefaultPrevented = true;
|
||||
}
|
||||
});
|
||||
if (isDefaultPrevented) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const { dispatchNavigateAction } = require('../components/app-router-instance');
|
||||
React.startTransition(()=>{
|
||||
dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, linkInstanceRef.current, transitionTypes);
|
||||
});
|
||||
}
|
||||
}
|
||||
function formatStringOrUrl(urlObjOrString) {
|
||||
if (typeof urlObjOrString === 'string') {
|
||||
return urlObjOrString;
|
||||
}
|
||||
return formatUrl(urlObjOrString);
|
||||
}
|
||||
/**
|
||||
* A React component that extends the HTML `<a>` element to provide
|
||||
* [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
|
||||
* and client-side navigation. This is the primary way to navigate between routes in Next.js.
|
||||
*
|
||||
* @remarks
|
||||
* - Prefetching is only enabled in production.
|
||||
*
|
||||
* @see https://nextjs.org/docs/app/api-reference/components/link
|
||||
*/ export default function LinkComponent(props) {
|
||||
const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS);
|
||||
let children;
|
||||
const linkInstanceRef = useRef(null);
|
||||
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, onClick, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, onNavigate, transitionTypes, ref: forwardedRef, unstable_dynamicOnHover, ...restProps } = props;
|
||||
children = childrenProp;
|
||||
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
|
||||
children = /*#__PURE__*/ _jsx("a", {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
const router = React.useContext(AppRouterContext);
|
||||
const prefetchEnabled = prefetchProp !== false;
|
||||
const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : FetchStrategy.PPR;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
function createPropError(args) {
|
||||
return Object.defineProperty(new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (typeof window !== 'undefined' ? "\nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||||
value: "E319",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
// TypeScript trick for type-guarding:
|
||||
const requiredPropsGuard = {
|
||||
href: true
|
||||
};
|
||||
const requiredProps = Object.keys(requiredPropsGuard);
|
||||
requiredProps.forEach((key)=>{
|
||||
if (key === 'href') {
|
||||
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`string` or `object`',
|
||||
actual: props[key] === null ? 'null' : typeof props[key]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// TypeScript trick for type-guarding:
|
||||
const _ = key;
|
||||
}
|
||||
});
|
||||
// TypeScript trick for type-guarding:
|
||||
const optionalPropsGuard = {
|
||||
as: true,
|
||||
replace: true,
|
||||
scroll: true,
|
||||
shallow: true,
|
||||
passHref: true,
|
||||
prefetch: true,
|
||||
unstable_dynamicOnHover: true,
|
||||
onClick: true,
|
||||
onMouseEnter: true,
|
||||
onTouchStart: true,
|
||||
legacyBehavior: true,
|
||||
onNavigate: true,
|
||||
transitionTypes: true
|
||||
};
|
||||
const optionalProps = Object.keys(optionalPropsGuard);
|
||||
optionalProps.forEach((key)=>{
|
||||
const valType = typeof props[key];
|
||||
if (key === 'as') {
|
||||
if (props[key] && valType !== 'string' && valType !== 'object') {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`string` or `object`',
|
||||
actual: valType
|
||||
});
|
||||
}
|
||||
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart' || key === 'onNavigate') {
|
||||
if (props[key] && valType !== 'function') {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`function`',
|
||||
actual: valType
|
||||
});
|
||||
}
|
||||
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'legacyBehavior' || key === 'unstable_dynamicOnHover') {
|
||||
if (props[key] != null && valType !== 'boolean') {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`boolean`',
|
||||
actual: valType
|
||||
});
|
||||
}
|
||||
} else if (key === 'prefetch') {
|
||||
if (props[key] != null && valType !== 'boolean' && props[key] !== 'auto') {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`boolean | "auto"`',
|
||||
actual: valType
|
||||
});
|
||||
}
|
||||
} else if (key === 'transitionTypes') {
|
||||
if (props[key] != null && !Array.isArray(props[key])) {
|
||||
throw createPropError({
|
||||
key,
|
||||
expected: '`string[]`',
|
||||
actual: valType
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// TypeScript trick for type-guarding:
|
||||
const _ = key;
|
||||
}
|
||||
});
|
||||
}
|
||||
const resolvedHref = asProp || hrefProp;
|
||||
const formattedHref = formatStringOrUrl(resolvedHref);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (props.locale) {
|
||||
warnOnce('The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization');
|
||||
}
|
||||
if (!asProp) {
|
||||
let href;
|
||||
if (typeof resolvedHref === 'string') {
|
||||
href = resolvedHref;
|
||||
} else if (typeof resolvedHref === 'object' && typeof resolvedHref.pathname === 'string') {
|
||||
href = resolvedHref.pathname;
|
||||
}
|
||||
if (href) {
|
||||
const hasDynamicSegment = href.split('/').some((segment)=>segment.startsWith('[') && segment.endsWith(']'));
|
||||
if (hasDynamicSegment) {
|
||||
throw Object.defineProperty(new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`), "__NEXT_ERROR_CODE", {
|
||||
value: "E267",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// This will return the first child, if multiple are provided it will throw an error
|
||||
let child;
|
||||
if (legacyBehavior) {
|
||||
if (children?.$$typeof === Symbol.for('react.lazy')) {
|
||||
throw Object.defineProperty(new Error(`\`<Link legacyBehavior>\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \`<a>\` tag.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E863",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (onClick) {
|
||||
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
|
||||
}
|
||||
if (onMouseEnterProp) {
|
||||
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
|
||||
}
|
||||
try {
|
||||
child = React.Children.only(children);
|
||||
} catch (err) {
|
||||
if (!children) {
|
||||
throw Object.defineProperty(new Error(`No children were passed to <Link> with \`href\` of \`${formattedHref}\` but one child is required https://nextjs.org/docs/messages/link-no-children`), "__NEXT_ERROR_CODE", {
|
||||
value: "E320",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
throw Object.defineProperty(new Error(`Multiple children were passed to <Link> with \`href\` of \`${formattedHref}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (typeof window !== 'undefined' ? " \nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||||
value: "E266",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
} else {
|
||||
child = React.Children.only(children);
|
||||
}
|
||||
} else {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (children?.type === 'a') {
|
||||
throw Object.defineProperty(new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'), "__NEXT_ERROR_CODE", {
|
||||
value: "E209",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
|
||||
// Use a callback ref to attach an IntersectionObserver to the anchor tag on
|
||||
// mount. In the future we will also use this to keep track of all the
|
||||
// currently mounted <Link> instances, e.g. so we can re-prefetch them after
|
||||
// a revalidation or refresh.
|
||||
const observeLinkVisibilityOnMount = React.useCallback((element)=>{
|
||||
if (router !== null) {
|
||||
linkInstanceRef.current = mountLinkInstance(element, formattedHref, router, fetchStrategy, prefetchEnabled, setOptimisticLinkStatus);
|
||||
}
|
||||
return ()=>{
|
||||
if (linkInstanceRef.current) {
|
||||
unmountLinkForCurrentNavigation(linkInstanceRef.current);
|
||||
linkInstanceRef.current = null;
|
||||
}
|
||||
unmountPrefetchableInstance(element);
|
||||
};
|
||||
}, [
|
||||
prefetchEnabled,
|
||||
formattedHref,
|
||||
router,
|
||||
fetchStrategy,
|
||||
setOptimisticLinkStatus
|
||||
]);
|
||||
const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef);
|
||||
const childProps = {
|
||||
ref: mergedRef,
|
||||
onClick (e) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!e) {
|
||||
throw Object.defineProperty(new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E312",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!legacyBehavior && typeof onClick === 'function') {
|
||||
onClick(e);
|
||||
}
|
||||
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
|
||||
child.props.onClick(e);
|
||||
}
|
||||
if (!router) {
|
||||
return;
|
||||
}
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes);
|
||||
},
|
||||
onMouseEnter (e) {
|
||||
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
|
||||
onMouseEnterProp(e);
|
||||
}
|
||||
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
|
||||
child.props.onMouseEnter(e);
|
||||
}
|
||||
if (!router) {
|
||||
return;
|
||||
}
|
||||
if (!prefetchEnabled || process.env.NODE_ENV === 'development') {
|
||||
return;
|
||||
}
|
||||
const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true;
|
||||
onNavigationIntent(e.currentTarget, upgradeToDynamicPrefetch);
|
||||
},
|
||||
onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START ? undefined : function onTouchStart(e) {
|
||||
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
|
||||
onTouchStartProp(e);
|
||||
}
|
||||
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
|
||||
child.props.onTouchStart(e);
|
||||
}
|
||||
if (!router) {
|
||||
return;
|
||||
}
|
||||
if (!prefetchEnabled) {
|
||||
return;
|
||||
}
|
||||
const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true;
|
||||
onNavigationIntent(e.currentTarget, upgradeToDynamicPrefetch);
|
||||
}
|
||||
};
|
||||
// If the url is absolute, we can bypass the logic to prepend the basePath.
|
||||
if (isAbsoluteUrl(formattedHref)) {
|
||||
childProps.href = formattedHref;
|
||||
} else if (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
|
||||
childProps.href = addBasePath(formattedHref);
|
||||
}
|
||||
let link;
|
||||
if (legacyBehavior) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
errorOnce('`legacyBehavior` is deprecated and will be removed in a future ' + 'release. A codemod is available to upgrade your components:\n\n' + 'npx @next/codemod@latest new-link .\n\n' + 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components');
|
||||
}
|
||||
link = /*#__PURE__*/ React.cloneElement(child, childProps);
|
||||
} else {
|
||||
link = /*#__PURE__*/ _jsx("a", {
|
||||
...restProps,
|
||||
...childProps,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsx(LinkStatusContext.Provider, {
|
||||
value: linkStatus,
|
||||
children: link
|
||||
});
|
||||
}
|
||||
const LinkStatusContext = /*#__PURE__*/ createContext(IDLE_LINK_STATUS);
|
||||
export const useLinkStatus = ()=>{
|
||||
return useContext(LinkStatusContext);
|
||||
};
|
||||
function getFetchStrategyFromPrefetchProp(prefetchProp) {
|
||||
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
||||
if (prefetchProp === true) {
|
||||
return FetchStrategy.Full;
|
||||
}
|
||||
// `null` or `"auto"`: this is the default "auto" mode, where we will prefetch partially if the link is in the viewport.
|
||||
// This will also include invalid prop values that don't match the types specified here.
|
||||
// (although those should've been filtered out by prop validation in dev)
|
||||
prefetchProp;
|
||||
return FetchStrategy.PPR;
|
||||
} else {
|
||||
return prefetchProp === null || prefetchProp === 'auto' ? FetchStrategy.PPR : // To preserve backwards-compatibility, anything other than `false`, `null`, or `"auto"` results in a full prefetch.
|
||||
// (although invalid values should've been filtered out by prop validation in dev)
|
||||
FetchStrategy.Full;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=link.js.map
|
||||
1
node_modules/next/dist/esm/client/app-dir/link.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-dir/link.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
node_modules/next/dist/esm/client/app-dir/link.react-server.js
generated
vendored
Normal file
20
node_modules/next/dist/esm/client/app-dir/link.react-server.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import ClientLinkComponent, { useLinkStatus } from './link';
|
||||
export default function LinkComponent(props) {
|
||||
const isLegacyBehavior = props.legacyBehavior;
|
||||
const childIsHostComponent = typeof props.children === 'string' || typeof props.children === 'number' || typeof props.children?.type === 'string';
|
||||
const childIsClientComponent = props.children?.type?.$$typeof === Symbol.for('react.client.reference');
|
||||
if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {
|
||||
if (props.children?.type?.$$typeof === Symbol.for('react.lazy')) {
|
||||
console.error(`Using a Lazy Component as a direct child of \`<Link legacyBehavior>\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \`<a>\` tag.`);
|
||||
} else {
|
||||
console.error(`Using a Server Component as a direct child of \`<Link legacyBehavior>\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \`<a>\` tag.`);
|
||||
}
|
||||
}
|
||||
return /*#__PURE__*/ _jsx(ClientLinkComponent, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
export { useLinkStatus };
|
||||
|
||||
//# sourceMappingURL=link.react-server.js.map
|
||||
1
node_modules/next/dist/esm/client/app-dir/link.react-server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-dir/link.react-server.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/app-dir/link.react-server.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n"],"names":["ClientLinkComponent","useLinkStatus","LinkComponent","props","isLegacyBehavior","legacyBehavior","childIsHostComponent","children","type","childIsClientComponent","$$typeof","Symbol","for","console","error"],"mappings":";AACA,OAAOA,uBAAuCC,aAAa,QAAQ,SAAQ;AAE3E,eAAe,SAASC,cACtBC,KAAiD;IAEjD,MAAMC,mBAAmBD,MAAME,cAAc;IAC7C,MAAMC,uBACJ,OAAOH,MAAMI,QAAQ,KAAK,YAC1B,OAAOJ,MAAMI,QAAQ,KAAK,YAC1B,OAAQJ,MAAMI,QAAQ,EAAUC,SAAS;IAC3C,MAAMC,yBACJ,AAACN,MAAMI,QAAQ,EAAUC,MAAME,aAC/BC,OAAOC,GAAG,CAAC;IAEb,IAAIR,oBAAoB,CAACE,wBAAwB,CAACG,wBAAwB;QACxE,IAAI,AAACN,MAAMI,QAAQ,EAAUC,MAAME,aAAaC,OAAOC,GAAG,CAAC,eAAe;YACxEC,QAAQC,KAAK,CACX,CAAC,+NAA+N,CAAC;QAErO,OAAO;YACLD,QAAQC,KAAK,CACX,CAAC,2MAA2M,CAAC;QAEjN;IACF;IAEA,qBAAO,KAACd;QAAqB,GAAGG,KAAK;;AACvC;AAEA,SAAyBF,aAAa,GAAE","ignoreList":[0]}
|
||||
23
node_modules/next/dist/esm/client/app-find-source-map-url.js
generated
vendored
Normal file
23
node_modules/next/dist/esm/client/app-find-source-map-url.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
|
||||
const pathname = `${basePath}/__nextjs_source-map`;
|
||||
export const findSourceMapURL = // Source maps are only served by the dev server.
|
||||
process.env.__NEXT_DEV_SERVER ? function findSourceMapURL(filename) {
|
||||
if (filename === '') {
|
||||
return null;
|
||||
}
|
||||
if (filename.startsWith(document.location.origin) && filename.includes('/_next/static')) {
|
||||
// This is a request for a client chunk. This can only happen when
|
||||
// using Turbopack. In this case, since we control how those source
|
||||
// maps are generated, we can safely assume that the sourceMappingURL
|
||||
// is relative to the filename, with an added `.map` extension. The
|
||||
// browser can just request this file, and it gets served through the
|
||||
// normal dev server, without the need to route this through
|
||||
// the `/__nextjs_source-map` dev middleware.
|
||||
return `${filename}.map`;
|
||||
}
|
||||
const url = new URL(pathname, document.location.origin);
|
||||
url.searchParams.set('filename', filename);
|
||||
return url.href;
|
||||
} : undefined;
|
||||
|
||||
//# sourceMappingURL=app-find-source-map-url.js.map
|
||||
1
node_modules/next/dist/esm/client/app-find-source-map-url.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-find-source-map-url.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-find-source-map-url.ts"],"sourcesContent":["const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n // Source maps are only served by the dev server.\n process.env.__NEXT_DEV_SERVER\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n"],"names":["basePath","process","env","__NEXT_ROUTER_BASEPATH","pathname","findSourceMapURL","__NEXT_DEV_SERVER","filename","startsWith","document","location","origin","includes","url","URL","searchParams","set","href","undefined"],"mappings":"AAAA,MAAMA,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,IAAI;AACvD,MAAMC,WAAW,GAAGJ,SAAS,oBAAoB,CAAC;AAElD,OAAO,MAAMK,mBACX,iDAAiD;AACjDJ,QAAQC,GAAG,CAACI,iBAAiB,GACzB,SAASD,iBAAiBE,QAAgB;IACxC,IAAIA,aAAa,IAAI;QACnB,OAAO;IACT;IAEA,IACEA,SAASC,UAAU,CAACC,SAASC,QAAQ,CAACC,MAAM,KAC5CJ,SAASK,QAAQ,CAAC,kBAClB;QACA,kEAAkE;QAClE,mEAAmE;QACnE,qEAAqE;QACrE,mEAAmE;QACnE,qEAAqE;QACrE,4DAA4D;QAC5D,6CAA6C;QAC7C,OAAO,GAAGL,SAAS,IAAI,CAAC;IAC1B;IAEA,MAAMM,MAAM,IAAIC,IAAIV,UAAUK,SAASC,QAAQ,CAACC,MAAM;IACtDE,IAAIE,YAAY,CAACC,GAAG,CAAC,YAAYT;IAEjC,OAAOM,IAAII,IAAI;AACjB,IACAC,UAAS","ignoreList":[0]}
|
||||
15
node_modules/next/dist/esm/client/app-globals.js
generated
vendored
Normal file
15
node_modules/next/dist/esm/client/app-globals.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// imports polyfill from `@next/polyfill-module` after build.
|
||||
import '../build/polyfills/polyfill-module';
|
||||
// Only set up devtools for the dev server.
|
||||
if (process.env.__NEXT_DEV_SERVER) {
|
||||
require('../next-devtools/userspace/app/app-dev-overlay-setup');
|
||||
}
|
||||
// Start listening for the instant navigation test cookie. The test framework
|
||||
// (e.g. Playwright) sets/clears this cookie to control the navigation lock.
|
||||
// Browser-only.
|
||||
if (process.env.__NEXT_EXPOSE_TESTING_API && typeof window !== 'undefined') {
|
||||
const { startListeningForInstantNavigationCookie } = require('./components/segment-cache/navigation-testing-lock');
|
||||
startListeningForInstantNavigationCookie();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-globals.js.map
|
||||
1
node_modules/next/dist/esm/client/app-globals.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-globals.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-globals.ts"],"sourcesContent":["// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\n\n// Only set up devtools for the dev server.\nif (process.env.__NEXT_DEV_SERVER) {\n require('../next-devtools/userspace/app/app-dev-overlay-setup') as typeof import('../next-devtools/userspace/app/app-dev-overlay-setup')\n}\n\n// Start listening for the instant navigation test cookie. The test framework\n// (e.g. Playwright) sets/clears this cookie to control the navigation lock.\n// Browser-only.\nif (process.env.__NEXT_EXPOSE_TESTING_API && typeof window !== 'undefined') {\n const { startListeningForInstantNavigationCookie } =\n require('./components/segment-cache/navigation-testing-lock') as typeof import('./components/segment-cache/navigation-testing-lock')\n startListeningForInstantNavigationCookie()\n}\n"],"names":["process","env","__NEXT_DEV_SERVER","require","__NEXT_EXPOSE_TESTING_API","window","startListeningForInstantNavigationCookie"],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,qCAAoC;AAE3C,2CAA2C;AAC3C,IAAIA,QAAQC,GAAG,CAACC,iBAAiB,EAAE;IACjCC,QAAQ;AACV;AAEA,6EAA6E;AAC7E,4EAA4E;AAC5E,gBAAgB;AAChB,IAAIH,QAAQC,GAAG,CAACG,yBAAyB,IAAI,OAAOC,WAAW,aAAa;IAC1E,MAAM,EAAEC,wCAAwC,EAAE,GAChDH,QAAQ;IACVG;AACF","ignoreList":[0]}
|
||||
297
node_modules/next/dist/esm/client/app-index.js
generated
vendored
Normal file
297
node_modules/next/dist/esm/client/app-index.js
generated
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import './app-globals';
|
||||
import ReactDOMClient from 'react-dom/client';
|
||||
import React from 'react';
|
||||
// TODO: Explicitly import from client.browser
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { createFromReadableStream as createFromReadableStreamBrowser, createFromFetch as createFromFetchBrowser } from 'react-server-dom-webpack/client';
|
||||
import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime';
|
||||
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
||||
import { onCaughtError, onUncaughtError } from './react-client-callbacks/error-boundary-callbacks';
|
||||
import { callServer } from './app-call-server';
|
||||
import { findSourceMapURL } from './app-find-source-map-url';
|
||||
import { createMutableActionQueue } from './components/app-router-instance';
|
||||
import AppRouter from './components/app-router';
|
||||
import { createInitialRouterState } from './components/router-reducer/create-initial-router-state';
|
||||
import { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime';
|
||||
import { createInitialRSCPayloadFromFallbackPrerender } from './flight-data-helpers';
|
||||
import { getDeploymentId } from '../shared/lib/deployment-id';
|
||||
import { setNavigationBuildId } from './navigation-build-id';
|
||||
/// <reference types="react-dom/experimental" />
|
||||
const createFromReadableStream = createFromReadableStreamBrowser;
|
||||
const createFromFetch = createFromFetchBrowser;
|
||||
const appElement = document;
|
||||
// Instant Navigation Testing API: captured once at module init. When truthy,
|
||||
// this is the fetch promise for the static RSC payload (set by an injected
|
||||
// <script> tag in the static shell HTML).
|
||||
const instantTestStaticFetch = self.__next_instant_test ? self.__next_instant_test : undefined;
|
||||
const encoder = new TextEncoder();
|
||||
let initialServerDataBuffer = undefined;
|
||||
let initialServerDataWriter = undefined;
|
||||
let initialServerDataLoaded = false;
|
||||
let initialServerDataFlushed = false;
|
||||
let initialFormStateData = null;
|
||||
function nextServerDataCallback(seg) {
|
||||
if (seg[0] === 0) {
|
||||
initialServerDataBuffer = [];
|
||||
} else if (seg[0] === 1) {
|
||||
if (!initialServerDataBuffer) throw Object.defineProperty(new Error('Unexpected server data: missing bootstrap script.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E18",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
if (initialServerDataWriter) {
|
||||
initialServerDataWriter.enqueue(encoder.encode(seg[1]));
|
||||
} else {
|
||||
initialServerDataBuffer.push(seg[1]);
|
||||
}
|
||||
} else if (seg[0] === 2) {
|
||||
initialFormStateData = seg[1];
|
||||
} else if (seg[0] === 3) {
|
||||
if (!initialServerDataBuffer) throw Object.defineProperty(new Error('Unexpected server data: missing bootstrap script.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E18",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
// Decode the base64 string back to binary data.
|
||||
const binaryString = atob(seg[1]);
|
||||
const decodedChunk = new Uint8Array(binaryString.length);
|
||||
for(var i = 0; i < binaryString.length; i++){
|
||||
decodedChunk[i] = binaryString.charCodeAt(i);
|
||||
}
|
||||
if (initialServerDataWriter) {
|
||||
initialServerDataWriter.enqueue(decodedChunk);
|
||||
} else {
|
||||
initialServerDataBuffer.push(decodedChunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
function isStreamErrorOrUnfinished(ctr) {
|
||||
// If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.
|
||||
return ctr.desiredSize === null || ctr.desiredSize < 0;
|
||||
}
|
||||
// There might be race conditions between `nextServerDataRegisterWriter` and
|
||||
// `DOMContentLoaded`. The former will be called when React starts to hydrate
|
||||
// the root, the latter will be called when the DOM is fully loaded.
|
||||
// For streaming, the former is called first due to partial hydration.
|
||||
// For non-streaming, the latter can be called first.
|
||||
// Hence, we use two variables `initialServerDataLoaded` and
|
||||
// `initialServerDataFlushed` to make sure the writer will be closed and
|
||||
// `initialServerDataBuffer` will be cleared in the right time.
|
||||
function nextServerDataRegisterWriter(ctr) {
|
||||
if (initialServerDataBuffer) {
|
||||
initialServerDataBuffer.forEach((val)=>{
|
||||
ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val);
|
||||
});
|
||||
if (initialServerDataLoaded && !initialServerDataFlushed) {
|
||||
// Instant Navigation Testing API: don't close or error the inline
|
||||
// Flight stream. The static shell has no inline Flight data, so the
|
||||
// stream is empty. Closing it would cause React to log an error about
|
||||
// missing data. Leaving it open lets React treat any holes as
|
||||
// "still suspended." Hydration uses the separately fetched RSC payload
|
||||
// (self.__next_instant_test), not this stream.
|
||||
if (isStreamErrorOrUnfinished(ctr)) {
|
||||
if (!instantTestStaticFetch) {
|
||||
ctr.error(Object.defineProperty(new Error('The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E117",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
ctr.close();
|
||||
}
|
||||
initialServerDataFlushed = true;
|
||||
initialServerDataBuffer = undefined;
|
||||
}
|
||||
}
|
||||
initialServerDataWriter = ctr;
|
||||
}
|
||||
// When `DOMContentLoaded`, we can close all pending writers to finish hydration.
|
||||
const DOMContentLoaded = function() {
|
||||
if (initialServerDataWriter && !initialServerDataFlushed) {
|
||||
initialServerDataWriter.close();
|
||||
initialServerDataFlushed = true;
|
||||
initialServerDataBuffer = undefined;
|
||||
}
|
||||
initialServerDataLoaded = true;
|
||||
};
|
||||
// It's possible that the DOM is already loaded.
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', DOMContentLoaded, false);
|
||||
} else {
|
||||
// Delayed in marco task to ensure it's executed later than hydration
|
||||
setTimeout(DOMContentLoaded);
|
||||
}
|
||||
const nextServerDataLoadingGlobal = self.__next_f = self.__next_f || [];
|
||||
// Consume all buffered chunks and clear the global data array right after to release memory.
|
||||
// Otherwise it will be retained indefinitely.
|
||||
nextServerDataLoadingGlobal.forEach(nextServerDataCallback);
|
||||
nextServerDataLoadingGlobal.length = 0;
|
||||
// Patch its push method so subsequent chunks are handled (but not actually pushed to the array).
|
||||
nextServerDataLoadingGlobal.push = nextServerDataCallback;
|
||||
let readable = new ReadableStream({
|
||||
start (controller) {
|
||||
nextServerDataRegisterWriter(controller);
|
||||
}
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// @ts-expect-error
|
||||
readable.name = 'hydration';
|
||||
}
|
||||
// When Cache Components is enabled, tee the inlined Flight stream so we can
|
||||
// truncate a clone at the static stage byte boundary and cache it. We don't
|
||||
// know if `l` is present until React decodes the payload, so always tee and
|
||||
// cancel the clone if not needed.
|
||||
let initialFlightStreamForCache = null;
|
||||
if (process.env.__NEXT_CACHE_COMPONENTS && process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS) {
|
||||
const [forReact, forCache] = readable.tee();
|
||||
readable = forReact;
|
||||
initialFlightStreamForCache = forCache;
|
||||
}
|
||||
let debugChannel;
|
||||
if (process.env.__NEXT_DEV_SERVER && process.env.__NEXT_REACT_DEBUG_CHANNEL && typeof window !== 'undefined') {
|
||||
const { createDebugChannel } = require('./dev/debug-channel');
|
||||
debugChannel = createDebugChannel(undefined);
|
||||
}
|
||||
let initialServerResponse;
|
||||
if (instantTestStaticFetch) {
|
||||
// Instant Navigation Testing API: hydrate from the static RSC payload
|
||||
// fetch kicked off by an injected <script> tag, instead of the inline
|
||||
// Flight data (which is not present in the static shell).
|
||||
initialServerResponse = Promise.resolve(createFromFetch(instantTestStaticFetch, {
|
||||
callServer,
|
||||
findSourceMapURL,
|
||||
debugChannel,
|
||||
// The static fetch response is a partial stream (static-only Flight
|
||||
// data with no dynamic content). Allow it to close without error so
|
||||
// React treats dynamic holes as still-suspended rather than
|
||||
// triggering error recovery.
|
||||
unstable_allowPartialStream: true
|
||||
})).then(async (initialRSCPayload)=>{
|
||||
return createInitialRSCPayloadFromFallbackPrerender(await instantTestStaticFetch, initialRSCPayload);
|
||||
});
|
||||
} else if (// @ts-expect-error
|
||||
window.__NEXT_CLIENT_RESUME) {
|
||||
const clientResumeFetch = // @ts-expect-error
|
||||
window.__NEXT_CLIENT_RESUME;
|
||||
initialServerResponse = Promise.resolve(createFromFetch(clientResumeFetch, {
|
||||
callServer,
|
||||
findSourceMapURL,
|
||||
debugChannel
|
||||
})).then(async (fallbackInitialRSCPayload)=>createInitialRSCPayloadFromFallbackPrerender(await clientResumeFetch, fallbackInitialRSCPayload));
|
||||
} else {
|
||||
initialServerResponse = createFromReadableStream(readable, {
|
||||
callServer,
|
||||
findSourceMapURL,
|
||||
debugChannel,
|
||||
startTime: 0
|
||||
});
|
||||
}
|
||||
function ServerRoot({ initialRSCPayload, actionQueue, webSocket, staticIndicatorState }) {
|
||||
const router = /*#__PURE__*/ _jsx(AppRouter, {
|
||||
actionQueue: actionQueue,
|
||||
globalErrorState: initialRSCPayload.G,
|
||||
webSocket: webSocket,
|
||||
staticIndicatorState: staticIndicatorState
|
||||
});
|
||||
if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {
|
||||
// We provide missing slot information in a context provider only during development
|
||||
// as we log some additional information about the missing slots in the console.
|
||||
return /*#__PURE__*/ _jsx(MissingSlotContext, {
|
||||
value: initialRSCPayload.m,
|
||||
children: router
|
||||
});
|
||||
}
|
||||
return router;
|
||||
}
|
||||
const StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP ? React.StrictMode : React.Fragment;
|
||||
function Root({ children }) {
|
||||
if (process.env.__NEXT_TEST_MODE) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useEffect(()=>{
|
||||
window.__NEXT_HYDRATED = true;
|
||||
window.__NEXT_HYDRATED_AT = performance.now();
|
||||
window.__NEXT_HYDRATED_CB?.();
|
||||
}, []);
|
||||
}
|
||||
return children;
|
||||
}
|
||||
const enableTransitionIndicator = process.env.__NEXT_TRANSITION_INDICATOR;
|
||||
function noDefaultTransitionIndicator() {
|
||||
return ()=>{};
|
||||
}
|
||||
const reactRootOptions = {
|
||||
onDefaultTransitionIndicator: enableTransitionIndicator ? undefined : noDefaultTransitionIndicator,
|
||||
onRecoverableError,
|
||||
onCaughtError,
|
||||
onUncaughtError
|
||||
};
|
||||
export async function hydrate(instrumentationHooks, assetPrefix) {
|
||||
let staticIndicatorState;
|
||||
let webSocket;
|
||||
if (process.env.__NEXT_DEV_SERVER) {
|
||||
const { createWebSocket } = require('./dev/hot-reloader/app/web-socket');
|
||||
staticIndicatorState = {
|
||||
pathname: null,
|
||||
appIsrManifest: null
|
||||
};
|
||||
webSocket = createWebSocket(assetPrefix, staticIndicatorState);
|
||||
}
|
||||
const initialRSCPayload = await initialServerResponse;
|
||||
// setNavigationBuildId should be called only once, during JS initialization
|
||||
// and before any components have hydrated.
|
||||
if (initialRSCPayload.b) {
|
||||
setNavigationBuildId(initialRSCPayload.b);
|
||||
} else {
|
||||
setNavigationBuildId(getDeploymentId());
|
||||
}
|
||||
const initialTimestamp = Date.now();
|
||||
const actionQueue = createMutableActionQueue(createInitialRouterState({
|
||||
navigatedAt: initialTimestamp,
|
||||
initialRSCPayload,
|
||||
initialFlightStreamForCache,
|
||||
location: window.location
|
||||
}), instrumentationHooks);
|
||||
const reactEl = /*#__PURE__*/ _jsx(StrictModeIfEnabled, {
|
||||
children: /*#__PURE__*/ _jsx(HeadManagerContext.Provider, {
|
||||
value: {
|
||||
appDir: true
|
||||
},
|
||||
children: /*#__PURE__*/ _jsx(Root, {
|
||||
children: /*#__PURE__*/ _jsx(ServerRoot, {
|
||||
initialRSCPayload: initialRSCPayload,
|
||||
actionQueue: actionQueue,
|
||||
webSocket: webSocket,
|
||||
staticIndicatorState: staticIndicatorState
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
if (document.documentElement.id === '__next_error__') {
|
||||
let element = reactEl;
|
||||
// Server rendering failed, fall back to client-side rendering
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const { RootLevelDevOverlayElement } = require('../next-devtools/userspace/app/client-entry');
|
||||
// Note this won't cause hydration mismatch because we are doing CSR w/o hydration
|
||||
element = /*#__PURE__*/ _jsx(RootLevelDevOverlayElement, {
|
||||
children: element
|
||||
});
|
||||
}
|
||||
ReactDOMClient.createRoot(appElement, reactRootOptions).render(element);
|
||||
} else {
|
||||
React.startTransition(()=>{
|
||||
ReactDOMClient.hydrateRoot(appElement, reactEl, {
|
||||
...reactRootOptions,
|
||||
formState: initialFormStateData
|
||||
});
|
||||
});
|
||||
}
|
||||
// TODO-APP: Remove this logic when Float has GC built-in in development.
|
||||
if (process.env.__NEXT_DEV_SERVER) {
|
||||
const { linkGc } = require('./app-link-gc');
|
||||
linkGc();
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-index.js.map
|
||||
1
node_modules/next/dist/esm/client/app-index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/next/dist/esm/client/app-link-gc.js
generated
vendored
Normal file
59
node_modules/next/dist/esm/client/app-link-gc.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
export function linkGc() {
|
||||
// TODO-APP: Remove this logic when Float has GC built-in in development.
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const callback = (mutationList)=>{
|
||||
for (const mutation of mutationList){
|
||||
if (mutation.type === 'childList') {
|
||||
for (const node of mutation.addedNodes){
|
||||
if ('tagName' in node && node.tagName === 'LINK') {
|
||||
const link = node;
|
||||
if (link.dataset.precedence?.startsWith('next')) {
|
||||
const href = link.getAttribute('href');
|
||||
if (href) {
|
||||
const [resource, version] = href.split('?v=', 2);
|
||||
if (version) {
|
||||
const currentOrigin = window.location.origin;
|
||||
const allLinks = [
|
||||
...document.querySelectorAll('link[href^="' + resource + '"]'),
|
||||
// It's possible that the resource is a full URL or only pathname,
|
||||
// so we need to remove the alternative href as well.
|
||||
...document.querySelectorAll('link[href^="' + (resource.startsWith(currentOrigin) ? resource.slice(currentOrigin.length) : currentOrigin + resource) + '"]')
|
||||
];
|
||||
for (const otherLink of allLinks){
|
||||
if (otherLink.dataset.precedence?.startsWith('next')) {
|
||||
const otherHref = otherLink.getAttribute('href');
|
||||
if (otherHref) {
|
||||
const [, otherVersion] = otherHref.split('?v=', 2);
|
||||
if (!otherVersion || +otherVersion < +version) {
|
||||
// Delay the removal of the stylesheet to avoid FOUC
|
||||
// caused by `@font-face` rules, as they seem to be
|
||||
// a couple of ticks delayed between the old and new
|
||||
// styles being swapped even if the font is cached.
|
||||
setTimeout(()=>{
|
||||
otherLink.remove();
|
||||
}, 5);
|
||||
const preloadLink = document.querySelector(`link[rel="preload"][as="style"][href="${otherHref}"]`);
|
||||
if (preloadLink) {
|
||||
preloadLink.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// Create an observer instance linked to the callback function
|
||||
const observer = new MutationObserver(callback);
|
||||
observer.observe(document.head, {
|
||||
childList: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-link-gc.js.map
|
||||
1
node_modules/next/dist/esm/client/app-link-gc.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-link-gc.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/next/dist/esm/client/app-next-dev.js
generated
vendored
Normal file
19
node_modules/next/dist/esm/client/app-next-dev.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// TODO-APP: hydration warning
|
||||
import './app-webpack';
|
||||
import { renderAppDevOverlay } from 'next/dist/compiled/next-devtools';
|
||||
import { appBootstrap } from './app-bootstrap';
|
||||
import { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error';
|
||||
import { isRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
||||
// eslint-disable-next-line @next/internal/typechecked-require
|
||||
const instrumentationHooks = require('../lib/require-instrumentation-client');
|
||||
appBootstrap((assetPrefix)=>{
|
||||
const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS;
|
||||
const { hydrate } = require('./app-index');
|
||||
try {
|
||||
hydrate(instrumentationHooks, assetPrefix);
|
||||
} finally{
|
||||
renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator);
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=app-next-dev.js.map
|
||||
1
node_modules/next/dist/esm/client/app-next-dev.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-next-dev.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-next-dev.ts"],"sourcesContent":["// TODO-APP: hydration warning\n\nimport './app-webpack'\n\nimport { renderAppDevOverlay } from 'next/dist/compiled/next-devtools'\nimport { appBootstrap } from './app-bootstrap'\nimport { getOwnerStack } from '../next-devtools/userspace/app/errors/stitched-error'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator)\n }\n})\n"],"names":["renderAppDevOverlay","appBootstrap","getOwnerStack","isRecoverableError","instrumentationHooks","require","assetPrefix","enableCacheIndicator","process","env","__NEXT_CACHE_COMPONENTS","hydrate"],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,gBAAe;AAEtB,SAASA,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,aAAa,QAAQ,uDAAsD;AACpF,SAASC,kBAAkB,QAAQ,gDAA+C;AAElF,8DAA8D;AAC9D,MAAMC,uBAAuBC,QAAQ;AAErCJ,aAAa,CAACK;IACZ,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,uBAAuB;IAEhE,MAAM,EAAEC,OAAO,EAAE,GAAGN,QAAQ;IAC5B,IAAI;QACFM,QAAQP,sBAAsBE;IAChC,SAAU;QACRN,oBAAoBE,eAAeC,oBAAoBI;IACzD;AACF","ignoreList":[0]}
|
||||
22
node_modules/next/dist/esm/client/app-next-turbopack.js
generated
vendored
Normal file
22
node_modules/next/dist/esm/client/app-next-turbopack.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import './register-deployment-id-global';
|
||||
import { appBootstrap } from './app-bootstrap';
|
||||
import { isRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
||||
window.next.turbopack = true;
|
||||
self.__webpack_hash__ = '';
|
||||
// eslint-disable-next-line @next/internal/typechecked-require
|
||||
const instrumentationHooks = require('../lib/require-instrumentation-client');
|
||||
appBootstrap((assetPrefix)=>{
|
||||
const { hydrate } = require('./app-index');
|
||||
try {
|
||||
hydrate(instrumentationHooks, assetPrefix);
|
||||
} finally{
|
||||
if (process.env.__NEXT_DEV_SERVER) {
|
||||
const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS;
|
||||
const { getOwnerStack } = require('../next-devtools/userspace/app/errors/stitched-error');
|
||||
const { renderAppDevOverlay } = require('next/dist/compiled/next-devtools');
|
||||
renderAppDevOverlay(getOwnerStack, isRecoverableError, enableCacheIndicator);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=app-next-turbopack.js.map
|
||||
1
node_modules/next/dist/esm/client/app-next-turbopack.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-next-turbopack.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-next-turbopack.ts"],"sourcesContent":["import './register-deployment-id-global'\nimport { appBootstrap } from './app-bootstrap'\nimport { isRecoverableError } from './react-client-callbacks/on-recoverable-error'\n\nwindow.next.turbopack = true\n;(self as any).__webpack_hash__ = ''\n\n// eslint-disable-next-line @next/internal/typechecked-require\nconst instrumentationHooks = require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n try {\n hydrate(instrumentationHooks, assetPrefix)\n } finally {\n if (process.env.__NEXT_DEV_SERVER) {\n const enableCacheIndicator = process.env.__NEXT_CACHE_COMPONENTS\n const { getOwnerStack } =\n require('../next-devtools/userspace/app/errors/stitched-error') as typeof import('../next-devtools/userspace/app/errors/stitched-error')\n const { renderAppDevOverlay } =\n require('next/dist/compiled/next-devtools') as typeof import('next/dist/compiled/next-devtools')\n renderAppDevOverlay(\n getOwnerStack,\n isRecoverableError,\n enableCacheIndicator\n )\n }\n }\n})\n"],"names":["appBootstrap","isRecoverableError","window","next","turbopack","self","__webpack_hash__","instrumentationHooks","require","assetPrefix","hydrate","process","env","__NEXT_DEV_SERVER","enableCacheIndicator","__NEXT_CACHE_COMPONENTS","getOwnerStack","renderAppDevOverlay"],"mappings":"AAAA,OAAO,kCAAiC;AACxC,SAASA,YAAY,QAAQ,kBAAiB;AAC9C,SAASC,kBAAkB,QAAQ,gDAA+C;AAElFC,OAAOC,IAAI,CAACC,SAAS,GAAG;AACtBC,KAAaC,gBAAgB,GAAG;AAElC,8DAA8D;AAC9D,MAAMC,uBAAuBC,QAAQ;AAErCR,aAAa,CAACS;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,IAAI;QACFE,QAAQH,sBAAsBE;IAChC,SAAU;QACR,IAAIE,QAAQC,GAAG,CAACC,iBAAiB,EAAE;YACjC,MAAMC,uBAAuBH,QAAQC,GAAG,CAACG,uBAAuB;YAChE,MAAM,EAAEC,aAAa,EAAE,GACrBR,QAAQ;YACV,MAAM,EAAES,mBAAmB,EAAE,GAC3BT,QAAQ;YACVS,oBACED,eACAf,oBACAa;QAEJ;IACF;AACF","ignoreList":[0]}
|
||||
17
node_modules/next/dist/esm/client/app-next.js
generated
vendored
Normal file
17
node_modules/next/dist/esm/client/app-next.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// This import must go first because it needs to patch webpack chunk loading
|
||||
// before React patches chunk loading.
|
||||
import './app-webpack';
|
||||
import { appBootstrap } from './app-bootstrap';
|
||||
const instrumentationHooks = // eslint-disable-next-line @next/internal/typechecked-require -- not a module
|
||||
require('../lib/require-instrumentation-client');
|
||||
appBootstrap((assetPrefix)=>{
|
||||
const { hydrate } = require('./app-index');
|
||||
// Include app-router and layout-router in the main chunk
|
||||
// eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?
|
||||
require('next/dist/client/components/app-router');
|
||||
// eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?
|
||||
require('next/dist/client/components/layout-router');
|
||||
hydrate(instrumentationHooks, assetPrefix);
|
||||
});
|
||||
|
||||
//# sourceMappingURL=app-next.js.map
|
||||
1
node_modules/next/dist/esm/client/app-next.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-next.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-next.ts"],"sourcesContent":["// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nconst instrumentationHooks =\n // eslint-disable-next-line @next/internal/typechecked-require -- not a module\n require('../lib/require-instrumentation-client')\n\nappBootstrap((assetPrefix) => {\n const { hydrate } = require('./app-index') as typeof import('./app-index')\n // Include app-router and layout-router in the main chunk\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/app-router')\n // eslint-disable-next-line @next/internal/typechecked-require -- Why not relative imports?\n require('next/dist/client/components/layout-router')\n hydrate(instrumentationHooks, assetPrefix)\n})\n"],"names":["appBootstrap","instrumentationHooks","require","assetPrefix","hydrate"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;AACtC,OAAO,gBAAe;AACtB,SAASA,YAAY,QAAQ,kBAAiB;AAE9C,MAAMC,uBACJ,8EAA8E;AAC9EC,QAAQ;AAEVF,aAAa,CAACG;IACZ,MAAM,EAAEC,OAAO,EAAE,GAAGF,QAAQ;IAC5B,yDAAyD;IACzD,2FAA2F;IAC3FA,QAAQ;IACR,2FAA2F;IAC3FA,QAAQ;IACRE,QAAQH,sBAAsBE;AAChC","ignoreList":[0]}
|
||||
29
node_modules/next/dist/esm/client/app-webpack.js
generated
vendored
Normal file
29
node_modules/next/dist/esm/client/app-webpack.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Override chunk URL mapping in the webpack runtime
|
||||
// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204
|
||||
import './register-deployment-id-global';
|
||||
import { getAssetToken, getAssetTokenQuery } from '../shared/lib/deployment-id';
|
||||
import { encodeURIPath } from '../shared/lib/encode-uri-path';
|
||||
// If we have a deployment ID, we need to append it to the webpack chunk names
|
||||
// I am keeping the process check explicit so this can be statically optimized
|
||||
if (getAssetToken()) {
|
||||
const suffix = getAssetTokenQuery();
|
||||
const getChunkScriptFilename = __webpack_require__.u;
|
||||
__webpack_require__.u = (...args)=>// We encode the chunk filename because our static server matches against and encoded
|
||||
// filename path.
|
||||
encodeURIPath(getChunkScriptFilename(...args)) + suffix;
|
||||
const getChunkCssFilename = __webpack_require__.k;
|
||||
__webpack_require__.k = (...args)=>getChunkCssFilename(...args) + suffix;
|
||||
const getMiniCssFilename = __webpack_require__.miniCssF;
|
||||
__webpack_require__.miniCssF = (...args)=>getMiniCssFilename(...args) + suffix;
|
||||
} else {
|
||||
const getChunkScriptFilename = __webpack_require__.u;
|
||||
__webpack_require__.u = (...args)=>// We encode the chunk filename because our static server matches against and encoded
|
||||
// filename path.
|
||||
encodeURIPath(getChunkScriptFilename(...args));
|
||||
// We don't need to override __webpack_require__.k because we don't modify
|
||||
// the css chunk name when not using deployment id suffixes
|
||||
// WE don't need to override __webpack_require__.miniCssF because we don't modify
|
||||
// the mini css chunk name when not using deployment id suffixes
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-webpack.js.map
|
||||
1
node_modules/next/dist/esm/client/app-webpack.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/app-webpack.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/app-webpack.ts"],"sourcesContent":["// Override chunk URL mapping in the webpack runtime\n// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204\n\nimport './register-deployment-id-global'\nimport { getAssetToken, getAssetTokenQuery } from '../shared/lib/deployment-id'\nimport { encodeURIPath } from '../shared/lib/encode-uri-path'\n\ndeclare const __webpack_require__: any\n\n// If we have a deployment ID, we need to append it to the webpack chunk names\n// I am keeping the process check explicit so this can be statically optimized\nif (getAssetToken()) {\n const suffix = getAssetTokenQuery()\n const getChunkScriptFilename = __webpack_require__.u\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args)) + suffix\n\n const getChunkCssFilename = __webpack_require__.k\n __webpack_require__.k = (...args: any[]) =>\n getChunkCssFilename(...args) + suffix\n\n const getMiniCssFilename = __webpack_require__.miniCssF\n __webpack_require__.miniCssF = (...args: any[]) =>\n getMiniCssFilename(...args) + suffix\n} else {\n const getChunkScriptFilename = __webpack_require__.u\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args))\n\n // We don't need to override __webpack_require__.k because we don't modify\n // the css chunk name when not using deployment id suffixes\n\n // WE don't need to override __webpack_require__.miniCssF because we don't modify\n // the mini css chunk name when not using deployment id suffixes\n}\n\nexport {}\n"],"names":["getAssetToken","getAssetTokenQuery","encodeURIPath","suffix","getChunkScriptFilename","__webpack_require__","u","args","getChunkCssFilename","k","getMiniCssFilename","miniCssF"],"mappings":"AAAA,oDAAoD;AACpD,8GAA8G;AAE9G,OAAO,kCAAiC;AACxC,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,8BAA6B;AAC/E,SAASC,aAAa,QAAQ,gCAA+B;AAI7D,8EAA8E;AAC9E,8EAA8E;AAC9E,IAAIF,iBAAiB;IACnB,MAAMG,SAASF;IACf,MAAMG,yBAAyBC,oBAAoBC,CAAC;IACpDD,oBAAoBC,CAAC,GAAG,CAAC,GAAGC,OAC1B,qFAAqF;QACrF,iBAAiB;QACjBL,cAAcE,0BAA0BG,SAASJ;IAEnD,MAAMK,sBAAsBH,oBAAoBI,CAAC;IACjDJ,oBAAoBI,CAAC,GAAG,CAAC,GAAGF,OAC1BC,uBAAuBD,QAAQJ;IAEjC,MAAMO,qBAAqBL,oBAAoBM,QAAQ;IACvDN,oBAAoBM,QAAQ,GAAG,CAAC,GAAGJ,OACjCG,sBAAsBH,QAAQJ;AAClC,OAAO;IACL,MAAMC,yBAAyBC,oBAAoBC,CAAC;IACpDD,oBAAoBC,CAAC,GAAG,CAAC,GAAGC,OAC1B,qFAAqF;QACrF,iBAAiB;QACjBL,cAAcE,0BAA0BG;AAE1C,0EAA0E;AAC1E,2DAA2D;AAE3D,iFAAiF;AACjF,gEAAgE;AAClE","ignoreList":[0]}
|
||||
23
node_modules/next/dist/esm/client/asset-prefix.js
generated
vendored
Normal file
23
node_modules/next/dist/esm/client/asset-prefix.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { InvariantError } from '../shared/lib/invariant-error';
|
||||
export function getAssetPrefix() {
|
||||
const currentScript = document.currentScript;
|
||||
if (!(currentScript instanceof HTMLScriptElement)) {
|
||||
throw Object.defineProperty(new InvariantError(`Expected document.currentScript to be a <script> element. Received ${currentScript} instead.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E783",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const { pathname } = new URL(currentScript.src);
|
||||
const nextIndex = pathname.indexOf('/_next/');
|
||||
if (nextIndex === -1) {
|
||||
throw Object.defineProperty(new InvariantError(`Expected document.currentScript src to contain '/_next/'. Received ${currentScript.src} instead.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E784",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return pathname.slice(0, nextIndex);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=asset-prefix.js.map
|
||||
1
node_modules/next/dist/esm/client/asset-prefix.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/asset-prefix.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/asset-prefix.ts"],"sourcesContent":["import { InvariantError } from '../shared/lib/invariant-error'\n\nexport function getAssetPrefix() {\n const currentScript = document.currentScript\n\n if (!(currentScript instanceof HTMLScriptElement)) {\n throw new InvariantError(\n `Expected document.currentScript to be a <script> element. Received ${currentScript} instead.`\n )\n }\n\n const { pathname } = new URL(currentScript.src)\n const nextIndex = pathname.indexOf('/_next/')\n\n if (nextIndex === -1) {\n throw new InvariantError(\n `Expected document.currentScript src to contain '/_next/'. Received ${currentScript.src} instead.`\n )\n }\n\n return pathname.slice(0, nextIndex)\n}\n"],"names":["InvariantError","getAssetPrefix","currentScript","document","HTMLScriptElement","pathname","URL","src","nextIndex","indexOf","slice"],"mappings":"AAAA,SAASA,cAAc,QAAQ,gCAA+B;AAE9D,OAAO,SAASC;IACd,MAAMC,gBAAgBC,SAASD,aAAa;IAE5C,IAAI,CAAEA,CAAAA,yBAAyBE,iBAAgB,GAAI;QACjD,MAAM,qBAEL,CAFK,IAAIJ,eACR,CAAC,mEAAmE,EAAEE,cAAc,SAAS,CAAC,GAD1F,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,EAAEG,QAAQ,EAAE,GAAG,IAAIC,IAAIJ,cAAcK,GAAG;IAC9C,MAAMC,YAAYH,SAASI,OAAO,CAAC;IAEnC,IAAID,cAAc,CAAC,GAAG;QACpB,MAAM,qBAEL,CAFK,IAAIR,eACR,CAAC,mEAAmE,EAAEE,cAAcK,GAAG,CAAC,SAAS,CAAC,GAD9F,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,OAAOF,SAASK,KAAK,CAAC,GAAGF;AAC3B","ignoreList":[0]}
|
||||
19
node_modules/next/dist/esm/client/assign-location.js
generated
vendored
Normal file
19
node_modules/next/dist/esm/client/assign-location.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { addBasePath } from './add-base-path';
|
||||
/**
|
||||
* Function to correctly assign location to URL
|
||||
*
|
||||
* The method will add basePath, and will also correctly add location (including if it is a relative path)
|
||||
* @param location Location that should be added to the url
|
||||
* @param url Base URL to which the location should be assigned
|
||||
*/ export function assignLocation(location, url) {
|
||||
if (location.startsWith('.')) {
|
||||
const urlBase = url.origin + url.pathname;
|
||||
return new URL(// In order for a relative path to be added to the current url correctly, the current url must end with a slash
|
||||
// new URL('./relative', 'https://example.com/subdir').href -> 'https://example.com/relative'
|
||||
// new URL('./relative', 'https://example.com/subdir/').href -> 'https://example.com/subdir/relative'
|
||||
(urlBase.endsWith('/') ? urlBase : urlBase + '/') + location);
|
||||
}
|
||||
return new URL(addBasePath(location), url.href);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=assign-location.js.map
|
||||
1
node_modules/next/dist/esm/client/assign-location.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/assign-location.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/assign-location.ts"],"sourcesContent":["import { addBasePath } from './add-base-path'\n\n/**\n * Function to correctly assign location to URL\n *\n * The method will add basePath, and will also correctly add location (including if it is a relative path)\n * @param location Location that should be added to the url\n * @param url Base URL to which the location should be assigned\n */\nexport function assignLocation(location: string, url: URL): URL {\n if (location.startsWith('.')) {\n const urlBase = url.origin + url.pathname\n return new URL(\n // In order for a relative path to be added to the current url correctly, the current url must end with a slash\n // new URL('./relative', 'https://example.com/subdir').href -> 'https://example.com/relative'\n // new URL('./relative', 'https://example.com/subdir/').href -> 'https://example.com/subdir/relative'\n (urlBase.endsWith('/') ? urlBase : urlBase + '/') + location\n )\n }\n\n return new URL(addBasePath(location), url.href)\n}\n"],"names":["addBasePath","assignLocation","location","url","startsWith","urlBase","origin","pathname","URL","endsWith","href"],"mappings":"AAAA,SAASA,WAAW,QAAQ,kBAAiB;AAE7C;;;;;;CAMC,GACD,OAAO,SAASC,eAAeC,QAAgB,EAAEC,GAAQ;IACvD,IAAID,SAASE,UAAU,CAAC,MAAM;QAC5B,MAAMC,UAAUF,IAAIG,MAAM,GAAGH,IAAII,QAAQ;QACzC,OAAO,IAAIC,IAIT,AAHA,+GAA+G;QAC/G,6FAA6F;QAC7F,qGAAqG;QACpGH,CAAAA,QAAQI,QAAQ,CAAC,OAAOJ,UAAUA,UAAU,GAAE,IAAKH;IAExD;IAEA,OAAO,IAAIM,IAAIR,YAAYE,WAAWC,IAAIO,IAAI;AAChD","ignoreList":[0]}
|
||||
16
node_modules/next/dist/esm/client/compat/router.js
generated
vendored
Normal file
16
node_modules/next/dist/esm/client/compat/router.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useContext } from 'react';
|
||||
import { RouterContext } from '../../shared/lib/router-context.shared-runtime';
|
||||
/**
|
||||
* useRouter from `next/compat/router` is designed to assist developers
|
||||
* migrating from `pages/` to `app/`. Unlike `next/router`, this hook does not
|
||||
* throw when the `NextRouter` is not mounted, and instead returns `null`. The
|
||||
* more concrete return type here lets developers use this hook within
|
||||
* components that could be shared between both `app/` and `pages/` and handle
|
||||
* to the case where the router is not mounted.
|
||||
*
|
||||
* @returns The `NextRouter` instance if it's available, otherwise `null`.
|
||||
*/ export function useRouter() {
|
||||
return useContext(RouterContext);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=router.js.map
|
||||
1
node_modules/next/dist/esm/client/compat/router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/compat/router.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/compat/router.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { RouterContext } from '../../shared/lib/router-context.shared-runtime'\nimport type { NextRouter } from '../router'\n\n/**\n * useRouter from `next/compat/router` is designed to assist developers\n * migrating from `pages/` to `app/`. Unlike `next/router`, this hook does not\n * throw when the `NextRouter` is not mounted, and instead returns `null`. The\n * more concrete return type here lets developers use this hook within\n * components that could be shared between both `app/` and `pages/` and handle\n * to the case where the router is not mounted.\n *\n * @returns The `NextRouter` instance if it's available, otherwise `null`.\n */\nexport function useRouter(): NextRouter | null {\n return useContext(RouterContext)\n}\n"],"names":["useContext","RouterContext","useRouter"],"mappings":"AAAA,SAASA,UAAU,QAAQ,QAAO;AAClC,SAASC,aAAa,QAAQ,iDAAgD;AAG9E;;;;;;;;;CASC,GACD,OAAO,SAASC;IACd,OAAOF,WAAWC;AACpB","ignoreList":[0]}
|
||||
62
node_modules/next/dist/esm/client/components/app-router-announcer.js
generated
vendored
Normal file
62
node_modules/next/dist/esm/client/components/app-router-announcer.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
const ANNOUNCER_TYPE = 'next-route-announcer';
|
||||
const ANNOUNCER_ID = '__next-route-announcer__';
|
||||
function getAnnouncerNode() {
|
||||
const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0];
|
||||
if (existingAnnouncer?.shadowRoot?.childNodes[0]) {
|
||||
return existingAnnouncer.shadowRoot.childNodes[0];
|
||||
} else {
|
||||
const container = document.createElement(ANNOUNCER_TYPE);
|
||||
container.style.cssText = 'position:absolute';
|
||||
const announcer = document.createElement('div');
|
||||
announcer.ariaLive = 'assertive';
|
||||
announcer.id = ANNOUNCER_ID;
|
||||
announcer.role = 'alert';
|
||||
announcer.style.cssText = 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal';
|
||||
// Use shadow DOM here to avoid any potential CSS bleed
|
||||
const shadow = container.attachShadow({
|
||||
mode: 'open'
|
||||
});
|
||||
shadow.appendChild(announcer);
|
||||
document.body.appendChild(container);
|
||||
return announcer;
|
||||
}
|
||||
}
|
||||
export function AppRouterAnnouncer({ tree }) {
|
||||
const [portalNode, setPortalNode] = useState(null);
|
||||
useEffect(()=>{
|
||||
const announcer = getAnnouncerNode();
|
||||
setPortalNode(announcer);
|
||||
return ()=>{
|
||||
const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0];
|
||||
if (container?.isConnected) {
|
||||
document.body.removeChild(container);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
const [routeAnnouncement, setRouteAnnouncement] = useState('');
|
||||
const previousTitle = useRef(undefined);
|
||||
useEffect(()=>{
|
||||
let currentTitle = '';
|
||||
if (document.title) {
|
||||
currentTitle = document.title;
|
||||
} else {
|
||||
const pageHeader = document.querySelector('h1');
|
||||
if (pageHeader) {
|
||||
currentTitle = pageHeader.innerText || pageHeader.textContent || '';
|
||||
}
|
||||
}
|
||||
// Only announce the title change, but not for the first load because screen
|
||||
// readers do that automatically.
|
||||
if (previousTitle.current !== undefined && previousTitle.current !== currentTitle) {
|
||||
setRouteAnnouncement(currentTitle);
|
||||
}
|
||||
previousTitle.current = currentTitle;
|
||||
}, [
|
||||
tree
|
||||
]);
|
||||
return portalNode ? /*#__PURE__*/ createPortal(routeAnnouncement, portalNode) : null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router-announcer.js.map
|
||||
1
node_modules/next/dist/esm/client/components/app-router-announcer.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/app-router-announcer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/app-router-announcer.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { FlightRouterState } from '../../shared/lib/app-router-types'\n\nconst ANNOUNCER_TYPE = 'next-route-announcer'\nconst ANNOUNCER_ID = '__next-route-announcer__'\n\nfunction getAnnouncerNode() {\n const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0]\n if (existingAnnouncer?.shadowRoot?.childNodes[0]) {\n return existingAnnouncer.shadowRoot.childNodes[0] as HTMLElement\n } else {\n const container = document.createElement(ANNOUNCER_TYPE)\n container.style.cssText = 'position:absolute'\n const announcer = document.createElement('div')\n announcer.ariaLive = 'assertive'\n announcer.id = ANNOUNCER_ID\n announcer.role = 'alert'\n announcer.style.cssText =\n 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal'\n\n // Use shadow DOM here to avoid any potential CSS bleed\n const shadow = container.attachShadow({ mode: 'open' })\n shadow.appendChild(announcer)\n document.body.appendChild(container)\n return announcer\n }\n}\n\nexport function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {\n const [portalNode, setPortalNode] = useState<HTMLElement | null>(null)\n\n useEffect(() => {\n const announcer = getAnnouncerNode()\n setPortalNode(announcer)\n return () => {\n const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0]\n if (container?.isConnected) {\n document.body.removeChild(container)\n }\n }\n }, [])\n\n const [routeAnnouncement, setRouteAnnouncement] = useState('')\n const previousTitle = useRef<string | undefined>(undefined)\n\n useEffect(() => {\n let currentTitle = ''\n if (document.title) {\n currentTitle = document.title\n } else {\n const pageHeader = document.querySelector('h1')\n if (pageHeader) {\n currentTitle = pageHeader.innerText || pageHeader.textContent || ''\n }\n }\n\n // Only announce the title change, but not for the first load because screen\n // readers do that automatically.\n if (\n previousTitle.current !== undefined &&\n previousTitle.current !== currentTitle\n ) {\n setRouteAnnouncement(currentTitle)\n }\n previousTitle.current = currentTitle\n }, [tree])\n\n return portalNode ? createPortal(routeAnnouncement, portalNode) : null\n}\n"],"names":["useEffect","useRef","useState","createPortal","ANNOUNCER_TYPE","ANNOUNCER_ID","getAnnouncerNode","existingAnnouncer","document","getElementsByName","shadowRoot","childNodes","container","createElement","style","cssText","announcer","ariaLive","id","role","shadow","attachShadow","mode","appendChild","body","AppRouterAnnouncer","tree","portalNode","setPortalNode","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","undefined","currentTitle","title","pageHeader","querySelector","innerText","textContent","current"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACnD,SAASC,YAAY,QAAQ,YAAW;AAGxC,MAAMC,iBAAiB;AACvB,MAAMC,eAAe;AAErB,SAASC;IACP,MAAMC,oBAAoBC,SAASC,iBAAiB,CAACL,eAAe,CAAC,EAAE;IACvE,IAAIG,mBAAmBG,YAAYC,UAAU,CAAC,EAAE,EAAE;QAChD,OAAOJ,kBAAkBG,UAAU,CAACC,UAAU,CAAC,EAAE;IACnD,OAAO;QACL,MAAMC,YAAYJ,SAASK,aAAa,CAACT;QACzCQ,UAAUE,KAAK,CAACC,OAAO,GAAG;QAC1B,MAAMC,YAAYR,SAASK,aAAa,CAAC;QACzCG,UAAUC,QAAQ,GAAG;QACrBD,UAAUE,EAAE,GAAGb;QACfW,UAAUG,IAAI,GAAG;QACjBH,UAAUF,KAAK,CAACC,OAAO,GACrB;QAEF,uDAAuD;QACvD,MAAMK,SAASR,UAAUS,YAAY,CAAC;YAAEC,MAAM;QAAO;QACrDF,OAAOG,WAAW,CAACP;QACnBR,SAASgB,IAAI,CAACD,WAAW,CAACX;QAC1B,OAAOI;IACT;AACF;AAEA,OAAO,SAASS,mBAAmB,EAAEC,IAAI,EAA+B;IACtE,MAAM,CAACC,YAAYC,cAAc,GAAG1B,SAA6B;IAEjEF,UAAU;QACR,MAAMgB,YAAYV;QAClBsB,cAAcZ;QACd,OAAO;YACL,MAAMJ,YAAYJ,SAASqB,oBAAoB,CAACzB,eAAe,CAAC,EAAE;YAClE,IAAIQ,WAAWkB,aAAa;gBAC1BtB,SAASgB,IAAI,CAACO,WAAW,CAACnB;YAC5B;QACF;IACF,GAAG,EAAE;IAEL,MAAM,CAACoB,mBAAmBC,qBAAqB,GAAG/B,SAAS;IAC3D,MAAMgC,gBAAgBjC,OAA2BkC;IAEjDnC,UAAU;QACR,IAAIoC,eAAe;QACnB,IAAI5B,SAAS6B,KAAK,EAAE;YAClBD,eAAe5B,SAAS6B,KAAK;QAC/B,OAAO;YACL,MAAMC,aAAa9B,SAAS+B,aAAa,CAAC;YAC1C,IAAID,YAAY;gBACdF,eAAeE,WAAWE,SAAS,IAAIF,WAAWG,WAAW,IAAI;YACnE;QACF;QAEA,4EAA4E;QAC5E,iCAAiC;QACjC,IACEP,cAAcQ,OAAO,KAAKP,aAC1BD,cAAcQ,OAAO,KAAKN,cAC1B;YACAH,qBAAqBG;QACvB;QACAF,cAAcQ,OAAO,GAAGN;IAC1B,GAAG;QAACV;KAAK;IAET,OAAOC,2BAAaxB,aAAa6B,mBAAmBL,cAAc;AACpE","ignoreList":[0]}
|
||||
46
node_modules/next/dist/esm/client/components/app-router-headers.js
generated
vendored
Normal file
46
node_modules/next/dist/esm/client/components/app-router-headers.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
export const RSC_HEADER = 'rsc';
|
||||
export const ACTION_HEADER = 'next-action';
|
||||
// TODO: Instead of sending the full router state, we only need to send the
|
||||
// segment path. Saves bytes. Then we could also use this field for segment
|
||||
// prefetches, which also need to specify a particular segment.
|
||||
export const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree';
|
||||
export const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch';
|
||||
// This contains the path to the segment being prefetched.
|
||||
// TODO: If we change next-router-state-tree to be a segment path, we can use
|
||||
// that instead. Then next-router-prefetch and next-router-segment-prefetch can
|
||||
// be merged into a single enum.
|
||||
export const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = 'next-router-segment-prefetch';
|
||||
export const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh';
|
||||
export const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__';
|
||||
export const NEXT_URL = 'next-url';
|
||||
export const RSC_CONTENT_TYPE_HEADER = 'text/x-component';
|
||||
// Header for the Instant Navigation Testing API. In development and testing
|
||||
// builds, static pre-renders normally don't happen. This header tells the
|
||||
// server to perform a static pre-render anyway, allowing tests to assert on
|
||||
// the prefetched UI. Not exposed in production builds by default.
|
||||
export const NEXT_INSTANT_PREFETCH_HEADER = 'next-instant-navigation-testing-prefetch';
|
||||
// Cookie for the Instant Navigation Testing API. Used for MPA navigations
|
||||
// (page reload, full page load) where we can't set request headers. When set,
|
||||
// the server renders only the static shell. Not exposed in production builds
|
||||
// by default.
|
||||
export const NEXT_INSTANT_TEST_COOKIE = 'next-instant-navigation-testing';
|
||||
export const FLIGHT_HEADERS = [
|
||||
RSC_HEADER,
|
||||
NEXT_ROUTER_STATE_TREE_HEADER,
|
||||
NEXT_ROUTER_PREFETCH_HEADER,
|
||||
NEXT_HMR_REFRESH_HEADER,
|
||||
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
||||
];
|
||||
export const NEXT_RSC_UNION_QUERY = '_rsc';
|
||||
export const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time';
|
||||
export const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed';
|
||||
export const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path';
|
||||
export const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query';
|
||||
export const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender';
|
||||
export const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found';
|
||||
export const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id';
|
||||
export const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id';
|
||||
// TODO: Should this include nextjs in the name, like the others?
|
||||
export const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated';
|
||||
|
||||
//# sourceMappingURL=app-router-headers.js.map
|
||||
1
node_modules/next/dist/esm/client/components/app-router-headers.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/app-router-headers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/app-router-headers.ts"],"sourcesContent":["export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\n// Header for the Instant Navigation Testing API. In development and testing\n// builds, static pre-renders normally don't happen. This header tells the\n// server to perform a static pre-render anyway, allowing tests to assert on\n// the prefetched UI. Not exposed in production builds by default.\nexport const NEXT_INSTANT_PREFETCH_HEADER =\n 'next-instant-navigation-testing-prefetch' as const\n\n// Cookie for the Instant Navigation Testing API. Used for MPA navigations\n// (page reload, full page load) where we can't set request headers. When set,\n// the server renders only the static shell. Not exposed in production builds\n// by default.\nexport const NEXT_INSTANT_TEST_COOKIE =\n 'next-instant-navigation-testing' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n\n// TODO: Should this include nextjs in the name, like the others?\nexport const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated' as const\n"],"names":["RSC_HEADER","ACTION_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_HMR_REFRESH_HASH_COOKIE","NEXT_URL","RSC_CONTENT_TYPE_HEADER","NEXT_INSTANT_PREFETCH_HEADER","NEXT_INSTANT_TEST_COOKIE","FLIGHT_HEADERS","NEXT_RSC_UNION_QUERY","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_ACTION_NOT_FOUND_HEADER","NEXT_REQUEST_ID_HEADER","NEXT_HTML_REQUEST_ID_HEADER","NEXT_ACTION_REVALIDATED_HEADER"],"mappings":"AAAA,OAAO,MAAMA,aAAa,MAAc;AACxC,OAAO,MAAMC,gBAAgB,cAAsB;AACnD,2EAA2E;AAC3E,2EAA2E;AAC3E,+DAA+D;AAC/D,OAAO,MAAMC,gCAAgC,yBAAiC;AAC9E,OAAO,MAAMC,8BAA8B,uBAA+B;AAC1E,0DAA0D;AAC1D,6EAA6E;AAC7E,+EAA+E;AAC/E,gCAAgC;AAChC,OAAO,MAAMC,sCACX,+BAAuC;AACzC,OAAO,MAAMC,0BAA0B,mBAA2B;AAClE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,WAAW,WAAmB;AAC3C,OAAO,MAAMC,0BAA0B,mBAA2B;AAElE,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E,kEAAkE;AAClE,OAAO,MAAMC,+BACX,2CAAmD;AAErD,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,cAAc;AACd,OAAO,MAAMC,2BACX,kCAA0C;AAE5C,OAAO,MAAMC,iBAAiB;IAC5BX;IACAE;IACAC;IACAE;IACAD;CACD,CAAS;AAEV,OAAO,MAAMQ,uBAAuB,OAAe;AAEnD,OAAO,MAAMC,gCAAgC,sBAA8B;AAC3E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,6BAA6B,0BAAkC;AAC5E,OAAO,MAAMC,8BAA8B,2BAAmC;AAC9E,OAAO,MAAMC,2BAA2B,qBAA6B;AACrE,OAAO,MAAMC,+BAA+B,4BAAoC;AAChF,OAAO,MAAMC,yBAAyB,sBAA8B;AACpE,OAAO,MAAMC,8BAA8B,2BAAmC;AAE9E,iEAAiE;AACjE,OAAO,MAAMC,iCAAiC,uBAA+B","ignoreList":[0]}
|
||||
361
node_modules/next/dist/esm/client/components/app-router-instance.js
generated
vendored
Normal file
361
node_modules/next/dist/esm/client/components/app-router-instance.js
generated
vendored
Normal file
@@ -0,0 +1,361 @@
|
||||
import { ACTION_REFRESH, ACTION_SERVER_ACTION, ACTION_NAVIGATE, ACTION_RESTORE, ACTION_HMR_REFRESH, PrefetchKind, ScrollBehavior } from './router-reducer/router-reducer-types';
|
||||
import { reducer } from './router-reducer/router-reducer';
|
||||
import { addTransitionType, startTransition } from 'react';
|
||||
import { isThenable } from '../../shared/lib/is-thenable';
|
||||
import { FetchStrategy } from './segment-cache/types';
|
||||
import { prefetch as prefetchWithSegmentCache } from './segment-cache/prefetch';
|
||||
import { navigate } from './segment-cache/navigation';
|
||||
import { dispatchAppRouterAction, dispatchGestureState } from './use-action-queue';
|
||||
import { resetKnownRoutes } from './segment-cache/optimistic-routes';
|
||||
import { FreshnessPolicy } from './router-reducer/ppr-navigations';
|
||||
import { addBasePath } from '../add-base-path';
|
||||
import { isExternalURL } from './app-router-utils';
|
||||
import { setLinkForCurrentNavigation } from './links';
|
||||
import { isJavaScriptURLString } from '../lib/javascript-url';
|
||||
function runRemainingActions(actionQueue, setState) {
|
||||
if (actionQueue.pending !== null) {
|
||||
actionQueue.pending = actionQueue.pending.next;
|
||||
if (actionQueue.pending !== null) {
|
||||
runAction({
|
||||
actionQueue,
|
||||
action: actionQueue.pending,
|
||||
setState
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Check for refresh when pending is already null
|
||||
// This handles the case where a discarded server action completes
|
||||
// after the navigation has already finished and the queue is empty
|
||||
if (actionQueue.needsRefresh) {
|
||||
actionQueue.needsRefresh = false;
|
||||
actionQueue.dispatch({
|
||||
type: ACTION_REFRESH
|
||||
}, setState);
|
||||
}
|
||||
}
|
||||
}
|
||||
async function runAction({ actionQueue, action, setState }) {
|
||||
const prevState = actionQueue.state;
|
||||
actionQueue.pending = action;
|
||||
const payload = action.payload;
|
||||
const actionResult = actionQueue.action(prevState, payload);
|
||||
function handleResult(nextState) {
|
||||
// if we discarded this action, the state should also be discarded
|
||||
if (action.discarded) {
|
||||
// Check if the discarded server action revalidated data
|
||||
if (action.payload.type === ACTION_SERVER_ACTION && action.payload.didRevalidate) {
|
||||
// The server action was discarded but it revalidated data,
|
||||
// mark that we need to refresh after all actions complete
|
||||
actionQueue.needsRefresh = true;
|
||||
}
|
||||
// Still need to run remaining actions even for discarded actions
|
||||
// to potentially trigger the refresh
|
||||
runRemainingActions(actionQueue, setState);
|
||||
return;
|
||||
}
|
||||
actionQueue.state = nextState;
|
||||
runRemainingActions(actionQueue, setState);
|
||||
action.resolve(nextState);
|
||||
}
|
||||
// if the action is a promise, set up a callback to resolve it
|
||||
if (isThenable(actionResult)) {
|
||||
actionResult.then(handleResult, (err)=>{
|
||||
runRemainingActions(actionQueue, setState);
|
||||
action.reject(err);
|
||||
});
|
||||
} else {
|
||||
handleResult(actionResult);
|
||||
}
|
||||
}
|
||||
function dispatchAction(actionQueue, payload, setState) {
|
||||
let resolvers = {
|
||||
resolve: setState,
|
||||
reject: ()=>{}
|
||||
};
|
||||
// most of the action types are async with the exception of restore
|
||||
// it's important that restore is handled quickly since it's fired on the popstate event
|
||||
// and we don't want to add any delay on a back/forward nav
|
||||
// this only creates a promise for the async actions
|
||||
if (payload.type !== ACTION_RESTORE) {
|
||||
// Create the promise and assign the resolvers to the object.
|
||||
const deferredPromise = new Promise((resolve, reject)=>{
|
||||
resolvers = {
|
||||
resolve,
|
||||
reject
|
||||
};
|
||||
});
|
||||
startTransition(()=>{
|
||||
// we immediately notify React of the pending promise -- the resolver is attached to the action node
|
||||
// and will be called when the associated action promise resolves
|
||||
setState(deferredPromise);
|
||||
});
|
||||
}
|
||||
const newAction = {
|
||||
payload,
|
||||
next: null,
|
||||
resolve: resolvers.resolve,
|
||||
reject: resolvers.reject
|
||||
};
|
||||
// Check if the queue is empty
|
||||
if (actionQueue.pending === null) {
|
||||
// The queue is empty, so add the action and start it immediately
|
||||
// Mark this action as the last in the queue
|
||||
actionQueue.last = newAction;
|
||||
runAction({
|
||||
actionQueue,
|
||||
action: newAction,
|
||||
setState
|
||||
});
|
||||
} else if (payload.type === ACTION_NAVIGATE || payload.type === ACTION_RESTORE) {
|
||||
// Navigations (including back/forward) take priority over any pending actions.
|
||||
// Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.
|
||||
actionQueue.pending.discarded = true;
|
||||
// The rest of the current queue should still execute after this navigation.
|
||||
// (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)
|
||||
newAction.next = actionQueue.pending.next;
|
||||
runAction({
|
||||
actionQueue,
|
||||
action: newAction,
|
||||
setState
|
||||
});
|
||||
} else {
|
||||
// The queue is not empty, so add the action to the end of the queue
|
||||
// It will be started by runRemainingActions after the previous action finishes
|
||||
if (actionQueue.last !== null) {
|
||||
actionQueue.last.next = newAction;
|
||||
}
|
||||
actionQueue.last = newAction;
|
||||
}
|
||||
}
|
||||
let globalActionQueue = null;
|
||||
export function createMutableActionQueue(initialState, instrumentationHooks) {
|
||||
const actionQueue = {
|
||||
state: initialState,
|
||||
dispatch: (payload, setState)=>dispatchAction(actionQueue, payload, setState),
|
||||
action: async (state, action)=>{
|
||||
const result = reducer(state, action);
|
||||
return result;
|
||||
},
|
||||
pending: null,
|
||||
last: null,
|
||||
onRouterTransitionStart: instrumentationHooks !== null && typeof instrumentationHooks.onRouterTransitionStart === 'function' ? instrumentationHooks.onRouterTransitionStart : null
|
||||
};
|
||||
if (typeof window !== 'undefined') {
|
||||
// The action queue is lazily created on hydration, but after that point
|
||||
// it doesn't change. So we can store it in a global rather than pass
|
||||
// it around everywhere via props/context.
|
||||
if (globalActionQueue !== null) {
|
||||
throw Object.defineProperty(new Error('Internal Next.js Error: createMutableActionQueue was called more ' + 'than once'), "__NEXT_ERROR_CODE", {
|
||||
value: "E624",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
globalActionQueue = actionQueue;
|
||||
}
|
||||
return actionQueue;
|
||||
}
|
||||
export function getCurrentAppRouterState() {
|
||||
return globalActionQueue !== null ? globalActionQueue.state : null;
|
||||
}
|
||||
function getAppRouterActionQueue() {
|
||||
if (globalActionQueue === null) {
|
||||
throw Object.defineProperty(new Error('Internal Next.js error: Router action dispatched before initialization.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E668",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return globalActionQueue;
|
||||
}
|
||||
function getProfilingHookForOnNavigationStart() {
|
||||
if (globalActionQueue !== null) {
|
||||
return globalActionQueue.onRouterTransitionStart;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
export function dispatchNavigateAction(href, navigateType, scrollBehavior, linkInstanceRef, transitionTypes) {
|
||||
// TODO: This stuff could just go into the reducer. Leaving as-is for now
|
||||
// since we're about to rewrite all the router reducer stuff anyway.
|
||||
if (transitionTypes) {
|
||||
for (const type of transitionTypes){
|
||||
addTransitionType(type);
|
||||
}
|
||||
}
|
||||
const url = new URL(addBasePath(href), location.href);
|
||||
if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {
|
||||
window.next.__pendingUrl = url;
|
||||
}
|
||||
setLinkForCurrentNavigation(linkInstanceRef);
|
||||
const onRouterTransitionStart = getProfilingHookForOnNavigationStart();
|
||||
if (onRouterTransitionStart !== null) {
|
||||
onRouterTransitionStart(href, navigateType);
|
||||
}
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_NAVIGATE,
|
||||
url,
|
||||
isExternalUrl: isExternalURL(url),
|
||||
locationSearch: location.search,
|
||||
scrollBehavior,
|
||||
navigateType
|
||||
});
|
||||
}
|
||||
export function dispatchTraverseAction(href, historyState) {
|
||||
const onRouterTransitionStart = getProfilingHookForOnNavigationStart();
|
||||
if (onRouterTransitionStart !== null) {
|
||||
onRouterTransitionStart(href, 'traverse');
|
||||
}
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_RESTORE,
|
||||
url: new URL(href),
|
||||
historyState
|
||||
});
|
||||
}
|
||||
/**
|
||||
* (Experimental) Perform a gesture navigation. This dispatches through React's
|
||||
* useOptimistic instead of the main action queue, allowing the state to be
|
||||
* shown during a gesture transition and discarded when the canonical navigation
|
||||
* completes.
|
||||
*
|
||||
* Only available when experimental.gestureTransition is enabled.
|
||||
*/ function gesturePush(href, options) {
|
||||
if (process.env.__NEXT_GESTURE_TRANSITION) {
|
||||
// TODO: Trigger a prefetch so the cache starts populating if there isn't
|
||||
// already a prefetch for this route.
|
||||
if (isJavaScriptURLString(href)) {
|
||||
throw Object.defineProperty(new Error('Next.js has blocked a javascript: URL as a security precaution.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E978",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const state = getCurrentAppRouterState();
|
||||
if (state === null) {
|
||||
return;
|
||||
}
|
||||
const url = new URL(addBasePath(href), location.href);
|
||||
if (isExternalURL(url)) {
|
||||
return;
|
||||
}
|
||||
// Fork the router state for the duration of the gesture transition.
|
||||
const currentUrl = new URL(state.canonicalUrl, location.href);
|
||||
const scrollBehavior = options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default;
|
||||
// This is a special freshness policy that prevents dynamic requests from
|
||||
// being spawned. During the gesture, we should only show the cached
|
||||
// prefetched UI, not dynamic data.
|
||||
// TODO: In the case of navigations to an unknown route, this will still
|
||||
// end up performing a dynamic request. The plan is to do prefetch instead.
|
||||
// There's a separate TODO for this.
|
||||
const freshnessPolicy = FreshnessPolicy.Gesture;
|
||||
const forkedGestureState = navigate(state, url, currentUrl, state.renderedSearch, state.cache, state.tree, state.nextUrl, freshnessPolicy, scrollBehavior, 'push');
|
||||
dispatchGestureState(forkedGestureState);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The app router that is exposed through `useRouter`. These are public API
|
||||
* methods. Internal Next.js code should call the lower level methods directly
|
||||
* (although there's lots of existing code that doesn't do that).
|
||||
*/ export const publicAppRouterInstance = {
|
||||
back: ()=>window.history.back(),
|
||||
forward: ()=>window.history.forward(),
|
||||
prefetch: // Unlike the old implementation, the Segment Cache doesn't store its
|
||||
// data in the router reducer state; it writes into a global mutable
|
||||
// cache. So we don't need to dispatch an action.
|
||||
(href, options)=>{
|
||||
if (isJavaScriptURLString(href)) {
|
||||
throw Object.defineProperty(new Error('Next.js has blocked a javascript: URL as a security precaution.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E978",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const actionQueue = getAppRouterActionQueue();
|
||||
const prefetchKind = options?.kind ?? PrefetchKind.AUTO;
|
||||
// We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.
|
||||
// This will be possible when we update its API to not take a PrefetchKind.
|
||||
let fetchStrategy;
|
||||
switch(prefetchKind){
|
||||
case PrefetchKind.AUTO:
|
||||
{
|
||||
// We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.
|
||||
fetchStrategy = FetchStrategy.PPR;
|
||||
break;
|
||||
}
|
||||
case PrefetchKind.FULL:
|
||||
{
|
||||
fetchStrategy = FetchStrategy.Full;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
prefetchKind;
|
||||
// Despite typescript thinking that this can't happen,
|
||||
// we might get an unexpected value from user code.
|
||||
// We don't know what they want, but we know they want a prefetch,
|
||||
// so use the default.
|
||||
fetchStrategy = FetchStrategy.PPR;
|
||||
}
|
||||
}
|
||||
prefetchWithSegmentCache(href, actionQueue.state.nextUrl, actionQueue.state.tree, fetchStrategy, options?.onInvalidate ?? null);
|
||||
},
|
||||
replace: (href, options)=>{
|
||||
if (isJavaScriptURLString(href)) {
|
||||
throw Object.defineProperty(new Error('Next.js has blocked a javascript: URL as a security precaution.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E978",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
startTransition(()=>{
|
||||
dispatchNavigateAction(href, 'replace', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes);
|
||||
});
|
||||
},
|
||||
push: (href, options)=>{
|
||||
if (isJavaScriptURLString(href)) {
|
||||
throw Object.defineProperty(new Error('Next.js has blocked a javascript: URL as a security precaution.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E978",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
startTransition(()=>{
|
||||
dispatchNavigateAction(href, 'push', options?.scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default, null, options?.transitionTypes);
|
||||
});
|
||||
},
|
||||
refresh: ()=>{
|
||||
startTransition(()=>{
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_REFRESH
|
||||
});
|
||||
});
|
||||
},
|
||||
hmrRefresh: ()=>{
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
throw Object.defineProperty(new Error('hmrRefresh can only be used in development mode. Please use refresh instead.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E485",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else {
|
||||
// Reset the known routes table so that route predictions are cleared
|
||||
// when routes change during development.
|
||||
resetKnownRoutes();
|
||||
startTransition(()=>{
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_HMR_REFRESH
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
// Conditionally add experimental_gesturePush when gestureTransition is enabled
|
||||
if (process.env.__NEXT_GESTURE_TRANSITION) {
|
||||
;
|
||||
publicAppRouterInstance.experimental_gesturePush = gesturePush;
|
||||
}
|
||||
// Exists for debugging purposes. Don't use in application code.
|
||||
if (typeof window !== 'undefined' && window.next) {
|
||||
window.next.router = publicAppRouterInstance;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router-instance.js.map
|
||||
1
node_modules/next/dist/esm/client/components/app-router-instance.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/app-router-instance.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
40
node_modules/next/dist/esm/client/components/app-router-utils.js
generated
vendored
Normal file
40
node_modules/next/dist/esm/client/components/app-router-utils.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import { isBot } from '../../shared/lib/router/utils/is-bot';
|
||||
import { addBasePath } from '../add-base-path';
|
||||
export function isExternalURL(url) {
|
||||
return url.origin !== window.location.origin;
|
||||
}
|
||||
/**
|
||||
* Given a link href, constructs the URL that should be prefetched. Returns null
|
||||
* in cases where prefetching should be disabled, like external URLs, or
|
||||
* during development.
|
||||
* @param href The href passed to <Link>, router.prefetch(), or similar
|
||||
* @returns A URL object to prefetch, or null if prefetching should be disabled
|
||||
*/ export function createPrefetchURL(href) {
|
||||
// Don't prefetch for bots as they don't navigate.
|
||||
if (isBot(window.navigator.userAgent)) {
|
||||
return null;
|
||||
}
|
||||
let url;
|
||||
try {
|
||||
url = new URL(addBasePath(href), window.location.href);
|
||||
} catch (_) {
|
||||
// TODO: Does this need to throw or can we just console.error instead? Does
|
||||
// anyone rely on this throwing? (Seems unlikely.)
|
||||
throw Object.defineProperty(new Error(`Cannot prefetch '${href}' because it cannot be converted to a URL.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E234",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
// Don't prefetch during development (improves compilation performance)
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return null;
|
||||
}
|
||||
// External urls can't be prefetched in the same way.
|
||||
if (isExternalURL(url)) {
|
||||
return null;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router-utils.js.map
|
||||
1
node_modules/next/dist/esm/client/components/app-router-utils.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/app-router-utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/app-router-utils.ts"],"sourcesContent":["import { isBot } from '../../shared/lib/router/utils/is-bot'\nimport { addBasePath } from '../add-base-path'\n\nexport function isExternalURL(url: URL) {\n return url.origin !== window.location.origin\n}\n\n/**\n * Given a link href, constructs the URL that should be prefetched. Returns null\n * in cases where prefetching should be disabled, like external URLs, or\n * during development.\n * @param href The href passed to <Link>, router.prefetch(), or similar\n * @returns A URL object to prefetch, or null if prefetching should be disabled\n */\nexport function createPrefetchURL(href: string): URL | null {\n // Don't prefetch for bots as they don't navigate.\n if (isBot(window.navigator.userAgent)) {\n return null\n }\n\n let url: URL\n try {\n url = new URL(addBasePath(href), window.location.href)\n } catch (_) {\n // TODO: Does this need to throw or can we just console.error instead? Does\n // anyone rely on this throwing? (Seems unlikely.)\n throw new Error(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n }\n\n // Don't prefetch during development (improves compilation performance)\n if (process.env.NODE_ENV === 'development') {\n return null\n }\n\n // External urls can't be prefetched in the same way.\n if (isExternalURL(url)) {\n return null\n }\n\n return url\n}\n"],"names":["isBot","addBasePath","isExternalURL","url","origin","window","location","createPrefetchURL","href","navigator","userAgent","URL","_","Error","process","env","NODE_ENV"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uCAAsC;AAC5D,SAASC,WAAW,QAAQ,mBAAkB;AAE9C,OAAO,SAASC,cAAcC,GAAQ;IACpC,OAAOA,IAAIC,MAAM,KAAKC,OAAOC,QAAQ,CAACF,MAAM;AAC9C;AAEA;;;;;;CAMC,GACD,OAAO,SAASG,kBAAkBC,IAAY;IAC5C,kDAAkD;IAClD,IAAIR,MAAMK,OAAOI,SAAS,CAACC,SAAS,GAAG;QACrC,OAAO;IACT;IAEA,IAAIP;IACJ,IAAI;QACFA,MAAM,IAAIQ,IAAIV,YAAYO,OAAOH,OAAOC,QAAQ,CAACE,IAAI;IACvD,EAAE,OAAOI,GAAG;QACV,2EAA2E;QAC3E,kDAAkD;QAClD,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,iBAAiB,EAAEL,KAAK,0CAA0C,CAAC,GADhE,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,uEAAuE;IACvE,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;QAC1C,OAAO;IACT;IAEA,qDAAqD;IACrD,IAAId,cAAcC,MAAM;QACtB,OAAO;IACT;IAEA,OAAOA;AACT","ignoreList":[0]}
|
||||
496
node_modules/next/dist/esm/client/components/app-router.js
generated
vendored
Normal file
496
node_modules/next/dist/esm/client/components/app-router.js
generated
vendored
Normal file
@@ -0,0 +1,496 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import React, { useEffect, useMemo, startTransition, useInsertionEffect, useDeferredValue } from 'react';
|
||||
import { AppRouterContext, LayoutRouterContext, GlobalLayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { ACTION_RESTORE } from './router-reducer/router-reducer-types';
|
||||
import { createHrefFromUrl } from './router-reducer/create-href-from-url';
|
||||
import { SearchParamsContext, PathnameContext, PathParamsContext, NavigationPromisesContext } from '../../shared/lib/hooks-client-context.shared-runtime';
|
||||
import { dispatchAppRouterAction, useActionQueue } from './use-action-queue';
|
||||
import { setLastCommittedTree } from './router-reducer/reducers/committed-state';
|
||||
import { AppRouterAnnouncer } from './app-router-announcer';
|
||||
import { RedirectBoundary } from './redirect-boundary';
|
||||
import { findHeadInCache } from './router-reducer/reducers/find-head-in-cache';
|
||||
import { unresolvedThenable } from './unresolved-thenable';
|
||||
import { removeBasePath } from '../remove-base-path';
|
||||
import { hasBasePath } from '../has-base-path';
|
||||
import { extractSourcePageFromFlightRouterState, getSelectedParams } from './router-reducer/compute-changed-path';
|
||||
import { useNavFailureHandler } from './nav-failure-handler';
|
||||
import { dispatchTraverseAction, publicAppRouterInstance } from './app-router-instance';
|
||||
import { getRedirectTypeFromError, getURLFromRedirectError } from './redirect';
|
||||
import { isRedirectError } from './redirect-error';
|
||||
import { pingVisibleLinks } from './links';
|
||||
import RootErrorBoundary from './errors/root-error-boundary';
|
||||
import DefaultGlobalError from './builtin/global-error';
|
||||
import { RootLayoutBoundary } from '../../lib/framework/boundary-components';
|
||||
import { getAssetTokenQuery } from '../../shared/lib/deployment-id';
|
||||
const globalMutable = {};
|
||||
function HistoryUpdater({ appRouterState }) {
|
||||
useInsertionEffect(()=>{
|
||||
if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {
|
||||
// clear pending URL as navigation is no longer
|
||||
// in flight
|
||||
window.next.__pendingUrl = undefined;
|
||||
}
|
||||
const { tree, pushRef, canonicalUrl, renderedSearch } = appRouterState;
|
||||
const appHistoryState = {
|
||||
tree,
|
||||
renderedSearch
|
||||
};
|
||||
// TODO: Use Navigation API if available
|
||||
const historyState = {
|
||||
...pushRef.preserveCustomHistoryState ? window.history.state : {},
|
||||
// Identifier is shortened intentionally.
|
||||
// __NA is used to identify if the history entry can be handled by the app-router.
|
||||
// __N is used to identify if the history entry can be handled by the old router.
|
||||
__NA: true,
|
||||
__PRIVATE_NEXTJS_INTERNALS_TREE: appHistoryState
|
||||
};
|
||||
if (pushRef.pendingPush && // Skip pushing an additional history entry if the canonicalUrl is the same as the current url.
|
||||
// This mirrors the browser behavior for normal navigation.
|
||||
createHrefFromUrl(new URL(window.location.href)) !== canonicalUrl) {
|
||||
// This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.
|
||||
pushRef.pendingPush = false;
|
||||
window.history.pushState(historyState, '', canonicalUrl);
|
||||
} else {
|
||||
window.history.replaceState(historyState, '', canonicalUrl);
|
||||
}
|
||||
setLastCommittedTree(tree);
|
||||
}, [
|
||||
appRouterState
|
||||
]);
|
||||
useEffect(()=>{
|
||||
// The Next-Url and the base tree may affect the result of a prefetch
|
||||
// task. Re-prefetch all visible links with the updated values. In most
|
||||
// cases, this will not result in any new network requests, only if
|
||||
// the prefetch result actually varies on one of these inputs.
|
||||
pingVisibleLinks(appRouterState.nextUrl, appRouterState.tree);
|
||||
}, [
|
||||
appRouterState.nextUrl,
|
||||
appRouterState.tree
|
||||
]);
|
||||
return null;
|
||||
}
|
||||
function copyNextJsInternalHistoryState(data) {
|
||||
if (data == null) data = {};
|
||||
const currentState = window.history.state;
|
||||
const __NA = currentState?.__NA;
|
||||
if (__NA) {
|
||||
data.__NA = __NA;
|
||||
}
|
||||
const __PRIVATE_NEXTJS_INTERNALS_TREE = currentState?.__PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
if (__PRIVATE_NEXTJS_INTERNALS_TREE) {
|
||||
data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function Head({ headCacheNode }) {
|
||||
// If this segment has a `prefetchHead`, it's the statically prefetched data.
|
||||
// We should use that on initial render instead of `head`. Then we'll switch
|
||||
// to `head` when the dynamic response streams in.
|
||||
const head = headCacheNode !== null ? headCacheNode.head : null;
|
||||
const prefetchHead = headCacheNode !== null ? headCacheNode.prefetchHead : null;
|
||||
// If no prefetch data is available, then we go straight to rendering `head`.
|
||||
const resolvedPrefetchRsc = prefetchHead !== null ? prefetchHead : head;
|
||||
// We use `useDeferredValue` to handle switching between the prefetched and
|
||||
// final values. The second argument is returned on initial render, then it
|
||||
// re-renders with the first argument.
|
||||
return useDeferredValue(head, resolvedPrefetchRsc);
|
||||
}
|
||||
/**
|
||||
* The global router that wraps the application components.
|
||||
*/ function Router({ actionQueue, globalError, webSocket, staticIndicatorState }) {
|
||||
const state = useActionQueue(actionQueue);
|
||||
const { canonicalUrl } = state;
|
||||
// Add memoized pathname/query for useSearchParams and usePathname.
|
||||
const { searchParams, pathname } = useMemo(()=>{
|
||||
const url = new URL(canonicalUrl, typeof window === 'undefined' ? 'http://n' : window.location.href);
|
||||
return {
|
||||
// This is turned into a readonly class in `useSearchParams`
|
||||
searchParams: url.searchParams,
|
||||
pathname: hasBasePath(url.pathname) ? removeBasePath(url.pathname) : url.pathname
|
||||
};
|
||||
}, [
|
||||
canonicalUrl
|
||||
]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const { cache, tree } = state;
|
||||
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useEffect(()=>{
|
||||
// Add `window.nd` for debugging purposes.
|
||||
// This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.
|
||||
// @ts-ignore this is for debugging
|
||||
window.nd = {
|
||||
router: publicAppRouterInstance,
|
||||
cache,
|
||||
tree
|
||||
};
|
||||
}, [
|
||||
cache,
|
||||
tree
|
||||
]);
|
||||
}
|
||||
useEffect(()=>{
|
||||
const sourcePage = extractSourcePageFromFlightRouterState(state.tree);
|
||||
if (sourcePage !== undefined) {
|
||||
window.next.__internal_src_page = sourcePage;
|
||||
} else {
|
||||
delete window.next.__internal_src_page;
|
||||
}
|
||||
}, [
|
||||
state.tree
|
||||
]);
|
||||
useEffect(()=>{
|
||||
// If the app is restored from bfcache, it's possible that
|
||||
// pushRef.mpaNavigation is true, which would mean that any re-render of this component
|
||||
// would trigger the mpa navigation logic again from the lines below.
|
||||
// This will restore the router to the initial state in the event that the app is restored from bfcache.
|
||||
function handlePageShow(event) {
|
||||
if (!event.persisted || !window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE) {
|
||||
return;
|
||||
}
|
||||
// Clear the pendingMpaPath value so that a subsequent MPA navigation to the same URL can be triggered.
|
||||
// This is necessary because if the browser restored from bfcache, the pendingMpaPath would still be set to the value
|
||||
// of the last MPA navigation.
|
||||
globalMutable.pendingMpaPath = undefined;
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_RESTORE,
|
||||
url: new URL(window.location.href),
|
||||
historyState: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE
|
||||
});
|
||||
}
|
||||
window.addEventListener('pageshow', handlePageShow);
|
||||
return ()=>{
|
||||
window.removeEventListener('pageshow', handlePageShow);
|
||||
};
|
||||
}, []);
|
||||
useEffect(()=>{
|
||||
// Ensure that any redirect errors that bubble up outside of the RedirectBoundary
|
||||
// are caught and handled by the router.
|
||||
function handleUnhandledRedirect(event) {
|
||||
const error = 'reason' in event ? event.reason : event.error;
|
||||
if (isRedirectError(error)) {
|
||||
event.preventDefault();
|
||||
const url = getURLFromRedirectError(error);
|
||||
const redirectType = getRedirectTypeFromError(error);
|
||||
// TODO: This should access the router methods directly, rather than
|
||||
// go through the public interface.
|
||||
if (redirectType === 'push') {
|
||||
publicAppRouterInstance.push(url, {});
|
||||
} else {
|
||||
publicAppRouterInstance.replace(url, {});
|
||||
}
|
||||
}
|
||||
}
|
||||
window.addEventListener('error', handleUnhandledRedirect);
|
||||
window.addEventListener('unhandledrejection', handleUnhandledRedirect);
|
||||
return ()=>{
|
||||
window.removeEventListener('error', handleUnhandledRedirect);
|
||||
window.removeEventListener('unhandledrejection', handleUnhandledRedirect);
|
||||
};
|
||||
}, []);
|
||||
// When mpaNavigation flag is set do a hard navigation to the new url.
|
||||
// Infinitely suspend because we don't actually want to rerender any child
|
||||
// components with the new URL and any entangled state updates shouldn't
|
||||
// commit either (eg: useTransition isPending should stay true until the page
|
||||
// unloads).
|
||||
//
|
||||
// This is a side effect in render. Don't try this at home, kids. It's
|
||||
// probably safe because we know this is a singleton component and it's never
|
||||
// in <Offscreen>. At least I hope so. (It will run twice in dev strict mode,
|
||||
// but that's... fine?)
|
||||
const { pushRef } = state;
|
||||
if (pushRef.mpaNavigation) {
|
||||
// if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL
|
||||
if (globalMutable.pendingMpaPath !== canonicalUrl) {
|
||||
const location = window.location;
|
||||
if (pushRef.pendingPush) {
|
||||
location.assign(canonicalUrl);
|
||||
} else {
|
||||
location.replace(canonicalUrl);
|
||||
}
|
||||
globalMutable.pendingMpaPath = canonicalUrl;
|
||||
}
|
||||
// TODO-APP: Should we listen to navigateerror here to catch failed
|
||||
// navigations somehow? And should we call window.stop() if a SPA navigation
|
||||
// should interrupt an MPA one?
|
||||
// NOTE: This is intentionally using `throw` instead of `use` because we're
|
||||
// inside an externally mutable condition (pushRef.mpaNavigation), which
|
||||
// violates the rules of hooks.
|
||||
throw unresolvedThenable;
|
||||
}
|
||||
useEffect(()=>{
|
||||
const originalPushState = window.history.pushState.bind(window.history);
|
||||
const originalReplaceState = window.history.replaceState.bind(window.history);
|
||||
// Ensure the canonical URL in the Next.js Router is updated when the URL is changed so that `usePathname` and `useSearchParams` hold the pushed values.
|
||||
const applyUrlFromHistoryPushReplace = (url)=>{
|
||||
const href = window.location.href;
|
||||
const appHistoryState = window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
startTransition(()=>{
|
||||
dispatchAppRouterAction({
|
||||
type: ACTION_RESTORE,
|
||||
url: new URL(url ?? href, href),
|
||||
historyState: appHistoryState
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Patch pushState to ensure external changes to the history are reflected in the Next.js Router.
|
||||
* Ensures Next.js internal history state is copied to the new history entry.
|
||||
* Ensures usePathname and useSearchParams hold the newly provided url.
|
||||
*/ window.history.pushState = function pushState(data, _unused, url) {
|
||||
// TODO: Warn when Navigation API is available (navigation.navigate() should be used)
|
||||
// Avoid a loop when Next.js internals trigger pushState/replaceState
|
||||
if (data?.__NA || data?._N) {
|
||||
return originalPushState(data, _unused, url);
|
||||
}
|
||||
data = copyNextJsInternalHistoryState(data);
|
||||
if (url) {
|
||||
applyUrlFromHistoryPushReplace(url);
|
||||
}
|
||||
return originalPushState(data, _unused, url);
|
||||
};
|
||||
/**
|
||||
* Patch replaceState to ensure external changes to the history are reflected in the Next.js Router.
|
||||
* Ensures Next.js internal history state is copied to the new history entry.
|
||||
* Ensures usePathname and useSearchParams hold the newly provided url.
|
||||
*/ window.history.replaceState = function replaceState(data, _unused, url) {
|
||||
// TODO: Warn when Navigation API is available (navigation.navigate() should be used)
|
||||
// Avoid a loop when Next.js internals trigger pushState/replaceState
|
||||
if (data?.__NA || data?._N) {
|
||||
return originalReplaceState(data, _unused, url);
|
||||
}
|
||||
data = copyNextJsInternalHistoryState(data);
|
||||
if (url) {
|
||||
applyUrlFromHistoryPushReplace(url);
|
||||
}
|
||||
return originalReplaceState(data, _unused, url);
|
||||
};
|
||||
/**
|
||||
* Handle popstate event, this is used to handle back/forward in the browser.
|
||||
* By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.
|
||||
* That case can happen when the old router injected the history entry.
|
||||
*/ const onPopState = (event)=>{
|
||||
if (!event.state) {
|
||||
// TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.
|
||||
return;
|
||||
}
|
||||
// This case happens when the history entry was pushed by the `pages` router.
|
||||
if (!event.state.__NA) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
// TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously
|
||||
// Without startTransition works if the cache is there for this path
|
||||
startTransition(()=>{
|
||||
dispatchTraverseAction(window.location.href, event.state.__PRIVATE_NEXTJS_INTERNALS_TREE);
|
||||
});
|
||||
};
|
||||
// Register popstate event to call onPopstate.
|
||||
window.addEventListener('popstate', onPopState);
|
||||
return ()=>{
|
||||
window.history.pushState = originalPushState;
|
||||
window.history.replaceState = originalReplaceState;
|
||||
window.removeEventListener('popstate', onPopState);
|
||||
};
|
||||
}, []);
|
||||
const { cache, tree, nextUrl, focusAndScrollRef, previousNextUrl } = state;
|
||||
const matchingHead = useMemo(()=>{
|
||||
return findHeadInCache(cache, tree[1]);
|
||||
}, [
|
||||
cache,
|
||||
tree
|
||||
]);
|
||||
// Add memoized pathParams for useParams.
|
||||
const pathParams = useMemo(()=>{
|
||||
return getSelectedParams(tree);
|
||||
}, [
|
||||
tree
|
||||
]);
|
||||
// Create instrumented promises for navigation hooks (dev-only)
|
||||
// These are specially instrumented promises to show in the Suspense DevTools
|
||||
// Promises are cached outside of render to survive suspense retries.
|
||||
let instrumentedNavigationPromises = null;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const { createRootNavigationPromises } = require('./navigation-devtools');
|
||||
instrumentedNavigationPromises = createRootNavigationPromises(tree, pathname, searchParams, pathParams);
|
||||
}
|
||||
const layoutRouterContext = useMemo(()=>{
|
||||
return {
|
||||
parentTree: tree,
|
||||
parentCacheNode: cache,
|
||||
parentSegmentPath: null,
|
||||
parentParams: {},
|
||||
parentLoadingData: null,
|
||||
// This is the <Activity> "name" that shows up in the Suspense DevTools.
|
||||
// It represents the root of the app.
|
||||
debugNameContext: '/',
|
||||
// Root node always has `url`
|
||||
// Provided in AppTreeContext to ensure it can be overwritten in layout-router
|
||||
url: canonicalUrl,
|
||||
// Root segment is always active
|
||||
isActive: true
|
||||
};
|
||||
}, [
|
||||
tree,
|
||||
cache,
|
||||
canonicalUrl
|
||||
]);
|
||||
const globalLayoutRouterContext = useMemo(()=>{
|
||||
return {
|
||||
tree,
|
||||
focusAndScrollRef,
|
||||
nextUrl,
|
||||
previousNextUrl
|
||||
};
|
||||
}, [
|
||||
tree,
|
||||
focusAndScrollRef,
|
||||
nextUrl,
|
||||
previousNextUrl
|
||||
]);
|
||||
let head;
|
||||
if (matchingHead !== null) {
|
||||
// The head is wrapped in an extra component so we can use
|
||||
// `useDeferredValue` to swap between the prefetched and final versions of
|
||||
// the head. (This is what LayoutRouter does for segment data, too.)
|
||||
//
|
||||
// The `key` is used to remount the component whenever the head moves to
|
||||
// a different segment.
|
||||
const [headCacheNode, headKey, headKeyWithoutSearchParams] = matchingHead;
|
||||
head = /*#__PURE__*/ _jsx(Head, {
|
||||
headCacheNode: headCacheNode
|
||||
}, // Necessary for PPR: omit search params from the key to match prerendered keys
|
||||
typeof window === 'undefined' ? headKeyWithoutSearchParams : headKey);
|
||||
} else {
|
||||
head = null;
|
||||
}
|
||||
let content = /*#__PURE__*/ _jsxs(RedirectBoundary, {
|
||||
children: [
|
||||
head,
|
||||
/*#__PURE__*/ _jsx(RootLayoutBoundary, {
|
||||
children: cache.rsc
|
||||
}),
|
||||
/*#__PURE__*/ _jsx(AppRouterAnnouncer, {
|
||||
tree: tree
|
||||
})
|
||||
]
|
||||
});
|
||||
if (process.env.__NEXT_DEV_SERVER) {
|
||||
// In development, we apply few error boundaries and hot-reloader:
|
||||
// - DevRootHTTPAccessFallbackBoundary: avoid using navigation API like notFound() in root layout
|
||||
// - HotReloader:
|
||||
// - hot-reload the app when the code changes
|
||||
// - render dev overlay
|
||||
// - catch runtime errors and display global-error when necessary
|
||||
if (typeof window !== 'undefined') {
|
||||
const { DevRootHTTPAccessFallbackBoundary } = require('./dev-root-http-access-fallback-boundary');
|
||||
content = /*#__PURE__*/ _jsx(DevRootHTTPAccessFallbackBoundary, {
|
||||
children: content
|
||||
});
|
||||
}
|
||||
const HotReloader = require('../dev/hot-reloader/app/hot-reloader-app').default;
|
||||
content = /*#__PURE__*/ _jsx(HotReloader, {
|
||||
globalError: globalError,
|
||||
webSocket: webSocket,
|
||||
staticIndicatorState: staticIndicatorState,
|
||||
children: content
|
||||
});
|
||||
} else {
|
||||
content = /*#__PURE__*/ _jsx(RootErrorBoundary, {
|
||||
errorComponent: globalError[0],
|
||||
errorStyles: globalError[1],
|
||||
children: content
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsxs(_Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx(HistoryUpdater, {
|
||||
appRouterState: state
|
||||
}),
|
||||
process.env.TURBOPACK ? null : /*#__PURE__*/ _jsx(RuntimeStylesForWebpack, {}),
|
||||
/*#__PURE__*/ _jsx(NavigationPromisesContext.Provider, {
|
||||
value: instrumentedNavigationPromises,
|
||||
children: /*#__PURE__*/ _jsx(PathParamsContext.Provider, {
|
||||
value: pathParams,
|
||||
children: /*#__PURE__*/ _jsx(PathnameContext.Provider, {
|
||||
value: pathname,
|
||||
children: /*#__PURE__*/ _jsx(SearchParamsContext.Provider, {
|
||||
value: searchParams,
|
||||
children: /*#__PURE__*/ _jsx(GlobalLayoutRouterContext.Provider, {
|
||||
value: globalLayoutRouterContext,
|
||||
children: /*#__PURE__*/ _jsx(AppRouterContext.Provider, {
|
||||
value: publicAppRouterInstance,
|
||||
children: /*#__PURE__*/ _jsx(LayoutRouterContext.Provider, {
|
||||
value: layoutRouterContext,
|
||||
children: content
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
export default function AppRouter({ actionQueue, globalErrorState, webSocket, staticIndicatorState }) {
|
||||
useNavFailureHandler();
|
||||
const router = /*#__PURE__*/ _jsx(Router, {
|
||||
actionQueue: actionQueue,
|
||||
globalError: globalErrorState,
|
||||
webSocket: webSocket,
|
||||
staticIndicatorState: staticIndicatorState
|
||||
});
|
||||
// At the very top level, use the default GlobalError component as the final fallback.
|
||||
// When the app router itself fails, which means the framework itself fails, we show the default error.
|
||||
return /*#__PURE__*/ _jsx(RootErrorBoundary, {
|
||||
errorComponent: DefaultGlobalError,
|
||||
children: router
|
||||
});
|
||||
}
|
||||
let runtimeStyles;
|
||||
let runtimeStyleChanged;
|
||||
if (!process.env.TURBOPACK && typeof window !== 'undefined') {
|
||||
runtimeStyles = new Set();
|
||||
runtimeStyleChanged = new Set();
|
||||
globalThis._N_E_STYLE_LOAD = function(href) {
|
||||
if (!runtimeStyles || !runtimeStyleChanged) return Promise.resolve();
|
||||
let len = runtimeStyles.size;
|
||||
runtimeStyles.add(href);
|
||||
if (runtimeStyles.size !== len) {
|
||||
runtimeStyleChanged.forEach((cb)=>cb());
|
||||
}
|
||||
// TODO figure out how to get a promise here
|
||||
// But maybe it's not necessary as react would block rendering until it's loaded
|
||||
return Promise.resolve();
|
||||
};
|
||||
}
|
||||
function RuntimeStylesForWebpack() {
|
||||
const [, forceUpdate] = React.useState(0);
|
||||
const renderedStylesSize = runtimeStyles?.size ?? 0;
|
||||
useEffect(()=>{
|
||||
if (!runtimeStyles || !runtimeStyleChanged) return;
|
||||
const changed = ()=>forceUpdate((c)=>c + 1);
|
||||
runtimeStyleChanged.add(changed);
|
||||
if (renderedStylesSize !== runtimeStyles.size) {
|
||||
changed();
|
||||
}
|
||||
return ()=>{
|
||||
runtimeStyleChanged.delete(changed);
|
||||
};
|
||||
}, [
|
||||
renderedStylesSize,
|
||||
forceUpdate
|
||||
]);
|
||||
const query = getAssetTokenQuery();
|
||||
return [
|
||||
...runtimeStyles || []
|
||||
].map((href, i)=>/*#__PURE__*/ _jsx("link", {
|
||||
rel: "stylesheet",
|
||||
href: `${href}${query}`,
|
||||
// @ts-ignore
|
||||
precedence: "next"
|
||||
}, i));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router.js.map
|
||||
1
node_modules/next/dist/esm/client/components/app-router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/app-router.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
96
node_modules/next/dist/esm/client/components/bfcache-state-manager.js
generated
vendored
Normal file
96
node_modules/next/dist/esm/client/components/bfcache-state-manager.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
import { useState } from 'react';
|
||||
// When the flag is disabled, only track the currently active tree
|
||||
const MAX_BF_CACHE_ENTRIES = process.env.__NEXT_CACHE_COMPONENTS ? 3 : 1;
|
||||
/**
|
||||
* Keeps track of the most recent N trees (FlightRouterStates) that were active
|
||||
* at a certain segment level. E.g. for a segment "/a/b/[param]", this hook
|
||||
* tracks the last N param values that the router rendered for N.
|
||||
*
|
||||
* The result of this hook precisely determines the number and order of
|
||||
* trees that are rendered in parallel at their segment level.
|
||||
*
|
||||
* The purpose of this cache is to we can preserve the React and DOM state of
|
||||
* some number of inactive trees, by rendering them in an <Activity> boundary.
|
||||
* That means it would not make sense for the the lifetime of the cache to be
|
||||
* any longer than the lifetime of the React tree; e.g. if the hook were
|
||||
* unmounted, then the React tree would be, too. So, we use React state to
|
||||
* manage it.
|
||||
*
|
||||
* Note that we don't store the RSC data for the cache entries in this hook —
|
||||
* the data for inactive segments is stored in the parent CacheNode, which
|
||||
* *does* have a longer lifetime than the React tree. This hook only determines
|
||||
* which of those trees should have their *state* preserved, by <Activity>.
|
||||
*/ export function useRouterBFCache(activeTree, activeCacheNode, activeStateKey) {
|
||||
// The currently active entry. The entries form a linked list, sorted in
|
||||
// order of most recently active. This allows us to reuse parts of the list
|
||||
// without cloning, unless there's a reordering or removal.
|
||||
// TODO: Once we start tracking back/forward history at each route level,
|
||||
// we should use the history order instead. In other words, when traversing
|
||||
// to an existing entry as a result of a popstate event, we should maintain
|
||||
// the existing order instead of moving it to the front of the list. I think
|
||||
// an initial implementation of this could be to pass an incrementing id
|
||||
// to history.pushState/replaceState, then use that here for ordering.
|
||||
const [prevActiveEntry, setPrevActiveEntry] = useState(()=>{
|
||||
const initialEntry = {
|
||||
tree: activeTree,
|
||||
cacheNode: activeCacheNode,
|
||||
stateKey: activeStateKey,
|
||||
next: null
|
||||
};
|
||||
return initialEntry;
|
||||
});
|
||||
if (prevActiveEntry.tree === activeTree) {
|
||||
// Fast path. The active tree hasn't changed, so we can reuse the
|
||||
// existing state.
|
||||
return prevActiveEntry;
|
||||
}
|
||||
// The route tree changed. Note that this doesn't mean that the tree changed
|
||||
// *at this level* — the change may be due to a child route. Either way, we
|
||||
// need to either add or update the router tree in the bfcache.
|
||||
//
|
||||
// The rest of the code looks more complicated than it actually is because we
|
||||
// can't mutate the state in place; we have to copy-on-write.
|
||||
// Create a new entry for the active cache key. This is the head of the new
|
||||
// linked list.
|
||||
const newActiveEntry = {
|
||||
tree: activeTree,
|
||||
cacheNode: activeCacheNode,
|
||||
stateKey: activeStateKey,
|
||||
next: null
|
||||
};
|
||||
// We need to append the old list onto the new list. If the head of the new
|
||||
// list was already present in the cache, then we'll need to clone everything
|
||||
// that came before it. Then we can reuse the rest.
|
||||
let n = 1;
|
||||
let oldEntry = prevActiveEntry;
|
||||
let clonedEntry = newActiveEntry;
|
||||
while(oldEntry !== null && n < MAX_BF_CACHE_ENTRIES){
|
||||
if (oldEntry.stateKey === activeStateKey) {
|
||||
// Fast path. This entry in the old list that corresponds to the key that
|
||||
// is now active. We've already placed a clone of this entry at the front
|
||||
// of the new list. We can reuse the rest of the old list without cloning.
|
||||
// NOTE: We don't need to worry about eviction in this case because we
|
||||
// haven't increased the size of the cache, and we assume the max size
|
||||
// is constant across renders. If we were to change it to a dynamic limit,
|
||||
// then the implementation would need to account for that.
|
||||
clonedEntry.next = oldEntry.next;
|
||||
break;
|
||||
} else {
|
||||
// Clone the entry and append it to the list.
|
||||
n++;
|
||||
const entry = {
|
||||
tree: oldEntry.tree,
|
||||
cacheNode: oldEntry.cacheNode,
|
||||
stateKey: oldEntry.stateKey,
|
||||
next: null
|
||||
};
|
||||
clonedEntry.next = entry;
|
||||
clonedEntry = entry;
|
||||
}
|
||||
oldEntry = oldEntry.next;
|
||||
}
|
||||
setPrevActiveEntry(newActiveEntry);
|
||||
return newActiveEntry;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=bfcache-state-manager.js.map
|
||||
1
node_modules/next/dist/esm/client/components/bfcache-state-manager.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/bfcache-state-manager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
54
node_modules/next/dist/esm/client/components/builtin/app-error.js
generated
vendored
Normal file
54
node_modules/next/dist/esm/client/components/builtin/app-error.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
import { errorStyles, errorThemeCss, WarningIcon } from './error-styles';
|
||||
// This is the static 500.html page for App Router apps.
|
||||
// Always a server error, rendered at build time.
|
||||
function AppError() {
|
||||
return /*#__PURE__*/ _jsxs("html", {
|
||||
id: "__next_error__",
|
||||
children: [
|
||||
/*#__PURE__*/ _jsxs("head", {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("title", {
|
||||
children: "500: This page couldn’t load"
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("style", {
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: errorThemeCss
|
||||
}
|
||||
})
|
||||
]
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("body", {
|
||||
children: /*#__PURE__*/ _jsx("div", {
|
||||
style: errorStyles.container,
|
||||
children: /*#__PURE__*/ _jsxs("div", {
|
||||
style: errorStyles.card,
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx(WarningIcon, {}),
|
||||
/*#__PURE__*/ _jsx("h1", {
|
||||
style: errorStyles.title,
|
||||
children: "This page couldn’t load"
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("p", {
|
||||
style: errorStyles.message,
|
||||
children: "A server error occurred. Reload to try again."
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("form", {
|
||||
style: errorStyles.form,
|
||||
children: /*#__PURE__*/ _jsx("button", {
|
||||
type: "submit",
|
||||
style: errorStyles.button,
|
||||
children: "Reload"
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
export default AppError;
|
||||
|
||||
//# sourceMappingURL=app-error.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/app-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/app-error.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/app-error.tsx"],"sourcesContent":["import React from 'react'\nimport { errorStyles, errorThemeCss, WarningIcon } from './error-styles'\n\n// This is the static 500.html page for App Router apps.\n// Always a server error, rendered at build time.\nfunction AppError() {\n return (\n <html id=\"__next_error__\">\n <head>\n <title>500: This page couldn’t load</title>\n <style dangerouslySetInnerHTML={{ __html: errorThemeCss }} />\n </head>\n <body>\n <div style={errorStyles.container}>\n <div style={errorStyles.card}>\n <WarningIcon />\n <h1 style={errorStyles.title}>This page couldn’t load</h1>\n <p style={errorStyles.message}>\n A server error occurred. Reload to try again.\n </p>\n <form style={errorStyles.form}>\n <button type=\"submit\" style={errorStyles.button}>\n Reload\n </button>\n </form>\n </div>\n </div>\n </body>\n </html>\n )\n}\n\nexport default AppError\n"],"names":["React","errorStyles","errorThemeCss","WarningIcon","AppError","html","id","head","title","style","dangerouslySetInnerHTML","__html","body","div","container","card","h1","p","message","form","button","type"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AACzB,SAASC,WAAW,EAAEC,aAAa,EAAEC,WAAW,QAAQ,iBAAgB;AAExE,wDAAwD;AACxD,iDAAiD;AACjD,SAASC;IACP,qBACE,MAACC;QAAKC,IAAG;;0BACP,MAACC;;kCACC,KAACC;kCAAM;;kCACP,KAACC;wBAAMC,yBAAyB;4BAAEC,QAAQT;wBAAc;;;;0BAE1D,KAACU;0BACC,cAAA,KAACC;oBAAIJ,OAAOR,YAAYa,SAAS;8BAC/B,cAAA,MAACD;wBAAIJ,OAAOR,YAAYc,IAAI;;0CAC1B,KAACZ;0CACD,KAACa;gCAAGP,OAAOR,YAAYO,KAAK;0CAAE;;0CAC9B,KAACS;gCAAER,OAAOR,YAAYiB,OAAO;0CAAE;;0CAG/B,KAACC;gCAAKV,OAAOR,YAAYkB,IAAI;0CAC3B,cAAA,KAACC;oCAAOC,MAAK;oCAASZ,OAAOR,YAAYmB,MAAM;8CAAE;;;;;;;;;AAS/D;AAEA,eAAehB,SAAQ","ignoreList":[0]}
|
||||
6
node_modules/next/dist/esm/client/components/builtin/default-null.js
generated
vendored
Normal file
6
node_modules/next/dist/esm/client/components/builtin/default-null.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export const PARALLEL_ROUTE_DEFAULT_NULL_PATH = 'next/dist/client/components/builtin/default-null.js';
|
||||
export default function ParallelRouteDefaultNull() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=default-null.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/default-null.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/default-null.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/default-null.tsx"],"sourcesContent":["export const PARALLEL_ROUTE_DEFAULT_NULL_PATH =\n 'next/dist/client/components/builtin/default-null.js'\n\nexport default function ParallelRouteDefaultNull() {\n return null\n}\n"],"names":["PARALLEL_ROUTE_DEFAULT_NULL_PATH","ParallelRouteDefaultNull"],"mappings":"AAAA,OAAO,MAAMA,mCACX,sDAAqD;AAEvD,eAAe,SAASC;IACtB,OAAO;AACT","ignoreList":[0]}
|
||||
7
node_modules/next/dist/esm/client/components/builtin/default.js
generated
vendored
Normal file
7
node_modules/next/dist/esm/client/components/builtin/default.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { notFound } from '../not-found';
|
||||
export const PARALLEL_ROUTE_DEFAULT_PATH = 'next/dist/client/components/builtin/default.js';
|
||||
export default function ParallelRouteDefault() {
|
||||
notFound();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=default.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/default.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/default.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/default.tsx"],"sourcesContent":["import { notFound } from '../not-found'\n\nexport const PARALLEL_ROUTE_DEFAULT_PATH =\n 'next/dist/client/components/builtin/default.js'\n\nexport default function ParallelRouteDefault() {\n notFound()\n}\n"],"names":["notFound","PARALLEL_ROUTE_DEFAULT_PATH","ParallelRouteDefault"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,eAAc;AAEvC,OAAO,MAAMC,8BACX,iDAAgD;AAElD,eAAe,SAASC;IACtBF;AACF","ignoreList":[0]}
|
||||
5
node_modules/next/dist/esm/client/components/builtin/empty-stub.js
generated
vendored
Normal file
5
node_modules/next/dist/esm/client/components/builtin/empty-stub.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function Empty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=empty-stub.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/empty-stub.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/empty-stub.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/empty-stub.tsx"],"sourcesContent":["export default function Empty() {\n return null\n}\n"],"names":["Empty"],"mappings":"AAAA,eAAe,SAASA;IACtB,OAAO;AACT","ignoreList":[0]}
|
||||
132
node_modules/next/dist/esm/client/components/builtin/error-styles.js
generated
vendored
Normal file
132
node_modules/next/dist/esm/client/components/builtin/error-styles.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
export const errorStyles = {
|
||||
container: {
|
||||
fontFamily: 'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',
|
||||
height: '100vh',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
},
|
||||
card: {
|
||||
marginTop: '-32px',
|
||||
maxWidth: '325px',
|
||||
padding: '32px 28px',
|
||||
textAlign: 'left'
|
||||
},
|
||||
icon: {
|
||||
marginBottom: '24px'
|
||||
},
|
||||
title: {
|
||||
fontSize: '24px',
|
||||
fontWeight: 500,
|
||||
letterSpacing: '-0.02em',
|
||||
lineHeight: '32px',
|
||||
margin: '0 0 12px 0',
|
||||
color: 'var(--next-error-title)'
|
||||
},
|
||||
message: {
|
||||
fontSize: '14px',
|
||||
fontWeight: 400,
|
||||
lineHeight: '21px',
|
||||
margin: '0 0 20px 0',
|
||||
color: 'var(--next-error-message)'
|
||||
},
|
||||
form: {
|
||||
margin: 0
|
||||
},
|
||||
buttonGroup: {
|
||||
display: 'flex',
|
||||
gap: '8px',
|
||||
alignItems: 'center'
|
||||
},
|
||||
button: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: '32px',
|
||||
padding: '0 12px',
|
||||
fontSize: '14px',
|
||||
fontWeight: 500,
|
||||
lineHeight: '20px',
|
||||
borderRadius: '6px',
|
||||
cursor: 'pointer',
|
||||
color: 'var(--next-error-btn-text)',
|
||||
background: 'var(--next-error-btn-bg)',
|
||||
border: 'var(--next-error-btn-border)'
|
||||
},
|
||||
buttonSecondary: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: '32px',
|
||||
padding: '0 12px',
|
||||
fontSize: '14px',
|
||||
fontWeight: 500,
|
||||
lineHeight: '20px',
|
||||
borderRadius: '6px',
|
||||
cursor: 'pointer',
|
||||
color: 'var(--next-error-btn-secondary-text)',
|
||||
background: 'var(--next-error-btn-secondary-bg)',
|
||||
border: 'var(--next-error-btn-secondary-border)'
|
||||
},
|
||||
digestFooter: {
|
||||
position: 'fixed',
|
||||
bottom: '32px',
|
||||
left: '0',
|
||||
right: '0',
|
||||
textAlign: 'center',
|
||||
fontFamily: 'ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace',
|
||||
fontSize: '12px',
|
||||
lineHeight: '18px',
|
||||
fontWeight: 400,
|
||||
margin: '0',
|
||||
color: 'var(--next-error-digest)'
|
||||
}
|
||||
};
|
||||
export const errorThemeCss = `
|
||||
:root {
|
||||
--next-error-bg: #fff;
|
||||
--next-error-text: #171717;
|
||||
--next-error-title: #171717;
|
||||
--next-error-message: #171717;
|
||||
--next-error-digest: #666666;
|
||||
--next-error-btn-text: #fff;
|
||||
--next-error-btn-bg: #171717;
|
||||
--next-error-btn-border: none;
|
||||
--next-error-btn-secondary-text: #171717;
|
||||
--next-error-btn-secondary-bg: transparent;
|
||||
--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--next-error-bg: #0a0a0a;
|
||||
--next-error-text: #ededed;
|
||||
--next-error-title: #ededed;
|
||||
--next-error-message: #ededed;
|
||||
--next-error-digest: #a0a0a0;
|
||||
--next-error-btn-text: #0a0a0a;
|
||||
--next-error-btn-bg: #ededed;
|
||||
--next-error-btn-border: none;
|
||||
--next-error-btn-secondary-text: #ededed;
|
||||
--next-error-btn-secondary-bg: transparent;
|
||||
--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);
|
||||
}
|
||||
}
|
||||
body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }
|
||||
`.replace(/\n\s*/g, '');
|
||||
export function WarningIcon() {
|
||||
return /*#__PURE__*/ _jsx("svg", {
|
||||
width: "32",
|
||||
height: "32",
|
||||
viewBox: "-0.2 -1.5 32 32",
|
||||
fill: "none",
|
||||
style: errorStyles.icon,
|
||||
children: /*#__PURE__*/ _jsx("path", {
|
||||
d: "M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z",
|
||||
fill: "var(--next-error-title)"
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=error-styles.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/error-styles.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/error-styles.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/next/dist/esm/client/components/builtin/forbidden.js
generated
vendored
Normal file
10
node_modules/next/dist/esm/client/components/builtin/forbidden.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback';
|
||||
export default function Forbidden() {
|
||||
return /*#__PURE__*/ _jsx(HTTPAccessErrorFallback, {
|
||||
status: 403,
|
||||
message: "This page could not be accessed."
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=forbidden.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/forbidden.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/forbidden.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/forbidden.tsx"],"sourcesContent":["import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback'\n\nexport default function Forbidden() {\n return (\n <HTTPAccessErrorFallback\n status={403}\n message=\"This page could not be accessed.\"\n />\n )\n}\n"],"names":["HTTPAccessErrorFallback","Forbidden","status","message"],"mappings":";AAAA,SAASA,uBAAuB,QAAQ,yCAAwC;AAEhF,eAAe,SAASC;IACtB,qBACE,KAACD;QACCE,QAAQ;QACRC,SAAQ;;AAGd","ignoreList":[0]}
|
||||
83
node_modules/next/dist/esm/client/components/builtin/global-error.js
generated
vendored
Normal file
83
node_modules/next/dist/esm/client/components/builtin/global-error.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
'use client';
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
import { handleISRError } from '../handle-isr-error';
|
||||
import { errorStyles, errorThemeCss, WarningIcon } from './error-styles';
|
||||
function DefaultGlobalError({ error }) {
|
||||
const digest = error?.digest;
|
||||
const isServerError = !!digest;
|
||||
const message = isServerError ? 'A server error occurred. Reload to try again.' : 'Reload to try again, or go back.';
|
||||
handleISRError({
|
||||
error
|
||||
});
|
||||
return /*#__PURE__*/ _jsxs("html", {
|
||||
id: "__next_error__",
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("head", {
|
||||
children: /*#__PURE__*/ _jsx("style", {
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: errorThemeCss
|
||||
}
|
||||
})
|
||||
}),
|
||||
/*#__PURE__*/ _jsxs("body", {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("div", {
|
||||
style: errorStyles.container,
|
||||
children: /*#__PURE__*/ _jsxs("div", {
|
||||
style: errorStyles.card,
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx(WarningIcon, {}),
|
||||
/*#__PURE__*/ _jsx("h1", {
|
||||
style: errorStyles.title,
|
||||
children: "This page couldn’t load"
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("p", {
|
||||
style: errorStyles.message,
|
||||
children: message
|
||||
}),
|
||||
/*#__PURE__*/ _jsxs("div", {
|
||||
style: errorStyles.buttonGroup,
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("form", {
|
||||
style: errorStyles.form,
|
||||
children: /*#__PURE__*/ _jsx("button", {
|
||||
type: "submit",
|
||||
style: errorStyles.button,
|
||||
children: "Reload"
|
||||
})
|
||||
}),
|
||||
!isServerError && /*#__PURE__*/ _jsx("button", {
|
||||
type: "button",
|
||||
style: errorStyles.buttonSecondary,
|
||||
onClick: ()=>{
|
||||
if (window.history.length > 1) {
|
||||
window.history.back();
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
},
|
||||
children: "Back"
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
}),
|
||||
digest && /*#__PURE__*/ _jsxs("p", {
|
||||
style: errorStyles.digestFooter,
|
||||
children: [
|
||||
"ERROR ",
|
||||
digest
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
// Exported so that the import signature in the loaders can be identical to user
|
||||
// supplied custom global error signatures.
|
||||
export default DefaultGlobalError;
|
||||
|
||||
//# sourceMappingURL=global-error.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/global-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/global-error.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/global-error.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport { handleISRError } from '../handle-isr-error'\nimport { errorStyles, errorThemeCss, WarningIcon } from './error-styles'\n\nexport type GlobalErrorComponent = React.ComponentType<{\n error: any\n reset: () => void\n unstable_retry: () => void\n}>\n\nfunction DefaultGlobalError({ error }: { error: any }) {\n const digest: string | undefined = error?.digest\n const isServerError = !!digest\n\n const message = isServerError\n ? 'A server error occurred. Reload to try again.'\n : 'Reload to try again, or go back.'\n\n handleISRError({ error })\n\n return (\n <html id=\"__next_error__\">\n <head>\n <style dangerouslySetInnerHTML={{ __html: errorThemeCss }} />\n </head>\n <body>\n <div style={errorStyles.container}>\n <div style={errorStyles.card}>\n <WarningIcon />\n <h1 style={errorStyles.title}>This page couldn’t load</h1>\n <p style={errorStyles.message}>{message}</p>\n <div style={errorStyles.buttonGroup}>\n <form style={errorStyles.form}>\n <button type=\"submit\" style={errorStyles.button}>\n Reload\n </button>\n </form>\n {!isServerError && (\n <button\n type=\"button\"\n style={errorStyles.buttonSecondary}\n onClick={() => {\n if (window.history.length > 1) {\n window.history.back()\n } else {\n window.location.href = '/'\n }\n }}\n >\n Back\n </button>\n )}\n </div>\n </div>\n </div>\n {digest && <p style={errorStyles.digestFooter}>ERROR {digest}</p>}\n </body>\n </html>\n )\n}\n\n// Exported so that the import signature in the loaders can be identical to user\n// supplied custom global error signatures.\nexport default DefaultGlobalError\n"],"names":["React","handleISRError","errorStyles","errorThemeCss","WarningIcon","DefaultGlobalError","error","digest","isServerError","message","html","id","head","style","dangerouslySetInnerHTML","__html","body","div","container","card","h1","title","p","buttonGroup","form","button","type","buttonSecondary","onClick","window","history","length","back","location","href","digestFooter"],"mappings":"AAAA;;AAEA,OAAOA,WAAW,QAAO;AACzB,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,WAAW,EAAEC,aAAa,EAAEC,WAAW,QAAQ,iBAAgB;AAQxE,SAASC,mBAAmB,EAAEC,KAAK,EAAkB;IACnD,MAAMC,SAA6BD,OAAOC;IAC1C,MAAMC,gBAAgB,CAAC,CAACD;IAExB,MAAME,UAAUD,gBACZ,kDACA;IAEJP,eAAe;QAAEK;IAAM;IAEvB,qBACE,MAACI;QAAKC,IAAG;;0BACP,KAACC;0BACC,cAAA,KAACC;oBAAMC,yBAAyB;wBAAEC,QAAQZ;oBAAc;;;0BAE1D,MAACa;;kCACC,KAACC;wBAAIJ,OAAOX,YAAYgB,SAAS;kCAC/B,cAAA,MAACD;4BAAIJ,OAAOX,YAAYiB,IAAI;;8CAC1B,KAACf;8CACD,KAACgB;oCAAGP,OAAOX,YAAYmB,KAAK;8CAAE;;8CAC9B,KAACC;oCAAET,OAAOX,YAAYO,OAAO;8CAAGA;;8CAChC,MAACQ;oCAAIJ,OAAOX,YAAYqB,WAAW;;sDACjC,KAACC;4CAAKX,OAAOX,YAAYsB,IAAI;sDAC3B,cAAA,KAACC;gDAAOC,MAAK;gDAASb,OAAOX,YAAYuB,MAAM;0DAAE;;;wCAIlD,CAACjB,+BACA,KAACiB;4CACCC,MAAK;4CACLb,OAAOX,YAAYyB,eAAe;4CAClCC,SAAS;gDACP,IAAIC,OAAOC,OAAO,CAACC,MAAM,GAAG,GAAG;oDAC7BF,OAAOC,OAAO,CAACE,IAAI;gDACrB,OAAO;oDACLH,OAAOI,QAAQ,CAACC,IAAI,GAAG;gDACzB;4CACF;sDACD;;;;;;;oBAOR3B,wBAAU,MAACe;wBAAET,OAAOX,YAAYiC,YAAY;;4BAAE;4BAAO5B;;;;;;;AAI9D;AAEA,gFAAgF;AAChF,2CAA2C;AAC3C,eAAeF,mBAAkB","ignoreList":[0]}
|
||||
15
node_modules/next/dist/esm/client/components/builtin/global-not-found.js
generated
vendored
Normal file
15
node_modules/next/dist/esm/client/components/builtin/global-not-found.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback';
|
||||
function GlobalNotFound() {
|
||||
return /*#__PURE__*/ _jsx("html", {
|
||||
children: /*#__PURE__*/ _jsx("body", {
|
||||
children: /*#__PURE__*/ _jsx(HTTPAccessErrorFallback, {
|
||||
status: 404,
|
||||
message: 'This page could not be found.'
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
export default GlobalNotFound;
|
||||
|
||||
//# sourceMappingURL=global-not-found.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/global-not-found.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/global-not-found.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/global-not-found.tsx"],"sourcesContent":["import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback'\n\nfunction GlobalNotFound() {\n return (\n <html>\n <body>\n <HTTPAccessErrorFallback\n status={404}\n message={'This page could not be found.'}\n />\n </body>\n </html>\n )\n}\n\nexport default GlobalNotFound\n"],"names":["HTTPAccessErrorFallback","GlobalNotFound","html","body","status","message"],"mappings":";AAAA,SAASA,uBAAuB,QAAQ,yCAAwC;AAEhF,SAASC;IACP,qBACE,KAACC;kBACC,cAAA,KAACC;sBACC,cAAA,KAACH;gBACCI,QAAQ;gBACRC,SAAS;;;;AAKnB;AAEA,eAAeJ,eAAc","ignoreList":[0]}
|
||||
11
node_modules/next/dist/esm/client/components/builtin/layout.js
generated
vendored
Normal file
11
node_modules/next/dist/esm/client/components/builtin/layout.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
export default function DefaultLayout({ children }) {
|
||||
return /*#__PURE__*/ _jsx("html", {
|
||||
children: /*#__PURE__*/ _jsx("body", {
|
||||
children: children
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=layout.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/layout.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/layout.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/layout.tsx"],"sourcesContent":["import React from 'react'\n\nexport default function DefaultLayout({\n children,\n}: {\n children: React.ReactNode\n}) {\n return (\n <html>\n <body>{children}</body>\n </html>\n )\n}\n"],"names":["React","DefaultLayout","children","html","body"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,eAAe,SAASC,cAAc,EACpCC,QAAQ,EAGT;IACC,qBACE,KAACC;kBACC,cAAA,KAACC;sBAAMF;;;AAGb","ignoreList":[0]}
|
||||
10
node_modules/next/dist/esm/client/components/builtin/not-found.js
generated
vendored
Normal file
10
node_modules/next/dist/esm/client/components/builtin/not-found.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback';
|
||||
export default function NotFound() {
|
||||
return /*#__PURE__*/ _jsx(HTTPAccessErrorFallback, {
|
||||
status: 404,
|
||||
message: "This page could not be found."
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=not-found.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/not-found.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/not-found.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/not-found.tsx"],"sourcesContent":["import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback'\n\nexport default function NotFound() {\n return (\n <HTTPAccessErrorFallback\n status={404}\n message=\"This page could not be found.\"\n />\n )\n}\n"],"names":["HTTPAccessErrorFallback","NotFound","status","message"],"mappings":";AAAA,SAASA,uBAAuB,QAAQ,yCAAwC;AAEhF,eAAe,SAASC;IACtB,qBACE,KAACD;QACCE,QAAQ;QACRC,SAAQ;;AAGd","ignoreList":[0]}
|
||||
10
node_modules/next/dist/esm/client/components/builtin/unauthorized.js
generated
vendored
Normal file
10
node_modules/next/dist/esm/client/components/builtin/unauthorized.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback';
|
||||
export default function Unauthorized() {
|
||||
return /*#__PURE__*/ _jsx(HTTPAccessErrorFallback, {
|
||||
status: 401,
|
||||
message: "You're not authorized to access this page."
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unauthorized.js.map
|
||||
1
node_modules/next/dist/esm/client/components/builtin/unauthorized.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/builtin/unauthorized.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/builtin/unauthorized.tsx"],"sourcesContent":["import { HTTPAccessErrorFallback } from '../http-access-fallback/error-fallback'\n\nexport default function Unauthorized() {\n return (\n <HTTPAccessErrorFallback\n status={401}\n message=\"You're not authorized to access this page.\"\n />\n )\n}\n"],"names":["HTTPAccessErrorFallback","Unauthorized","status","message"],"mappings":";AAAA,SAASA,uBAAuB,QAAQ,yCAAwC;AAEhF,eAAe,SAASC;IACtB,qBACE,KAACD;QACCE,QAAQ;QACRC,SAAQ;;AAGd","ignoreList":[0]}
|
||||
165
node_modules/next/dist/esm/client/components/catch-error.js
generated
vendored
Normal file
165
node_modules/next/dist/esm/client/components/catch-error.js
generated
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React, { startTransition, useContext } from 'react';
|
||||
import { useUntrackedPathname } from './navigation-untracked';
|
||||
import { isNextRouterError } from './is-next-router-error';
|
||||
import { handleHardNavError } from './nav-failure-handler';
|
||||
import { handleISRError } from './handle-isr-error';
|
||||
import { isBot } from '../../shared/lib/router/utils/is-bot';
|
||||
import { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { RouterContext as PagesRouterContext } from '../../shared/lib/router-context.shared-runtime';
|
||||
const isBotUserAgent = typeof window !== 'undefined' && isBot(window.navigator.userAgent);
|
||||
// This is forked from error-boundary.
|
||||
// TODO: Extend it instead of forking to easily sync the behavior?
|
||||
class CatchError extends React.Component {
|
||||
static{
|
||||
this.contextType = AppRouterContext;
|
||||
}
|
||||
static{
|
||||
// `unstable_catchError()` is parsed as an HOC-style name and displays as
|
||||
// a label (<name> [unstable_catchError]) in DevTools.
|
||||
this.displayName = 'unstable_catchError(Next.CatchError)';
|
||||
}
|
||||
constructor(props){
|
||||
super(props), this.reset = ()=>{
|
||||
this.setState({
|
||||
error: null
|
||||
});
|
||||
}, this.unstable_retry = ()=>{
|
||||
if (this.props.isPagesRouter) {
|
||||
throw Object.defineProperty(new Error('`unstable_retry()` can only be used in the App Router. Use `reset()` in the Pages Router.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E1138",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
startTransition(()=>{
|
||||
this.context?.refresh();
|
||||
this.reset();
|
||||
});
|
||||
};
|
||||
this.state = {
|
||||
error: null,
|
||||
previousPathname: this.props.pathname
|
||||
};
|
||||
}
|
||||
static getDerivedStateFromError(error) {
|
||||
if (isNextRouterError(error)) {
|
||||
// Re-throw if an expected internal Next.js router error occurs
|
||||
// this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)
|
||||
throw error;
|
||||
}
|
||||
return {
|
||||
error
|
||||
};
|
||||
}
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
const { error } = state;
|
||||
// if we encounter an error while
|
||||
// a navigation is pending we shouldn't render
|
||||
// the error boundary and instead should fallback
|
||||
// to a hard navigation to attempt recovering
|
||||
if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {
|
||||
if (error && handleHardNavError(error)) {
|
||||
// clear error so we don't render anything
|
||||
return {
|
||||
error: null,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Handles reset of the error boundary when a navigation happens.
|
||||
* Ensures the error boundary does not stay enabled when navigating to a new page.
|
||||
* Approach of setState in render is safe as it checks the previous pathname and then overrides
|
||||
* it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders
|
||||
*/ if (props.pathname !== state.previousPathname && state.error) {
|
||||
return {
|
||||
error: null,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
return {
|
||||
error: state.error,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
|
||||
render() {
|
||||
//When it's bot request, segment level error boundary will keep rendering the children,
|
||||
// the final error will be caught by the root error boundary and determine wether need to apply graceful degrade.
|
||||
if (this.state.error && !isBotUserAgent) {
|
||||
handleISRError({
|
||||
error: this.state.error
|
||||
});
|
||||
return /*#__PURE__*/ _jsx(this.props.fallback, {
|
||||
props: this.props.props,
|
||||
errorInfo: {
|
||||
error: this.state.error,
|
||||
reset: this.reset,
|
||||
unstable_retry: this.unstable_retry
|
||||
}
|
||||
});
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* `unstable_catchError` is a counterpart to `error.js` that provides a granular
|
||||
* control of error boundaries at the component level. It provides the `ErrorInfo`
|
||||
* including `unstable_retry` for error recovery.
|
||||
*
|
||||
* Pass a Component-like fallback function that receives the props and `ErrorInfo`.
|
||||
* The props omit `children` intentionally as it is the "fallback" of the error and
|
||||
* is not expected to render the children.
|
||||
*
|
||||
* This API is must be used inside the client module graph and cannot be imported
|
||||
* in `server-only` environments like proxy, instrumentation, etc.
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
* // CustomErrorBoundary.tsx
|
||||
* 'use client'
|
||||
* import { unstable_catchError, type ErrorInfo } from 'next/error'
|
||||
*
|
||||
* function CustomErrorBoundary(props: Props, errorInfo: ErrorInfo) {
|
||||
* return ...
|
||||
* }
|
||||
*
|
||||
* export default unstable_catchError(CustomErrorBoundary)
|
||||
*
|
||||
* // page.tsx
|
||||
* 'use client'
|
||||
* import CustomErrorBoundary from './CustomErrorBoundary'
|
||||
*
|
||||
* export default function Page() {
|
||||
* return (
|
||||
* <CustomErrorBoundary>
|
||||
* ...
|
||||
* </CustomErrorBoundary>
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*/ export function unstable_catchError(fallback) {
|
||||
// Create Fallback component from the closure of `unstable_catchError`.
|
||||
const Fallback = ({ props, errorInfo })=>fallback(props, errorInfo);
|
||||
// Rename to match the user component name for DevTools.
|
||||
Fallback.displayName = fallback.name || 'CatchErrorFallback';
|
||||
return ({ children, ...props })=>{
|
||||
// When we're rendering the missing params shell, this will return null. This
|
||||
// is because we won't be rendering any not found boundaries or error
|
||||
// boundaries for the missing params shell. When this runs on the client
|
||||
// (where these errors can occur), we will get the correct pathname.
|
||||
const pathname = useUntrackedPathname();
|
||||
const isPagesRouter = useContext(PagesRouterContext) !== null;
|
||||
return /*#__PURE__*/ _jsx(CatchError, {
|
||||
pathname: pathname,
|
||||
isPagesRouter: isPagesRouter,
|
||||
fallback: Fallback,
|
||||
props: props,
|
||||
children: children
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=catch-error.js.map
|
||||
1
node_modules/next/dist/esm/client/components/catch-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/catch-error.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
55
node_modules/next/dist/esm/client/components/client-page.js
generated
vendored
Normal file
55
node_modules/next/dist/esm/client/components/client-page.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { use } from 'react';
|
||||
import { urlSearchParamsToParsedUrlQuery } from '../route-params';
|
||||
import { SearchParamsContext } from '../../shared/lib/hooks-client-context.shared-runtime';
|
||||
/**
|
||||
* When the Page is a client component we send the params and searchParams to this client wrapper
|
||||
* where they are turned into dynamically tracked values before being passed to the actual Page component.
|
||||
*
|
||||
* additionally we may send promises representing the params and searchParams. We don't ever use these passed
|
||||
* values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.
|
||||
* It is up to the caller to decide if the promises are needed.
|
||||
*/ export function ClientPageRoot({ Component, serverProvidedParams }) {
|
||||
let searchParams;
|
||||
let params;
|
||||
if (serverProvidedParams !== null) {
|
||||
searchParams = serverProvidedParams.searchParams;
|
||||
params = serverProvidedParams.params;
|
||||
} else {
|
||||
// When Cache Components is enabled, the server does not pass the params as
|
||||
// props; they are parsed on the client and passed via context.
|
||||
const layoutRouterContext = use(LayoutRouterContext);
|
||||
params = layoutRouterContext !== null ? layoutRouterContext.parentParams : {};
|
||||
// This is an intentional behavior change: when Cache Components is enabled,
|
||||
// client segments receive the "canonical" search params, not the
|
||||
// rewritten ones. Users should either call useSearchParams directly or pass
|
||||
// the rewritten ones in from a Server Component.
|
||||
// TODO: Log a deprecation error when this object is accessed
|
||||
searchParams = urlSearchParamsToParsedUrlQuery(use(SearchParamsContext));
|
||||
}
|
||||
if (typeof window === 'undefined') {
|
||||
let clientSearchParams;
|
||||
let clientParams;
|
||||
const { createSearchParamsFromClient } = require('../../server/request/search-params');
|
||||
clientSearchParams = createSearchParamsFromClient(searchParams);
|
||||
const { createParamsFromClient } = require('../../server/request/params');
|
||||
clientParams = createParamsFromClient(params);
|
||||
return /*#__PURE__*/ _jsx(Component, {
|
||||
params: clientParams,
|
||||
searchParams: clientSearchParams
|
||||
});
|
||||
} else {
|
||||
const { createRenderSearchParamsFromClient } = require('../request/search-params.browser');
|
||||
const clientSearchParams = createRenderSearchParamsFromClient(searchParams);
|
||||
const { createRenderParamsFromClient } = require('../request/params.browser');
|
||||
const clientParams = createRenderParamsFromClient(params);
|
||||
return /*#__PURE__*/ _jsx(Component, {
|
||||
params: clientParams,
|
||||
searchParams: clientSearchParams
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=client-page.js.map
|
||||
1
node_modules/next/dist/esm/client/components/client-page.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/client-page.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/client-page.tsx"],"sourcesContent":["'use client'\n\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { Params } from '../../server/request/params'\nimport { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { use } from 'react'\nimport { urlSearchParamsToParsedUrlQuery } from '../route-params'\nimport { SearchParamsContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * When the Page is a client component we send the params and searchParams to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Page component.\n *\n * additionally we may send promises representing the params and searchParams. We don't ever use these passed\n * values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.\n * It is up to the caller to decide if the promises are needed.\n */\nexport function ClientPageRoot({\n Component,\n serverProvidedParams,\n}: {\n Component: React.ComponentType<any>\n serverProvidedParams: null | {\n searchParams: ParsedUrlQuery\n params: Params\n promises: Array<Promise<any>> | null\n }\n}) {\n let searchParams: ParsedUrlQuery\n let params: Params\n if (serverProvidedParams !== null) {\n searchParams = serverProvidedParams.searchParams\n params = serverProvidedParams.params\n } else {\n // When Cache Components is enabled, the server does not pass the params as\n // props; they are parsed on the client and passed via context.\n const layoutRouterContext = use(LayoutRouterContext)\n params =\n layoutRouterContext !== null ? layoutRouterContext.parentParams : {}\n\n // This is an intentional behavior change: when Cache Components is enabled,\n // client segments receive the \"canonical\" search params, not the\n // rewritten ones. Users should either call useSearchParams directly or pass\n // the rewritten ones in from a Server Component.\n // TODO: Log a deprecation error when this object is accessed\n searchParams = urlSearchParamsToParsedUrlQuery(use(SearchParamsContext)!)\n }\n\n if (typeof window === 'undefined') {\n let clientSearchParams: Promise<ParsedUrlQuery>\n let clientParams: Promise<Params>\n\n const { createSearchParamsFromClient } =\n require('../../server/request/search-params') as typeof import('../../server/request/search-params')\n clientSearchParams = createSearchParamsFromClient(searchParams)\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params)\n\n return <Component params={clientParams} searchParams={clientSearchParams} />\n } else {\n const { createRenderSearchParamsFromClient } =\n require('../request/search-params.browser') as typeof import('../request/search-params.browser')\n const clientSearchParams = createRenderSearchParamsFromClient(searchParams)\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n\n return <Component params={clientParams} searchParams={clientSearchParams} />\n }\n}\n"],"names":["LayoutRouterContext","use","urlSearchParamsToParsedUrlQuery","SearchParamsContext","ClientPageRoot","Component","serverProvidedParams","searchParams","params","layoutRouterContext","parentParams","window","clientSearchParams","clientParams","createSearchParamsFromClient","require","createParamsFromClient","createRenderSearchParamsFromClient","createRenderParamsFromClient"],"mappings":"AAAA;;AAIA,SAASA,mBAAmB,QAAQ,qDAAoD;AACxF,SAASC,GAAG,QAAQ,QAAO;AAC3B,SAASC,+BAA+B,QAAQ,kBAAiB;AACjE,SAASC,mBAAmB,QAAQ,uDAAsD;AAE1F;;;;;;;CAOC,GACD,OAAO,SAASC,eAAe,EAC7BC,SAAS,EACTC,oBAAoB,EAQrB;IACC,IAAIC;IACJ,IAAIC;IACJ,IAAIF,yBAAyB,MAAM;QACjCC,eAAeD,qBAAqBC,YAAY;QAChDC,SAASF,qBAAqBE,MAAM;IACtC,OAAO;QACL,2EAA2E;QAC3E,+DAA+D;QAC/D,MAAMC,sBAAsBR,IAAID;QAChCQ,SACEC,wBAAwB,OAAOA,oBAAoBC,YAAY,GAAG,CAAC;QAErE,4EAA4E;QAC5E,iEAAiE;QACjE,4EAA4E;QAC5E,iDAAiD;QACjD,6DAA6D;QAC7DH,eAAeL,gCAAgCD,IAAIE;IACrD;IAEA,IAAI,OAAOQ,WAAW,aAAa;QACjC,IAAIC;QACJ,IAAIC;QAEJ,MAAM,EAAEC,4BAA4B,EAAE,GACpCC,QAAQ;QACVH,qBAAqBE,6BAA6BP;QAElD,MAAM,EAAES,sBAAsB,EAAE,GAC9BD,QAAQ;QACVF,eAAeG,uBAAuBR;QAEtC,qBAAO,KAACH;YAAUG,QAAQK;YAAcN,cAAcK;;IACxD,OAAO;QACL,MAAM,EAAEK,kCAAkC,EAAE,GAC1CF,QAAQ;QACV,MAAMH,qBAAqBK,mCAAmCV;QAC9D,MAAM,EAAEW,4BAA4B,EAAE,GACpCH,QAAQ;QACV,MAAMF,eAAeK,6BAA6BV;QAElD,qBAAO,KAACH;YAAUG,QAAQK;YAAcN,cAAcK;;IACxD;AACF","ignoreList":[0]}
|
||||
39
node_modules/next/dist/esm/client/components/client-segment.js
generated
vendored
Normal file
39
node_modules/next/dist/esm/client/components/client-segment.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { use } from 'react';
|
||||
/**
|
||||
* When the Page is a client component we send the params to this client wrapper
|
||||
* where they are turned into dynamically tracked values before being passed to the actual Segment component.
|
||||
*
|
||||
* additionally we may send a promise representing params. We don't ever use this passed
|
||||
* value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations
|
||||
* such as when cacheComponents is enabled. It is up to the caller to decide if the promises are needed.
|
||||
*/ export function ClientSegmentRoot({ Component, slots, serverProvidedParams }) {
|
||||
let params;
|
||||
if (serverProvidedParams !== null) {
|
||||
params = serverProvidedParams.params;
|
||||
} else {
|
||||
// When Cache Components is enabled, the server does not pass the params
|
||||
// as props; they are parsed on the client and passed via context.
|
||||
const layoutRouterContext = use(LayoutRouterContext);
|
||||
params = layoutRouterContext !== null ? layoutRouterContext.parentParams : {};
|
||||
}
|
||||
if (typeof window === 'undefined') {
|
||||
const { createParamsFromClient } = require('../../server/request/params');
|
||||
const clientParams = createParamsFromClient(params);
|
||||
return /*#__PURE__*/ _jsx(Component, {
|
||||
...slots,
|
||||
params: clientParams
|
||||
});
|
||||
} else {
|
||||
const { createRenderParamsFromClient } = require('../request/params.browser');
|
||||
const clientParams = createRenderParamsFromClient(params);
|
||||
return /*#__PURE__*/ _jsx(Component, {
|
||||
...slots,
|
||||
params: clientParams
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=client-segment.js.map
|
||||
1
node_modules/next/dist/esm/client/components/client-segment.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/client-segment.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/client-segment.tsx"],"sourcesContent":["'use client'\n\nimport type { Params } from '../../server/request/params'\nimport { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { use } from 'react'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when cacheComponents is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n serverProvidedParams,\n}: {\n Component: React.ComponentType<any>\n slots: { [key: string]: React.ReactNode }\n serverProvidedParams: null | {\n params: Params\n promises: Array<Promise<any>> | null\n }\n}) {\n let params: Params\n if (serverProvidedParams !== null) {\n params = serverProvidedParams.params\n } else {\n // When Cache Components is enabled, the server does not pass the params\n // as props; they are parsed on the client and passed via context.\n const layoutRouterContext = use(LayoutRouterContext)\n params =\n layoutRouterContext !== null ? layoutRouterContext.parentParams : {}\n }\n\n if (typeof window === 'undefined') {\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n const clientParams: Promise<Params> = createParamsFromClient(params)\n\n return <Component {...slots} params={clientParams} />\n } else {\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return <Component {...slots} params={clientParams} />\n }\n}\n"],"names":["LayoutRouterContext","use","ClientSegmentRoot","Component","slots","serverProvidedParams","params","layoutRouterContext","parentParams","window","createParamsFromClient","require","clientParams","createRenderParamsFromClient"],"mappings":"AAAA;;AAGA,SAASA,mBAAmB,QAAQ,qDAAoD;AACxF,SAASC,GAAG,QAAQ,QAAO;AAE3B;;;;;;;CAOC,GACD,OAAO,SAASC,kBAAkB,EAChCC,SAAS,EACTC,KAAK,EACLC,oBAAoB,EAQrB;IACC,IAAIC;IACJ,IAAID,yBAAyB,MAAM;QACjCC,SAASD,qBAAqBC,MAAM;IACtC,OAAO;QACL,wEAAwE;QACxE,kEAAkE;QAClE,MAAMC,sBAAsBN,IAAID;QAChCM,SACEC,wBAAwB,OAAOA,oBAAoBC,YAAY,GAAG,CAAC;IACvE;IAEA,IAAI,OAAOC,WAAW,aAAa;QACjC,MAAM,EAAEC,sBAAsB,EAAE,GAC9BC,QAAQ;QACV,MAAMC,eAAgCF,uBAAuBJ;QAE7D,qBAAO,KAACH;YAAW,GAAGC,KAAK;YAAEE,QAAQM;;IACvC,OAAO;QACL,MAAM,EAAEC,4BAA4B,EAAE,GACpCF,QAAQ;QACV,MAAMC,eAAeC,6BAA6BP;QAClD,qBAAO,KAACH;YAAW,GAAGC,KAAK;YAAEE,QAAQM;;IACvC;AACF","ignoreList":[0]}
|
||||
24
node_modules/next/dist/esm/client/components/dev-root-http-access-fallback-boundary.js
generated
vendored
Normal file
24
node_modules/next/dist/esm/client/components/dev-root-http-access-fallback-boundary.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
import { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary';
|
||||
// TODO: error on using forbidden and unauthorized in root layout
|
||||
export function bailOnRootNotFound() {
|
||||
throw Object.defineProperty(new Error('notFound() is not allowed to use in root layout'), "__NEXT_ERROR_CODE", {
|
||||
value: "E192",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function NotAllowedRootHTTPFallbackError() {
|
||||
bailOnRootNotFound();
|
||||
return null;
|
||||
}
|
||||
export function DevRootHTTPAccessFallbackBoundary({ children }) {
|
||||
return /*#__PURE__*/ _jsx(HTTPAccessFallbackBoundary, {
|
||||
notFound: /*#__PURE__*/ _jsx(NotAllowedRootHTTPFallbackError, {}),
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=dev-root-http-access-fallback-boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/dev-root-http-access-fallback-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/dev-root-http-access-fallback-boundary.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/dev-root-http-access-fallback-boundary.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\n\n// TODO: error on using forbidden and unauthorized in root layout\nexport function bailOnRootNotFound() {\n throw new Error('notFound() is not allowed to use in root layout')\n}\n\nfunction NotAllowedRootHTTPFallbackError() {\n bailOnRootNotFound()\n return null\n}\n\nexport function DevRootHTTPAccessFallbackBoundary({\n children,\n}: {\n children: React.ReactNode\n}) {\n return (\n <HTTPAccessFallbackBoundary notFound={<NotAllowedRootHTTPFallbackError />}>\n {children}\n </HTTPAccessFallbackBoundary>\n )\n}\n"],"names":["React","HTTPAccessFallbackBoundary","bailOnRootNotFound","Error","NotAllowedRootHTTPFallbackError","DevRootHTTPAccessFallbackBoundary","children","notFound"],"mappings":"AAAA;;AAEA,OAAOA,WAAW,QAAO;AACzB,SAASC,0BAA0B,QAAQ,wCAAuC;AAElF,iEAAiE;AACjE,OAAO,SAASC;IACd,MAAM,qBAA4D,CAA5D,IAAIC,MAAM,oDAAV,qBAAA;eAAA;oBAAA;sBAAA;IAA2D;AACnE;AAEA,SAASC;IACPF;IACA,OAAO;AACT;AAEA,OAAO,SAASG,kCAAkC,EAChDC,QAAQ,EAGT;IACC,qBACE,KAACL;QAA2BM,wBAAU,KAACH;kBACpCE;;AAGP","ignoreList":[0]}
|
||||
121
node_modules/next/dist/esm/client/components/error-boundary.js
generated
vendored
Normal file
121
node_modules/next/dist/esm/client/components/error-boundary.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
'use client';
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import React, { startTransition } from 'react';
|
||||
import { useUntrackedPathname } from './navigation-untracked';
|
||||
import { isNextRouterError } from './is-next-router-error';
|
||||
import { handleHardNavError } from './nav-failure-handler';
|
||||
import { handleISRError } from './handle-isr-error';
|
||||
import { isBot } from '../../shared/lib/router/utils/is-bot';
|
||||
import { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
const isBotUserAgent = typeof window !== 'undefined' && isBot(window.navigator.userAgent);
|
||||
export class ErrorBoundaryHandler extends React.Component {
|
||||
static{
|
||||
this.contextType = AppRouterContext;
|
||||
}
|
||||
constructor(props){
|
||||
super(props), this.reset = ()=>{
|
||||
this.setState({
|
||||
error: null
|
||||
});
|
||||
}, this.unstable_retry = ()=>{
|
||||
startTransition(()=>{
|
||||
this.context?.refresh();
|
||||
this.reset();
|
||||
});
|
||||
};
|
||||
this.state = {
|
||||
error: null,
|
||||
previousPathname: this.props.pathname
|
||||
};
|
||||
}
|
||||
static getDerivedStateFromError(error) {
|
||||
if (isNextRouterError(error)) {
|
||||
// Re-throw if an expected internal Next.js router error occurs
|
||||
// this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)
|
||||
throw error;
|
||||
}
|
||||
return {
|
||||
error
|
||||
};
|
||||
}
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
const { error } = state;
|
||||
// if we encounter an error while
|
||||
// a navigation is pending we shouldn't render
|
||||
// the error boundary and instead should fallback
|
||||
// to a hard navigation to attempt recovering
|
||||
if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {
|
||||
if (error && handleHardNavError(error)) {
|
||||
// clear error so we don't render anything
|
||||
return {
|
||||
error: null,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Handles reset of the error boundary when a navigation happens.
|
||||
* Ensures the error boundary does not stay enabled when navigating to a new page.
|
||||
* Approach of setState in render is safe as it checks the previous pathname and then overrides
|
||||
* it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders
|
||||
*/ if (props.pathname !== state.previousPathname && state.error) {
|
||||
return {
|
||||
error: null,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
return {
|
||||
error: state.error,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
|
||||
render() {
|
||||
//When it's bot request, segment level error boundary will keep rendering the children,
|
||||
// the final error will be caught by the root error boundary and determine wether need to apply graceful degrade.
|
||||
if (this.state.error && !isBotUserAgent) {
|
||||
handleISRError({
|
||||
error: this.state.error
|
||||
});
|
||||
return /*#__PURE__*/ _jsxs(_Fragment, {
|
||||
children: [
|
||||
this.props.errorStyles,
|
||||
this.props.errorScripts,
|
||||
/*#__PURE__*/ _jsx(this.props.errorComponent, {
|
||||
error: this.state.error,
|
||||
reset: this.reset,
|
||||
unstable_retry: this.unstable_retry
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Handles errors through `getDerivedStateFromError`.
|
||||
* Renders the provided error component and provides a way to `reset` the error boundary state.
|
||||
*/ /**
|
||||
* Renders error boundary with the provided "errorComponent" property as the fallback.
|
||||
* If no "errorComponent" property is provided it renders the children without an error boundary.
|
||||
*/ export function ErrorBoundary({ errorComponent, errorStyles, errorScripts, children }) {
|
||||
// When we're rendering the missing params shell, this will return null. This
|
||||
// is because we won't be rendering any not found boundaries or error
|
||||
// boundaries for the missing params shell. When this runs on the client
|
||||
// (where these errors can occur), we will get the correct pathname.
|
||||
const pathname = useUntrackedPathname();
|
||||
if (errorComponent) {
|
||||
return /*#__PURE__*/ _jsx(ErrorBoundaryHandler, {
|
||||
pathname: pathname,
|
||||
errorComponent: errorComponent,
|
||||
errorStyles: errorStyles,
|
||||
errorScripts: errorScripts,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsx(_Fragment, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=error-boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/error-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/error-boundary.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
node_modules/next/dist/esm/client/components/errors/graceful-degrade-boundary.js
generated
vendored
Normal file
58
node_modules/next/dist/esm/client/components/errors/graceful-degrade-boundary.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { Component, createRef } from 'react';
|
||||
function getDomNodeAttributes(node) {
|
||||
const result = {};
|
||||
for(let i = 0; i < node.attributes.length; i++){
|
||||
const attr = node.attributes[i];
|
||||
result[attr.name] = attr.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export class GracefulDegradeBoundary extends Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
hasError: false
|
||||
};
|
||||
this.rootHtml = '';
|
||||
this.htmlAttributes = {};
|
||||
this.htmlRef = /*#__PURE__*/ createRef();
|
||||
}
|
||||
static getDerivedStateFromError(_) {
|
||||
return {
|
||||
hasError: true
|
||||
};
|
||||
}
|
||||
componentDidMount() {
|
||||
const htmlNode = this.htmlRef.current;
|
||||
if (this.state.hasError && htmlNode) {
|
||||
// Reapply the cached HTML attributes to the root element
|
||||
Object.entries(this.htmlAttributes).forEach(([key, value])=>{
|
||||
htmlNode.setAttribute(key, value);
|
||||
});
|
||||
}
|
||||
}
|
||||
render() {
|
||||
const { hasError } = this.state;
|
||||
// Cache the root HTML content on the first render
|
||||
if (typeof window !== 'undefined' && !this.rootHtml) {
|
||||
this.rootHtml = document.documentElement.innerHTML;
|
||||
this.htmlAttributes = getDomNodeAttributes(document.documentElement);
|
||||
}
|
||||
if (hasError) {
|
||||
// Render the current HTML content without hydration
|
||||
return /*#__PURE__*/ _jsx("html", {
|
||||
ref: this.htmlRef,
|
||||
suppressHydrationWarning: true,
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: this.rootHtml
|
||||
}
|
||||
});
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
export default GracefulDegradeBoundary;
|
||||
|
||||
//# sourceMappingURL=graceful-degrade-boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/errors/graceful-degrade-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/errors/graceful-degrade-boundary.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/errors/graceful-degrade-boundary.tsx"],"sourcesContent":["'use client'\n\nimport { Component, createRef, type ReactNode } from 'react'\n\ninterface ErrorBoundaryProps {\n children: ReactNode\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean\n}\n\nfunction getDomNodeAttributes(node: HTMLElement): Record<string, string> {\n const result: Record<string, string> = {}\n for (let i = 0; i < node.attributes.length; i++) {\n const attr = node.attributes[i]\n result[attr.name] = attr.value\n }\n return result\n}\n\nexport class GracefulDegradeBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n private rootHtml: string\n private htmlAttributes: Record<string, string>\n private htmlRef: React.RefObject<HTMLHtmlElement | null>\n\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n this.rootHtml = ''\n this.htmlAttributes = {}\n this.htmlRef = createRef<HTMLHtmlElement>()\n }\n\n static getDerivedStateFromError(_: unknown): ErrorBoundaryState {\n return { hasError: true }\n }\n\n componentDidMount() {\n const htmlNode = this.htmlRef.current\n if (this.state.hasError && htmlNode) {\n // Reapply the cached HTML attributes to the root element\n Object.entries(this.htmlAttributes).forEach(([key, value]) => {\n htmlNode.setAttribute(key, value)\n })\n }\n }\n\n render() {\n const { hasError } = this.state\n // Cache the root HTML content on the first render\n if (typeof window !== 'undefined' && !this.rootHtml) {\n this.rootHtml = document.documentElement.innerHTML\n this.htmlAttributes = getDomNodeAttributes(document.documentElement)\n }\n\n if (hasError) {\n // Render the current HTML content without hydration\n return (\n <html\n ref={this.htmlRef}\n suppressHydrationWarning\n dangerouslySetInnerHTML={{\n __html: this.rootHtml,\n }}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport default GracefulDegradeBoundary\n"],"names":["Component","createRef","getDomNodeAttributes","node","result","i","attributes","length","attr","name","value","GracefulDegradeBoundary","constructor","props","state","hasError","rootHtml","htmlAttributes","htmlRef","getDerivedStateFromError","_","componentDidMount","htmlNode","current","Object","entries","forEach","key","setAttribute","render","window","document","documentElement","innerHTML","html","ref","suppressHydrationWarning","dangerouslySetInnerHTML","__html","children"],"mappings":"AAAA;;AAEA,SAASA,SAAS,EAAEC,SAAS,QAAwB,QAAO;AAU5D,SAASC,qBAAqBC,IAAiB;IAC7C,MAAMC,SAAiC,CAAC;IACxC,IAAK,IAAIC,IAAI,GAAGA,IAAIF,KAAKG,UAAU,CAACC,MAAM,EAAEF,IAAK;QAC/C,MAAMG,OAAOL,KAAKG,UAAU,CAACD,EAAE;QAC/BD,MAAM,CAACI,KAAKC,IAAI,CAAC,GAAGD,KAAKE,KAAK;IAChC;IACA,OAAON;AACT;AAEA,OAAO,MAAMO,gCAAgCX;IAQ3CY,YAAYC,KAAyB,CAAE;QACrC,KAAK,CAACA;QACN,IAAI,CAACC,KAAK,GAAG;YAAEC,UAAU;QAAM;QAC/B,IAAI,CAACC,QAAQ,GAAG;QAChB,IAAI,CAACC,cAAc,GAAG,CAAC;QACvB,IAAI,CAACC,OAAO,iBAAGjB;IACjB;IAEA,OAAOkB,yBAAyBC,CAAU,EAAsB;QAC9D,OAAO;YAAEL,UAAU;QAAK;IAC1B;IAEAM,oBAAoB;QAClB,MAAMC,WAAW,IAAI,CAACJ,OAAO,CAACK,OAAO;QACrC,IAAI,IAAI,CAACT,KAAK,CAACC,QAAQ,IAAIO,UAAU;YACnC,yDAAyD;YACzDE,OAAOC,OAAO,CAAC,IAAI,CAACR,cAAc,EAAES,OAAO,CAAC,CAAC,CAACC,KAAKjB,MAAM;gBACvDY,SAASM,YAAY,CAACD,KAAKjB;YAC7B;QACF;IACF;IAEAmB,SAAS;QACP,MAAM,EAAEd,QAAQ,EAAE,GAAG,IAAI,CAACD,KAAK;QAC/B,kDAAkD;QAClD,IAAI,OAAOgB,WAAW,eAAe,CAAC,IAAI,CAACd,QAAQ,EAAE;YACnD,IAAI,CAACA,QAAQ,GAAGe,SAASC,eAAe,CAACC,SAAS;YAClD,IAAI,CAAChB,cAAc,GAAGf,qBAAqB6B,SAASC,eAAe;QACrE;QAEA,IAAIjB,UAAU;YACZ,oDAAoD;YACpD,qBACE,KAACmB;gBACCC,KAAK,IAAI,CAACjB,OAAO;gBACjBkB,wBAAwB;gBACxBC,yBAAyB;oBACvBC,QAAQ,IAAI,CAACtB,QAAQ;gBACvB;;QAGN;QAEA,OAAO,IAAI,CAACH,KAAK,CAAC0B,QAAQ;IAC5B;AACF;AAEA,eAAe5B,wBAAuB","ignoreList":[0]}
|
||||
24
node_modules/next/dist/esm/client/components/errors/root-error-boundary.js
generated
vendored
Normal file
24
node_modules/next/dist/esm/client/components/errors/root-error-boundary.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import React from 'react';
|
||||
import GracefulDegradeBoundary from './graceful-degrade-boundary';
|
||||
import { ErrorBoundary } from '../error-boundary';
|
||||
import { isBot } from '../../../shared/lib/router/utils/is-bot';
|
||||
const isBotUserAgent = typeof window !== 'undefined' && isBot(window.navigator.userAgent);
|
||||
export default function RootErrorBoundary({ children, errorComponent, errorStyles, errorScripts }) {
|
||||
if (isBotUserAgent) {
|
||||
// Preserve existing DOM/HTML for bots to avoid replacing content with an error UI
|
||||
// and to keep the original SSR output intact.
|
||||
return /*#__PURE__*/ _jsx(GracefulDegradeBoundary, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsx(ErrorBoundary, {
|
||||
errorComponent: errorComponent,
|
||||
errorStyles: errorStyles,
|
||||
errorScripts: errorScripts,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=root-error-boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/errors/root-error-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/errors/root-error-boundary.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/errors/root-error-boundary.tsx"],"sourcesContent":["'use client'\n\nimport React, { type JSX } from 'react'\nimport GracefulDegradeBoundary from './graceful-degrade-boundary'\nimport { ErrorBoundary, type ErrorBoundaryProps } from '../error-boundary'\nimport { isBot } from '../../../shared/lib/router/utils/is-bot'\n\nconst isBotUserAgent =\n typeof window !== 'undefined' && isBot(window.navigator.userAgent)\n\nexport default function RootErrorBoundary({\n children,\n errorComponent,\n errorStyles,\n errorScripts,\n}: ErrorBoundaryProps & { children: React.ReactNode }): JSX.Element {\n if (isBotUserAgent) {\n // Preserve existing DOM/HTML for bots to avoid replacing content with an error UI\n // and to keep the original SSR output intact.\n return <GracefulDegradeBoundary>{children}</GracefulDegradeBoundary>\n }\n\n return (\n <ErrorBoundary\n errorComponent={errorComponent}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n {children}\n </ErrorBoundary>\n )\n}\n"],"names":["React","GracefulDegradeBoundary","ErrorBoundary","isBot","isBotUserAgent","window","navigator","userAgent","RootErrorBoundary","children","errorComponent","errorStyles","errorScripts"],"mappings":"AAAA;;AAEA,OAAOA,WAAyB,QAAO;AACvC,OAAOC,6BAA6B,8BAA6B;AACjE,SAASC,aAAa,QAAiC,oBAAmB;AAC1E,SAASC,KAAK,QAAQ,0CAAyC;AAE/D,MAAMC,iBACJ,OAAOC,WAAW,eAAeF,MAAME,OAAOC,SAAS,CAACC,SAAS;AAEnE,eAAe,SAASC,kBAAkB,EACxCC,QAAQ,EACRC,cAAc,EACdC,WAAW,EACXC,YAAY,EACuC;IACnD,IAAIR,gBAAgB;QAClB,kFAAkF;QAClF,8CAA8C;QAC9C,qBAAO,KAACH;sBAAyBQ;;IACnC;IAEA,qBACE,KAACP;QACCQ,gBAAgBA;QAChBC,aAAaA;QACbC,cAAcA;kBAEbH;;AAGP","ignoreList":[0]}
|
||||
32
node_modules/next/dist/esm/client/components/forbidden.js
generated
vendored
Normal file
32
node_modules/next/dist/esm/client/components/forbidden.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { HTTP_ERROR_FALLBACK_ERROR_CODE } from './http-access-fallback/http-access-fallback';
|
||||
// TODO: Add `forbidden` docs
|
||||
/**
|
||||
* @experimental
|
||||
* This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)
|
||||
* within a route segment as well as inject a tag.
|
||||
*
|
||||
* `forbidden()` can be used in
|
||||
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
||||
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
|
||||
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
|
||||
*
|
||||
* Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)
|
||||
*/ const DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`;
|
||||
export function forbidden() {
|
||||
if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {
|
||||
throw Object.defineProperty(new Error(`\`forbidden()\` is experimental and only allowed to be enabled when \`experimental.authInterrupts\` is enabled.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E488",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
|
||||
value: "E1019",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
error.digest = DIGEST;
|
||||
throw error;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=forbidden.js.map
|
||||
1
node_modules/next/dist/esm/client/components/forbidden.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/forbidden.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/forbidden.ts"],"sourcesContent":["import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `forbidden` docs\n/**\n * @experimental\n * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)\n * within a route segment as well as inject a tag.\n *\n * `forbidden()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`\n\nexport function forbidden(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`forbidden()\\` is experimental and only allowed to be enabled when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n"],"names":["HTTP_ERROR_FALLBACK_ERROR_CODE","DIGEST","forbidden","process","env","__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS","Error","error","digest"],"mappings":"AAAA,SACEA,8BAA8B,QAEzB,8CAA6C;AAEpD,6BAA6B;AAC7B;;;;;;;;;;;CAWC,GAED,MAAMC,SAAS,GAAGD,+BAA+B,IAAI,CAAC;AAEtD,OAAO,SAASE;IACd,IAAI,CAACC,QAAQC,GAAG,CAACC,mCAAmC,EAAE;QACpD,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,+GAA+G,CAAC,GAD7G,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAMC,QAAQ,qBAAiB,CAAjB,IAAID,MAAML,SAAV,qBAAA;eAAA;oBAAA;sBAAA;IAAgB;IAC5BM,MAAkCC,MAAM,GAAGP;IAC7C,MAAMM;AACR","ignoreList":[0]}
|
||||
17
node_modules/next/dist/esm/client/components/handle-isr-error.js
generated
vendored
Normal file
17
node_modules/next/dist/esm/client/components/handle-isr-error.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const workAsyncStorage = typeof window === 'undefined' ? require('../../server/app-render/work-async-storage.external').workAsyncStorage : undefined;
|
||||
// if we are revalidating we want to re-throw the error so the
|
||||
// function crashes so we can maintain our previous cache
|
||||
// instead of caching the error page
|
||||
export function handleISRError({ error }) {
|
||||
if (workAsyncStorage) {
|
||||
const store = workAsyncStorage.getStore();
|
||||
if (store?.isStaticGeneration) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=handle-isr-error.js.map
|
||||
1
node_modules/next/dist/esm/client/components/handle-isr-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/handle-isr-error.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/handle-isr-error.tsx"],"sourcesContent":["const workAsyncStorage =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n ).workAsyncStorage\n : undefined\n\n// if we are revalidating we want to re-throw the error so the\n// function crashes so we can maintain our previous cache\n// instead of caching the error page\nexport function handleISRError({ error }: { error: any }) {\n if (workAsyncStorage) {\n const store = workAsyncStorage.getStore()\n if (store?.isStaticGeneration) {\n if (error) {\n console.error(error)\n }\n throw error\n }\n }\n}\n"],"names":["workAsyncStorage","window","require","undefined","handleISRError","error","store","getStore","isStaticGeneration","console"],"mappings":"AAAA,MAAMA,mBACJ,OAAOC,WAAW,cACd,AACEC,QAAQ,uDACRF,gBAAgB,GAClBG;AAEN,8DAA8D;AAC9D,yDAAyD;AACzD,oCAAoC;AACpC,OAAO,SAASC,eAAe,EAAEC,KAAK,EAAkB;IACtD,IAAIL,kBAAkB;QACpB,MAAMM,QAAQN,iBAAiBO,QAAQ;QACvC,IAAID,OAAOE,oBAAoB;YAC7B,IAAIH,OAAO;gBACTI,QAAQJ,KAAK,CAACA;YAChB;YACA,MAAMA;QACR;IACF;AACF","ignoreList":[0]}
|
||||
14
node_modules/next/dist/esm/client/components/hooks-server-context.js
generated
vendored
Normal file
14
node_modules/next/dist/esm/client/components/hooks-server-context.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE';
|
||||
export class DynamicServerError extends Error {
|
||||
constructor(description){
|
||||
super(`Dynamic server usage: ${description}`), this.description = description, this.digest = DYNAMIC_ERROR_CODE;
|
||||
}
|
||||
}
|
||||
export function isDynamicServerError(err) {
|
||||
if (typeof err !== 'object' || err === null || !('digest' in err) || typeof err.digest !== 'string') {
|
||||
return false;
|
||||
}
|
||||
return err.digest === DYNAMIC_ERROR_CODE;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=hooks-server-context.js.map
|
||||
1
node_modules/next/dist/esm/client/components/hooks-server-context.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/hooks-server-context.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/hooks-server-context.ts"],"sourcesContent":["const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n"],"names":["DYNAMIC_ERROR_CODE","DynamicServerError","Error","constructor","description","digest","isDynamicServerError","err"],"mappings":"AAAA,MAAMA,qBAAqB;AAE3B,OAAO,MAAMC,2BAA2BC;IAGtCC,YAAY,AAAgBC,WAAmB,CAAE;QAC/C,KAAK,CAAC,CAAC,sBAAsB,EAAEA,aAAa,QADlBA,cAAAA,kBAF5BC,SAAoCL;IAIpC;AACF;AAEA,OAAO,SAASM,qBAAqBC,GAAY;IAC/C,IACE,OAAOA,QAAQ,YACfA,QAAQ,QACR,CAAE,CAAA,YAAYA,GAAE,KAChB,OAAOA,IAAIF,MAAM,KAAK,UACtB;QACA,OAAO;IACT;IAEA,OAAOE,IAAIF,MAAM,KAAKL;AACxB","ignoreList":[0]}
|
||||
117
node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js
generated
vendored
Normal file
117
node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use client';
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
/**
|
||||
* HTTPAccessFallbackBoundary is a boundary that catches errors and renders a
|
||||
* fallback component for HTTP errors.
|
||||
*
|
||||
* It receives the status code, and determine if it should render fallbacks for few HTTP 4xx errors.
|
||||
*
|
||||
* e.g. 404
|
||||
* 404 represents not found, and the fallback component pair contains the component and its styles.
|
||||
*
|
||||
*/ import React, { useContext } from 'react';
|
||||
import { useUntrackedPathname } from '../navigation-untracked';
|
||||
import { HTTPAccessErrorStatus, getAccessFallbackHTTPStatus, getAccessFallbackErrorTypeByStatus, isHTTPAccessFallbackError } from './http-access-fallback';
|
||||
import { warnOnce } from '../../../shared/lib/utils/warn-once';
|
||||
import { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime';
|
||||
class HTTPAccessFallbackErrorBoundary extends React.Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
triggeredStatus: undefined,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
componentDidCatch() {
|
||||
if (process.env.NODE_ENV === 'development' && this.props.missingSlots && this.props.missingSlots.size > 0 && // A missing children slot is the typical not-found case, so no need to warn
|
||||
!this.props.missingSlots.has('children')) {
|
||||
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';
|
||||
const formattedSlots = Array.from(this.props.missingSlots).sort((a, b)=>a.localeCompare(b)).map((slot)=>`@${slot}`).join(', ');
|
||||
warningMessage += 'Missing slots: ' + formattedSlots;
|
||||
warnOnce(warningMessage);
|
||||
}
|
||||
}
|
||||
static getDerivedStateFromError(error) {
|
||||
if (isHTTPAccessFallbackError(error)) {
|
||||
const httpStatus = getAccessFallbackHTTPStatus(error);
|
||||
return {
|
||||
triggeredStatus: httpStatus
|
||||
};
|
||||
}
|
||||
// Re-throw if error is not for 404
|
||||
throw error;
|
||||
}
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
/**
|
||||
* Handles reset of the error boundary when a navigation happens.
|
||||
* Ensures the error boundary does not stay enabled when navigating to a new page.
|
||||
* Approach of setState in render is safe as it checks the previous pathname and then overrides
|
||||
* it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders
|
||||
*/ if (props.pathname !== state.previousPathname && state.triggeredStatus) {
|
||||
return {
|
||||
triggeredStatus: undefined,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
return {
|
||||
triggeredStatus: state.triggeredStatus,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
render() {
|
||||
const { notFound, forbidden, unauthorized, children } = this.props;
|
||||
const { triggeredStatus } = this.state;
|
||||
const errorComponents = {
|
||||
[HTTPAccessErrorStatus.NOT_FOUND]: notFound,
|
||||
[HTTPAccessErrorStatus.FORBIDDEN]: forbidden,
|
||||
[HTTPAccessErrorStatus.UNAUTHORIZED]: unauthorized
|
||||
};
|
||||
if (triggeredStatus) {
|
||||
const isNotFound = triggeredStatus === HTTPAccessErrorStatus.NOT_FOUND && notFound;
|
||||
const isForbidden = triggeredStatus === HTTPAccessErrorStatus.FORBIDDEN && forbidden;
|
||||
const isUnauthorized = triggeredStatus === HTTPAccessErrorStatus.UNAUTHORIZED && unauthorized;
|
||||
// If there's no matched boundary in this layer, keep throwing the error by rendering the children
|
||||
if (!(isNotFound || isForbidden || isUnauthorized)) {
|
||||
return children;
|
||||
}
|
||||
return /*#__PURE__*/ _jsxs(_Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("meta", {
|
||||
name: "robots",
|
||||
content: "noindex"
|
||||
}),
|
||||
process.env.NODE_ENV === 'development' && /*#__PURE__*/ _jsx("meta", {
|
||||
name: "boundary-next-error",
|
||||
content: getAccessFallbackErrorTypeByStatus(triggeredStatus)
|
||||
}),
|
||||
errorComponents[triggeredStatus]
|
||||
]
|
||||
});
|
||||
}
|
||||
return children;
|
||||
}
|
||||
}
|
||||
export function HTTPAccessFallbackBoundary({ notFound, forbidden, unauthorized, children }) {
|
||||
// When we're rendering the missing params shell, this will return null. This
|
||||
// is because we won't be rendering any not found boundaries or error
|
||||
// boundaries for the missing params shell. When this runs on the client
|
||||
// (where these error can occur), we will get the correct pathname.
|
||||
const pathname = useUntrackedPathname();
|
||||
const missingSlots = useContext(MissingSlotContext);
|
||||
const hasErrorFallback = !!(notFound || forbidden || unauthorized);
|
||||
if (hasErrorFallback) {
|
||||
return /*#__PURE__*/ _jsx(HTTPAccessFallbackErrorBoundary, {
|
||||
pathname: pathname,
|
||||
notFound: notFound,
|
||||
forbidden: forbidden,
|
||||
unauthorized: unauthorized,
|
||||
missingSlots: missingSlots,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsx(_Fragment, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=error-boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
49
node_modules/next/dist/esm/client/components/http-access-fallback/error-fallback.js
generated
vendored
Normal file
49
node_modules/next/dist/esm/client/components/http-access-fallback/error-fallback.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { styles } from '../styles/access-error-styles';
|
||||
export function HTTPAccessErrorFallback({ status, message }) {
|
||||
return /*#__PURE__*/ _jsxs(_Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("title", {
|
||||
children: `${status}: ${message}`
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("div", {
|
||||
style: styles.error,
|
||||
children: /*#__PURE__*/ _jsxs("div", {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("style", {
|
||||
dangerouslySetInnerHTML: {
|
||||
/* Minified CSS from
|
||||
body { margin: 0; color: #000; background: #fff; }
|
||||
.next-error-h1 {
|
||||
border-right: 1px solid rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body { color: #fff; background: #000; }
|
||||
.next-error-h1 {
|
||||
border-right: 1px solid rgba(255, 255, 255, .3);
|
||||
}
|
||||
}
|
||||
*/ __html: `body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}`
|
||||
}
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("h1", {
|
||||
className: "next-error-h1",
|
||||
style: styles.h1,
|
||||
children: status
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("div", {
|
||||
style: styles.desc,
|
||||
children: /*#__PURE__*/ _jsx("h2", {
|
||||
style: styles.h2,
|
||||
children: message
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=error-fallback.js.map
|
||||
1
node_modules/next/dist/esm/client/components/http-access-fallback/error-fallback.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/http-access-fallback/error-fallback.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/http-access-fallback/error-fallback.tsx"],"sourcesContent":["import { styles } from '../styles/access-error-styles'\n\nexport function HTTPAccessErrorFallback({\n status,\n message,\n}: {\n status: number\n message: string\n}) {\n return (\n <>\n {/* <head> */}\n <title>{`${status}: ${message}`}</title>\n {/* </head> */}\n <div style={styles.error}>\n <div>\n <style\n dangerouslySetInnerHTML={{\n /* Minified CSS from\n body { margin: 0; color: #000; background: #fff; }\n .next-error-h1 {\n border-right: 1px solid rgba(0, 0, 0, .3);\n }\n\n @media (prefers-color-scheme: dark) {\n body { color: #fff; background: #000; }\n .next-error-h1 {\n border-right: 1px solid rgba(255, 255, 255, .3);\n }\n }\n */\n __html: `body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}`,\n }}\n />\n <h1 className=\"next-error-h1\" style={styles.h1}>\n {status}\n </h1>\n <div style={styles.desc}>\n <h2 style={styles.h2}>{message}</h2>\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["styles","HTTPAccessErrorFallback","status","message","title","div","style","error","dangerouslySetInnerHTML","__html","h1","className","desc","h2"],"mappings":";AAAA,SAASA,MAAM,QAAQ,gCAA+B;AAEtD,OAAO,SAASC,wBAAwB,EACtCC,MAAM,EACNC,OAAO,EAIR;IACC,qBACE;;0BAEE,KAACC;0BAAO,GAAGF,OAAO,EAAE,EAAEC,SAAS;;0BAE/B,KAACE;gBAAIC,OAAON,OAAOO,KAAK;0BACtB,cAAA,MAACF;;sCACC,KAACC;4BACCE,yBAAyB;gCACvB;;;;;;;;;;;;cAYA,GACAC,QAAQ,CAAC,6NAA6N,CAAC;4BACzO;;sCAEF,KAACC;4BAAGC,WAAU;4BAAgBL,OAAON,OAAOU,EAAE;sCAC3CR;;sCAEH,KAACG;4BAAIC,OAAON,OAAOY,IAAI;sCACrB,cAAA,KAACC;gCAAGP,OAAON,OAAOa,EAAE;0CAAGV;;;;;;;;AAMnC","ignoreList":[0]}
|
||||
38
node_modules/next/dist/esm/client/components/http-access-fallback/http-access-fallback.js
generated
vendored
Normal file
38
node_modules/next/dist/esm/client/components/http-access-fallback/http-access-fallback.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
export const HTTPAccessErrorStatus = {
|
||||
NOT_FOUND: 404,
|
||||
FORBIDDEN: 403,
|
||||
UNAUTHORIZED: 401
|
||||
};
|
||||
const ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus));
|
||||
export const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK';
|
||||
/**
|
||||
* Checks an error to determine if it's an error generated by
|
||||
* the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.
|
||||
*
|
||||
* @param error the error that may reference a HTTP access error
|
||||
* @returns true if the error is a HTTP access error
|
||||
*/ export function isHTTPAccessFallbackError(error) {
|
||||
if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
|
||||
return false;
|
||||
}
|
||||
const [prefix, httpStatus] = error.digest.split(';');
|
||||
return prefix === HTTP_ERROR_FALLBACK_ERROR_CODE && ALLOWED_CODES.has(Number(httpStatus));
|
||||
}
|
||||
export function getAccessFallbackHTTPStatus(error) {
|
||||
const httpStatus = error.digest.split(';')[1];
|
||||
return Number(httpStatus);
|
||||
}
|
||||
export function getAccessFallbackErrorTypeByStatus(status) {
|
||||
switch(status){
|
||||
case 401:
|
||||
return 'unauthorized';
|
||||
case 403:
|
||||
return 'forbidden';
|
||||
case 404:
|
||||
return 'not-found';
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=http-access-fallback.js.map
|
||||
1
node_modules/next/dist/esm/client/components/http-access-fallback/http-access-fallback.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/http-access-fallback/http-access-fallback.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/http-access-fallback/http-access-fallback.ts"],"sourcesContent":["export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n"],"names":["HTTPAccessErrorStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","ALLOWED_CODES","Set","Object","values","HTTP_ERROR_FALLBACK_ERROR_CODE","isHTTPAccessFallbackError","error","digest","prefix","httpStatus","split","has","Number","getAccessFallbackHTTPStatus","getAccessFallbackErrorTypeByStatus","status"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB;IACnCC,WAAW;IACXC,WAAW;IACXC,cAAc;AAChB,EAAC;AAED,MAAMC,gBAAgB,IAAIC,IAAIC,OAAOC,MAAM,CAACP;AAE5C,OAAO,MAAMQ,iCAAiC,2BAA0B;AAMxE;;;;;;CAMC,GACD,OAAO,SAASC,0BACdC,KAAc;IAEd,IACE,OAAOA,UAAU,YACjBA,UAAU,QACV,CAAE,CAAA,YAAYA,KAAI,KAClB,OAAOA,MAAMC,MAAM,KAAK,UACxB;QACA,OAAO;IACT;IACA,MAAM,CAACC,QAAQC,WAAW,GAAGH,MAAMC,MAAM,CAACG,KAAK,CAAC;IAEhD,OACEF,WAAWJ,kCACXJ,cAAcW,GAAG,CAACC,OAAOH;AAE7B;AAEA,OAAO,SAASI,4BACdP,KAA8B;IAE9B,MAAMG,aAAaH,MAAMC,MAAM,CAACG,KAAK,CAAC,IAAI,CAAC,EAAE;IAC7C,OAAOE,OAAOH;AAChB;AAEA,OAAO,SAASK,mCACdC,MAAc;IAEd,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE;IACJ;AACF","ignoreList":[0]}
|
||||
13
node_modules/next/dist/esm/client/components/instant-validation/boundary.js
generated
vendored
Normal file
13
node_modules/next/dist/esm/client/components/instant-validation/boundary.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
// This facade ensures that the boundary code is DCE'd in browser bundles.
|
||||
//
|
||||
// It also exists to satisfy `browser-chunks.test.ts`, which looks for
|
||||
// references to code in `packages/next/src/server` in browser bundles and errors if it finds any.
|
||||
// A "use client" module seems to always have always have an entry in the browser bundle,
|
||||
// so this module cannot be colocated with the rest of the instant validation code,
|
||||
// because it ends up looking like it's importing server code in the browser
|
||||
// even though all the server code inside is actually DCE'd.
|
||||
const { InstantValidationBoundaryContext, PlaceValidationBoundaryBelowThisLevel, RenderValidationBoundaryAtThisLevel } = typeof window === 'undefined' && process.env.__NEXT_CACHE_COMPONENTS ? require('../../../server/app-render/instant-validation/boundary-impl') : {};
|
||||
export { InstantValidationBoundaryContext, PlaceValidationBoundaryBelowThisLevel, RenderValidationBoundaryAtThisLevel, };
|
||||
|
||||
//# sourceMappingURL=boundary.js.map
|
||||
1
node_modules/next/dist/esm/client/components/instant-validation/boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/instant-validation/boundary.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/client/components/instant-validation/boundary.tsx"],"sourcesContent":["'use client'\n\n// This facade ensures that the boundary code is DCE'd in browser bundles.\n//\n// It also exists to satisfy `browser-chunks.test.ts`, which looks for\n// references to code in `packages/next/src/server` in browser bundles and errors if it finds any.\n// A \"use client\" module seems to always have always have an entry in the browser bundle,\n// so this module cannot be colocated with the rest of the instant validation code,\n// because it ends up looking like it's importing server code in the browser\n// even though all the server code inside is actually DCE'd.\n\nconst {\n InstantValidationBoundaryContext,\n PlaceValidationBoundaryBelowThisLevel,\n RenderValidationBoundaryAtThisLevel,\n} =\n typeof window === 'undefined' && process.env.__NEXT_CACHE_COMPONENTS\n ? (require('../../../server/app-render/instant-validation/boundary-impl') as typeof import('../../../server/app-render/instant-validation/boundary-impl'))\n : ({} as typeof import('../../../server/app-render/instant-validation/boundary-impl'))\n\nexport {\n InstantValidationBoundaryContext,\n PlaceValidationBoundaryBelowThisLevel,\n RenderValidationBoundaryAtThisLevel,\n}\n"],"names":["InstantValidationBoundaryContext","PlaceValidationBoundaryBelowThisLevel","RenderValidationBoundaryAtThisLevel","window","process","env","__NEXT_CACHE_COMPONENTS","require"],"mappings":"AAAA;AAEA,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,kGAAkG;AAClG,yFAAyF;AACzF,mFAAmF;AACnF,4EAA4E;AAC5E,4DAA4D;AAE5D,MAAM,EACJA,gCAAgC,EAChCC,qCAAqC,EACrCC,mCAAmC,EACpC,GACC,OAAOC,WAAW,eAAeC,QAAQC,GAAG,CAACC,uBAAuB,GAC/DC,QAAQ,iEACR,CAAC;AAER,SACEP,gCAAgC,EAChCC,qCAAqC,EACrCC,mCAAmC,KACpC","ignoreList":[0]}
|
||||
11
node_modules/next/dist/esm/client/components/is-next-router-error.js
generated
vendored
Normal file
11
node_modules/next/dist/esm/client/components/is-next-router-error.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { isHTTPAccessFallbackError } from './http-access-fallback/http-access-fallback';
|
||||
import { isRedirectError } from './redirect-error';
|
||||
/**
|
||||
* Returns true if the error is a navigation signal error. These errors are
|
||||
* thrown by user code to perform navigation operations and interrupt the React
|
||||
* render.
|
||||
*/ export function isNextRouterError(error) {
|
||||
return isRedirectError(error) || isHTTPAccessFallbackError(error);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=is-next-router-error.js.map
|
||||
1
node_modules/next/dist/esm/client/components/is-next-router-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/components/is-next-router-error.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/client/components/is-next-router-error.ts"],"sourcesContent":["import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n"],"names":["isHTTPAccessFallbackError","isRedirectError","isNextRouterError","error"],"mappings":"AAAA,SACEA,yBAAyB,QAEpB,8CAA6C;AACpD,SAASC,eAAe,QAA4B,mBAAkB;AAEtE;;;;CAIC,GACD,OAAO,SAASC,kBACdC,KAAc;IAEd,OAAOF,gBAAgBE,UAAUH,0BAA0BG;AAC7D","ignoreList":[0]}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user