/opt/canhelp/apps/web/.next/cache/webpack/edge-server-production
Edit: /opt/canhelp/apps/web/.next/cache/webpack/edge-server-production/3.pack (8355878B)
wpc webpack/lib/cache/PackFileCacheStrategyPackContentItemsu Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!/opt/canhelp/apps/web/src/middleware.ts|middleware{ Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-middleware-loader.js?absolutePagePath=private-next-root-dir%2Fsrc%2Fmiddleware.ts&page=%2Fsrc%2Fmiddleware&rootDir=%2Fopt%2Fcanhelp%2Fapps%2Fweb&matchers=W3sicmVnZXhwIjoiXig%2FOlxcLyhfbmV4dFxcL2RhdGFcXC9bXi9dezEsfSkpPyg%2FOlxcLygoPyFfbmV4dFxcL3N0YXRpY3xfbmV4dFxcL2ltYWdlfGZhdmljb24uaWNvKS4qKSkoXFwuanNvbik%2FW1xcLyNcXD9dPyQiLCJvcmlnaW5hbFNvdXJjZSI6Ii8oKD8hX25leHQvc3RhdGljfF9uZXh0L2ltYWdlfGZhdmljb24uaWNvKS4qKSJ9XQ%3D%3D&preferredRegion=&middlewareConfig=eyJtYXRjaGVycyI6W3sicmVnZXhwIjoiXig%2FOlxcLyhfbmV4dFxcL2RhdGFcXC9bXi9dezEsfSkpPyg%2FOlxcLygoPyFfbmV4dFxcL3N0YXRpY3xfbmV4dFxcL2ltYWdlfGZhdmljb24uaWNvKS4qKSkoXFwuanNvbik%2FW1xcLyNcXD9dPyQiLCJvcmlnaW5hbFNvdXJjZSI6Ii8oKD8hX25leHQvc3RhdGljfF9uZXh0L2ltYWdlfGZhdmljb24uaWNvKS4qKSJ9XX0%3D!|middleware|1a3e90c141121463|edge-runtime-webpackCompilation/assets|chunk550MinifierWebpackPlugin|src/middleware.jsSourceMapDevToolPlugin|src/middleware.jswebpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/SourceMapSource import { NextResponse } from 'next/server';
export async function middleware(request) {
const { pathname } = request.nextUrl;
// Pass pathname to layouts via request header
const requestHeaders = new Headers(request.headers);
requestHeaders.set('x-pathname', pathname);
// Skip admin, login/auth, maintenance page itself, API, static assets, and SEO files
if (pathname.startsWith('/admin') || pathname.startsWith('/login') || pathname.startsWith('/register') || pathname.startsWith('/auth') || pathname.startsWith('/maintenance') || pathname.startsWith('/api') || pathname.startsWith('/_next') || pathname.startsWith('/fonts') || pathname === '/sitemap.xml' || pathname === '/robots.txt' || pathname.match(/\.(ico|png|jpg|jpeg|svg|webp|css|js|xml|txt)$/)) {
return NextResponse.next({
request: {
headers: requestHeaders
}
});
}
try {
const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000';
const res = await fetch(`${apiBase}/api/admin/seo-public`, {
next: {
revalidate: 30
}
});
if (res.ok) {
const settings = await res.json();
if (settings['seo.maintenanceMode'] === 'true') {
return NextResponse.redirect(new URL('/maintenance', request.url));
}
}
} catch {
// If API is unreachable, allow access — don't block the site
}
return NextResponse.next({
request: {
headers: requestHeaders
}
});
}
export const config = {
matcher: [
'/((?!_next/static|_next/image|favicon.ico).*)'
]
};
B webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!./src/middleware.ts|middleware {"version":3,"sources":["webpack://./src/middleware.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server'\n\nexport async function middleware(request: NextRequest) {\n const { pathname } = request.nextUrl\n\n // Pass pathname to layouts via request header\n const requestHeaders = new Headers(request.headers)\n requestHeaders.set('x-pathname', pathname)\n\n // Skip admin, login/auth, maintenance page itself, API, static assets, and SEO files\n if (\n pathname.startsWith('/admin') ||\n pathname.startsWith('/login') ||\n pathname.startsWith('/register') ||\n pathname.startsWith('/auth') ||\n pathname.startsWith('/maintenance') ||\n pathname.startsWith('/api') ||\n pathname.startsWith('/_next') ||\n pathname.startsWith('/fonts') ||\n pathname === '/sitemap.xml' ||\n pathname === '/robots.txt' ||\n pathname.match(/\\.(ico|png|jpg|jpeg|svg|webp|css|js|xml|txt)$/)\n ) {\n return NextResponse.next({ request: { headers: requestHeaders } })\n }\n\n try {\n const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'\n const res = await fetch(`${apiBase}/api/admin/seo-public`, {\n next: { revalidate: 30 },\n })\n if (res.ok) {\n const settings: Record
= await res.json()\n if (settings['seo.maintenanceMode'] === 'true') {\n return NextResponse.redirect(new URL('/maintenance', request.url))\n }\n }\n } catch {\n // If API is unreachable, allow access — don't block the site\n }\n\n return NextResponse.next({ request: { headers: requestHeaders } })\n}\n\nexport const config = {\n matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],\n}\n"],"names":["NextResponse","middleware","request","pathname","nextUrl","requestHeaders","Headers","headers","set","startsWith","match","next","apiBase","process","env","NEXT_PUBLIC_API_URL","res","fetch","revalidate","ok","settings","json","redirect","URL","url","config","matcher"],"mappings":"AAAA,SAAsBA,YAAY,QAAQ,cAAa;AAEvD,OAAO,eAAeC,WAAWC,OAAoB;IACnD,MAAM,EAAEC,QAAQ,EAAE,GAAGD,QAAQE,OAAO;IAEpC,8CAA8C;IAC9C,MAAMC,iBAAiB,IAAIC,QAAQJ,QAAQK,OAAO;IAClDF,eAAeG,GAAG,CAAC,cAAcL;IAEjC,qFAAqF;IACrF,IACEA,SAASM,UAAU,CAAC,aACpBN,SAASM,UAAU,CAAC,aACpBN,SAASM,UAAU,CAAC,gBACpBN,SAASM,UAAU,CAAC,YACpBN,SAASM,UAAU,CAAC,mBACpBN,SAASM,UAAU,CAAC,WACpBN,SAASM,UAAU,CAAC,aACpBN,SAASM,UAAU,CAAC,aACpBN,aAAa,kBACbA,aAAa,iBACbA,SAASO,KAAK,CAAC,kDACf;QACA,OAAOV,aAAaW,IAAI,CAAC;YAAET,SAAS;gBAAEK,SAASF;YAAe;QAAE;IAClE;IAEA,IAAI;QACF,MAAMO,UAAUC,QAAQC,GAAG,CAACC,mBAAmB,IAAI;QACnD,MAAMC,MAAM,MAAMC,MAAM,GAAGL,QAAQ,qBAAqB,CAAC,EAAE;YACzDD,MAAM;gBAAEO,YAAY;YAAG;QACzB;QACA,IAAIF,IAAIG,EAAE,EAAE;YACV,MAAMC,WAAmC,MAAMJ,IAAIK,IAAI;YACvD,IAAID,QAAQ,CAAC,sBAAsB,KAAK,QAAQ;gBAC9C,OAAOpB,aAAasB,QAAQ,CAAC,IAAIC,IAAI,gBAAgBrB,QAAQsB,GAAG;YAClE;QACF;IACF,EAAE,OAAM;IACN,6DAA6D;IAC/D;IAEA,OAAOxB,aAAaW,IAAI,CAAC;QAAET,SAAS;YAAEK,SAASF;QAAe;IAAE;AAClE;AAEA,OAAO,MAAMoB,SAAS;IACpBC,SAAS;QAAC;KAAgD;AAC5D,EAAC","file":"x"}exportsTypenamespace
javascript/automiddleware/opt/canhelp/apps/web/srcaliasmainFieldsconditionNamesfallback`)server-only$client-only$next/dist/compiled/server-only$next/dist/compiled/client-only$/opt/canhelp/node_modules/next/head.js/opt/canhelp/node_modules/next/image.js/opt/canhelp/node_modules/next/constants.js/opt/canhelp/node_modules/next/router.js/opt/canhelp/node_modules/next/dynamic.js/opt/canhelp/node_modules/next/script.js/opt/canhelp/node_modules/next/link.js/opt/canhelp/node_modules/next/form.js/opt/canhelp/node_modules/next/navigation.js/opt/canhelp/node_modules/next/headers.js/opt/canhelp/node_modules/next/og.js/opt/canhelp/node_modules/next/server.js/opt/canhelp/node_modules/next/document.js/opt/canhelp/node_modules/next/app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$next/dist/compiled/react$next/dist/compiled/react/compiler-runtime$next/dist/compiled/react/jsx-dev-runtime$next/dist/compiled/react/jsx-runtime$next/dist/compiled/react-dom$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.tsnextnext/dist/compiled/server-only/emptynext/dist/compiled/client-only/errornext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigation.react-servernext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/compiled/react/react.react-servernext/dist/compiled/react/compiler-runtimenext/dist/compiled/react/jsx-dev-runtime.react-servernext/dist/compiled/react/jsx-runtime.react-servernext/dist/compiled/react-dom/react-dom.react-servernext/dist/compiled/react-dom/clientnext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/server.browsernext/dist/compiled/react-dom/static.edgenext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-server-dom-webpack/client.edgenext/dist/compiled/react-server-dom-webpack/server.edgenext/dist/compiled/react-server-dom-webpack/server.nodenext/dist/compiled/react-server-dom-webpack/static.edgenext/dist/client/dev/noop-turbopack-hmr/opt/canhelp/node_modules/nextedge-light...
react-serverprocess/opt/canhelp/node_modules/next/dist/build/polyfills/process.js `cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependencieshashassetsassetsInforscstrictexportsArgumentimportLocByPathtopLevelDeclarationssnapshotwebpack/lib/util/LazySet/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.jswebpack/DefinePlugin_hashwebpack/DefinePlugin process.env.NEXT_PUBLIC_API_URL63807817"https://api.canhelp.gr"36cdbc9b82dbfcbdtypeactionIdsclientRefsclientEntryTypeisClientRefserver
__webpack_exports__next/serversourcePositionsourceContentlinecolumnsource a javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!/opt/canhelp/apps/web/src/middleware.ts|middleware import { NextResponse } from 'next/server';
export async function middleware(request) {
const { pathname } = request.nextUrl;
// Pass pathname to layouts via request header
const requestHeaders = new Headers(request.headers);
requestHeaders.set('x-pathname', pathname);
// Skip admin, login/auth, maintenance page itself, API, static assets, and SEO files
if (pathname.startsWith('/admin') || pathname.startsWith('/login') || pathname.startsWith('/register') || pathname.startsWith('/auth') || pathname.startsWith('/maintenance') || pathname.startsWith('/api') || pathname.startsWith('/_next') || pathname.startsWith('/fonts') || pathname === '/sitemap.xml' || pathname === '/robots.txt' || pathname.match(/\.(ico|png|jpg|jpeg|svg|webp|css|js|xml|txt)$/)) {
return NextResponse.next({
request: {
headers: requestHeaders
}
});
}
try {
const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000';
const res = await fetch(`${apiBase}/api/admin/seo-public`, {
next: {
revalidate: 30
}
});
if (res.ok) {
const settings = await res.json();
if (settings['seo.maintenanceMode'] === 'true') {
return NextResponse.redirect(new URL('/maintenance', request.url));
}
}
} catch {
// If API is unreachable, allow access — don't block the site
}
return NextResponse.next({
request: {
headers: requestHeaders
}
});
}
export const config = {
matcher: [
'/((?!_next/static|_next/image|favicon.ico).*)'
]
};
tconfigwebpack/lib/FileSystemInfoSnapshot @yB/opt/canhelp/apps/web/src/middleware.tssafeTimetimestamp! @v)yB 0v)yB6539aa2a8b35e40dwebpack/lib/dependencies/HarmonyCompatibilityDependency
d webpack/lib/dependencies/ConstDependency `+
`+webpack/lib/dependencies/HarmonyExportHeaderDependency`3@/ `,@/
a$A7 A0
c% )A
c70A
cRwebpack/lib/dependencies/HarmonyImportSideEffectDependency
`+webpack/lib/dependencies/HarmonyExportSpecifierDependency@ZZ
a$webpack/lib/dependencies/HarmonyImportSpecifierDependencyaNextResponseA . A )
T
b redirectA / A &
c,{A A
c
c% )
sourcesdataruntimeRequirementsjavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource M webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource@ webpack/lib/util/registerExternalSerializerwebpack-sources/RawSource // ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ nHandler)
});
// NAMESPACE OBJECT: ./src/middleware.ts
var middleware_namespaceObject = {};
__webpack_require__.r(middleware_namespaceObject);
__webpack_require__.d(middleware_namespaceObject, {
config: () => (config),
middleware: () => (middleware)
});
;// ../../node_modules/next/dist/esm/server/web/globals.js
webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/OriginalSource export async function getEdgeInstrumentationModule() {
const instrumentation = '_ENTRIES' in globalThis && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation;
return instrumentation;
}
let instrumentationModulePromise = null;
async function registerInstrumentation() {
// Ensure registerInstrumentation is not called in production build
if (process.env.NEXT_PHASE === 'phase-production-build') return;
if (!instrumentationModulePromise) {
instrumentationModulePromise = getEdgeInstrumentationModule();
}
const instrumentation = await instrumentationModulePromise;
if (instrumentation == null ? void 0 : instrumentation.register) {
try {
await instrumentation.register();
} catch (err) {
err.message = `An error occurred while loading instrumentation hook: ${err.message}`;
throw err;
}
}
}
export async function edgeInstrumentationOnRequestError(...args) {
const instrumentation = await getEdgeInstrumentationModule();
try {
var _instrumentation_onRequestError;
await (instrumentation == null ? void 0 : (_instrumentation_onRequestError = instrumentation.onRequestError) == null ? void 0 : _instrumentation_onRequestError.call(instrumentation, ...args));
} catch (err) {
// Log the soft error and continue, since the original error has already been thrown
console.error('Error in instrumentation.onRequestError:', err);
}
}
let registerInstrumentationPromise = null;
export function ensureInstrumentationRegistered() {
if (!registerInstrumentationPromise) {
registerInstrumentationPromise = registerInstrumentation();
}
return registerInstrumentationPromise;
}
function getUnsupportedModuleErrorMessage(module) {
// warning: if you change these messages, you must adjust how dev-overlay's middleware detects modules not found
return `The edge runtime does not support Node.js '${module}' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`;
}
function __import_unsupported(moduleName) {
const proxy = new Proxy(function() {}, {
get (_obj, prop) {
if (prop === 'then') {
return {};
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
construct () {
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
apply (_target, _this, args) {
if (typeof args[0] === 'function') {
return args[0](proxy);
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
}
});
return new Proxy({}, {
get: ()=>proxy
});
}
function enhanceGlobals() {
if (process.env.NEXT_RUNTIME !== 'edge') {
return;
}
// The condition is true when the "process" module is provided
if (process !== global.process) {
// prefer local process but global.process has correct "env"
process.env = global.process.env;
global.process = process;
}
// to allow building code that import but does not use node.js modules,
// webpack will expect this function to exist in global scope
try {
Object.defineProperty(globalThis, '__import_unsupported', {
value: __import_unsupported,
enumerable: false,
configurable: false
});
} catch {}
// Eagerly fire instrumentation hook to make the startup faster.
void ensureInstrumentationRegistered();
}
enhanceGlobals();
//# sourceMappingURL=globals.js.mape webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/globals.js|middleware M
j
o
false{}__webpack_require__.gbuffersourcesizemapshash async function getEdgeInstrumentationModule() {
const instrumentation = '_ENTRIES' in globalThis && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation;
return instrumentation;
}
let instrumentationModulePromise = null;
async function registerInstrumentation() {
// Ensure registerInstrumentation is not called in production build
if (process.env.NEXT_PHASE === 'phase-production-build') return;
if (!instrumentationModulePromise) {
instrumentationModulePromise = getEdgeInstrumentationModule();
}
const instrumentation = await instrumentationModulePromise;
if (instrumentation == null ? void 0 : instrumentation.register) {
try {
await instrumentation.register();
} catch (err) {
err.message = `An error occurred while loading instrumentation hook: ${err.message}`;
throw err;
}
}
}
async function edgeInstrumentationOnRequestError(...args) {
const instrumentation = await getEdgeInstrumentationModule();
try {
var _instrumentation_onRequestError;
await (instrumentation == null ? void 0 : (_instrumentation_onRequestError = instrumentation.onRequestError) == null ? void 0 : _instrumentation_onRequestError.call(instrumentation, ...args));
} catch (err) {
// Log the soft error and continue, since the original error has already been thrown
console.error('Error in instrumentation.onRequestError:', err);
}
}
let registerInstrumentationPromise = null;
function ensureInstrumentationRegistered() {
if (!registerInstrumentationPromise) {
registerInstrumentationPromise = registerInstrumentation();
}
return registerInstrumentationPromise;
}
function getUnsupportedModuleErrorMessage(module) {
// warning: if you change these messages, you must adjust how dev-overlay's middleware detects modules not found
return `The edge runtime does not support Node.js '${module}' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`;
}
function __import_unsupported(moduleName) {
const proxy = new Proxy(function() {}, {
get (_obj, prop) {
if (prop === 'then') {
return {};
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
construct () {
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
apply (_target, _this, args) {
if (typeof args[0] === 'function') {
return args[0](proxy);
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
}
});
return new Proxy({}, {
get: ()=>proxy
});
}
function enhanceGlobals() {
if (false) {}
// The condition is true when the "process" module is provided
if (process !== __webpack_require__.g.process) {
// prefer local process but global.process has correct "env"
process.env = __webpack_require__.g.process.env;
__webpack_require__.g.process = process;
}
// to allow building code that import but does not use node.js modules,
// webpack will expect this function to exist in global scope
try {
Object.defineProperty(globalThis, '__import_unsupported', {
value: __import_unsupported,
enumerable: false,
configurable: false
});
} catch {}
// Eagerly fire instrumentation hook to make the startup faster.
void ensureInstrumentationRegistered();
}
enhanceGlobals();
//# sourceMappingURL=globals.js.map{"finalSource":false}mapbufferedMapversionfilemappingssourcessourcesContentnamesx AAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,mFAAmF,YAAY;AAC/F;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,uBAAuB;AACvB;AACA,KAAK;AACL;AACA;AACA,QAAQ,KAAmC,EAAE,EAExC;AACL;AACA,oBAAoB,qBAAM;AAC1B;AACA,sBAAsB,qBAAM;AAC5B,QAAQ,qBAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA;;AAEAe webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/globals.js|middleware export async function getEdgeInstrumentationModule() {
const instrumentation = '_ENTRIES' in globalThis && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation;
return instrumentation;
}
let instrumentationModulePromise = null;
async function registerInstrumentation() {
// Ensure registerInstrumentation is not called in production build
if (process.env.NEXT_PHASE === 'phase-production-build') return;
if (!instrumentationModulePromise) {
instrumentationModulePromise = getEdgeInstrumentationModule();
}
const instrumentation = await instrumentationModulePromise;
if (instrumentation == null ? void 0 : instrumentation.register) {
try {
await instrumentation.register();
} catch (err) {
err.message = `An error occurred while loading instrumentation hook: ${err.message}`;
throw err;
}
}
}
export async function edgeInstrumentationOnRequestError(...args) {
const instrumentation = await getEdgeInstrumentationModule();
try {
var _instrumentation_onRequestError;
await (instrumentation == null ? void 0 : (_instrumentation_onRequestError = instrumentation.onRequestError) == null ? void 0 : _instrumentation_onRequestError.call(instrumentation, ...args));
} catch (err) {
// Log the soft error and continue, since the original error has already been thrown
console.error('Error in instrumentation.onRequestError:', err);
}
}
let registerInstrumentationPromise = null;
export function ensureInstrumentationRegistered() {
if (!registerInstrumentationPromise) {
registerInstrumentationPromise = registerInstrumentation();
}
return registerInstrumentationPromise;
}
function getUnsupportedModuleErrorMessage(module) {
// warning: if you change these messages, you must adjust how dev-overlay's middleware detects modules not found
return `The edge runtime does not support Node.js '${module}' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`;
}
function __import_unsupported(moduleName) {
const proxy = new Proxy(function() {}, {
get (_obj, prop) {
if (prop === 'then') {
return {};
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
construct () {
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
},
apply (_target, _this, args) {
if (typeof args[0] === 'function') {
return args[0](proxy);
}
throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
}
});
return new Proxy({}, {
get: ()=>proxy
});
}
function enhanceGlobals() {
if (process.env.NEXT_RUNTIME !== 'edge') {
return;
}
// The condition is true when the "process" module is provided
if (process !== global.process) {
// prefer local process but global.process has correct "env"
process.env = global.process.env;
global.process = process;
}
// to allow building code that import but does not use node.js modules,
// webpack will expect this function to exist in global scope
try {
Object.defineProperty(globalThis, '__import_unsupported', {
value: __import_unsupported,
enumerable: false,
configurable: false
});
} catch {}
// Eagerly fire instrumentation hook to make the startup faster.
void ensureInstrumentationRegistered();
}
enhanceGlobals();
//# sourceMappingURL=globals.js.map ReplaceSourceOriginalSource+ webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/globals.js|middleware06undefined924930undefined15491555undefined32863320falseundefined33233345{}undefined34343439__webpack_require__.gundefined35433548__webpack_require__.gundefined35713576__webpack_require__.gundefined :
;// ../../node_modules/next/dist/esm/server/web/error.js
u webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/OriginalSourceS export class PageSignatureError extends Error {
constructor({ page }){
super(`The middleware "${page}" accepts an async API directly with the form:
export function middleware(request, event) {
return NextResponse.redirect('/new-location')
}
Read more: https://nextjs.org/docs/messages/middleware-new-signature
`);
}
}
export class RemovedPageError extends Error {
constructor(){
super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`);
}
}
export class RemovedUAError extends Error {
constructor(){
super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`);
}
}
//# sourceMappingURL=error.js.mapc webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/error.js|middleware C` f F L > class PageSignatureError extends Error {
constructor({ page }){
super(`The middleware "${page}" accepts an async API directly with the form:
export function middleware(request, event) {
return NextResponse.redirect('/new-location')
}
Read more: https://nextjs.org/docs/messages/middleware-new-signature
`);
}
}
class RemovedPageError extends Error {
constructor(){
super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`);
}
}
class RemovedUAError extends Error {
constructor(){
super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`);
}
}
//# sourceMappingURL=error.js.mapx AAAO;AACP,kBAAkB,MAAM;AACxB,iCAAiC,KAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEAc webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/error.js|middlewareS export class PageSignatureError extends Error {
constructor({ page }){
super(`The middleware "${page}" accepts an async API directly with the form:
export function middleware(request, event) {
return NextResponse.redirect('/new-location')
}
Read more: https://nextjs.org/docs/messages/middleware-new-signature
`);
}
}
export class RemovedPageError extends Error {
constructor(){
super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`);
}
}
export class RemovedUAError extends Error {
constructor(){
super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`);
}
}
//# sourceMappingURL=error.js.map webpack://javascript/auto|../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!../../node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[21].oneOf[2].use[1]!../../node_modules/next/dist/esm/server/web/error.js|middleware06undefined352358undefined582588undefined 7
;// ../../node_modules/next/dist/esm/lib/constants.js
A&