Initial boiler plate project
This commit is contained in:
1
node_modules/next/dist/client/add-base-path.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/add-base-path.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function addBasePath(path: string, required?: boolean): string;
|
||||
24
node_modules/next/dist/client/add-base-path.js
generated
vendored
Normal file
24
node_modules/next/dist/client/add-base-path.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "addBasePath", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return addBasePath;
|
||||
}
|
||||
});
|
||||
const _addpathprefix = require("../shared/lib/router/utils/add-path-prefix");
|
||||
const _normalizetrailingslash = require("./normalize-trailing-slash");
|
||||
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
|
||||
function addBasePath(path, required) {
|
||||
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : (0, _addpathprefix.addPathPrefix)(path, basePath));
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=add-base-path.js.map
|
||||
1
node_modules/next/dist/client/add-base-path.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/add-base-path.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/add-base-path.ts"],"names":["addBasePath","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","required","normalizePathTrailingSlash","__NEXT_MANUAL_CLIENT_BASE_PATH","addPathPrefix"],"mappings":";;;;+BAKgBA;;;eAAAA;;;+BALc;wCACa;AAE3C,MAAMC,WAAW,AAACC,QAAQC,GAAG,CAACC,sBAAsB,IAAe;AAE5D,SAASJ,YAAYK,IAAY,EAAEC,QAAkB;IAC1D,OAAOC,IAAAA,kDAA0B,EAC/BL,QAAQC,GAAG,CAACK,8BAA8B,IAAI,CAACF,WAC3CD,OACAI,IAAAA,4BAAa,EAACJ,MAAMJ;AAE5B"}
|
||||
2
node_modules/next/dist/client/add-locale.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/client/add-locale.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { addLocale as Fn } from '../shared/lib/router/utils/add-locale';
|
||||
export declare const addLocale: typeof Fn;
|
||||
28
node_modules/next/dist/client/add-locale.js
generated
vendored
Normal file
28
node_modules/next/dist/client/add-locale.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "addLocale", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return addLocale;
|
||||
}
|
||||
});
|
||||
const _normalizetrailingslash = require("./normalize-trailing-slash");
|
||||
const addLocale = function(path) {
|
||||
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
if (process.env.__NEXT_I18N_SUPPORT) {
|
||||
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(require("../shared/lib/router/utils/add-locale").addLocale(path, ...args));
|
||||
}
|
||||
return path;
|
||||
};
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=add-locale.js.map
|
||||
1
node_modules/next/dist/client/add-locale.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/add-locale.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/add-locale.ts"],"names":["addLocale","path","args","process","env","__NEXT_I18N_SUPPORT","normalizePathTrailingSlash","require"],"mappings":";;;;+BAGaA;;;eAAAA;;;wCAF8B;AAEpC,MAAMA,YAAuB,SAACC;qCAASC;QAAAA;;IAC5C,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACnC,OAAOC,IAAAA,kDAA0B,EAC/BC,QAAQ,yCAAyCP,SAAS,CAACC,SAASC;IAExE;IACA,OAAOD;AACT"}
|
||||
7
node_modules/next/dist/client/app-bootstrap.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/client/app-bootstrap.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
export declare function appBootstrap(callback: () => void): void;
|
||||
67
node_modules/next/dist/client/app-bootstrap.js
generated
vendored
Normal file
67
node_modules/next/dist/client/app-bootstrap.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
/**
|
||||
* 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
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "appBootstrap", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return appBootstrap;
|
||||
}
|
||||
});
|
||||
const version = "14.2.13";
|
||||
window.next = {
|
||||
version,
|
||||
appDir: true
|
||||
};
|
||||
function loadScriptsInSequence(scripts, hydrate) {
|
||||
if (!scripts || !scripts.length) {
|
||||
return hydrate();
|
||||
}
|
||||
return scripts.reduce((promise, param)=>{
|
||||
let [src, props] = param;
|
||||
return promise.then(()=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
const el = document.createElement("script");
|
||||
if (props) {
|
||||
for(const key in props){
|
||||
if (key !== "children") {
|
||||
el.setAttribute(key, props[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
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();
|
||||
});
|
||||
}
|
||||
function appBootstrap(callback) {
|
||||
loadScriptsInSequence(self.__next_s, ()=>{
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-bootstrap.js.map
|
||||
1
node_modules/next/dist/client/app-bootstrap.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-bootstrap.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-bootstrap.ts"],"names":["appBootstrap","version","process","env","__NEXT_VERSION","window","next","appDir","loadScriptsInSequence","scripts","hydrate","length","reduce","promise","src","props","then","Promise","resolve","reject","el","document","createElement","key","setAttribute","onload","onerror","innerHTML","children","setTimeout","head","appendChild","catch","err","console","error","callback","self","__next_s"],"mappings":"AAAA;;;;;CAKC;;;;+BAqDeA;;;eAAAA;;;AAnDhB,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;YAAS,CAACC,KAAKC,MAAM;QAC5B,OAAOF,QAAQG,IAAI,CAAC;YAClB,OAAO,IAAIC,QAAc,CAACC,SAASC;gBACjC,MAAMC,KAAKC,SAASC,aAAa,CAAC;gBAElC,IAAIP,OAAO;oBACT,IAAK,MAAMQ,OAAOR,MAAO;wBACvB,IAAIQ,QAAQ,YAAY;4BACtBH,GAAGI,YAAY,CAACD,KAAKR,KAAK,CAACQ,IAAI;wBACjC;oBACF;gBACF;gBAEA,IAAIT,KAAK;oBACPM,GAAGN,GAAG,GAAGA;oBACTM,GAAGK,MAAM,GAAG,IAAMP;oBAClBE,GAAGM,OAAO,GAAGP;gBACf,OAAO,IAAIJ,OAAO;oBAChBK,GAAGO,SAAS,GAAGZ,MAAMa,QAAQ;oBAC7BC,WAAWX;gBACb;gBAEAG,SAASS,IAAI,CAACC,WAAW,CAACX;YAC5B;QACF;IACF,GAAGH,QAAQC,OAAO,IACjBc,KAAK,CAAC,CAACC;QACNC,QAAQC,KAAK,CAACF;IACd,iDAAiD;IACnD,GACCjB,IAAI,CAAC;QACJN;IACF;AACJ;AAEO,SAASV,aAAaoC,QAAoB;IAC/C5B,sBAAsB,AAAC6B,KAAaC,QAAQ,EAAE;QAC5CF;IACF;AACF"}
|
||||
1
node_modules/next/dist/client/app-call-server.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-call-server.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function callServer(actionId: string, actionArgs: any[]): Promise<unknown>;
|
||||
33
node_modules/next/dist/client/app-call-server.js
generated
vendored
Normal file
33
node_modules/next/dist/client/app-call-server.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "callServer", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return callServer;
|
||||
}
|
||||
});
|
||||
const _approuter = require("./components/app-router");
|
||||
async function callServer(actionId, actionArgs) {
|
||||
const actionDispatcher = (0, _approuter.getServerActionDispatcher)();
|
||||
if (!actionDispatcher) {
|
||||
throw new Error("Invariant: missing action dispatcher.");
|
||||
}
|
||||
return new Promise((resolve, reject)=>{
|
||||
actionDispatcher({
|
||||
actionId,
|
||||
actionArgs,
|
||||
resolve,
|
||||
reject
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-call-server.js.map
|
||||
1
node_modules/next/dist/client/app-call-server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-call-server.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-call-server.ts"],"names":["callServer","actionId","actionArgs","actionDispatcher","getServerActionDispatcher","Error","Promise","resolve","reject"],"mappings":";;;;+BAEsBA;;;eAAAA;;;2BAFoB;AAEnC,eAAeA,WAAWC,QAAgB,EAAEC,UAAiB;IAClE,MAAMC,mBAAmBC,IAAAA,oCAAyB;IAElD,IAAI,CAACD,kBAAkB;QACrB,MAAM,IAAIE,MAAM;IAClB;IAEA,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BL,iBAAiB;YACfF;YACAC;YACAK;YACAC;QACF;IACF;AACF"}
|
||||
2
node_modules/next/dist/client/app-index.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/client/app-index.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import '../build/polyfills/polyfill-module';
|
||||
export declare function hydrate(): void;
|
||||
225
node_modules/next/dist/client/app-index.js
generated
vendored
Normal file
225
node_modules/next/dist/client/app-index.js
generated
vendored
Normal file
@ -0,0 +1,225 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "hydrate", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return hydrate;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
require("../build/polyfills/polyfill-module");
|
||||
const _client = /*#__PURE__*/ _interop_require_default._(require("react-dom/client"));
|
||||
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
||||
const _client1 = require("react-server-dom-webpack/client");
|
||||
const _headmanagercontextsharedruntime = require("../shared/lib/head-manager-context.shared-runtime");
|
||||
const _onrecoverableerror = /*#__PURE__*/ _interop_require_default._(require("./on-recoverable-error"));
|
||||
const _appcallserver = require("./app-call-server");
|
||||
const _isnextroutererror = require("./components/is-next-router-error");
|
||||
const _actionqueue = require("../shared/lib/router/action-queue");
|
||||
const _hotreloadertypes = require("../server/dev/hot-reloader-types");
|
||||
// Since React doesn't call onerror for errors caught in error boundaries.
|
||||
const origConsoleError = window.console.error;
|
||||
window.console.error = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
if ((0, _isnextroutererror.isNextRouterError)(args[0])) {
|
||||
return;
|
||||
}
|
||||
origConsoleError.apply(window.console, args);
|
||||
};
|
||||
window.addEventListener("error", (ev)=>{
|
||||
if ((0, _isnextroutererror.isNextRouterError)(ev.error)) {
|
||||
ev.preventDefault();
|
||||
return;
|
||||
}
|
||||
});
|
||||
/// <reference types="react-dom/experimental" />
|
||||
const appElement = document;
|
||||
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 new Error("Unexpected server data: missing bootstrap script.");
|
||||
if (initialServerDataWriter) {
|
||||
initialServerDataWriter.enqueue(encoder.encode(seg[1]));
|
||||
} else {
|
||||
initialServerDataBuffer.push(seg[1]);
|
||||
}
|
||||
} else if (seg[0] === 2) {
|
||||
initialFormStateData = seg[1];
|
||||
}
|
||||
}
|
||||
// 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(encoder.encode(val));
|
||||
});
|
||||
if (initialServerDataLoaded && !initialServerDataFlushed) {
|
||||
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 {
|
||||
DOMContentLoaded();
|
||||
}
|
||||
const nextServerDataLoadingGlobal = self.__next_f = self.__next_f || [];
|
||||
nextServerDataLoadingGlobal.forEach(nextServerDataCallback);
|
||||
nextServerDataLoadingGlobal.push = nextServerDataCallback;
|
||||
const readable = new ReadableStream({
|
||||
start (controller) {
|
||||
nextServerDataRegisterWriter(controller);
|
||||
}
|
||||
});
|
||||
const initialServerResponse = (0, _client1.createFromReadableStream)(readable, {
|
||||
callServer: _appcallserver.callServer
|
||||
});
|
||||
function ServerRoot() {
|
||||
return (0, _react.use)(initialServerResponse);
|
||||
}
|
||||
const StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP ? _react.default.StrictMode : _react.default.Fragment;
|
||||
function Root(param) {
|
||||
let { children } = param;
|
||||
// TODO: remove in the next major version
|
||||
if (process.env.__NEXT_ANALYTICS_ID) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
_react.default.useEffect(()=>{
|
||||
require("./performance-relayer-app")();
|
||||
}, []);
|
||||
}
|
||||
if (process.env.__NEXT_TEST_MODE) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
_react.default.useEffect(()=>{
|
||||
window.__NEXT_HYDRATED = true;
|
||||
window.__NEXT_HYDRATED_CB == null ? void 0 : window.__NEXT_HYDRATED_CB.call(window);
|
||||
}, []);
|
||||
}
|
||||
return children;
|
||||
}
|
||||
function hydrate() {
|
||||
const actionQueue = (0, _actionqueue.createMutableActionQueue)();
|
||||
const reactEl = /*#__PURE__*/ (0, _jsxruntime.jsx)(StrictModeIfEnabled, {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_headmanagercontextsharedruntime.HeadManagerContext.Provider, {
|
||||
value: {
|
||||
appDir: true
|
||||
},
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_actionqueue.ActionQueueContext.Provider, {
|
||||
value: actionQueue,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Root, {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ServerRoot, {})
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
const rootLayoutMissingTags = window.__next_root_layout_missing_tags;
|
||||
const hasMissingTags = !!(rootLayoutMissingTags == null ? void 0 : rootLayoutMissingTags.length);
|
||||
const options = {
|
||||
onRecoverableError: _onrecoverableerror.default
|
||||
};
|
||||
const isError = document.documentElement.id === "__next_error__" || hasMissingTags;
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
// Patch console.error to collect information about hydration errors
|
||||
const patchConsoleError = require("./components/react-dev-overlay/internal/helpers/hydration-error-info").patchConsoleError;
|
||||
if (!isError) {
|
||||
patchConsoleError();
|
||||
}
|
||||
}
|
||||
if (isError) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
// if an error is thrown while rendering an RSC stream, this will catch it in dev
|
||||
// and show the error overlay
|
||||
const ReactDevOverlay = require("./components/react-dev-overlay/app/ReactDevOverlay").default;
|
||||
const INITIAL_OVERLAY_STATE = require("./components/react-dev-overlay/shared").INITIAL_OVERLAY_STATE;
|
||||
const getSocketUrl = require("./components/react-dev-overlay/internal/helpers/get-socket-url").getSocketUrl;
|
||||
const FallbackLayout = hasMissingTags ? (param)=>{
|
||||
let { children } = param;
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)("html", {
|
||||
id: "__next_error__",
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("body", {
|
||||
children: children
|
||||
})
|
||||
});
|
||||
} : _react.default.Fragment;
|
||||
const errorTree = /*#__PURE__*/ (0, _jsxruntime.jsx)(FallbackLayout, {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ReactDevOverlay, {
|
||||
state: {
|
||||
...INITIAL_OVERLAY_STATE,
|
||||
rootLayoutMissingTags
|
||||
},
|
||||
onReactError: ()=>{},
|
||||
children: reactEl
|
||||
})
|
||||
});
|
||||
const socketUrl = getSocketUrl(process.env.__NEXT_ASSET_PREFIX || "");
|
||||
const socket = new window.WebSocket("" + socketUrl + "/_next/webpack-hmr");
|
||||
// add minimal "hot reload" support for RSC errors
|
||||
const handler = (event)=>{
|
||||
let obj;
|
||||
try {
|
||||
obj = JSON.parse(event.data);
|
||||
} catch (e) {}
|
||||
if (!obj || !("action" in obj)) {
|
||||
return;
|
||||
}
|
||||
if (obj.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES) {
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
socket.addEventListener("message", handler);
|
||||
_client.default.createRoot(appElement, options).render(errorTree);
|
||||
} else {
|
||||
_client.default.createRoot(appElement, options).render(reactEl);
|
||||
}
|
||||
} else {
|
||||
_react.default.startTransition(()=>_client.default.hydrateRoot(appElement, reactEl, {
|
||||
...options,
|
||||
formState: initialFormStateData
|
||||
}));
|
||||
}
|
||||
// TODO-APP: Remove this logic when Float has GC built-in in development.
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
const { linkGc } = require("./app-link-gc");
|
||||
linkGc();
|
||||
}
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-index.js.map
|
||||
1
node_modules/next/dist/client/app-index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/next/dist/client/app-link-gc.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-link-gc.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function linkGc(): void;
|
||||
77
node_modules/next/dist/client/app-link-gc.js
generated
vendored
Normal file
77
node_modules/next/dist/client/app-link-gc.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "linkGc", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return linkGc;
|
||||
}
|
||||
});
|
||||
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") {
|
||||
var _link_dataset_precedence;
|
||||
const link = node;
|
||||
if ((_link_dataset_precedence = link.dataset.precedence) == null ? void 0 : _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){
|
||||
var _otherLink_dataset_precedence;
|
||||
if ((_otherLink_dataset_precedence = otherLink.dataset.precedence) == null ? void 0 : _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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-link-gc.js.map
|
||||
1
node_modules/next/dist/client/app-link-gc.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-link-gc.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-link-gc.ts"],"names":["linkGc","process","env","NODE_ENV","callback","mutationList","mutation","type","node","addedNodes","tagName","link","dataset","precedence","startsWith","href","getAttribute","resource","version","split","currentOrigin","window","location","origin","allLinks","document","querySelectorAll","slice","length","otherLink","otherHref","otherVersion","setTimeout","remove","preloadLink","querySelector","observer","MutationObserver","observe","head","childList"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA;IACd,yEAAyE;IACzE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,MAAMC,WAAW,CAACC;YAChB,KAAK,MAAMC,YAAYD,aAAc;gBACnC,IAAIC,SAASC,IAAI,KAAK,aAAa;oBACjC,KAAK,MAAMC,QAAQF,SAASG,UAAU,CAAE;wBACtC,IACE,aAAaD,QACb,AAACA,KAAyBE,OAAO,KAAK,QACtC;gCAEIC;4BADJ,MAAMA,OAAOH;4BACb,KAAIG,2BAAAA,KAAKC,OAAO,CAACC,UAAU,qBAAvBF,yBAAyBG,UAAU,CAAC,SAAS;gCAC/C,MAAMC,OAAOJ,KAAKK,YAAY,CAAC;gCAC/B,IAAID,MAAM;oCACR,MAAM,CAACE,UAAUC,QAAQ,GAAGH,KAAKI,KAAK,CAAC,OAAO;oCAC9C,IAAID,SAAS;wCACX,MAAME,gBAAgBC,OAAOC,QAAQ,CAACC,MAAM;wCAC5C,MAAMC,WAAW;+CACZC,SAASC,gBAAgB,CAC1B,iBAAiBT,WAAW;4CAE9B,kEAAkE;4CAClE,qDAAqD;+CAClDQ,SAASC,gBAAgB,CAC1B,iBACGT,CAAAA,SAASH,UAAU,CAACM,iBACjBH,SAASU,KAAK,CAACP,cAAcQ,MAAM,IACnCR,gBAAgBH,QAAO,IAC3B;yCAEL;wCAED,KAAK,MAAMY,aAAaL,SAAU;gDAC5BK;4CAAJ,KAAIA,gCAAAA,UAAUjB,OAAO,CAACC,UAAU,qBAA5BgB,8BAA8Bf,UAAU,CAAC,SAAS;gDACpD,MAAMgB,YAAYD,UAAUb,YAAY,CAAC;gDACzC,IAAIc,WAAW;oDACb,MAAM,GAAGC,aAAa,GAAGD,UAAUX,KAAK,CAAC,OAAO;oDAChD,IAAI,CAACY,gBAAgB,CAACA,eAAe,CAACb,SAAS;wDAC7C,oDAAoD;wDACpD,mDAAmD;wDACnD,oDAAoD;wDACpD,mDAAmD;wDACnDc,WAAW;4DACTH,UAAUI,MAAM;wDAClB,GAAG;wDACH,MAAMC,cAAcT,SAASU,aAAa,CACxC,AAAC,2CAAwCL,YAAU;wDAErD,IAAII,aAAa;4DACfA,YAAYD,MAAM;wDACpB;oDACF;gDACF;4CACF;wCACF;oCACF;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,8DAA8D;QAC9D,MAAMG,WAAW,IAAIC,iBAAiBjC;QACtCgC,SAASE,OAAO,CAACb,SAASc,IAAI,EAAE;YAC9BC,WAAW;QACb;IACF;AACF"}
|
||||
1
node_modules/next/dist/client/app-next-dev.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next-dev.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
import './app-webpack';
|
||||
20
node_modules/next/dist/client/app-next-dev.js
generated
vendored
Normal file
20
node_modules/next/dist/client/app-next-dev.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// TODO-APP: hydration warning
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
require("./app-webpack");
|
||||
const _appbootstrap = require("./app-bootstrap");
|
||||
(0, _appbootstrap.appBootstrap)(()=>{
|
||||
const { hydrate } = require("./app-index");
|
||||
hydrate();
|
||||
}) // TODO-APP: build indicator
|
||||
;
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-next-dev.js.map
|
||||
1
node_modules/next/dist/client/app-next-dev.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next-dev.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-next-dev.ts"],"names":["appBootstrap","hydrate","require"],"mappings":"AAAA,8BAA8B;;;;;QAEvB;8BACsB;AAE7BA,IAAAA,0BAAY,EAAC;IACX,MAAM,EAAEC,OAAO,EAAE,GAAGC,QAAQ;IAC5BD;AACF,GAEA,4BAA4B"}
|
||||
1
node_modules/next/dist/client/app-next-turbopack.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next-turbopack.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
||||
21
node_modules/next/dist/client/app-next-turbopack.js
generated
vendored
Normal file
21
node_modules/next/dist/client/app-next-turbopack.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// TODO-APP: hydration warning
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _appbootstrap = require("./app-bootstrap");
|
||||
window.next.version += "-turbo";
|
||||
self.__webpack_hash__ = "";
|
||||
(0, _appbootstrap.appBootstrap)(()=>{
|
||||
const { hydrate } = require("./app-index");
|
||||
hydrate();
|
||||
}) // TODO-APP: build indicator
|
||||
;
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-next-turbopack.js.map
|
||||
1
node_modules/next/dist/client/app-next-turbopack.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next-turbopack.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-next-turbopack.ts"],"names":["window","next","version","self","__webpack_hash__","appBootstrap","hydrate","require"],"mappings":"AAAA,8BAA8B;;;;;8BAED;AAE7BA,OAAOC,IAAI,CAACC,OAAO,IAAI;AACrBC,KAAaC,gBAAgB,GAAG;AAElCC,IAAAA,0BAAY,EAAC;IACX,MAAM,EAAEC,OAAO,EAAE,GAAGC,QAAQ;IAC5BD;AACF,GAEA,4BAA4B"}
|
||||
1
node_modules/next/dist/client/app-next.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
import './app-webpack';
|
||||
23
node_modules/next/dist/client/app-next.js
generated
vendored
Normal file
23
node_modules/next/dist/client/app-next.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// This import must go first because it needs to patch webpack chunk loading
|
||||
// before React patches chunk loading.
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
require("./app-webpack");
|
||||
const _appbootstrap = require("./app-bootstrap");
|
||||
(0, _appbootstrap.appBootstrap)(()=>{
|
||||
const { hydrate } = require("./app-index");
|
||||
// Include app-router and layout-router in the main chunk
|
||||
require("next/dist/client/components/app-router");
|
||||
require("next/dist/client/components/layout-router");
|
||||
hydrate();
|
||||
});
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-next.js.map
|
||||
1
node_modules/next/dist/client/app-next.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-next.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-next.ts"],"names":["appBootstrap","hydrate","require"],"mappings":"AAAA,4EAA4E;AAC5E,sCAAsC;;;;;QAC/B;8BACsB;AAE7BA,IAAAA,0BAAY,EAAC;IACX,MAAM,EAAEC,OAAO,EAAE,GAAGC,QAAQ;IAC5B,yDAAyD;IACzDA,QAAQ;IACRA,QAAQ;IACRD;AACF"}
|
||||
1
node_modules/next/dist/client/app-webpack.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/app-webpack.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
||||
65
node_modules/next/dist/client/app-webpack.js
generated
vendored
Normal file
65
node_modules/next/dist/client/app-webpack.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
// Override chunk URL mapping in the webpack runtime
|
||||
// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _deploymentid = require("../build/deployment-id");
|
||||
// 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 (process.env.NEXT_DEPLOYMENT_ID) {
|
||||
const suffix = (0, _deploymentid.getDeploymentIdQueryOrEmptyString)();
|
||||
// eslint-disable-next-line no-undef
|
||||
const getChunkScriptFilename = __webpack_require__.u;
|
||||
// eslint-disable-next-line no-undef
|
||||
__webpack_require__.u = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return(// We enode the chunk filename because our static server matches against and encoded
|
||||
// filename path.
|
||||
encodeURI(getChunkScriptFilename(...args) + suffix));
|
||||
};
|
||||
// eslint-disable-next-line no-undef
|
||||
const getChunkCssFilename = __webpack_require__.k;
|
||||
// eslint-disable-next-line no-undef
|
||||
__webpack_require__.k = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return getChunkCssFilename(...args) + suffix;
|
||||
};
|
||||
// eslint-disable-next-line no-undef
|
||||
const getMiniCssFilename = __webpack_require__.miniCssF;
|
||||
// eslint-disable-next-line no-undef
|
||||
__webpack_require__.miniCssF = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return getMiniCssFilename(...args) + suffix;
|
||||
};
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
const getChunkScriptFilename = __webpack_require__.u;
|
||||
// eslint-disable-next-line no-undef
|
||||
__webpack_require__.u = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return(// We enode the chunk filename because our static server matches against and encoded
|
||||
// filename path.
|
||||
encodeURI(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
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-webpack.js.map
|
||||
1
node_modules/next/dist/client/app-webpack.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/app-webpack.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/client/app-webpack.ts"],"names":["process","env","NEXT_DEPLOYMENT_ID","suffix","getDeploymentIdQueryOrEmptyString","getChunkScriptFilename","__webpack_require__","u","args","encodeURI","getChunkCssFilename","k","getMiniCssFilename","miniCssF"],"mappings":"AAAA,oDAAoD;AACpD,8GAA8G;;;;;8BAE5D;AAIlD,8EAA8E;AAC9E,8EAA8E;AAC9E,IAAIA,QAAQC,GAAG,CAACC,kBAAkB,EAAE;IAClC,MAAMC,SAASC,IAAAA,+CAAiC;IAChD,oCAAoC;IACpC,MAAMC,yBAAyBC,oBAAoBC,CAAC;IACpD,oCAAoC;IACpCD,oBAAoBC,CAAC,GAAG;yCAAIC;YAAAA;;eAC1B,oFAAoF;QACpF,iBAAiB;QACjBC,UAAUJ,0BAA0BG,QAAQL;;IAE9C,oCAAoC;IACpC,MAAMO,sBAAsBJ,oBAAoBK,CAAC;IACjD,oCAAoC;IACpCL,oBAAoBK,CAAC,GAAG;yCAAIH;YAAAA;;eAC1BE,uBAAuBF,QAAQL;;IAEjC,oCAAoC;IACpC,MAAMS,qBAAqBN,oBAAoBO,QAAQ;IACvD,oCAAoC;IACpCP,oBAAoBO,QAAQ,GAAG;yCAAIL;YAAAA;;eACjCI,sBAAsBJ,QAAQL;;AAClC,OAAO;IACL,oCAAoC;IACpC,MAAME,yBAAyBC,oBAAoBC,CAAC;IACpD,oCAAoC;IACpCD,oBAAoBC,CAAC,GAAG;yCAAIC;YAAAA;;eAC1B,oFAAoF;QACpF,iBAAiB;QACjBC,UAAUJ,0BAA0BG;;AAEtC,0EAA0E;AAC1E,2DAA2D;AAE3D,iFAAiF;AACjF,gEAAgE;AAClE"}
|
||||
12
node_modules/next/dist/client/compat/router.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/client/compat/router.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import type { NextRouter } from '../router';
|
||||
/**
|
||||
* 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 declare function useRouter(): NextRouter | null;
|
||||
23
node_modules/next/dist/client/compat/router.js
generated
vendored
Normal file
23
node_modules/next/dist/client/compat/router.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "useRouter", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return useRouter;
|
||||
}
|
||||
});
|
||||
const _react = require("react");
|
||||
const _routercontextsharedruntime = require("../../shared/lib/router-context.shared-runtime");
|
||||
function useRouter() {
|
||||
return (0, _react.useContext)(_routercontextsharedruntime.RouterContext);
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=router.js.map
|
||||
1
node_modules/next/dist/client/compat/router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/compat/router.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/compat/router.ts"],"names":["useRouter","useContext","RouterContext"],"mappings":";;;;+BAcgBA;;;eAAAA;;;uBAdW;4CACG;AAavB,SAASA;IACd,OAAOC,IAAAA,iBAAU,EAACC,yCAAa;AACjC"}
|
||||
2
node_modules/next/dist/client/components/action-async-storage-instance.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/client/components/action-async-storage-instance.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { ActionAsyncStorage } from './action-async-storage.external';
|
||||
export declare const actionAsyncStorage: ActionAsyncStorage;
|
||||
20
node_modules/next/dist/client/components/action-async-storage-instance.js
generated
vendored
Normal file
20
node_modules/next/dist/client/components/action-async-storage-instance.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "actionAsyncStorage", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return actionAsyncStorage;
|
||||
}
|
||||
});
|
||||
const _asynclocalstorage = require("./async-local-storage");
|
||||
const actionAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=action-async-storage-instance.js.map
|
||||
1
node_modules/next/dist/client/components/action-async-storage-instance.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/action-async-storage-instance.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/action-async-storage-instance.ts"],"names":["actionAsyncStorage","createAsyncLocalStorage"],"mappings":";;;;+BAGaA;;;eAAAA;;;mCAF2B;AAEjC,MAAMA,qBAAyCC,IAAAA,0CAAuB"}
|
||||
9
node_modules/next/dist/client/components/action-async-storage.external.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/client/components/action-async-storage.external.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
import type { AsyncLocalStorage } from 'async_hooks';
|
||||
import { actionAsyncStorage } from './action-async-storage-instance';
|
||||
export interface ActionStore {
|
||||
readonly isAction?: boolean;
|
||||
readonly isAppRoute?: boolean;
|
||||
}
|
||||
export type ActionAsyncStorage = AsyncLocalStorage<ActionStore>;
|
||||
export { actionAsyncStorage };
|
||||
20
node_modules/next/dist/client/components/action-async-storage.external.js
generated
vendored
Normal file
20
node_modules/next/dist/client/components/action-async-storage.external.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"TURBOPACK { transition: next-shared }";
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "actionAsyncStorage", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _actionasyncstorageinstance.actionAsyncStorage;
|
||||
}
|
||||
});
|
||||
const _actionasyncstorageinstance = require("./action-async-storage-instance");
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=action-async-storage.external.js.map
|
||||
1
node_modules/next/dist/client/components/action-async-storage.external.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/action-async-storage.external.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/action-async-storage.external.ts"],"names":["actionAsyncStorage"],"mappings":"AAIE;;;;;+BASOA;;;eAAAA,8CAAkB;;;4CARQ"}
|
||||
5
node_modules/next/dist/client/components/app-router-announcer.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/client/components/app-router-announcer.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/// <reference types="react" />
|
||||
import type { FlightRouterState } from '../../server/app-render/types';
|
||||
export declare function AppRouterAnnouncer({ tree }: {
|
||||
tree: FlightRouterState;
|
||||
}): import("react").ReactPortal | null;
|
||||
80
node_modules/next/dist/client/components/app-router-announcer.js
generated
vendored
Normal file
80
node_modules/next/dist/client/components/app-router-announcer.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "AppRouterAnnouncer", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return AppRouterAnnouncer;
|
||||
}
|
||||
});
|
||||
const _react = require("react");
|
||||
const _reactdom = require("react-dom");
|
||||
const ANNOUNCER_TYPE = "next-route-announcer";
|
||||
const ANNOUNCER_ID = "__next-route-announcer__";
|
||||
function getAnnouncerNode() {
|
||||
var _existingAnnouncer_shadowRoot;
|
||||
const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0];
|
||||
if (existingAnnouncer == null ? void 0 : (_existingAnnouncer_shadowRoot = existingAnnouncer.shadowRoot) == null ? void 0 : _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;
|
||||
}
|
||||
}
|
||||
function AppRouterAnnouncer(param) {
|
||||
let { tree } = param;
|
||||
const [portalNode, setPortalNode] = (0, _react.useState)(null);
|
||||
(0, _react.useEffect)(()=>{
|
||||
const announcer = getAnnouncerNode();
|
||||
setPortalNode(announcer);
|
||||
return ()=>{
|
||||
const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0];
|
||||
if (container == null ? void 0 : container.isConnected) {
|
||||
document.body.removeChild(container);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
const [routeAnnouncement, setRouteAnnouncement] = (0, _react.useState)("");
|
||||
const previousTitle = (0, _react.useRef)();
|
||||
(0, _react.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__*/ (0, _reactdom.createPortal)(routeAnnouncement, portalNode) : null;
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router-announcer.js.map
|
||||
1
node_modules/next/dist/client/components/app-router-announcer.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/app-router-announcer.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/app-router-announcer.tsx"],"names":["AppRouterAnnouncer","ANNOUNCER_TYPE","ANNOUNCER_ID","getAnnouncerNode","existingAnnouncer","document","getElementsByName","shadowRoot","childNodes","container","createElement","style","cssText","announcer","ariaLive","id","role","shadow","attachShadow","mode","appendChild","body","tree","portalNode","setPortalNode","useState","useEffect","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","current","undefined","createPortal"],"mappings":";;;;+BA6BgBA;;;eAAAA;;;uBA7B4B;0BACf;AAG7B,MAAMC,iBAAiB;AACvB,MAAMC,eAAe;AAErB,SAASC;QAEHC;IADJ,MAAMA,oBAAoBC,SAASC,iBAAiB,CAACL,eAAe,CAAC,EAAE;IACvE,IAAIG,sCAAAA,gCAAAA,kBAAmBG,UAAU,qBAA7BH,8BAA+BI,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;AAEO,SAASb,mBAAmB,KAAqC;IAArC,IAAA,EAAEsB,IAAI,EAA+B,GAArC;IACjC,MAAM,CAACC,YAAYC,cAAc,GAAGC,IAAAA,eAAQ,EAAqB;IAEjEC,IAAAA,gBAAS,EAAC;QACR,MAAMb,YAAYV;QAClBqB,cAAcX;QACd,OAAO;YACL,MAAMJ,YAAYJ,SAASsB,oBAAoB,CAAC1B,eAAe,CAAC,EAAE;YAClE,IAAIQ,6BAAAA,UAAWmB,WAAW,EAAE;gBAC1BvB,SAASgB,IAAI,CAACQ,WAAW,CAACpB;YAC5B;QACF;IACF,GAAG,EAAE;IAEL,MAAM,CAACqB,mBAAmBC,qBAAqB,GAAGN,IAAAA,eAAQ,EAAC;IAC3D,MAAMO,gBAAgBC,IAAAA,aAAM;IAE5BP,IAAAA,gBAAS,EAAC;QACR,IAAIQ,eAAe;QACnB,IAAI7B,SAAS8B,KAAK,EAAE;YAClBD,eAAe7B,SAAS8B,KAAK;QAC/B,OAAO;YACL,MAAMC,aAAa/B,SAASgC,aAAa,CAAC;YAC1C,IAAID,YAAY;gBACdF,eAAeE,WAAWE,SAAS,IAAIF,WAAWG,WAAW,IAAI;YACnE;QACF;QAEA,4EAA4E;QAC5E,iCAAiC;QACjC,IACEP,cAAcQ,OAAO,KAAKC,aAC1BT,cAAcQ,OAAO,KAAKN,cAC1B;YACAH,qBAAqBG;QACvB;QACAF,cAAcQ,OAAO,GAAGN;IAC1B,GAAG;QAACZ;KAAK;IAET,OAAOC,2BAAamB,IAAAA,sBAAY,EAACZ,mBAAmBP,cAAc;AACpE"}
|
||||
9
node_modules/next/dist/client/components/app-router-headers.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/client/components/app-router-headers.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export declare const RSC_HEADER: "RSC";
|
||||
export declare const ACTION: "Next-Action";
|
||||
export declare const NEXT_ROUTER_STATE_TREE: "Next-Router-State-Tree";
|
||||
export declare const NEXT_ROUTER_PREFETCH_HEADER: "Next-Router-Prefetch";
|
||||
export declare const NEXT_URL: "Next-Url";
|
||||
export declare const RSC_CONTENT_TYPE_HEADER: "text/x-component";
|
||||
export declare const FLIGHT_PARAMETERS: readonly [readonly ["RSC"], readonly ["Next-Router-State-Tree"], readonly ["Next-Router-Prefetch"]];
|
||||
export declare const NEXT_RSC_UNION_QUERY: "_rsc";
|
||||
export declare const NEXT_DID_POSTPONE_HEADER: "x-nextjs-postponed";
|
||||
77
node_modules/next/dist/client/components/app-router-headers.js
generated
vendored
Normal file
77
node_modules/next/dist/client/components/app-router-headers.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ACTION: null,
|
||||
FLIGHT_PARAMETERS: null,
|
||||
NEXT_DID_POSTPONE_HEADER: null,
|
||||
NEXT_ROUTER_PREFETCH_HEADER: null,
|
||||
NEXT_ROUTER_STATE_TREE: null,
|
||||
NEXT_RSC_UNION_QUERY: null,
|
||||
NEXT_URL: null,
|
||||
RSC_CONTENT_TYPE_HEADER: null,
|
||||
RSC_HEADER: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ACTION: function() {
|
||||
return ACTION;
|
||||
},
|
||||
FLIGHT_PARAMETERS: function() {
|
||||
return FLIGHT_PARAMETERS;
|
||||
},
|
||||
NEXT_DID_POSTPONE_HEADER: function() {
|
||||
return NEXT_DID_POSTPONE_HEADER;
|
||||
},
|
||||
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
||||
return NEXT_ROUTER_PREFETCH_HEADER;
|
||||
},
|
||||
NEXT_ROUTER_STATE_TREE: function() {
|
||||
return NEXT_ROUTER_STATE_TREE;
|
||||
},
|
||||
NEXT_RSC_UNION_QUERY: function() {
|
||||
return NEXT_RSC_UNION_QUERY;
|
||||
},
|
||||
NEXT_URL: function() {
|
||||
return NEXT_URL;
|
||||
},
|
||||
RSC_CONTENT_TYPE_HEADER: function() {
|
||||
return RSC_CONTENT_TYPE_HEADER;
|
||||
},
|
||||
RSC_HEADER: function() {
|
||||
return RSC_HEADER;
|
||||
}
|
||||
});
|
||||
const RSC_HEADER = "RSC";
|
||||
const ACTION = "Next-Action";
|
||||
const NEXT_ROUTER_STATE_TREE = "Next-Router-State-Tree";
|
||||
const NEXT_ROUTER_PREFETCH_HEADER = "Next-Router-Prefetch";
|
||||
const NEXT_URL = "Next-Url";
|
||||
const RSC_CONTENT_TYPE_HEADER = "text/x-component";
|
||||
const FLIGHT_PARAMETERS = [
|
||||
[
|
||||
RSC_HEADER
|
||||
],
|
||||
[
|
||||
NEXT_ROUTER_STATE_TREE
|
||||
],
|
||||
[
|
||||
NEXT_ROUTER_PREFETCH_HEADER
|
||||
]
|
||||
];
|
||||
const NEXT_RSC_UNION_QUERY = "_rsc";
|
||||
const NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router-headers.js.map
|
||||
1
node_modules/next/dist/client/components/app-router-headers.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/app-router-headers.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/app-router-headers.ts"],"names":["ACTION","FLIGHT_PARAMETERS","NEXT_DID_POSTPONE_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_STATE_TREE","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IACaA,MAAM;eAANA;;IAOAC,iBAAiB;eAAjBA;;IAQAC,wBAAwB;eAAxBA;;IAZAC,2BAA2B;eAA3BA;;IADAC,sBAAsB;eAAtBA;;IAWAC,oBAAoB;eAApBA;;IATAC,QAAQ;eAARA;;IACAC,uBAAuB;eAAvBA;;IANAC,UAAU;eAAVA;;;AAAN,MAAMA,aAAa;AACnB,MAAMR,SAAS;AAEf,MAAMI,yBAAyB;AAC/B,MAAMD,8BAA8B;AACpC,MAAMG,WAAW;AACjB,MAAMC,0BAA0B;AAEhC,MAAMN,oBAAoB;IAC/B;QAACO;KAAW;IACZ;QAACJ;KAAuB;IACxB;QAACD;KAA4B;CAC9B;AAEM,MAAME,uBAAuB;AAE7B,MAAMH,2BAA2B"}
|
||||
18
node_modules/next/dist/client/components/app-router.d.ts
generated
vendored
Normal file
18
node_modules/next/dist/client/components/app-router.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import type { CacheNode } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import type { ErrorComponent } from './error-boundary';
|
||||
import type { ServerActionDispatcher } from './router-reducer/router-reducer-types';
|
||||
import type { InitialRouterStateParameters } from './router-reducer/create-initial-router-state';
|
||||
export declare function getServerActionDispatcher(): ServerActionDispatcher | null;
|
||||
export declare function urlToUrlWithoutFlightMarker(url: string): URL;
|
||||
type AppRouterProps = Omit<Omit<InitialRouterStateParameters, 'isServer' | 'location'>, 'initialParallelRoutes'> & {
|
||||
buildId: string;
|
||||
initialHead: ReactNode;
|
||||
assetPrefix: string;
|
||||
missingSlots: Set<string>;
|
||||
};
|
||||
export declare function createEmptyCacheNode(): CacheNode;
|
||||
export default function AppRouter(props: AppRouterProps & {
|
||||
globalErrorComponent: ErrorComponent;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
603
node_modules/next/dist/client/components/app-router.js
generated
vendored
Normal file
603
node_modules/next/dist/client/components/app-router.js
generated
vendored
Normal file
@ -0,0 +1,603 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
createEmptyCacheNode: null,
|
||||
default: null,
|
||||
getServerActionDispatcher: null,
|
||||
urlToUrlWithoutFlightMarker: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
createEmptyCacheNode: function() {
|
||||
return createEmptyCacheNode;
|
||||
},
|
||||
default: function() {
|
||||
return AppRouter;
|
||||
},
|
||||
getServerActionDispatcher: function() {
|
||||
return getServerActionDispatcher;
|
||||
},
|
||||
urlToUrlWithoutFlightMarker: function() {
|
||||
return urlToUrlWithoutFlightMarker;
|
||||
}
|
||||
});
|
||||
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
||||
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
|
||||
const _routerreducertypes = require("./router-reducer/router-reducer-types");
|
||||
const _createhreffromurl = require("./router-reducer/create-href-from-url");
|
||||
const _hooksclientcontextsharedruntime = require("../../shared/lib/hooks-client-context.shared-runtime");
|
||||
const _usereducerwithdevtools = require("./use-reducer-with-devtools");
|
||||
const _errorboundary = require("./error-boundary");
|
||||
const _createinitialrouterstate = require("./router-reducer/create-initial-router-state");
|
||||
const _isbot = require("../../shared/lib/router/utils/is-bot");
|
||||
const _addbasepath = require("../add-base-path");
|
||||
const _approuterannouncer = require("./app-router-announcer");
|
||||
const _redirectboundary = require("./redirect-boundary");
|
||||
const _findheadincache = require("./router-reducer/reducers/find-head-in-cache");
|
||||
const _unresolvedthenable = require("./unresolved-thenable");
|
||||
const _approuterheaders = require("./app-router-headers");
|
||||
const _removebasepath = require("../remove-base-path");
|
||||
const _hasbasepath = require("../has-base-path");
|
||||
const _segment = require("../../shared/lib/segment");
|
||||
const isServer = typeof window === "undefined";
|
||||
// Ensure the initialParallelRoutes are not combined because of double-rendering in the browser with Strict Mode.
|
||||
let initialParallelRoutes = isServer ? null : new Map();
|
||||
let globalServerActionDispatcher = null;
|
||||
function getServerActionDispatcher() {
|
||||
return globalServerActionDispatcher;
|
||||
}
|
||||
const globalMutable = {};
|
||||
function urlToUrlWithoutFlightMarker(url) {
|
||||
const urlWithoutFlightParameters = new URL(url, location.origin);
|
||||
urlWithoutFlightParameters.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY);
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
if (process.env.__NEXT_CONFIG_OUTPUT === "export" && urlWithoutFlightParameters.pathname.endsWith(".txt")) {
|
||||
const { pathname } = urlWithoutFlightParameters;
|
||||
const length = pathname.endsWith("/index.txt") ? 10 : 4;
|
||||
// Slice off `/index.txt` or `.txt` from the end of the pathname
|
||||
urlWithoutFlightParameters.pathname = pathname.slice(0, -length);
|
||||
}
|
||||
}
|
||||
return urlWithoutFlightParameters;
|
||||
}
|
||||
// this function performs a depth-first search of the tree to find the selected
|
||||
// params
|
||||
function getSelectedParams(currentTree, params) {
|
||||
if (params === void 0) params = {};
|
||||
const parallelRoutes = currentTree[1];
|
||||
for (const parallelRoute of Object.values(parallelRoutes)){
|
||||
const segment = parallelRoute[0];
|
||||
const isDynamicParameter = Array.isArray(segment);
|
||||
const segmentValue = isDynamicParameter ? segment[1] : segment;
|
||||
if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) continue;
|
||||
// Ensure catchAll and optional catchall are turned into an array
|
||||
const isCatchAll = isDynamicParameter && (segment[2] === "c" || segment[2] === "oc");
|
||||
if (isCatchAll) {
|
||||
params[segment[0]] = segment[1].split("/");
|
||||
} else if (isDynamicParameter) {
|
||||
params[segment[0]] = segment[1];
|
||||
}
|
||||
params = getSelectedParams(parallelRoute, params);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
function isExternalURL(url) {
|
||||
return url.origin !== window.location.origin;
|
||||
}
|
||||
function HistoryUpdater(param) {
|
||||
let { appRouterState, sync } = param;
|
||||
(0, _react.useInsertionEffect)(()=>{
|
||||
const { tree, pushRef, canonicalUrl } = appRouterState;
|
||||
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: tree
|
||||
};
|
||||
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.
|
||||
(0, _createhreffromurl.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);
|
||||
}
|
||||
sync(appRouterState);
|
||||
}, [
|
||||
appRouterState,
|
||||
sync
|
||||
]);
|
||||
return null;
|
||||
}
|
||||
function createEmptyCacheNode() {
|
||||
return {
|
||||
lazyData: null,
|
||||
rsc: null,
|
||||
prefetchRsc: null,
|
||||
head: null,
|
||||
prefetchHead: null,
|
||||
parallelRoutes: new Map(),
|
||||
lazyDataResolved: false,
|
||||
loading: null
|
||||
};
|
||||
}
|
||||
function useServerActionDispatcher(dispatch) {
|
||||
const serverActionDispatcher = (0, _react.useCallback)((actionPayload)=>{
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
...actionPayload,
|
||||
type: _routerreducertypes.ACTION_SERVER_ACTION
|
||||
});
|
||||
});
|
||||
}, [
|
||||
dispatch
|
||||
]);
|
||||
globalServerActionDispatcher = serverActionDispatcher;
|
||||
}
|
||||
/**
|
||||
* Server response that only patches the cache and tree.
|
||||
*/ function useChangeByServerResponse(dispatch) {
|
||||
return (0, _react.useCallback)((param)=>{
|
||||
let { previousTree, serverResponse } = param;
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_SERVER_PATCH,
|
||||
previousTree,
|
||||
serverResponse
|
||||
});
|
||||
});
|
||||
}, [
|
||||
dispatch
|
||||
]);
|
||||
}
|
||||
function useNavigate(dispatch) {
|
||||
return (0, _react.useCallback)((href, navigateType, shouldScroll)=>{
|
||||
const url = new URL((0, _addbasepath.addBasePath)(href), location.href);
|
||||
return dispatch({
|
||||
type: _routerreducertypes.ACTION_NAVIGATE,
|
||||
url,
|
||||
isExternalUrl: isExternalURL(url),
|
||||
locationSearch: location.search,
|
||||
shouldScroll: shouldScroll != null ? shouldScroll : true,
|
||||
navigateType
|
||||
});
|
||||
}, [
|
||||
dispatch
|
||||
]);
|
||||
}
|
||||
function copyNextJsInternalHistoryState(data) {
|
||||
if (data == null) data = {};
|
||||
const currentState = window.history.state;
|
||||
const __NA = currentState == null ? void 0 : currentState.__NA;
|
||||
if (__NA) {
|
||||
data.__NA = __NA;
|
||||
}
|
||||
const __PRIVATE_NEXTJS_INTERNALS_TREE = currentState == null ? void 0 : currentState.__PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
if (__PRIVATE_NEXTJS_INTERNALS_TREE) {
|
||||
data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function Head(param) {
|
||||
let { headCacheNode } = param;
|
||||
// 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.
|
||||
//
|
||||
// @ts-expect-error The second argument to `useDeferredValue` is only
|
||||
// available in the experimental builds. When its disabled, it will always
|
||||
// return `head`.
|
||||
return (0, _react.useDeferredValue)(head, resolvedPrefetchRsc);
|
||||
}
|
||||
/**
|
||||
* The global router that wraps the application components.
|
||||
*/ function Router(param) {
|
||||
let { buildId, initialHead, initialTree, urlParts, initialSeedData, couldBeIntercepted, assetPrefix, missingSlots } = param;
|
||||
const initialState = (0, _react.useMemo)(()=>(0, _createinitialrouterstate.createInitialRouterState)({
|
||||
buildId,
|
||||
initialSeedData,
|
||||
urlParts,
|
||||
initialTree,
|
||||
initialParallelRoutes,
|
||||
location: !isServer ? window.location : null,
|
||||
initialHead,
|
||||
couldBeIntercepted
|
||||
}), [
|
||||
buildId,
|
||||
initialSeedData,
|
||||
urlParts,
|
||||
initialTree,
|
||||
initialHead,
|
||||
couldBeIntercepted
|
||||
]);
|
||||
const [reducerState, dispatch, sync] = (0, _usereducerwithdevtools.useReducerWithReduxDevtools)(initialState);
|
||||
(0, _react.useEffect)(()=>{
|
||||
// Ensure initialParallelRoutes is cleaned up from memory once it's used.
|
||||
initialParallelRoutes = null;
|
||||
}, []);
|
||||
const { canonicalUrl } = (0, _usereducerwithdevtools.useUnwrapState)(reducerState);
|
||||
// Add memoized pathname/query for useSearchParams and usePathname.
|
||||
const { searchParams, pathname } = (0, _react.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: (0, _hasbasepath.hasBasePath)(url.pathname) ? (0, _removebasepath.removeBasePath)(url.pathname) : url.pathname
|
||||
};
|
||||
}, [
|
||||
canonicalUrl
|
||||
]);
|
||||
const changeByServerResponse = useChangeByServerResponse(dispatch);
|
||||
const navigate = useNavigate(dispatch);
|
||||
useServerActionDispatcher(dispatch);
|
||||
/**
|
||||
* The app router that is exposed through `useRouter`. It's only concerned with dispatching actions to the reducer, does not hold state.
|
||||
*/ const appRouter = (0, _react.useMemo)(()=>{
|
||||
const routerInstance = {
|
||||
back: ()=>window.history.back(),
|
||||
forward: ()=>window.history.forward(),
|
||||
prefetch: (href, options)=>{
|
||||
// Don't prefetch for bots as they don't navigate.
|
||||
if ((0, _isbot.isBot)(window.navigator.userAgent)) {
|
||||
return;
|
||||
}
|
||||
let url;
|
||||
try {
|
||||
url = new URL((0, _addbasepath.addBasePath)(href), window.location.href);
|
||||
} catch (_) {
|
||||
throw new Error("Cannot prefetch '" + href + "' because it cannot be converted to a URL.");
|
||||
}
|
||||
// Don't prefetch during development (improves compilation performance)
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return;
|
||||
}
|
||||
// External urls can't be prefetched in the same way.
|
||||
if (isExternalURL(url)) {
|
||||
return;
|
||||
}
|
||||
(0, _react.startTransition)(()=>{
|
||||
var _options_kind;
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_PREFETCH,
|
||||
url,
|
||||
kind: (_options_kind = options == null ? void 0 : options.kind) != null ? _options_kind : _routerreducertypes.PrefetchKind.FULL
|
||||
});
|
||||
});
|
||||
},
|
||||
replace: (href, options)=>{
|
||||
if (options === void 0) options = {};
|
||||
(0, _react.startTransition)(()=>{
|
||||
var _options_scroll;
|
||||
navigate(href, "replace", (_options_scroll = options.scroll) != null ? _options_scroll : true);
|
||||
});
|
||||
},
|
||||
push: (href, options)=>{
|
||||
if (options === void 0) options = {};
|
||||
(0, _react.startTransition)(()=>{
|
||||
var _options_scroll;
|
||||
navigate(href, "push", (_options_scroll = options.scroll) != null ? _options_scroll : true);
|
||||
});
|
||||
},
|
||||
refresh: ()=>{
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_REFRESH,
|
||||
origin: window.location.origin
|
||||
});
|
||||
});
|
||||
},
|
||||
fastRefresh: ()=>{
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
throw new Error("fastRefresh can only be used in development mode. Please use refresh instead.");
|
||||
} else {
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_FAST_REFRESH,
|
||||
origin: window.location.origin
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
return routerInstance;
|
||||
}, [
|
||||
dispatch,
|
||||
navigate
|
||||
]);
|
||||
(0, _react.useEffect)(()=>{
|
||||
// Exists for debugging purposes. Don't use in application code.
|
||||
if (window.next) {
|
||||
window.next.router = appRouter;
|
||||
}
|
||||
}, [
|
||||
appRouter
|
||||
]);
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const { cache, prefetchCache, tree } = (0, _usereducerwithdevtools.useUnwrapState)(reducerState);
|
||||
// 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
|
||||
(0, _react.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: appRouter,
|
||||
cache,
|
||||
prefetchCache,
|
||||
tree
|
||||
};
|
||||
}, [
|
||||
appRouter,
|
||||
cache,
|
||||
prefetchCache,
|
||||
tree
|
||||
]);
|
||||
}
|
||||
(0, _react.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) {
|
||||
var _window_history_state;
|
||||
if (!event.persisted || !((_window_history_state = window.history.state) == null ? void 0 : _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;
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_RESTORE,
|
||||
url: new URL(window.location.href),
|
||||
tree: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE
|
||||
});
|
||||
}
|
||||
window.addEventListener("pageshow", handlePageShow);
|
||||
return ()=>{
|
||||
window.removeEventListener("pageshow", handlePageShow);
|
||||
};
|
||||
}, [
|
||||
dispatch
|
||||
]);
|
||||
// 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 } = (0, _usereducerwithdevtools.useUnwrapState)(reducerState);
|
||||
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 location1 = window.location;
|
||||
if (pushRef.pendingPush) {
|
||||
location1.assign(canonicalUrl);
|
||||
} else {
|
||||
location1.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?
|
||||
(0, _react.use)(_unresolvedthenable.unresolvedThenable);
|
||||
}
|
||||
(0, _react.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)=>{
|
||||
var _window_history_state;
|
||||
const href = window.location.href;
|
||||
const tree = (_window_history_state = window.history.state) == null ? void 0 : _window_history_state.__PRIVATE_NEXTJS_INTERNALS_TREE;
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_RESTORE,
|
||||
url: new URL(url != null ? url : href, href),
|
||||
tree
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 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) {
|
||||
// Avoid a loop when Next.js internals trigger pushState/replaceState
|
||||
if ((data == null ? void 0 : data.__NA) || (data == null ? void 0 : 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) {
|
||||
// Avoid a loop when Next.js internals trigger pushState/replaceState
|
||||
if ((data == null ? void 0 : data.__NA) || (data == null ? void 0 : 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 = (param)=>{
|
||||
let { state } = param;
|
||||
if (!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 (!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
|
||||
(0, _react.startTransition)(()=>{
|
||||
dispatch({
|
||||
type: _routerreducertypes.ACTION_RESTORE,
|
||||
url: new URL(window.location.href),
|
||||
tree: 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);
|
||||
};
|
||||
}, [
|
||||
dispatch
|
||||
]);
|
||||
const { cache, tree, nextUrl, focusAndScrollRef } = (0, _usereducerwithdevtools.useUnwrapState)(reducerState);
|
||||
const matchingHead = (0, _react.useMemo)(()=>{
|
||||
return (0, _findheadincache.findHeadInCache)(cache, tree[1]);
|
||||
}, [
|
||||
cache,
|
||||
tree
|
||||
]);
|
||||
// Add memoized pathParams for useParams.
|
||||
const pathParams = (0, _react.useMemo)(()=>{
|
||||
return getSelectedParams(tree);
|
||||
}, [
|
||||
tree
|
||||
]);
|
||||
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] = matchingHead;
|
||||
head = /*#__PURE__*/ (0, _jsxruntime.jsx)(Head, {
|
||||
headCacheNode: headCacheNode
|
||||
}, headKey);
|
||||
} else {
|
||||
head = null;
|
||||
}
|
||||
let content = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_redirectboundary.RedirectBoundary, {
|
||||
children: [
|
||||
head,
|
||||
cache.rsc,
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(_approuterannouncer.AppRouterAnnouncer, {
|
||||
tree: tree
|
||||
})
|
||||
]
|
||||
});
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
if (typeof window !== "undefined") {
|
||||
const DevRootNotFoundBoundary = require("./dev-root-not-found-boundary").DevRootNotFoundBoundary;
|
||||
content = /*#__PURE__*/ (0, _jsxruntime.jsx)(DevRootNotFoundBoundary, {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.MissingSlotContext.Provider, {
|
||||
value: missingSlots,
|
||||
children: content
|
||||
})
|
||||
});
|
||||
}
|
||||
const HotReloader = require("./react-dev-overlay/app/hot-reloader-client").default;
|
||||
content = /*#__PURE__*/ (0, _jsxruntime.jsx)(HotReloader, {
|
||||
assetPrefix: assetPrefix,
|
||||
children: content
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(HistoryUpdater, {
|
||||
appRouterState: (0, _usereducerwithdevtools.useUnwrapState)(reducerState),
|
||||
sync: sync
|
||||
}),
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(_hooksclientcontextsharedruntime.PathParamsContext.Provider, {
|
||||
value: pathParams,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_hooksclientcontextsharedruntime.PathnameContext.Provider, {
|
||||
value: pathname,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_hooksclientcontextsharedruntime.SearchParamsContext.Provider, {
|
||||
value: searchParams,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.GlobalLayoutRouterContext.Provider, {
|
||||
value: {
|
||||
buildId,
|
||||
changeByServerResponse,
|
||||
tree,
|
||||
focusAndScrollRef,
|
||||
nextUrl
|
||||
},
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.AppRouterContext.Provider, {
|
||||
value: appRouter,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.LayoutRouterContext.Provider, {
|
||||
value: {
|
||||
childNodes: cache.parallelRoutes,
|
||||
tree,
|
||||
// Root node always has `url`
|
||||
// Provided in AppTreeContext to ensure it can be overwritten in layout-router
|
||||
url: canonicalUrl,
|
||||
loading: cache.loading
|
||||
},
|
||||
children: content
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
function AppRouter(props) {
|
||||
const { globalErrorComponent, ...rest } = props;
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_errorboundary.ErrorBoundary, {
|
||||
errorComponent: globalErrorComponent,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Router, {
|
||||
...rest
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-router.js.map
|
||||
1
node_modules/next/dist/client/components/app-router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/app-router.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/next/dist/client/components/async-local-storage.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/client/components/async-local-storage.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="node" />
|
||||
import type { AsyncLocalStorage } from 'async_hooks';
|
||||
export declare function createAsyncLocalStorage<Store extends {}>(): AsyncLocalStorage<Store>;
|
||||
44
node_modules/next/dist/client/components/async-local-storage.js
generated
vendored
Normal file
44
node_modules/next/dist/client/components/async-local-storage.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createAsyncLocalStorage", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createAsyncLocalStorage;
|
||||
}
|
||||
});
|
||||
const sharedAsyncLocalStorageNotAvailableError = new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");
|
||||
class FakeAsyncLocalStorage {
|
||||
disable() {
|
||||
throw sharedAsyncLocalStorageNotAvailableError;
|
||||
}
|
||||
getStore() {
|
||||
// This fake implementation of AsyncLocalStorage always returns `undefined`.
|
||||
return undefined;
|
||||
}
|
||||
run() {
|
||||
throw sharedAsyncLocalStorageNotAvailableError;
|
||||
}
|
||||
exit() {
|
||||
throw sharedAsyncLocalStorageNotAvailableError;
|
||||
}
|
||||
enterWith() {
|
||||
throw sharedAsyncLocalStorageNotAvailableError;
|
||||
}
|
||||
}
|
||||
const maybeGlobalAsyncLocalStorage = globalThis.AsyncLocalStorage;
|
||||
function createAsyncLocalStorage() {
|
||||
if (maybeGlobalAsyncLocalStorage) {
|
||||
return new maybeGlobalAsyncLocalStorage();
|
||||
}
|
||||
return new FakeAsyncLocalStorage();
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=async-local-storage.js.map
|
||||
1
node_modules/next/dist/client/components/async-local-storage.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/async-local-storage.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/async-local-storage.ts"],"names":["createAsyncLocalStorage","sharedAsyncLocalStorageNotAvailableError","Error","FakeAsyncLocalStorage","disable","getStore","undefined","run","exit","enterWith","maybeGlobalAsyncLocalStorage","globalThis","AsyncLocalStorage"],"mappings":";;;;+BAiCgBA;;;eAAAA;;;AA/BhB,MAAMC,2CAA2C,IAAIC,MACnD;AAGF,MAAMC;IAGJC,UAAgB;QACd,MAAMH;IACR;IAEAI,WAA8B;QAC5B,4EAA4E;QAC5E,OAAOC;IACT;IAEAC,MAAY;QACV,MAAMN;IACR;IAEAO,OAAa;QACX,MAAMP;IACR;IAEAQ,YAAkB;QAChB,MAAMR;IACR;AACF;AAEA,MAAMS,+BAA+B,AAACC,WAAmBC,iBAAiB;AAEnE,SAASZ;IAGd,IAAIU,8BAA8B;QAChC,OAAO,IAAIA;IACb;IACA,OAAO,IAAIP;AACb"}
|
||||
1
node_modules/next/dist/client/components/bailout-to-client-rendering.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/components/bailout-to-client-rendering.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function bailoutToClientRendering(reason: string): void | never;
|
||||
25
node_modules/next/dist/client/components/bailout-to-client-rendering.js
generated
vendored
Normal file
25
node_modules/next/dist/client/components/bailout-to-client-rendering.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "bailoutToClientRendering", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return bailoutToClientRendering;
|
||||
}
|
||||
});
|
||||
const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
|
||||
const _staticgenerationasyncstorageexternal = require("./static-generation-async-storage.external");
|
||||
function bailoutToClientRendering(reason) {
|
||||
const staticGenerationStore = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if (staticGenerationStore == null ? void 0 : staticGenerationStore.forceStatic) return;
|
||||
if (staticGenerationStore == null ? void 0 : staticGenerationStore.isStaticGeneration) throw new _bailouttocsr.BailoutToCSRError(reason);
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=bailout-to-client-rendering.js.map
|
||||
1
node_modules/next/dist/client/components/bailout-to-client-rendering.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/bailout-to-client-rendering.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/bailout-to-client-rendering.ts"],"names":["bailoutToClientRendering","reason","staticGenerationStore","staticGenerationAsyncStorage","getStore","forceStatic","isStaticGeneration","BailoutToCSRError"],"mappings":";;;;+BAGgBA;;;eAAAA;;;8BAHkB;sDACW;AAEtC,SAASA,yBAAyBC,MAAc;IACrD,MAAMC,wBAAwBC,kEAA4B,CAACC,QAAQ;IAEnE,IAAIF,yCAAAA,sBAAuBG,WAAW,EAAE;IAExC,IAAIH,yCAAAA,sBAAuBI,kBAAkB,EAC3C,MAAM,IAAIC,+BAAiB,CAACN;AAChC"}
|
||||
7
node_modules/next/dist/client/components/client-page.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/client/components/client-page.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/// <reference types="react" />
|
||||
export declare function ClientPageRoot({ Component, props, }: {
|
||||
Component: React.ComponentType<any>;
|
||||
props: {
|
||||
[props: string]: any;
|
||||
};
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
35
node_modules/next/dist/client/components/client-page.js
generated
vendored
Normal file
35
node_modules/next/dist/client/components/client-page.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "ClientPageRoot", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return ClientPageRoot;
|
||||
}
|
||||
});
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _searchparams = require("./search-params");
|
||||
function ClientPageRoot(param) {
|
||||
let { Component, props } = param;
|
||||
// We expect to be passed searchParams but even if we aren't we can construct one from
|
||||
// an empty object. We only do this if we are in a static generation as a performance
|
||||
// optimization. Ideally we'd unconditionally construct the tracked params but since
|
||||
// this creates a proxy which is slow and this would happen even for client navigations
|
||||
// that are done entirely dynamically and we know there the dynamic tracking is a noop
|
||||
// in this dynamic case we can safely elide it.
|
||||
props.searchParams = (0, _searchparams.createDynamicallyTrackedSearchParams)(props.searchParams || {});
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=client-page.js.map
|
||||
1
node_modules/next/dist/client/components/client-page.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/client-page.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/client-page.tsx"],"names":["ClientPageRoot","Component","props","searchParams","createDynamicallyTrackedSearchParams"],"mappings":"AAAA;;;;;+BAGgBA;;;eAAAA;;;;8BAFqC;AAE9C,SAASA,eAAe,KAM9B;IAN8B,IAAA,EAC7BC,SAAS,EACTC,KAAK,EAIN,GAN8B;IAO7B,sFAAsF;IACtF,qFAAqF;IACrF,oFAAoF;IACpF,uFAAuF;IACvF,sFAAsF;IACtF,+CAA+C;IAC/CA,MAAMC,YAAY,GAAGC,IAAAA,kDAAoC,EACvDF,MAAMC,YAAY,IAAI,CAAC;IAEzB,qBAAO,qBAACF;QAAW,GAAGC,KAAK;;AAC7B"}
|
||||
4
node_modules/next/dist/client/components/default-layout.d.ts
generated
vendored
Normal file
4
node_modules/next/dist/client/components/default-layout.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import React from 'react';
|
||||
export default function DefaultLayout({ children, }: {
|
||||
children: React.ReactNode;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
29
node_modules/next/dist/client/components/default-layout.js
generated
vendored
Normal file
29
node_modules/next/dist/client/components/default-layout.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return DefaultLayout;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
||||
function DefaultLayout(param) {
|
||||
let { children } = param;
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)("html", {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("body", {
|
||||
children: children
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=default-layout.js.map
|
||||
1
node_modules/next/dist/client/components/default-layout.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/default-layout.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/default-layout.tsx"],"names":["DefaultLayout","children","html","body"],"mappings":";;;;+BAEA;;;eAAwBA;;;;;gEAFN;AAEH,SAASA,cAAc,KAIrC;IAJqC,IAAA,EACpCC,QAAQ,EAGT,GAJqC;IAKpC,qBACE,qBAACC;kBACC,cAAA,qBAACC;sBAAMF;;;AAGb"}
|
||||
5
node_modules/next/dist/client/components/dev-root-not-found-boundary.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/client/components/dev-root-not-found-boundary.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
export declare function bailOnNotFound(): void;
|
||||
export declare function DevRootNotFoundBoundary({ children, }: {
|
||||
children: React.ReactNode;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
50
node_modules/next/dist/client/components/dev-root-not-found-boundary.js
generated
vendored
Normal file
50
node_modules/next/dist/client/components/dev-root-not-found-boundary.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
DevRootNotFoundBoundary: null,
|
||||
bailOnNotFound: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
DevRootNotFoundBoundary: function() {
|
||||
return DevRootNotFoundBoundary;
|
||||
},
|
||||
bailOnNotFound: function() {
|
||||
return bailOnNotFound;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
||||
const _notfoundboundary = require("./not-found-boundary");
|
||||
function bailOnNotFound() {
|
||||
throw new Error("notFound() is not allowed to use in root layout");
|
||||
}
|
||||
function NotAllowedRootNotFoundError() {
|
||||
bailOnNotFound();
|
||||
return null;
|
||||
}
|
||||
function DevRootNotFoundBoundary(param) {
|
||||
let { children } = param;
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_notfoundboundary.NotFoundBoundary, {
|
||||
notFound: /*#__PURE__*/ (0, _jsxruntime.jsx)(NotAllowedRootNotFoundError, {}),
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=dev-root-not-found-boundary.js.map
|
||||
1
node_modules/next/dist/client/components/dev-root-not-found-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/dev-root-not-found-boundary.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/dev-root-not-found-boundary.tsx"],"names":["DevRootNotFoundBoundary","bailOnNotFound","Error","NotAllowedRootNotFoundError","children","NotFoundBoundary","notFound"],"mappings":"AAAA;;;;;;;;;;;;;;;;IAcgBA,uBAAuB;eAAvBA;;IATAC,cAAc;eAAdA;;;;;gEAHE;kCACe;AAE1B,SAASA;IACd,MAAM,IAAIC,MAAM;AAClB;AAEA,SAASC;IACPF;IACA,OAAO;AACT;AAEO,SAASD,wBAAwB,KAIvC;IAJuC,IAAA,EACtCI,QAAQ,EAGT,GAJuC;IAKtC,qBACE,qBAACC,kCAAgB;QAACC,wBAAU,qBAACH;kBAC1BC;;AAGP"}
|
||||
7
node_modules/next/dist/client/components/draft-mode.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/client/components/draft-mode.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import type { DraftModeProvider } from '../../server/async-storage/draft-mode-provider';
|
||||
export declare class DraftMode {
|
||||
constructor(provider: DraftModeProvider);
|
||||
get isEnabled(): boolean;
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
}
|
||||
46
node_modules/next/dist/client/components/draft-mode.js
generated
vendored
Normal file
46
node_modules/next/dist/client/components/draft-mode.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "DraftMode", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return DraftMode;
|
||||
}
|
||||
});
|
||||
const _staticgenerationasyncstorageexternal = require("./static-generation-async-storage.external");
|
||||
const _dynamicrendering = require("../../server/app-render/dynamic-rendering");
|
||||
class DraftMode {
|
||||
get isEnabled() {
|
||||
return this._provider.isEnabled;
|
||||
}
|
||||
enable() {
|
||||
const store = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if (store) {
|
||||
// We we have a store we want to track dynamic data access to ensure we
|
||||
// don't statically generate routes that manipulate draft mode.
|
||||
(0, _dynamicrendering.trackDynamicDataAccessed)(store, "draftMode().enable()");
|
||||
}
|
||||
return this._provider.enable();
|
||||
}
|
||||
disable() {
|
||||
const store = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if (store) {
|
||||
// We we have a store we want to track dynamic data access to ensure we
|
||||
// don't statically generate routes that manipulate draft mode.
|
||||
(0, _dynamicrendering.trackDynamicDataAccessed)(store, "draftMode().disable()");
|
||||
}
|
||||
return this._provider.disable();
|
||||
}
|
||||
constructor(provider){
|
||||
this._provider = provider;
|
||||
}
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=draft-mode.js.map
|
||||
1
node_modules/next/dist/client/components/draft-mode.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/draft-mode.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/draft-mode.ts"],"names":["DraftMode","isEnabled","_provider","enable","store","staticGenerationAsyncStorage","getStore","trackDynamicDataAccessed","disable","constructor","provider"],"mappings":";;;;+BAKaA;;;eAAAA;;;sDAHgC;kCACJ;AAElC,MAAMA;IASX,IAAIC,YAAY;QACd,OAAO,IAAI,CAACC,SAAS,CAACD,SAAS;IACjC;IACOE,SAAS;QACd,MAAMC,QAAQC,kEAA4B,CAACC,QAAQ;QACnD,IAAIF,OAAO;YACT,uEAAuE;YACvE,+DAA+D;YAC/DG,IAAAA,0CAAwB,EAACH,OAAO;QAClC;QACA,OAAO,IAAI,CAACF,SAAS,CAACC,MAAM;IAC9B;IACOK,UAAU;QACf,MAAMJ,QAAQC,kEAA4B,CAACC,QAAQ;QACnD,IAAIF,OAAO;YACT,uEAAuE;YACvE,+DAA+D;YAC/DG,IAAAA,0CAAwB,EAACH,OAAO;QAClC;QACA,OAAO,IAAI,CAACF,SAAS,CAACM,OAAO;IAC/B;IAvBAC,YAAYC,QAA2B,CAAE;QACvC,IAAI,CAACR,SAAS,GAAGQ;IACnB;AAsBF"}
|
||||
43
node_modules/next/dist/client/components/error-boundary.d.ts
generated
vendored
Normal file
43
node_modules/next/dist/client/components/error-boundary.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
export type ErrorComponent = React.ComponentType<{
|
||||
error: Error;
|
||||
reset: () => void;
|
||||
}>;
|
||||
export interface ErrorBoundaryProps {
|
||||
children?: React.ReactNode;
|
||||
errorComponent: ErrorComponent | undefined;
|
||||
errorStyles?: React.ReactNode | undefined;
|
||||
errorScripts?: React.ReactNode | undefined;
|
||||
}
|
||||
interface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {
|
||||
pathname: string;
|
||||
errorComponent: ErrorComponent;
|
||||
}
|
||||
interface ErrorBoundaryHandlerState {
|
||||
error: Error | null;
|
||||
previousPathname: string;
|
||||
}
|
||||
export declare class ErrorBoundaryHandler extends React.Component<ErrorBoundaryHandlerProps, ErrorBoundaryHandlerState> {
|
||||
constructor(props: ErrorBoundaryHandlerProps);
|
||||
static getDerivedStateFromError(error: Error): {
|
||||
error: Error;
|
||||
};
|
||||
static getDerivedStateFromProps(props: ErrorBoundaryHandlerProps, state: ErrorBoundaryHandlerState): ErrorBoundaryHandlerState | null;
|
||||
reset: () => void;
|
||||
render(): React.ReactNode;
|
||||
}
|
||||
export declare function GlobalError({ error }: {
|
||||
error: any;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
export default GlobalError;
|
||||
/**
|
||||
* 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 declare function ErrorBoundary({ errorComponent, errorStyles, errorScripts, children, }: ErrorBoundaryProps & {
|
||||
children: React.ReactNode;
|
||||
}): JSX.Element;
|
||||
187
node_modules/next/dist/client/components/error-boundary.js
generated
vendored
Normal file
187
node_modules/next/dist/client/components/error-boundary.js
generated
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ErrorBoundary: null,
|
||||
ErrorBoundaryHandler: null,
|
||||
GlobalError: null,
|
||||
default: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ErrorBoundary: function() {
|
||||
return ErrorBoundary;
|
||||
},
|
||||
ErrorBoundaryHandler: function() {
|
||||
return ErrorBoundaryHandler;
|
||||
},
|
||||
GlobalError: function() {
|
||||
return GlobalError;
|
||||
},
|
||||
// Exported so that the import signature in the loaders can be identical to user
|
||||
// supplied custom global error signatures.
|
||||
default: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
||||
const _navigation = require("./navigation");
|
||||
const _isnextroutererror = require("./is-next-router-error");
|
||||
const _staticgenerationasyncstorageexternal = require("./static-generation-async-storage.external");
|
||||
const styles = {
|
||||
error: {
|
||||
// https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52
|
||||
fontFamily: 'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',
|
||||
height: "100vh",
|
||||
textAlign: "center",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center"
|
||||
},
|
||||
text: {
|
||||
fontSize: "14px",
|
||||
fontWeight: 400,
|
||||
lineHeight: "28px",
|
||||
margin: "0 8px"
|
||||
}
|
||||
};
|
||||
// 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
|
||||
function HandleISRError(param) {
|
||||
let { error } = param;
|
||||
const store = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if ((store == null ? void 0 : store.isRevalidate) || (store == null ? void 0 : store.isStaticGeneration)) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
class ErrorBoundaryHandler extends _react.default.Component {
|
||||
static getDerivedStateFromError(error) {
|
||||
if ((0, _isnextroutererror.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) {
|
||||
/**
|
||||
* 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 the the `@types/react` version.
|
||||
render() {
|
||||
if (this.state.error) {
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(HandleISRError, {
|
||||
error: this.state.error
|
||||
}),
|
||||
this.props.errorStyles,
|
||||
this.props.errorScripts,
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(this.props.errorComponent, {
|
||||
error: this.state.error,
|
||||
reset: this.reset
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.reset = ()=>{
|
||||
this.setState({
|
||||
error: null
|
||||
});
|
||||
};
|
||||
this.state = {
|
||||
error: null,
|
||||
previousPathname: this.props.pathname
|
||||
};
|
||||
}
|
||||
}
|
||||
function GlobalError(param) {
|
||||
let { error } = param;
|
||||
const digest = error == null ? void 0 : error.digest;
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("html", {
|
||||
id: "__next_error__",
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)("head", {}),
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(HandleISRError, {
|
||||
error: error
|
||||
}),
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
||||
style: styles.error,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)("h2", {
|
||||
style: styles.text,
|
||||
children: "Application error: a " + (digest ? "server" : "client") + "-side exception has occurred (see the " + (digest ? "server logs" : "browser console") + " for more information)."
|
||||
}),
|
||||
digest ? /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
|
||||
style: styles.text,
|
||||
children: "Digest: " + digest
|
||||
}) : null
|
||||
]
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
const _default = GlobalError;
|
||||
function ErrorBoundary(param) {
|
||||
let { errorComponent, errorStyles, errorScripts, children } = param;
|
||||
const pathname = (0, _navigation.usePathname)();
|
||||
if (errorComponent) {
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(ErrorBoundaryHandler, {
|
||||
pathname: pathname,
|
||||
errorComponent: errorComponent,
|
||||
errorStyles: errorStyles,
|
||||
errorScripts: errorScripts,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=error-boundary.js.map
|
||||
1
node_modules/next/dist/client/components/error-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/error-boundary.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/error-boundary.tsx"],"names":["ErrorBoundary","ErrorBoundaryHandler","GlobalError","styles","error","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","text","fontSize","fontWeight","lineHeight","margin","HandleISRError","store","staticGenerationAsyncStorage","getStore","isRevalidate","isStaticGeneration","console","React","Component","getDerivedStateFromError","isNextRouterError","getDerivedStateFromProps","props","state","pathname","previousPathname","render","errorStyles","errorScripts","this","errorComponent","reset","children","constructor","setState","digest","html","id","head","body","div","style","h2","p","usePathname"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;IAoKgBA,aAAa;eAAbA;;IAtGHC,oBAAoB;eAApBA;;IAiEGC,WAAW;eAAXA;;IAwBhB,gFAAgF;IAChF,2CAA2C;IAC3C,OAA0B;eAA1B;;;;;gEAvJkB;4BACU;mCACM;sDACW;AAE7C,MAAMC,SAAS;IACbC,OAAO;QACL,0FAA0F;QAC1FC,YACE;QACFC,QAAQ;QACRC,WAAW;QACXC,SAAS;QACTC,eAAe;QACfC,YAAY;QACZC,gBAAgB;IAClB;IACAC,MAAM;QACJC,UAAU;QACVC,YAAY;QACZC,YAAY;QACZC,QAAQ;IACV;AACF;AAwBA,8DAA8D;AAC9D,yDAAyD;AACzD,oCAAoC;AACpC,SAASC,eAAe,KAAyB;IAAzB,IAAA,EAAEb,KAAK,EAAkB,GAAzB;IACtB,MAAMc,QAAQC,kEAA4B,CAACC,QAAQ;IACnD,IAAIF,CAAAA,yBAAAA,MAAOG,YAAY,MAAIH,yBAAAA,MAAOI,kBAAkB,GAAE;QACpDC,QAAQnB,KAAK,CAACA;QACd,MAAMA;IACR;IAEA,OAAO;AACT;AAEO,MAAMH,6BAA6BuB,cAAK,CAACC,SAAS;IASvD,OAAOC,yBAAyBtB,KAAY,EAAE;QAC5C,IAAIuB,IAAAA,oCAAiB,EAACvB,QAAQ;YAC5B,+DAA+D;YAC/D,4GAA4G;YAC5G,MAAMA;QACR;QAEA,OAAO;YAAEA;QAAM;IACjB;IAEA,OAAOwB,yBACLC,KAAgC,EAChCC,KAAgC,EACE;QAClC;;;;;KAKC,GACD,IAAID,MAAME,QAAQ,KAAKD,MAAME,gBAAgB,IAAIF,MAAM1B,KAAK,EAAE;YAC5D,OAAO;gBACLA,OAAO;gBACP4B,kBAAkBH,MAAME,QAAQ;YAClC;QACF;QACA,OAAO;YACL3B,OAAO0B,MAAM1B,KAAK;YAClB4B,kBAAkBH,MAAME,QAAQ;QAClC;IACF;IAMA,0IAA0I;IAC1IE,SAA0B;QACxB,IAAI,IAAI,CAACH,KAAK,CAAC1B,KAAK,EAAE;YACpB,qBACE;;kCACE,qBAACa;wBAAeb,OAAO,IAAI,CAAC0B,KAAK,CAAC1B,KAAK;;oBACtC,IAAI,CAACyB,KAAK,CAACK,WAAW;oBACtB,IAAI,CAACL,KAAK,CAACM,YAAY;kCACxB,qBAACC,IAAI,CAACP,KAAK,CAACQ,cAAc;wBACxBjC,OAAO,IAAI,CAAC0B,KAAK,CAAC1B,KAAK;wBACvBkC,OAAO,IAAI,CAACA,KAAK;;;;QAIzB;QAEA,OAAO,IAAI,CAACT,KAAK,CAACU,QAAQ;IAC5B;IA1DAC,YAAYX,KAAgC,CAAE;QAC5C,KAAK,CAACA;aAoCRS,QAAQ;YACN,IAAI,CAACG,QAAQ,CAAC;gBAAErC,OAAO;YAAK;QAC9B;QArCE,IAAI,CAAC0B,KAAK,GAAG;YAAE1B,OAAO;YAAM4B,kBAAkB,IAAI,CAACH,KAAK,CAACE,QAAQ;QAAC;IACpE;AAwDF;AAEO,SAAS7B,YAAY,KAAyB;IAAzB,IAAA,EAAEE,KAAK,EAAkB,GAAzB;IAC1B,MAAMsC,SAA6BtC,yBAAAA,MAAOsC,MAAM;IAChD,qBACE,sBAACC;QAAKC,IAAG;;0BACP,qBAACC;0BACD,sBAACC;;kCACC,qBAAC7B;wBAAeb,OAAOA;;kCACvB,qBAAC2C;wBAAIC,OAAO7C,OAAOC,KAAK;kCACtB,cAAA,sBAAC2C;;8CACC,qBAACE;oCAAGD,OAAO7C,OAAOS,IAAI;8CACnB,AAAC,0BACA8B,CAAAA,SAAS,WAAW,QAAO,IAC5B,2CACCA,CAAAA,SAAS,gBAAgB,iBAAgB,IAC1C;;gCAEFA,uBAAS,qBAACQ;oCAAEF,OAAO7C,OAAOS,IAAI;8CAAG,AAAC,aAAU8B;qCAAgB;;;;;;;;AAMzE;MAIA,WAAexC;AAWR,SAASF,cAAc,KAKuB;IALvB,IAAA,EAC5BqC,cAAc,EACdH,WAAW,EACXC,YAAY,EACZI,QAAQ,EAC2C,GALvB;IAM5B,MAAMR,WAAWoB,IAAAA,uBAAW;IAC5B,IAAId,gBAAgB;QAClB,qBACE,qBAACpC;YACC8B,UAAUA;YACVM,gBAAgBA;YAChBH,aAAaA;YACbC,cAAcA;sBAEbI;;IAGP;IAEA,qBAAO;kBAAGA;;AACZ"}
|
||||
14
node_modules/next/dist/client/components/headers.d.ts
generated
vendored
Normal file
14
node_modules/next/dist/client/components/headers.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { type ReadonlyRequestCookies } from '../../server/web/spec-extension/adapters/request-cookies';
|
||||
import { DraftMode } from './draft-mode';
|
||||
/**
|
||||
* This function allows you to read the HTTP incoming request headers in
|
||||
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
||||
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),
|
||||
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and
|
||||
* [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).
|
||||
*
|
||||
* Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)
|
||||
*/
|
||||
export declare function headers(): import("../../server/web/spec-extension/adapters/headers").ReadonlyHeaders;
|
||||
export declare function cookies(): ReadonlyRequestCookies;
|
||||
export declare function draftMode(): DraftMode;
|
||||
82
node_modules/next/dist/client/components/headers.js
generated
vendored
Normal file
82
node_modules/next/dist/client/components/headers.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
cookies: null,
|
||||
draftMode: null,
|
||||
headers: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
cookies: function() {
|
||||
return cookies;
|
||||
},
|
||||
draftMode: function() {
|
||||
return draftMode;
|
||||
},
|
||||
headers: function() {
|
||||
return headers;
|
||||
}
|
||||
});
|
||||
const _requestcookies = require("../../server/web/spec-extension/adapters/request-cookies");
|
||||
const _headers = require("../../server/web/spec-extension/adapters/headers");
|
||||
const _cookies = require("../../server/web/spec-extension/cookies");
|
||||
const _actionasyncstorageexternal = require("./action-async-storage.external");
|
||||
const _draftmode = require("./draft-mode");
|
||||
const _dynamicrendering = require("../../server/app-render/dynamic-rendering");
|
||||
const _staticgenerationasyncstorageexternal = require("./static-generation-async-storage.external");
|
||||
const _requestasyncstorageexternal = require("./request-async-storage.external");
|
||||
function headers() {
|
||||
const callingExpression = "headers";
|
||||
const staticGenerationStore = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if (staticGenerationStore) {
|
||||
if (staticGenerationStore.forceStatic) {
|
||||
// When we are forcing static we don't mark this as a Dynamic read and we return an empty headers object
|
||||
return _headers.HeadersAdapter.seal(new Headers({}));
|
||||
} else {
|
||||
// We will return a real headers object below so we mark this call as reading from a dynamic data source
|
||||
(0, _dynamicrendering.trackDynamicDataAccessed)(staticGenerationStore, callingExpression);
|
||||
}
|
||||
}
|
||||
return (0, _requestasyncstorageexternal.getExpectedRequestStore)(callingExpression).headers;
|
||||
}
|
||||
function cookies() {
|
||||
const callingExpression = "cookies";
|
||||
const staticGenerationStore = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
||||
if (staticGenerationStore) {
|
||||
if (staticGenerationStore.forceStatic) {
|
||||
// When we are forcing static we don't mark this as a Dynamic read and we return an empty cookies object
|
||||
return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({})));
|
||||
} else {
|
||||
// We will return a real headers object below so we mark this call as reading from a dynamic data source
|
||||
(0, _dynamicrendering.trackDynamicDataAccessed)(staticGenerationStore, callingExpression);
|
||||
}
|
||||
}
|
||||
const requestStore = (0, _requestasyncstorageexternal.getExpectedRequestStore)(callingExpression);
|
||||
const asyncActionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore();
|
||||
if ((asyncActionStore == null ? void 0 : asyncActionStore.isAction) || (asyncActionStore == null ? void 0 : asyncActionStore.isAppRoute)) {
|
||||
// We can't conditionally return different types here based on the context.
|
||||
// To avoid confusion, we always return the readonly type here.
|
||||
return requestStore.mutableCookies;
|
||||
}
|
||||
return requestStore.cookies;
|
||||
}
|
||||
function draftMode() {
|
||||
const callingExpression = "draftMode";
|
||||
const requestStore = (0, _requestasyncstorageexternal.getExpectedRequestStore)(callingExpression);
|
||||
return new _draftmode.DraftMode(requestStore.draftMode);
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=headers.js.map
|
||||
1
node_modules/next/dist/client/components/headers.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/headers.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/headers.ts"],"names":["cookies","draftMode","headers","callingExpression","staticGenerationStore","staticGenerationAsyncStorage","getStore","forceStatic","HeadersAdapter","seal","Headers","trackDynamicDataAccessed","getExpectedRequestStore","RequestCookiesAdapter","RequestCookies","requestStore","asyncActionStore","actionAsyncStorage","isAction","isAppRoute","mutableCookies","DraftMode"],"mappings":";;;;;;;;;;;;;;;;IAsCgBA,OAAO;eAAPA;;IA0BAC,SAAS;eAATA;;IA3CAC,OAAO;eAAPA;;;gCAlBT;yBACwB;yBACA;4CACI;2BACT;kCACe;sDACI;6CACL;AAWjC,SAASA;IACd,MAAMC,oBAAoB;IAC1B,MAAMC,wBAAwBC,kEAA4B,CAACC,QAAQ;IAEnE,IAAIF,uBAAuB;QACzB,IAAIA,sBAAsBG,WAAW,EAAE;YACrC,wGAAwG;YACxG,OAAOC,uBAAc,CAACC,IAAI,CAAC,IAAIC,QAAQ,CAAC;QAC1C,OAAO;YACL,wGAAwG;YACxGC,IAAAA,0CAAwB,EAACP,uBAAuBD;QAClD;IACF;IAEA,OAAOS,IAAAA,oDAAuB,EAACT,mBAAmBD,OAAO;AAC3D;AAEO,SAASF;IACd,MAAMG,oBAAoB;IAC1B,MAAMC,wBAAwBC,kEAA4B,CAACC,QAAQ;IAEnE,IAAIF,uBAAuB;QACzB,IAAIA,sBAAsBG,WAAW,EAAE;YACrC,wGAAwG;YACxG,OAAOM,qCAAqB,CAACJ,IAAI,CAAC,IAAIK,uBAAc,CAAC,IAAIJ,QAAQ,CAAC;QACpE,OAAO;YACL,wGAAwG;YACxGC,IAAAA,0CAAwB,EAACP,uBAAuBD;QAClD;IACF;IAEA,MAAMY,eAAeH,IAAAA,oDAAuB,EAACT;IAE7C,MAAMa,mBAAmBC,8CAAkB,CAACX,QAAQ;IACpD,IAAIU,CAAAA,oCAAAA,iBAAkBE,QAAQ,MAAIF,oCAAAA,iBAAkBG,UAAU,GAAE;QAC9D,2EAA2E;QAC3E,+DAA+D;QAC/D,OAAOJ,aAAaK,cAAc;IACpC;IAEA,OAAOL,aAAaf,OAAO;AAC7B;AAEO,SAASC;IACd,MAAME,oBAAoB;IAC1B,MAAMY,eAAeH,IAAAA,oDAAuB,EAACT;IAE7C,OAAO,IAAIkB,oBAAS,CAACN,aAAad,SAAS;AAC7C"}
|
||||
8
node_modules/next/dist/client/components/hooks-server-context.d.ts
generated
vendored
Normal file
8
node_modules/next/dist/client/components/hooks-server-context.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
declare const DYNAMIC_ERROR_CODE = "DYNAMIC_SERVER_USAGE";
|
||||
export declare class DynamicServerError extends Error {
|
||||
readonly description: string;
|
||||
digest: typeof DYNAMIC_ERROR_CODE;
|
||||
constructor(description: string);
|
||||
}
|
||||
export declare function isDynamicServerError(err: unknown): err is DynamicServerError;
|
||||
export {};
|
||||
44
node_modules/next/dist/client/components/hooks-server-context.js
generated
vendored
Normal file
44
node_modules/next/dist/client/components/hooks-server-context.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
DynamicServerError: null,
|
||||
isDynamicServerError: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
DynamicServerError: function() {
|
||||
return DynamicServerError;
|
||||
},
|
||||
isDynamicServerError: function() {
|
||||
return isDynamicServerError;
|
||||
}
|
||||
});
|
||||
const DYNAMIC_ERROR_CODE = "DYNAMIC_SERVER_USAGE";
|
||||
class DynamicServerError extends Error {
|
||||
constructor(description){
|
||||
super("Dynamic server usage: " + description);
|
||||
this.description = description;
|
||||
this.digest = DYNAMIC_ERROR_CODE;
|
||||
}
|
||||
}
|
||||
function isDynamicServerError(err) {
|
||||
if (typeof err !== "object" || err === null || !("digest" in err) || typeof err.digest !== "string") {
|
||||
return false;
|
||||
}
|
||||
return err.digest === DYNAMIC_ERROR_CODE;
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=hooks-server-context.js.map
|
||||
1
node_modules/next/dist/client/components/hooks-server-context.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/hooks-server-context.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/hooks-server-context.ts"],"names":["DynamicServerError","isDynamicServerError","DYNAMIC_ERROR_CODE","Error","constructor","description","digest","err"],"mappings":";;;;;;;;;;;;;;;IAEaA,kBAAkB;eAAlBA;;IAQGC,oBAAoB;eAApBA;;;AAVhB,MAAMC,qBAAqB;AAEpB,MAAMF,2BAA2BG;IAGtCC,YAAY,AAAgBC,WAAmB,CAAE;QAC/C,KAAK,CAAC,AAAC,2BAAwBA;aADLA,cAAAA;aAF5BC,SAAoCJ;IAIpC;AACF;AAEO,SAASD,qBAAqBM,GAAY;IAC/C,IACE,OAAOA,QAAQ,YACfA,QAAQ,QACR,CAAE,CAAA,YAAYA,GAAE,KAChB,OAAOA,IAAID,MAAM,KAAK,UACtB;QACA,OAAO;IACT;IAEA,OAAOC,IAAID,MAAM,KAAKJ;AACxB"}
|
||||
1
node_modules/next/dist/client/components/is-hydration-error.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/components/is-hydration-error.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function isHydrationError(error: unknown): boolean;
|
||||
24
node_modules/next/dist/client/components/is-hydration-error.js
generated
vendored
Normal file
24
node_modules/next/dist/client/components/is-hydration-error.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isHydrationError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return isHydrationError;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default._(require("../../lib/is-error"));
|
||||
const hydrationErrorRegex = /hydration failed|while hydrating|content does not match|did not match/i;
|
||||
function isHydrationError(error) {
|
||||
return (0, _iserror.default)(error) && hydrationErrorRegex.test(error.message);
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=is-hydration-error.js.map
|
||||
1
node_modules/next/dist/client/components/is-hydration-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/is-hydration-error.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/is-hydration-error.ts"],"names":["isHydrationError","hydrationErrorRegex","error","isError","test","message"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;kEALI;AAEpB,MAAMC,sBACJ;AAEK,SAASD,iBAAiBE,KAAc;IAC7C,OAAOC,IAAAA,gBAAO,EAACD,UAAUD,oBAAoBG,IAAI,CAACF,MAAMG,OAAO;AACjE"}
|
||||
1
node_modules/next/dist/client/components/is-next-router-error.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/components/is-next-router-error.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function isNextRouterError(error: any): boolean;
|
||||
23
node_modules/next/dist/client/components/is-next-router-error.js
generated
vendored
Normal file
23
node_modules/next/dist/client/components/is-next-router-error.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isNextRouterError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return isNextRouterError;
|
||||
}
|
||||
});
|
||||
const _notfound = require("./not-found");
|
||||
const _redirect = require("./redirect");
|
||||
function isNextRouterError(error) {
|
||||
return error && error.digest && ((0, _redirect.isRedirectError)(error) || (0, _notfound.isNotFoundError)(error));
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=is-next-router-error.js.map
|
||||
1
node_modules/next/dist/client/components/is-next-router-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/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"],"names":["isNextRouterError","error","digest","isRedirectError","isNotFoundError"],"mappings":";;;;+BAGgBA;;;eAAAA;;;0BAHgB;0BACA;AAEzB,SAASA,kBAAkBC,KAAU;IAC1C,OACEA,SAASA,MAAMC,MAAM,IAAKC,CAAAA,IAAAA,yBAAe,EAACF,UAAUG,IAAAA,yBAAe,EAACH,MAAK;AAE7E"}
|
||||
19
node_modules/next/dist/client/components/layout-router.d.ts
generated
vendored
Normal file
19
node_modules/next/dist/client/components/layout-router.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import type { FlightSegmentPath } from '../../server/app-render/types';
|
||||
import type { ErrorComponent } from './error-boundary';
|
||||
import React from 'react';
|
||||
/**
|
||||
* OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.
|
||||
* It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.
|
||||
*/
|
||||
export default function OuterLayoutRouter({ parallelRouterKey, segmentPath, error, errorStyles, errorScripts, templateStyles, templateScripts, template, notFound, notFoundStyles, }: {
|
||||
parallelRouterKey: string;
|
||||
segmentPath: FlightSegmentPath;
|
||||
error: ErrorComponent | undefined;
|
||||
errorStyles: React.ReactNode | undefined;
|
||||
errorScripts: React.ReactNode | undefined;
|
||||
templateStyles: React.ReactNode | undefined;
|
||||
templateScripts: React.ReactNode | undefined;
|
||||
template: React.ReactNode;
|
||||
notFound: React.ReactNode | undefined;
|
||||
notFoundStyles: React.ReactNode | undefined;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
458
node_modules/next/dist/client/components/layout-router.js
generated
vendored
Normal file
458
node_modules/next/dist/client/components/layout-router.js
generated
vendored
Normal file
@ -0,0 +1,458 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, /**
|
||||
* OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.
|
||||
* It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.
|
||||
*/ "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return OuterLayoutRouter;
|
||||
}
|
||||
});
|
||||
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
||||
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
||||
const _reactdom = /*#__PURE__*/ _interop_require_default._(require("react-dom"));
|
||||
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
|
||||
const _fetchserverresponse = require("./router-reducer/fetch-server-response");
|
||||
const _unresolvedthenable = require("./unresolved-thenable");
|
||||
const _errorboundary = require("./error-boundary");
|
||||
const _matchsegments = require("./match-segments");
|
||||
const _handlesmoothscroll = require("../../shared/lib/router/utils/handle-smooth-scroll");
|
||||
const _redirectboundary = require("./redirect-boundary");
|
||||
const _notfoundboundary = require("./not-found-boundary");
|
||||
const _getsegmentvalue = require("./router-reducer/reducers/get-segment-value");
|
||||
const _createroutercachekey = require("./router-reducer/create-router-cache-key");
|
||||
const _hasinterceptionrouteincurrenttree = require("./router-reducer/reducers/has-interception-route-in-current-tree");
|
||||
/**
|
||||
* Add refetch marker to router state at the point of the current layout segment.
|
||||
* This ensures the response returned is not further down than the current layout segment.
|
||||
*/ function walkAddRefetch(segmentPathToWalk, treeToRecreate) {
|
||||
if (segmentPathToWalk) {
|
||||
const [segment, parallelRouteKey] = segmentPathToWalk;
|
||||
const isLast = segmentPathToWalk.length === 2;
|
||||
if ((0, _matchsegments.matchSegment)(treeToRecreate[0], segment)) {
|
||||
if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {
|
||||
if (isLast) {
|
||||
const subTree = walkAddRefetch(undefined, treeToRecreate[1][parallelRouteKey]);
|
||||
return [
|
||||
treeToRecreate[0],
|
||||
{
|
||||
...treeToRecreate[1],
|
||||
[parallelRouteKey]: [
|
||||
subTree[0],
|
||||
subTree[1],
|
||||
subTree[2],
|
||||
"refetch"
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
return [
|
||||
treeToRecreate[0],
|
||||
{
|
||||
...treeToRecreate[1],
|
||||
[parallelRouteKey]: walkAddRefetch(segmentPathToWalk.slice(2), treeToRecreate[1][parallelRouteKey])
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
return treeToRecreate;
|
||||
}
|
||||
// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available
|
||||
/**
|
||||
* Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning
|
||||
*/ function findDOMNode(instance) {
|
||||
// Tree-shake for server bundle
|
||||
if (typeof window === "undefined") return null;
|
||||
// Only apply strict mode warning when not in production
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
const originalConsoleError = console.error;
|
||||
try {
|
||||
console.error = function() {
|
||||
for(var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
messages[_key] = arguments[_key];
|
||||
}
|
||||
// Ignore strict mode warning for the findDomNode call below
|
||||
if (!messages[0].includes("Warning: %s is deprecated in StrictMode.")) {
|
||||
originalConsoleError(...messages);
|
||||
}
|
||||
};
|
||||
return _reactdom.default.findDOMNode(instance);
|
||||
} finally{
|
||||
console.error = originalConsoleError;
|
||||
}
|
||||
}
|
||||
return _reactdom.default.findDOMNode(instance);
|
||||
}
|
||||
const rectProperties = [
|
||||
"bottom",
|
||||
"height",
|
||||
"left",
|
||||
"right",
|
||||
"top",
|
||||
"width",
|
||||
"x",
|
||||
"y"
|
||||
];
|
||||
/**
|
||||
* Check if a HTMLElement is hidden or fixed/sticky position
|
||||
*/ function shouldSkipElement(element) {
|
||||
// we ignore fixed or sticky positioned elements since they'll likely pass the "in-viewport" check
|
||||
// and will result in a situation we bail on scroll because of something like a fixed nav,
|
||||
// even though the actual page content is offscreen
|
||||
if ([
|
||||
"sticky",
|
||||
"fixed"
|
||||
].includes(getComputedStyle(element).position)) {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
console.warn("Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:", element);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`
|
||||
// because `offsetParent` doesn't consider document/body
|
||||
const rect = element.getBoundingClientRect();
|
||||
return rectProperties.every((item)=>rect[item] === 0);
|
||||
}
|
||||
/**
|
||||
* Check if the top corner of the HTMLElement is in the viewport.
|
||||
*/ function topOfElementInViewport(element, viewportHeight) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return rect.top >= 0 && rect.top <= viewportHeight;
|
||||
}
|
||||
/**
|
||||
* Find the DOM node for a hash fragment.
|
||||
* If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.
|
||||
* If the hash fragment is an id, the page has to scroll to the element with that id.
|
||||
* If the hash fragment is a name, the page has to scroll to the first element with that name.
|
||||
*/ function getHashFragmentDomNode(hashFragment) {
|
||||
// If the hash fragment is `top` the page has to scroll to the top of the page.
|
||||
if (hashFragment === "top") {
|
||||
return document.body;
|
||||
}
|
||||
var _document_getElementById;
|
||||
// If the hash fragment is an id, the page has to scroll to the element with that id.
|
||||
return (_document_getElementById = document.getElementById(hashFragment)) != null ? _document_getElementById : // If the hash fragment is a name, the page has to scroll to the first element with that name.
|
||||
document.getElementsByName(hashFragment)[0];
|
||||
}
|
||||
class InnerScrollAndFocusHandler extends _react.default.Component {
|
||||
componentDidMount() {
|
||||
this.handlePotentialScroll();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
// Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.
|
||||
if (this.props.focusAndScrollRef.apply) {
|
||||
this.handlePotentialScroll();
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return this.props.children;
|
||||
}
|
||||
constructor(...args){
|
||||
super(...args);
|
||||
this.handlePotentialScroll = ()=>{
|
||||
// Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.
|
||||
const { focusAndScrollRef, segmentPath } = this.props;
|
||||
if (focusAndScrollRef.apply) {
|
||||
// segmentPaths is an array of segment paths that should be scrolled to
|
||||
// if the current segment path is not in the array, the scroll is not applied
|
||||
// unless the array is empty, in which case the scroll is always applied
|
||||
if (focusAndScrollRef.segmentPaths.length !== 0 && !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath)=>segmentPath.every((segment, index)=>(0, _matchsegments.matchSegment)(segment, scrollRefSegmentPath[index])))) {
|
||||
return;
|
||||
}
|
||||
let domNode = null;
|
||||
const hashFragment = focusAndScrollRef.hashFragment;
|
||||
if (hashFragment) {
|
||||
domNode = getHashFragmentDomNode(hashFragment);
|
||||
}
|
||||
// `findDOMNode` is tricky because it returns just the first child if the component is a fragment.
|
||||
// This already caused a bug where the first child was a <link/> in head.
|
||||
if (!domNode) {
|
||||
domNode = findDOMNode(this);
|
||||
}
|
||||
// If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.
|
||||
if (!(domNode instanceof Element)) {
|
||||
return;
|
||||
}
|
||||
// Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.
|
||||
// If the element is skipped, try to select the next sibling and try again.
|
||||
while(!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)){
|
||||
// No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.
|
||||
if (domNode.nextElementSibling === null) {
|
||||
return;
|
||||
}
|
||||
domNode = domNode.nextElementSibling;
|
||||
}
|
||||
// State is mutated to ensure that the focus and scroll is applied only once.
|
||||
focusAndScrollRef.apply = false;
|
||||
focusAndScrollRef.hashFragment = null;
|
||||
focusAndScrollRef.segmentPaths = [];
|
||||
(0, _handlesmoothscroll.handleSmoothScroll)(()=>{
|
||||
// In case of hash scroll, we only need to scroll the element into view
|
||||
if (hashFragment) {
|
||||
domNode.scrollIntoView();
|
||||
return;
|
||||
}
|
||||
// Store the current viewport height because reading `clientHeight` causes a reflow,
|
||||
// and it won't change during this function.
|
||||
const htmlElement = document.documentElement;
|
||||
const viewportHeight = htmlElement.clientHeight;
|
||||
// If the element's top edge is already in the viewport, exit early.
|
||||
if (topOfElementInViewport(domNode, viewportHeight)) {
|
||||
return;
|
||||
}
|
||||
// Otherwise, try scrolling go the top of the document to be backward compatible with pages
|
||||
// scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)
|
||||
// We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left
|
||||
// scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically
|
||||
htmlElement.scrollTop = 0;
|
||||
// Scroll to domNode if domNode is not in viewport when scrolled to top of document
|
||||
if (!topOfElementInViewport(domNode, viewportHeight)) {
|
||||
domNode.scrollIntoView();
|
||||
}
|
||||
}, {
|
||||
// We will force layout by querying domNode position
|
||||
dontForceLayout: true,
|
||||
onlyHashChange: focusAndScrollRef.onlyHashChange
|
||||
});
|
||||
// Mutate after scrolling so that it can be read by `handleSmoothScroll`
|
||||
focusAndScrollRef.onlyHashChange = false;
|
||||
// Set focus on the element
|
||||
domNode.focus();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
function ScrollAndFocusHandler(param) {
|
||||
let { segmentPath, children } = param;
|
||||
const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
|
||||
if (!context) {
|
||||
throw new Error("invariant global layout router not mounted");
|
||||
}
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(InnerScrollAndFocusHandler, {
|
||||
segmentPath: segmentPath,
|
||||
focusAndScrollRef: context.focusAndScrollRef,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
/**
|
||||
* InnerLayoutRouter handles rendering the provided segment based on the cache.
|
||||
*/ function InnerLayoutRouter(param) {
|
||||
let { parallelRouterKey, url, childNodes, segmentPath, tree, // TODO-APP: implement `<Offscreen>` when available.
|
||||
// isActive,
|
||||
cacheKey } = param;
|
||||
const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
|
||||
if (!context) {
|
||||
throw new Error("invariant global layout router not mounted");
|
||||
}
|
||||
const { buildId, changeByServerResponse, tree: fullTree } = context;
|
||||
// Read segment path from the parallel router cache node.
|
||||
let childNode = childNodes.get(cacheKey);
|
||||
// When data is not available during rendering client-side we need to fetch
|
||||
// it from the server.
|
||||
if (childNode === undefined) {
|
||||
const newLazyCacheNode = {
|
||||
lazyData: null,
|
||||
rsc: null,
|
||||
prefetchRsc: null,
|
||||
head: null,
|
||||
prefetchHead: null,
|
||||
parallelRoutes: new Map(),
|
||||
lazyDataResolved: false,
|
||||
loading: null
|
||||
};
|
||||
/**
|
||||
* Flight data fetch kicked off during render and put into the cache.
|
||||
*/ childNode = newLazyCacheNode;
|
||||
childNodes.set(cacheKey, newLazyCacheNode);
|
||||
}
|
||||
// `rsc` represents the renderable node for this segment.
|
||||
// If this segment has a `prefetchRsc`, it's the statically prefetched data.
|
||||
// We should use that on initial render instead of `rsc`. Then we'll switch
|
||||
// to `rsc` when the dynamic response streams in.
|
||||
//
|
||||
// If no prefetch data is available, then we go straight to rendering `rsc`.
|
||||
const resolvedPrefetchRsc = childNode.prefetchRsc !== null ? childNode.prefetchRsc : childNode.rsc;
|
||||
// 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.
|
||||
//
|
||||
// @ts-expect-error The second argument to `useDeferredValue` is only
|
||||
// available in the experimental builds. When its disabled, it will always
|
||||
// return `rsc`.
|
||||
const rsc = (0, _react.useDeferredValue)(childNode.rsc, resolvedPrefetchRsc);
|
||||
// `rsc` is either a React node or a promise for a React node, except we
|
||||
// special case `null` to represent that this segment's data is missing. If
|
||||
// it's a promise, we need to unwrap it so we can determine whether or not the
|
||||
// data is missing.
|
||||
const resolvedRsc = typeof rsc === "object" && rsc !== null && typeof rsc.then === "function" ? (0, _react.use)(rsc) : rsc;
|
||||
if (!resolvedRsc) {
|
||||
// The data for this segment is not available, and there's no pending
|
||||
// navigation that will be able to fulfill it. We need to fetch more from
|
||||
// the server and patch the cache.
|
||||
// Check if there's already a pending request.
|
||||
let lazyData = childNode.lazyData;
|
||||
if (lazyData === null) {
|
||||
/**
|
||||
* Router state with refetch marker added
|
||||
*/ // TODO-APP: remove ''
|
||||
const refetchTree = walkAddRefetch([
|
||||
"",
|
||||
...segmentPath
|
||||
], fullTree);
|
||||
const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(fullTree);
|
||||
childNode.lazyData = lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(url, location.origin), refetchTree, includeNextUrl ? context.nextUrl : null, buildId);
|
||||
childNode.lazyDataResolved = false;
|
||||
}
|
||||
/**
|
||||
* Flight response data
|
||||
*/ // When the data has not resolved yet `use` will suspend here.
|
||||
const serverResponse = (0, _react.use)(lazyData);
|
||||
if (!childNode.lazyDataResolved) {
|
||||
// setTimeout is used to start a new transition during render, this is an intentional hack around React.
|
||||
setTimeout(()=>{
|
||||
(0, _react.startTransition)(()=>{
|
||||
changeByServerResponse({
|
||||
previousTree: fullTree,
|
||||
serverResponse
|
||||
});
|
||||
});
|
||||
});
|
||||
// It's important that we mark this as resolved, in case this branch is replayed, we don't want to continously re-apply
|
||||
// the patch to the tree.
|
||||
childNode.lazyDataResolved = true;
|
||||
}
|
||||
// Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.
|
||||
// A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.
|
||||
(0, _react.use)(_unresolvedthenable.unresolvedThenable);
|
||||
}
|
||||
// If we get to this point, then we know we have something we can render.
|
||||
const subtree = // The layout router context narrows down tree and childNodes at each level.
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)(_approutercontextsharedruntime.LayoutRouterContext.Provider, {
|
||||
value: {
|
||||
tree: tree[1][parallelRouterKey],
|
||||
childNodes: childNode.parallelRoutes,
|
||||
// TODO-APP: overriding of url for parallel routes
|
||||
url: url,
|
||||
loading: childNode.loading
|
||||
},
|
||||
children: resolvedRsc
|
||||
});
|
||||
// Ensure root layout is not wrapped in a div as the root layout renders `<html>`
|
||||
return subtree;
|
||||
}
|
||||
/**
|
||||
* Renders suspense boundary with the provided "loading" property as the fallback.
|
||||
* If no loading property is provided it renders the children without a suspense boundary.
|
||||
*/ function LoadingBoundary(param) {
|
||||
let { children, hasLoading, loading, loadingStyles, loadingScripts } = param;
|
||||
// We have an explicit prop for checking if `loading` is provided, to disambiguate between a loading
|
||||
// component that returns `null` / `undefined`, vs not having a loading component at all.
|
||||
if (hasLoading) {
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Suspense, {
|
||||
fallback: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
||||
children: [
|
||||
loadingStyles,
|
||||
loadingScripts,
|
||||
loading
|
||||
]
|
||||
}),
|
||||
children: children
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
function OuterLayoutRouter(param) {
|
||||
let { parallelRouterKey, segmentPath, error, errorStyles, errorScripts, templateStyles, templateScripts, template, notFound, notFoundStyles } = param;
|
||||
const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
|
||||
if (!context) {
|
||||
throw new Error("invariant expected layout router to be mounted");
|
||||
}
|
||||
const { childNodes, tree, url, loading } = context;
|
||||
// Get the current parallelRouter cache node
|
||||
let childNodesForParallelRouter = childNodes.get(parallelRouterKey);
|
||||
// If the parallel router cache node does not exist yet, create it.
|
||||
// This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.
|
||||
if (!childNodesForParallelRouter) {
|
||||
childNodesForParallelRouter = new Map();
|
||||
childNodes.set(parallelRouterKey, childNodesForParallelRouter);
|
||||
}
|
||||
// Get the active segment in the tree
|
||||
// The reason arrays are used in the data format is that these are transferred from the server to the browser so it's optimized to save bytes.
|
||||
const treeSegment = tree[1][parallelRouterKey][0];
|
||||
// If segment is an array it's a dynamic route and we want to read the dynamic route value as the segment to get from the cache.
|
||||
const currentChildSegmentValue = (0, _getsegmentvalue.getSegmentValue)(treeSegment);
|
||||
/**
|
||||
* Decides which segments to keep rendering, all segments that are not active will be wrapped in `<Offscreen>`.
|
||||
*/ // TODO-APP: Add handling of `<Offscreen>` when it's available.
|
||||
const preservedSegments = [
|
||||
treeSegment
|
||||
];
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
||||
children: preservedSegments.map((preservedSegment)=>{
|
||||
const preservedSegmentValue = (0, _getsegmentvalue.getSegmentValue)(preservedSegment);
|
||||
const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(preservedSegment);
|
||||
return(/*
|
||||
- Error boundary
|
||||
- Only renders error boundary if error component is provided.
|
||||
- Rendered for each segment to ensure they have their own error state.
|
||||
- Loading boundary
|
||||
- Only renders suspense boundary if loading components is provided.
|
||||
- Rendered for each segment to ensure they have their own loading state.
|
||||
- Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.
|
||||
*/ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_approutercontextsharedruntime.TemplateContext.Provider, {
|
||||
value: /*#__PURE__*/ (0, _jsxruntime.jsx)(ScrollAndFocusHandler, {
|
||||
segmentPath: segmentPath,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_errorboundary.ErrorBoundary, {
|
||||
errorComponent: error,
|
||||
errorStyles: errorStyles,
|
||||
errorScripts: errorScripts,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(LoadingBoundary, {
|
||||
hasLoading: Boolean(loading),
|
||||
loading: loading == null ? void 0 : loading[0],
|
||||
loadingStyles: loading == null ? void 0 : loading[1],
|
||||
loadingScripts: loading == null ? void 0 : loading[2],
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_notfoundboundary.NotFoundBoundary, {
|
||||
notFound: notFound,
|
||||
notFoundStyles: notFoundStyles,
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_redirectboundary.RedirectBoundary, {
|
||||
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(InnerLayoutRouter, {
|
||||
parallelRouterKey: parallelRouterKey,
|
||||
url: url,
|
||||
tree: tree,
|
||||
childNodes: childNodesForParallelRouter,
|
||||
segmentPath: segmentPath,
|
||||
cacheKey: cacheKey,
|
||||
isActive: currentChildSegmentValue === preservedSegmentValue
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}),
|
||||
children: [
|
||||
templateStyles,
|
||||
templateScripts,
|
||||
template
|
||||
]
|
||||
}, (0, _createroutercachekey.createRouterCacheKey)(preservedSegment, true)));
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=layout-router.js.map
|
||||
1
node_modules/next/dist/client/components/layout-router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/layout-router.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/next/dist/client/components/match-segments.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/client/components/match-segments.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { Segment } from '../../server/app-render/types';
|
||||
export declare const matchSegment: (existingSegment: Segment, segment: Segment) => boolean;
|
||||
export declare const canSegmentBeOverridden: (existingSegment: Segment, segment: Segment) => boolean;
|
||||
52
node_modules/next/dist/client/components/match-segments.js
generated
vendored
Normal file
52
node_modules/next/dist/client/components/match-segments.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
canSegmentBeOverridden: null,
|
||||
matchSegment: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
canSegmentBeOverridden: function() {
|
||||
return canSegmentBeOverridden;
|
||||
},
|
||||
matchSegment: function() {
|
||||
return matchSegment;
|
||||
}
|
||||
});
|
||||
const _getsegmentparam = require("../../server/app-render/get-segment-param");
|
||||
const matchSegment = (existingSegment, segment)=>{
|
||||
// segment is either Array or string
|
||||
if (typeof existingSegment === "string") {
|
||||
if (typeof segment === "string") {
|
||||
// Common case: segment is just a string
|
||||
return existingSegment === segment;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (typeof segment === "string") {
|
||||
return false;
|
||||
}
|
||||
return existingSegment[0] === segment[0] && existingSegment[1] === segment[1];
|
||||
};
|
||||
const canSegmentBeOverridden = (existingSegment, segment)=>{
|
||||
var _getSegmentParam;
|
||||
if (Array.isArray(existingSegment) || !Array.isArray(segment)) {
|
||||
return false;
|
||||
}
|
||||
return ((_getSegmentParam = (0, _getsegmentparam.getSegmentParam)(existingSegment)) == null ? void 0 : _getSegmentParam.param) === segment[0];
|
||||
};
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=match-segments.js.map
|
||||
1
node_modules/next/dist/client/components/match-segments.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/match-segments.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/match-segments.ts"],"names":["canSegmentBeOverridden","matchSegment","existingSegment","segment","getSegmentParam","Array","isArray","param"],"mappings":";;;;;;;;;;;;;;;IAyBaA,sBAAsB;eAAtBA;;IAtBAC,YAAY;eAAZA;;;iCAHmB;AAGzB,MAAMA,eAAe,CAC1BC,iBACAC;IAEA,oCAAoC;IACpC,IAAI,OAAOD,oBAAoB,UAAU;QACvC,IAAI,OAAOC,YAAY,UAAU;YAC/B,wCAAwC;YACxC,OAAOD,oBAAoBC;QAC7B;QACA,OAAO;IACT;IAEA,IAAI,OAAOA,YAAY,UAAU;QAC/B,OAAO;IACT;IACA,OAAOD,eAAe,CAAC,EAAE,KAAKC,OAAO,CAAC,EAAE,IAAID,eAAe,CAAC,EAAE,KAAKC,OAAO,CAAC,EAAE;AAC/E;AAKO,MAAMH,yBAAyB,CACpCE,iBACAC;QAMOC;IAJP,IAAIC,MAAMC,OAAO,CAACJ,oBAAoB,CAACG,MAAMC,OAAO,CAACH,UAAU;QAC7D,OAAO;IACT;IAEA,OAAOC,EAAAA,mBAAAA,IAAAA,gCAAe,EAACF,qCAAhBE,iBAAkCG,KAAK,MAAKJ,OAAO,CAAC,EAAE;AAC/D"}
|
||||
129
node_modules/next/dist/client/components/navigation.d.ts
generated
vendored
Normal file
129
node_modules/next/dist/client/components/navigation.d.ts
generated
vendored
Normal file
@ -0,0 +1,129 @@
|
||||
import { type AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime';
|
||||
import { ReadonlyURLSearchParams } from './navigation.react-server';
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you *read* the current URL's search parameters.
|
||||
*
|
||||
* Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useSearchParams } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const searchParams = useSearchParams()
|
||||
* searchParams.get('foo') // returns 'bar' when ?foo=bar
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)
|
||||
*/
|
||||
declare function useSearchParams(): ReadonlyURLSearchParams;
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the current URL's pathname.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { usePathname } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const pathname = usePathname() // returns "/dashboard" on /dashboard?foo=bar
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)
|
||||
*/
|
||||
declare function usePathname(): string;
|
||||
import { ServerInsertedHTMLContext, useServerInsertedHTML } from '../../shared/lib/server-inserted-html.shared-runtime';
|
||||
/**
|
||||
*
|
||||
* This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useRouter } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const router = useRouter()
|
||||
* // ...
|
||||
* router.push('/dashboard') // Navigate to /dashboard
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)
|
||||
*/
|
||||
declare function useRouter(): AppRouterInstance;
|
||||
interface Params {
|
||||
[key: string]: string | string[];
|
||||
}
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read a route's dynamic params filled in by the current URL.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useParams } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* // on /dashboard/[team] where pathname is /dashboard/nextjs
|
||||
* const { team } = useParams() // team === "nextjs"
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)
|
||||
*/
|
||||
declare function useParams<T extends Params = Params>(): T;
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the active route segments **below** the Layout it is called from.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* 'use client'
|
||||
*
|
||||
* import { useSelectedLayoutSegments } from 'next/navigation'
|
||||
*
|
||||
* export default function ExampleClientComponent() {
|
||||
* const segments = useSelectedLayoutSegments()
|
||||
*
|
||||
* return (
|
||||
* <ul>
|
||||
* {segments.map((segment, index) => (
|
||||
* <li key={index}>{segment}</li>
|
||||
* ))}
|
||||
* </ul>
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)
|
||||
*/
|
||||
declare function useSelectedLayoutSegments(parallelRouteKey?: string): string[];
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the active route segment **one level below** the Layout it is called from.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* 'use client'
|
||||
* import { useSelectedLayoutSegment } from 'next/navigation'
|
||||
*
|
||||
* export default function ExampleClientComponent() {
|
||||
* const segment = useSelectedLayoutSegment()
|
||||
*
|
||||
* return <p>Active segment: {segment}</p>
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)
|
||||
*/
|
||||
declare function useSelectedLayoutSegment(parallelRouteKey?: string): string | null;
|
||||
export { useSearchParams, usePathname, useSelectedLayoutSegment, useSelectedLayoutSegments, useParams, useRouter, useServerInsertedHTML, ServerInsertedHTMLContext, };
|
||||
export { notFound, redirect, permanentRedirect, RedirectType, ReadonlyURLSearchParams, } from './navigation.react-server';
|
||||
268
node_modules/next/dist/client/components/navigation.js
generated
vendored
Normal file
268
node_modules/next/dist/client/components/navigation.js
generated
vendored
Normal file
@ -0,0 +1,268 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ReadonlyURLSearchParams: null,
|
||||
RedirectType: null,
|
||||
ServerInsertedHTMLContext: null,
|
||||
notFound: null,
|
||||
permanentRedirect: null,
|
||||
redirect: null,
|
||||
useParams: null,
|
||||
usePathname: null,
|
||||
useRouter: null,
|
||||
useSearchParams: null,
|
||||
useSelectedLayoutSegment: null,
|
||||
useSelectedLayoutSegments: null,
|
||||
useServerInsertedHTML: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ReadonlyURLSearchParams: function() {
|
||||
return _navigationreactserver.ReadonlyURLSearchParams;
|
||||
},
|
||||
RedirectType: function() {
|
||||
return _navigationreactserver.RedirectType;
|
||||
},
|
||||
ServerInsertedHTMLContext: function() {
|
||||
return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext;
|
||||
},
|
||||
notFound: function() {
|
||||
return _navigationreactserver.notFound;
|
||||
},
|
||||
permanentRedirect: function() {
|
||||
return _navigationreactserver.permanentRedirect;
|
||||
},
|
||||
redirect: function() {
|
||||
return _navigationreactserver.redirect;
|
||||
},
|
||||
useParams: function() {
|
||||
return useParams;
|
||||
},
|
||||
usePathname: function() {
|
||||
return usePathname;
|
||||
},
|
||||
useRouter: function() {
|
||||
return useRouter;
|
||||
},
|
||||
useSearchParams: function() {
|
||||
return useSearchParams;
|
||||
},
|
||||
useSelectedLayoutSegment: function() {
|
||||
return useSelectedLayoutSegment;
|
||||
},
|
||||
useSelectedLayoutSegments: function() {
|
||||
return useSelectedLayoutSegments;
|
||||
},
|
||||
useServerInsertedHTML: function() {
|
||||
return _serverinsertedhtmlsharedruntime.useServerInsertedHTML;
|
||||
}
|
||||
});
|
||||
const _react = require("react");
|
||||
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
|
||||
const _hooksclientcontextsharedruntime = require("../../shared/lib/hooks-client-context.shared-runtime");
|
||||
const _getsegmentvalue = require("./router-reducer/reducers/get-segment-value");
|
||||
const _segment = require("../../shared/lib/segment");
|
||||
const _navigationreactserver = require("./navigation.react-server");
|
||||
const _serverinsertedhtmlsharedruntime = require("../../shared/lib/server-inserted-html.shared-runtime");
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you *read* the current URL's search parameters.
|
||||
*
|
||||
* Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useSearchParams } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const searchParams = useSearchParams()
|
||||
* searchParams.get('foo') // returns 'bar' when ?foo=bar
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)
|
||||
*/ function useSearchParams() {
|
||||
const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext);
|
||||
// In the case where this is `null`, the compat types added in
|
||||
// `next-env.d.ts` will add a new overload that changes the return type to
|
||||
// include `null`.
|
||||
const readonlySearchParams = (0, _react.useMemo)(()=>{
|
||||
if (!searchParams) {
|
||||
// When the router is not ready in pages, we won't have the search params
|
||||
// available.
|
||||
return null;
|
||||
}
|
||||
return new _navigationreactserver.ReadonlyURLSearchParams(searchParams);
|
||||
}, [
|
||||
searchParams
|
||||
]);
|
||||
if (typeof window === "undefined") {
|
||||
// AsyncLocalStorage should not be included in the client bundle.
|
||||
const { bailoutToClientRendering } = require("./bailout-to-client-rendering");
|
||||
// TODO-APP: handle dynamic = 'force-static' here and on the client
|
||||
bailoutToClientRendering("useSearchParams()");
|
||||
}
|
||||
return readonlySearchParams;
|
||||
}
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the current URL's pathname.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { usePathname } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const pathname = usePathname() // returns "/dashboard" on /dashboard?foo=bar
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)
|
||||
*/ function usePathname() {
|
||||
// In the case where this is `null`, the compat types added in `next-env.d.ts`
|
||||
// will add a new overload that changes the return type to include `null`.
|
||||
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useRouter } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* const router = useRouter()
|
||||
* // ...
|
||||
* router.push('/dashboard') // Navigate to /dashboard
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)
|
||||
*/ function useRouter() {
|
||||
const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext);
|
||||
if (router === null) {
|
||||
throw new Error("invariant expected app router to be mounted");
|
||||
}
|
||||
return router;
|
||||
}
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read a route's dynamic params filled in by the current URL.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* "use client"
|
||||
* import { useParams } from 'next/navigation'
|
||||
*
|
||||
* export default function Page() {
|
||||
* // on /dashboard/[team] where pathname is /dashboard/nextjs
|
||||
* const { team } = useParams() // team === "nextjs"
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)
|
||||
*/ function useParams() {
|
||||
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext);
|
||||
}
|
||||
/** Get the canonical parameters from the current level to the leaf node. */ function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) {
|
||||
if (first === void 0) first = true;
|
||||
if (segmentPath === void 0) segmentPath = [];
|
||||
let node;
|
||||
if (first) {
|
||||
// Use the provided parallel route key on the first parallel route
|
||||
node = tree[1][parallelRouteKey];
|
||||
} else {
|
||||
// After first parallel route prefer children, if there's no children pick the first parallel route.
|
||||
const parallelRoutes = tree[1];
|
||||
var _parallelRoutes_children;
|
||||
node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0];
|
||||
}
|
||||
if (!node) return segmentPath;
|
||||
const segment = node[0];
|
||||
const segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment);
|
||||
if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) {
|
||||
return segmentPath;
|
||||
}
|
||||
segmentPath.push(segmentValue);
|
||||
return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
|
||||
}
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the active route segments **below** the Layout it is called from.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* 'use client'
|
||||
*
|
||||
* import { useSelectedLayoutSegments } from 'next/navigation'
|
||||
*
|
||||
* export default function ExampleClientComponent() {
|
||||
* const segments = useSelectedLayoutSegments()
|
||||
*
|
||||
* return (
|
||||
* <ul>
|
||||
* {segments.map((segment, index) => (
|
||||
* <li key={index}>{segment}</li>
|
||||
* ))}
|
||||
* </ul>
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)
|
||||
*/ function useSelectedLayoutSegments(parallelRouteKey) {
|
||||
if (parallelRouteKey === void 0) parallelRouteKey = "children";
|
||||
const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
|
||||
// @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts
|
||||
if (!context) return null;
|
||||
return getSelectedLayoutSegmentPath(context.tree, parallelRouteKey);
|
||||
}
|
||||
/**
|
||||
* A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook
|
||||
* that lets you read the active route segment **one level below** the Layout it is called from.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* 'use client'
|
||||
* import { useSelectedLayoutSegment } from 'next/navigation'
|
||||
*
|
||||
* export default function ExampleClientComponent() {
|
||||
* const segment = useSelectedLayoutSegment()
|
||||
*
|
||||
* return <p>Active segment: {segment}</p>
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)
|
||||
*/ function useSelectedLayoutSegment(parallelRouteKey) {
|
||||
if (parallelRouteKey === void 0) parallelRouteKey = "children";
|
||||
const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);
|
||||
if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const selectedLayoutSegment = parallelRouteKey === "children" ? selectedLayoutSegments[0] : selectedLayoutSegments[selectedLayoutSegments.length - 1];
|
||||
// if the default slot is showing, we return null since it's not technically "selected" (it's a fallback)
|
||||
// and returning an internal value like `__DEFAULT__` would be confusing.
|
||||
return selectedLayoutSegment === _segment.DEFAULT_SEGMENT_KEY ? null : selectedLayoutSegment;
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=navigation.js.map
|
||||
1
node_modules/next/dist/client/components/navigation.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/navigation.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/navigation.ts"],"names":["ReadonlyURLSearchParams","RedirectType","ServerInsertedHTMLContext","notFound","permanentRedirect","redirect","useParams","usePathname","useRouter","useSearchParams","useSelectedLayoutSegment","useSelectedLayoutSegments","useServerInsertedHTML","searchParams","useContext","SearchParamsContext","readonlySearchParams","useMemo","window","bailoutToClientRendering","require","PathnameContext","router","AppRouterContext","Error","PathParamsContext","getSelectedLayoutSegmentPath","tree","parallelRouteKey","first","segmentPath","node","parallelRoutes","children","Object","values","segment","segmentValue","getSegmentValue","startsWith","PAGE_SEGMENT_KEY","push","context","LayoutRouterContext","selectedLayoutSegments","length","selectedLayoutSegment","DEFAULT_SEGMENT_KEY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IA8QEA,uBAAuB;eAAvBA,8CAAuB;;IADvBC,YAAY;eAAZA,mCAAY;;IARZC,yBAAyB;eAAzBA,0DAAyB;;IAKzBC,QAAQ;eAARA,+BAAQ;;IAERC,iBAAiB;eAAjBA,wCAAiB;;IADjBC,QAAQ;eAARA,+BAAQ;;IATRC,SAAS;eAATA;;IAHAC,WAAW;eAAXA;;IAIAC,SAAS;eAATA;;IALAC,eAAe;eAAfA;;IAEAC,wBAAwB;eAAxBA;;IACAC,yBAAyB;eAAzBA;;IAGAC,qBAAqB;eAArBA,sDAAqB;;;uBApQa;+CAM7B;iDAKA;iCACyB;yBACsB;uCACd;iDA2EjC;AAzEP;;;;;;;;;;;;;;;;;;;CAmBC,GACD,SAASH;IACP,MAAMI,eAAeC,IAAAA,iBAAU,EAACC,oDAAmB;IAEnD,8DAA8D;IAC9D,0EAA0E;IAC1E,kBAAkB;IAClB,MAAMC,uBAAuBC,IAAAA,cAAO,EAAC;QACnC,IAAI,CAACJ,cAAc;YACjB,yEAAyE;YACzE,aAAa;YACb,OAAO;QACT;QAEA,OAAO,IAAIb,8CAAuB,CAACa;IACrC,GAAG;QAACA;KAAa;IAEjB,IAAI,OAAOK,WAAW,aAAa;QACjC,iEAAiE;QACjE,MAAM,EAAEC,wBAAwB,EAAE,GAChCC,QAAQ;QACV,mEAAmE;QACnED,yBAAyB;IAC3B;IAEA,OAAOH;AACT;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,SAAST;IACP,8EAA8E;IAC9E,0EAA0E;IAC1E,OAAOO,IAAAA,iBAAU,EAACO,gDAAe;AACnC;AAOA;;;;;;;;;;;;;;;;;CAiBC,GACD,SAASb;IACP,MAAMc,SAASR,IAAAA,iBAAU,EAACS,+CAAgB;IAC1C,IAAID,WAAW,MAAM;QACnB,MAAM,IAAIE,MAAM;IAClB;IAEA,OAAOF;AACT;AAMA;;;;;;;;;;;;;;;;CAgBC,GACD,SAAShB;IACP,OAAOQ,IAAAA,iBAAU,EAACW,kDAAiB;AACrC;AAEA,0EAA0E,GAC1E,SAASC,6BACPC,IAAuB,EACvBC,gBAAwB,EACxBC,KAAY,EACZC,WAA0B;IAD1BD,IAAAA,kBAAAA,QAAQ;IACRC,IAAAA,wBAAAA,cAAwB,EAAE;IAE1B,IAAIC;IACJ,IAAIF,OAAO;QACT,kEAAkE;QAClEE,OAAOJ,IAAI,CAAC,EAAE,CAACC,iBAAiB;IAClC,OAAO;QACL,oGAAoG;QACpG,MAAMI,iBAAiBL,IAAI,CAAC,EAAE;YACvBK;QAAPD,OAAOC,CAAAA,2BAAAA,eAAeC,QAAQ,YAAvBD,2BAA2BE,OAAOC,MAAM,CAACH,eAAe,CAAC,EAAE;IACpE;IAEA,IAAI,CAACD,MAAM,OAAOD;IAClB,MAAMM,UAAUL,IAAI,CAAC,EAAE;IAEvB,MAAMM,eAAeC,IAAAA,gCAAe,EAACF;IACrC,IAAI,CAACC,gBAAgBA,aAAaE,UAAU,CAACC,yBAAgB,GAAG;QAC9D,OAAOV;IACT;IAEAA,YAAYW,IAAI,CAACJ;IAEjB,OAAOX,6BACLK,MACAH,kBACA,OACAE;AAEJ;AAEA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,SAASnB,0BACPiB,gBAAqC;IAArCA,IAAAA,6BAAAA,mBAA2B;IAE3B,MAAMc,UAAU5B,IAAAA,iBAAU,EAAC6B,kDAAmB;IAC9C,wFAAwF;IACxF,IAAI,CAACD,SAAS,OAAO;IAErB,OAAOhB,6BAA6BgB,QAAQf,IAAI,EAAEC;AACpD;AAEA;;;;;;;;;;;;;;;;;CAiBC,GACD,SAASlB,yBACPkB,gBAAqC;IAArCA,IAAAA,6BAAAA,mBAA2B;IAE3B,MAAMgB,yBAAyBjC,0BAA0BiB;IAEzD,IAAI,CAACgB,0BAA0BA,uBAAuBC,MAAM,KAAK,GAAG;QAClE,OAAO;IACT;IAEA,MAAMC,wBACJlB,qBAAqB,aACjBgB,sBAAsB,CAAC,EAAE,GACzBA,sBAAsB,CAACA,uBAAuBC,MAAM,GAAG,EAAE;IAE/D,yGAAyG;IACzG,yEAAyE;IACzE,OAAOC,0BAA0BC,4BAAmB,GAChD,OACAD;AACN"}
|
||||
13
node_modules/next/dist/client/components/navigation.react-server.d.ts
generated
vendored
Normal file
13
node_modules/next/dist/client/components/navigation.react-server.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
declare class ReadonlyURLSearchParams extends URLSearchParams {
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
||||
append(): void;
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
||||
delete(): void;
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
||||
set(): void;
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
||||
sort(): void;
|
||||
}
|
||||
export { redirect, permanentRedirect, RedirectType } from './redirect';
|
||||
export { notFound } from './not-found';
|
||||
export { ReadonlyURLSearchParams };
|
||||
63
node_modules/next/dist/client/components/navigation.react-server.js
generated
vendored
Normal file
63
node_modules/next/dist/client/components/navigation.react-server.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
/** @internal */ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ReadonlyURLSearchParams: null,
|
||||
RedirectType: null,
|
||||
notFound: null,
|
||||
permanentRedirect: null,
|
||||
redirect: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ReadonlyURLSearchParams: function() {
|
||||
return ReadonlyURLSearchParams;
|
||||
},
|
||||
RedirectType: function() {
|
||||
return _redirect.RedirectType;
|
||||
},
|
||||
notFound: function() {
|
||||
return _notfound.notFound;
|
||||
},
|
||||
permanentRedirect: function() {
|
||||
return _redirect.permanentRedirect;
|
||||
},
|
||||
redirect: function() {
|
||||
return _redirect.redirect;
|
||||
}
|
||||
});
|
||||
const _redirect = require("./redirect");
|
||||
const _notfound = require("./not-found");
|
||||
class ReadonlyURLSearchParamsError extends Error {
|
||||
constructor(){
|
||||
super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams");
|
||||
}
|
||||
}
|
||||
class ReadonlyURLSearchParams extends URLSearchParams {
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ append() {
|
||||
throw new ReadonlyURLSearchParamsError();
|
||||
}
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ delete() {
|
||||
throw new ReadonlyURLSearchParamsError();
|
||||
}
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ set() {
|
||||
throw new ReadonlyURLSearchParamsError();
|
||||
}
|
||||
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ sort() {
|
||||
throw new ReadonlyURLSearchParamsError();
|
||||
}
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=navigation.react-server.js.map
|
||||
1
node_modules/next/dist/client/components/navigation.react-server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/navigation.react-server.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/navigation.react-server.ts"],"names":["ReadonlyURLSearchParams","RedirectType","notFound","permanentRedirect","redirect","ReadonlyURLSearchParamsError","Error","constructor","URLSearchParams","append","delete","set","sort"],"mappings":"AAAA,cAAc;;;;;;;;;;;;;;;;;;IA8BLA,uBAAuB;eAAvBA;;IAF6BC,YAAY;eAAZA,sBAAY;;IACzCC,QAAQ;eAARA,kBAAQ;;IADEC,iBAAiB;eAAjBA,2BAAiB;;IAA3BC,QAAQ;eAARA,kBAAQ;;;0BAAyC;0BACjC;AA5BzB,MAAMC,qCAAqCC;IACzCC,aAAc;QACZ,KAAK,CACH;IAEJ;AACF;AAEA,MAAMP,gCAAgCQ;IACpC,wKAAwK,GACxKC,SAAS;QACP,MAAM,IAAIJ;IACZ;IACA,wKAAwK,GACxKK,SAAS;QACP,MAAM,IAAIL;IACZ;IACA,wKAAwK,GACxKM,MAAM;QACJ,MAAM,IAAIN;IACZ;IACA,wKAAwK,GACxKO,OAAO;QACL,MAAM,IAAIP;IACZ;AACF"}
|
||||
1
node_modules/next/dist/client/components/navigation.test.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/components/navigation.test.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
||||
1
node_modules/next/dist/client/components/noop-head.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/client/components/noop-head.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export default function NoopHead(): null;
|
||||
21
node_modules/next/dist/client/components/noop-head.js
generated
vendored
Normal file
21
node_modules/next/dist/client/components/noop-head.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return NoopHead;
|
||||
}
|
||||
});
|
||||
function NoopHead() {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=noop-head.js.map
|
||||
1
node_modules/next/dist/client/components/noop-head.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/noop-head.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/noop-head.tsx"],"names":["NoopHead"],"mappings":";;;;+BAAA;;;eAAwBA;;;AAAT,SAASA;IACtB,OAAO;AACT"}
|
||||
9
node_modules/next/dist/client/components/not-found-boundary.d.ts
generated
vendored
Normal file
9
node_modules/next/dist/client/components/not-found-boundary.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
interface NotFoundBoundaryProps {
|
||||
notFound?: React.ReactNode;
|
||||
notFoundStyles?: React.ReactNode;
|
||||
asNotFound?: boolean;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
export declare function NotFoundBoundary({ notFound, notFoundStyles, asNotFound, children, }: NotFoundBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
107
node_modules/next/dist/client/components/not-found-boundary.js
generated
vendored
Normal file
107
node_modules/next/dist/client/components/not-found-boundary.js
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
"use client";
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "NotFoundBoundary", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return NotFoundBoundary;
|
||||
}
|
||||
});
|
||||
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
||||
const _jsxruntime = require("react/jsx-runtime");
|
||||
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
||||
const _navigation = require("./navigation");
|
||||
const _notfound = require("./not-found");
|
||||
const _warnonce = require("../../shared/lib/utils/warn-once");
|
||||
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
|
||||
class NotFoundErrorBoundary extends _react.default.Component {
|
||||
componentDidCatch() {
|
||||
if (process.env.NODE_ENV === "development" && // 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";
|
||||
if (this.props.missingSlots.size > 0) {
|
||||
const formattedSlots = Array.from(this.props.missingSlots).sort((a, b)=>a.localeCompare(b)).map((slot)=>"@" + slot).join(", ");
|
||||
warningMessage += "Missing slots: " + formattedSlots;
|
||||
}
|
||||
(0, _warnonce.warnOnce)(warningMessage);
|
||||
}
|
||||
}
|
||||
static getDerivedStateFromError(error) {
|
||||
if ((0, _notfound.isNotFoundError)(error)) {
|
||||
return {
|
||||
notFoundTriggered: true
|
||||
};
|
||||
}
|
||||
// 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.notFoundTriggered) {
|
||||
return {
|
||||
notFoundTriggered: false,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
return {
|
||||
notFoundTriggered: state.notFoundTriggered,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
render() {
|
||||
if (this.state.notFoundTriggered) {
|
||||
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
||||
children: [
|
||||
/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
||||
name: "robots",
|
||||
content: "noindex"
|
||||
}),
|
||||
process.env.NODE_ENV === "development" && /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
||||
name: "next-error",
|
||||
content: "not-found"
|
||||
}),
|
||||
this.props.notFoundStyles,
|
||||
this.props.notFound
|
||||
]
|
||||
});
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
notFoundTriggered: !!props.asNotFound,
|
||||
previousPathname: props.pathname
|
||||
};
|
||||
}
|
||||
}
|
||||
function NotFoundBoundary(param) {
|
||||
let { notFound, notFoundStyles, asNotFound, children } = param;
|
||||
const pathname = (0, _navigation.usePathname)();
|
||||
const missingSlots = (0, _react.useContext)(_approutercontextsharedruntime.MissingSlotContext);
|
||||
return notFound ? /*#__PURE__*/ (0, _jsxruntime.jsx)(NotFoundErrorBoundary, {
|
||||
pathname: pathname,
|
||||
notFound: notFound,
|
||||
notFoundStyles: notFoundStyles,
|
||||
asNotFound: asNotFound,
|
||||
missingSlots: missingSlots,
|
||||
children: children
|
||||
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=not-found-boundary.js.map
|
||||
1
node_modules/next/dist/client/components/not-found-boundary.js.map
generated
vendored
Normal file
1
node_modules/next/dist/client/components/not-found-boundary.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/client/components/not-found-boundary.tsx"],"names":["NotFoundBoundary","NotFoundErrorBoundary","React","Component","componentDidCatch","process","env","NODE_ENV","props","missingSlots","has","warningMessage","size","formattedSlots","Array","from","sort","a","b","localeCompare","map","slot","join","warnOnce","getDerivedStateFromError","error","isNotFoundError","notFoundTriggered","getDerivedStateFromProps","state","pathname","previousPathname","render","meta","name","content","notFoundStyles","notFound","children","constructor","asNotFound","usePathname","useContext","MissingSlotContext"],"mappings":"AAAA;;;;;+BA8GgBA;;;eAAAA;;;;;iEA5GkB;4BACN;0BACI;0BACP;+CACU;AAmBnC,MAAMC,8BAA8BC,cAAK,CAACC,SAAS;IAYjDC,oBAA0B;QACxB,IACEC,QAAQC,GAAG,CAACC,QAAQ,KAAK,iBACzB,4EAA4E;QAC5E,CAAC,IAAI,CAACC,KAAK,CAACC,YAAY,CAACC,GAAG,CAAC,aAC7B;YACA,IAAIC,iBACF,4HACA;YAEF,IAAI,IAAI,CAACH,KAAK,CAACC,YAAY,CAACG,IAAI,GAAG,GAAG;gBACpC,MAAMC,iBAAiBC,MAAMC,IAAI,CAAC,IAAI,CAACP,KAAK,CAACC,YAAY,EACtDO,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAC/BE,GAAG,CAAC,CAACC,OAAS,AAAC,MAAGA,MAClBC,IAAI,CAAC;gBAERX,kBAAkB,oBAAoBE;YACxC;YAEAU,IAAAA,kBAAQ,EAACZ;QACX;IACF;IAEA,OAAOa,yBAAyBC,KAAU,EAAE;QAC1C,IAAIC,IAAAA,yBAAe,EAACD,QAAQ;YAC1B,OAAO;gBACLE,mBAAmB;YACrB;QACF;QACA,mCAAmC;QACnC,MAAMF;IACR;IAEA,OAAOG,yBACLpB,KAAiC,EACjCqB,KAAiC,EACE;QACnC;;;;;KAKC,GACD,IAAIrB,MAAMsB,QAAQ,KAAKD,MAAME,gBAAgB,IAAIF,MAAMF,iBAAiB,EAAE;YACxE,OAAO;gBACLA,mBAAmB;gBACnBI,kBAAkBvB,MAAMsB,QAAQ;YAClC;QACF;QACA,OAAO;YACLH,mBAAmBE,MAAMF,iBAAiB;YAC1CI,kBAAkBvB,MAAMsB,QAAQ;QAClC;IACF;IAEAE,SAAS;QACP,IAAI,IAAI,CAACH,KAAK,CAACF,iBAAiB,EAAE;YAChC,qBACE;;kCACE,qBAACM;wBAAKC,MAAK;wBAASC,SAAQ;;oBAC3B9B,QAAQC,GAAG,CAACC,QAAQ,KAAK,+BACxB,qBAAC0B;wBAAKC,MAAK;wBAAaC,SAAQ;;oBAEjC,IAAI,CAAC3B,KAAK,CAAC4B,cAAc;oBACzB,IAAI,CAAC5B,KAAK,CAAC6B,QAAQ;;;QAG1B;QAEA,OAAO,IAAI,CAAC7B,KAAK,CAAC8B,QAAQ;IAC5B;IA9EAC,YAAY/B,KAAiC,CAAE;QAC7C,KAAK,CAACA;QACN,IAAI,CAACqB,KAAK,GAAG;YACXF,mBAAmB,CAAC,CAACnB,MAAMgC,UAAU;YACrCT,kBAAkBvB,MAAMsB,QAAQ;QAClC;IACF;AAyEF;AAEO,SAAS9B,iBAAiB,KAKT;IALS,IAAA,EAC/BqC,QAAQ,EACRD,cAAc,EACdI,UAAU,EACVF,QAAQ,EACc,GALS;IAM/B,MAAMR,WAAWW,IAAAA,uBAAW;IAC5B,MAAMhC,eAAeiC,IAAAA,iBAAU,EAACC,iDAAkB;IAClD,OAAON,yBACL,qBAACpC;QACC6B,UAAUA;QACVO,UAAUA;QACVD,gBAAgBA;QAChBI,YAAYA;QACZ/B,cAAcA;kBAEb6B;uBAGH;kBAAGA;;AAEP"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user