next 15.0.4-canary.4 → 15.0.4-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/base-server.js +13 -7
- package/dist/esm/server/base-server.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/server/base-server.js +13 -7
- package/dist/server/base-server.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/bin/next
CHANGED
|
@@ -72,7 +72,7 @@ const program = new NextRootCommand();
|
|
|
72
72
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
|
73
73
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
|
74
74
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
|
75
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.0.4-canary.
|
|
75
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.0.4-canary.5"}`, '-v, --version', 'Outputs the Next.js version.');
|
|
76
76
|
program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
|
77
77
|
'compile',
|
|
78
78
|
'generate'
|
package/dist/build/index.js
CHANGED
|
@@ -351,7 +351,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
351
351
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
|
352
352
|
buildMode: experimentalBuildMode,
|
|
353
353
|
isTurboBuild: String(turboNextBuild),
|
|
354
|
-
version: "15.0.4-canary.
|
|
354
|
+
version: "15.0.4-canary.5"
|
|
355
355
|
});
|
|
356
356
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
357
357
|
_buildcontext.NextBuildContext.dir = dir;
|
|
@@ -752,7 +752,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
752
752
|
// Files outside of the distDir can be "type": "module"
|
|
753
753
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
754
754
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
755
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.0.4-canary.
|
|
755
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.0.4-canary.5");
|
|
756
756
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
|
757
757
|
buildStage: 'start'
|
|
758
758
|
});
|
package/dist/build/swc/index.js
CHANGED
|
@@ -127,7 +127,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
127
127
|
}
|
|
128
128
|
return newObj;
|
|
129
129
|
}
|
|
130
|
-
const nextVersion = "15.0.4-canary.
|
|
130
|
+
const nextVersion = "15.0.4-canary.5";
|
|
131
131
|
const ArchName = (0, _os.arch)();
|
|
132
132
|
const PlatformName = (0, _os.platform)();
|
|
133
133
|
function infoLog(...args) {
|
|
@@ -1508,7 +1508,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1508
1508
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1509
1509
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1510
1510
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1511
|
-
cacheKey: "15.0.4-canary.
|
|
1511
|
+
cacheKey: "15.0.4-canary.5",
|
|
1512
1512
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1513
1513
|
minimize: false,
|
|
1514
1514
|
info: {
|
|
@@ -1736,7 +1736,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1736
1736
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1737
1737
|
// - Next.js version
|
|
1738
1738
|
// - next.config.js keys that affect compilation
|
|
1739
|
-
version: `${__dirname}|${"15.0.4-canary.
|
|
1739
|
+
version: `${__dirname}|${"15.0.4-canary.5"}|${configVars}`,
|
|
1740
1740
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1741
1741
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1742
1742
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/client/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
|
61
61
|
const _shared = require("./react-client-callbacks/shared");
|
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
63
63
|
const _reporttosocket = /*#__PURE__*/ _interop_require_default._(require("./tracing/report-to-socket"));
|
|
64
|
-
const version = "15.0.4-canary.
|
|
64
|
+
const version = "15.0.4-canary.5";
|
|
65
65
|
let router;
|
|
66
66
|
const emitter = (0, _mitt.default)();
|
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -2869,5 +2869,5 @@ ${B}`)}function a(t,r){let s;let{stackTraceLimit:n,prepareStackTrace:a}=Error;if
|
|
|
2869
2869
|
`)}}var rx=__webpack_require__("./dist/esm/server/web/spec-extension/cookies.js");let rv=Symbol("internal request");class rE extends Request{constructor(t,r={}){let s="string"!=typeof t&&"url"in t?t.url:String(t);rr(s),t instanceof Request?super(t,r):super(s,r);let n=new ry(s,{headers:rt(this.headers),nextConfig:r.nextConfig});this[rv]={cookies:new rx.tm(this.headers),nextUrl:n,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?s:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[rv].cookies}get nextUrl(){return this[rv].nextUrl}get page(){throw new rb}get ua(){throw new rD}get url(){return this[rv].url}}let rj=t=>!0,rA=t=>!0,rS="ResponseAborted";class rP extends Error{constructor(...t){super(...t),this.name=rS}}function r_(t){let r=new AbortController;return t.once("close",()=>{t.writableFinished||r.abort(new rP)}),r}function rw(t){let{errored:r,destroyed:s}=t;if(r||s)return AbortSignal.abort(r??new rP);let{signal:n}=r_(t);return n}class rI{static fromBaseNextRequest(t,r){if(rj(t))return rI.fromNodeNextRequest(t,r);throw Error("Invariant: Unsupported NextRequest type")}static fromNodeNextRequest(t,r){let s,n=null;if("GET"!==t.method&&"HEAD"!==t.method&&t.body&&(n=t.body),t.url.startsWith("http"))s=new URL(t.url);else{let r=eS(t,"initURL");s=r&&r.startsWith("http")?new URL(t.url,r):new URL(t.url,"http://n")}return new rE(s,{method:t.method,headers:t8(t.headers),duplex:"half",signal:r,...r.aborted?{}:{body:n}})}static fromWebNextRequest(t){let r=null;return"GET"!==t.method&&"HEAD"!==t.method&&(r=t.body),new rE(t.url,{method:t.method,headers:t8(t.headers),duplex:"half",signal:t.request.signal,...t.request.signal.aborted?{}:{body:r}})}}let rO=0,rT=0,rN=0;function rF(t={}){let r=0===rO?void 0:{clientComponentLoadStart:rO,clientComponentLoadTimes:rT,clientComponentLoadCount:rN};return t.reset&&(rO=0,rT=0,rN=0),r}function rk(t){return(null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.name)===rS}function rM(t,r){let s=!1,n=new tz;function a(){n.resolve()}t.on("drain",a),t.once("close",()=>{t.off("drain",a),n.resolve()});let i=new tz;return t.once("finish",()=>{i.resolve()}),new WritableStream({write:async r=>{if(!s){if(s=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let t=rF();t&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:t.clientComponentLoadStart,end:t.clientComponentLoadStart+t.clientComponentLoadTimes})}t.flushHeaders(),(0,t1.getTracer)().trace(t0.Fx.startResponse,{spanName:"start response"},()=>void 0)}try{let s=t.write(r);"flush"in t&&"function"==typeof t.flush&&t.flush(),s||(await n.promise,n=new tz)}catch(r){throw t.end(),Error("failed to write chunk to response",{cause:r})}},abort:r=>{t.writableFinished||t.destroy(r)},close:async()=>{if(r&&await r,!t.writableFinished)return t.end(),i.promise}})}async function rL(t,r,s){try{let{errored:n,destroyed:a}=r;if(n||a)return;let i=r_(r),o=rM(r,s);await t.pipeTo(o,{signal:i.signal})}catch(t){if(rk(t))return;throw Error("failed to pipe response",{cause:t})}}class rR{static fromStatic(t){return new rR(t,{metadata:{}})}constructor(t,{contentType:r,waitUntil:s,metadata:n}){this.response=t,this.contentType=r,this.metadata=n,this.waitUntil=s}assignMetadata(t){Object.assign(this.metadata,t)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedBuffer(t=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return t7(this.readable)}return Buffer.from(this.response)}toUnchunkedString(t=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return t9(this.readable)}return this.response}get readable(){if(null===this.response)throw Error("Invariant: null responses cannot be streamed");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be streamed");return Buffer.isBuffer(this.response)?t6(this.response):Array.isArray(this.response)?t5(...this.response):this.response}chain(t){let r;if(null===this.response)throw Error("Invariant: response is null. This is a bug in Next.js");"string"==typeof this.response?r=[t4(this.response)]:Array.isArray(this.response)?r=this.response:Buffer.isBuffer(this.response)?r=[t6(this.response)]:r=[this.response],r.push(t),this.response=r}async pipeTo(t){try{await this.readable.pipeTo(t,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await t.close()}catch(r){if(rk(r)){await t.abort(r);return}throw r}}async pipeToNodeResponse(t){await rL(this.readable,t,this.waitUntil)}}async function rH(t){var r,s;return{...t,value:(null==(r=t.value)?void 0:r.kind)===B.PAGES?{kind:B.PAGES,html:await t.value.html.toUnchunkedString(!0),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(s=t.value)?void 0:s.kind)===B.APP_PAGE?{kind:B.APP_PAGE,html:await t.value.html.toUnchunkedString(!0),postponed:t.value.postponed,rscData:t.value.rscData,headers:t.value.headers,status:t.value.status,segmentData:t.value.segmentData}:t.value}}async function rG(t){var r,s,n;if(!t)return null;if((null==(r=t.value)?void 0:r.kind)===B.FETCH)throw Error("Invariant: unexpected cachedResponse of kind fetch in response cache");return{isMiss:t.isMiss,isStale:t.isStale,revalidate:t.revalidate,isFallback:t.isFallback,value:(null==(s=t.value)?void 0:s.kind)===B.PAGES?{kind:B.PAGES,html:rR.fromStatic(t.value.html),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(n=t.value)?void 0:n.kind)===B.APP_PAGE?{kind:B.APP_PAGE,html:rR.fromStatic(t.value.html),rscData:t.value.rscData,headers:t.value.headers,status:t.value.status,postponed:t.value.postponed,segmentData:t.value.segmentData}:t.value}}function rK(t){switch(t){case u.PAGES:return l.PAGES;case u.APP_PAGE:return l.APP_PAGE;case u.IMAGE:return l.IMAGE;case u.APP_ROUTE:return l.APP_ROUTE;default:throw Error(`Unexpected route kind ${t}`)}}!function(t){t.PAGES="PAGES",t.PAGES_API="PAGES_API",t.APP_PAGE="APP_PAGE",t.APP_ROUTE="APP_ROUTE",t.IMAGE="IMAGE"}(u||(u={}));class rJ{constructor(t){this.batcher=tZ.create({cacheKeyFn:({key:t,isOnDemandRevalidate:r})=>`${t}-${r?"1":"0"}`,schedulerFn:t$}),this.minimalMode=t}async get(t,r,s){if(!t)return r({hasResolved:!1,previousCacheEntry:null});let{incrementalCache:n,isOnDemandRevalidate:a=!1,isFallback:i=!1,isRoutePPREnabled:o=!1}=s;return rG(await this.batcher.batch({key:t,isOnDemandRevalidate:a},async(B,l)=>{var u;if((null==(u=this.previousCacheItem)?void 0:u.key)===B&&this.previousCacheItem.expiresAt>Date.now())return this.previousCacheItem.entry;rK(s.routeKind);let c=!1,d=null;try{d=null;let t=await r({hasResolved:c,previousCacheEntry:d,isRevalidating:!0});if(!t)return this.previousCacheItem=void 0,null;let s=await rH({...t,isMiss:!d});if(!s)return this.previousCacheItem=void 0,null;return a||c||(l(s),c=!0),void 0!==s.revalidate&&(this.previousCacheItem={key:B,entry:s,expiresAt:Date.now()+1e3}),s}catch(r){if(d&&await n.set(t,d.value,{revalidate:Math.min(Math.max(d.revalidate||3,3),30),isRoutePPREnabled:o,isFallback:i}),c)return console.error(r),null;throw r}}))}}let rU="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",rQ=`(${rU}[.]){3}${rU}`,rW="(?:[0-9a-fA-F]{1,4})",rV=RegExp(`^((?:${rW}:){7}(?:${rW}|:)|(?:${rW}:){6}(?:${rQ}|:${rW}|:)|(?:${rW}:){5}(?::${rQ}|(:${rW}){1,2}|:)|(?:${rW}:){4}(?:(:${rW}){0,1}:${rQ}|(:${rW}){1,3}|:)|(?:${rW}:){3}(?:(:${rW}){0,2}:${rQ}|(:${rW}){1,4}|:)|(?:${rW}:){2}(?:(:${rW}){0,3}:${rQ}|(:${rW}){1,5}|:)|(?:${rW}:){1}(?:(:${rW}){0,4}:${rQ}|(:${rW}){1,6}|:)|(?::((?::${rW}){0,5}:${rQ}|(?::${rW}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function rq(t){return rV.test(t)}function rY(t){return rq(t)?`[${t}]`:t}function rX(t){return t.statusCode||(t.permanent?o.PermanentRedirect:o.TemporaryRedirect)}function rz(t){return t===e8.li.experimentalEdge||t===e8.li.edge}let rZ=/\/\[[^/]+?\](?=\/|$)/;function r$(t){return tF(t)&&(t=tk(t).interceptedRoute),rZ.test(t)}let r1=require("next/dist/shared/lib/runtime-config.external.js");function r0(t){return eQ.includes(t)}let r2=/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i;function r3(t){return r2.test(t)}function r5(t){return t.replace(/\\/g,"/")}function r4(t){let r=r5(t);return r.startsWith("/index/")&&!r$(r)?r.slice(6):"/index"!==r?r:"/"}var r6=__webpack_require__("./dist/compiled/path-to-regexp/index.js");function r7(t,r){let s=[],n=(0,r6.pathToRegexp)(t,s,{delimiter:"/",sensitive:"boolean"==typeof(null==r?void 0:r.sensitive)&&r.sensitive,strict:null==r?void 0:r.strict}),a=(0,r6.regexpToFunction)((null==r?void 0:r.regexModifier)?new RegExp(r.regexModifier(n.source),n.flags):n,s);return(t,n)=>{if("string"!=typeof t)return!1;let i=a(t);if(!i)return!1;if(null==r?void 0:r.removeUnnamedParams)for(let t of s)"number"==typeof t.name&&delete i.params[t.name];return{...n,...i.params}}}function r9(t){let r="";for(let s=0;s<t.length;s++){let n=t.charCodeAt(s);(n>64&&n<91||n>96&&n<123)&&(r+=t[s])}return r}function r8(t,r){return t.replace(RegExp(":"+tR(r),"g"),"__ESC_COLON_"+r)}function se(t){return t.replace(/__ESC_COLON_/gi,":")}function st(t,r,s,n){void 0===s&&(s=[]),void 0===n&&(n=[]);let a={},i=s=>{let n;let i=s.key;switch(s.type){case"header":i=i.toLowerCase(),n=t.headers[i];break;case"cookie":n="cookies"in t?t.cookies[s.key]:e$(t.headers)()[s.key];break;case"query":n=r[i];break;case"host":{let{host:r}=(null==t?void 0:t.headers)||{};n=null==r?void 0:r.split(":",1)[0].toLowerCase()}}if(!s.value&&n)return a[r9(i)]=n,!0;if(n){let t=RegExp("^"+s.value+"$"),r=Array.isArray(n)?n.slice(-1)[0].match(t):n.match(t);if(r)return Array.isArray(r)&&(r.groups?Object.keys(r.groups).forEach(t=>{a[t]=r.groups[t]}):"host"===s.type&&r[0]&&(a.host=r[0])),!0}return!1};return!!s.every(t=>i(t))&&!n.some(t=>i(t))&&a}function sr(t,r){if(!t.includes(":"))return t;for(let s of Object.keys(r))t.includes(":"+s)&&(t=t.replace(RegExp(":"+s+"\\*","g"),":"+s+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+s+"\\?","g"),":"+s+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+s+"\\+","g"),":"+s+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+s+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+s));return t=t.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,r6.compile)("/"+t,{validate:!1})(r).slice(1)}function ss(t){let r;let s=Object.assign({},t.query);delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextDataReq,delete s.__nextInferredLocaleFromDefault,delete s[tl];let n=t.destination;for(let r of Object.keys({...t.params,...s}))n=r?r8(n,r):n;let a=tm(n),i=a.query,o=se(""+a.pathname+(a.hash||"")),B=se(a.hostname||""),l=[],u=[];(0,r6.pathToRegexp)(o,l),(0,r6.pathToRegexp)(B,u);let c=[];l.forEach(t=>c.push(t.name)),u.forEach(t=>c.push(t.name));let d=(0,r6.compile)(o,{validate:!1}),p=(0,r6.compile)(B,{validate:!1});for(let[r,s]of Object.entries(i))Array.isArray(s)?i[r]=s.map(r=>sr(se(r),t.params)):"string"==typeof s&&(i[r]=sr(se(s),t.params));let C=Object.keys(t.params).filter(t=>"nextInternalLocale"!==t);if(t.appendParamsToQuery&&!C.some(t=>c.includes(t)))for(let r of C)r in i||(i[r]=t.params[r]);if(tF(o))for(let r of o.split("/")){let s=tN.find(t=>r.startsWith(t));if(s){"(..)(..)"===s?(t.params["0"]="(..)",t.params["1"]="(..)"):t.params["0"]=s;break}}try{let[s,n]=(r=d(t.params)).split("#",2);a.hostname=p(t.params),a.pathname=s,a.hash=(n?"#":"")+(n||""),delete a.search}catch(t){if(t.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw t}return a.query={...s,...a.query},{newUrl:r,destQuery:i,parsedDestination:a}}function sn(t,r,s,n,a){if(n&&r&&a){let r=(0,h.parse)(t.url,!0);for(let t of(delete r.search,Object.keys(r.query))){let n=t!==e8.AA&&t.startsWith(e8.AA),i=t!==e8.h&&t.startsWith(e8.h);(n||i||(s||Object.keys(a.groups)).includes(t))&&delete r.query[t]}t.url=(0,h.format)(r)}}function sa(t,r,s){if(!s)return t;for(let n of Object.keys(s.groups)){let a;let{optional:i,repeat:o}=s.groups[n],B=`[${o?"...":""}${n}]`;i&&(B=`[${B}]`);let l=r[n];a=Array.isArray(l)?l.map(t=>t&&encodeURIComponent(t)).join("/"):l?encodeURIComponent(l):"",t=t.replaceAll(B,a)}return t}function si(t,r,s,n){let a=!0;return s?{params:t=Object.keys(s.groups).reduce((i,o)=>{let B=t[o];"string"==typeof B&&(B=tT(B)),Array.isArray(B)&&(B=B.map(t=>("string"==typeof t&&(t=tT(t)),t)));let l=n[o],u=s.groups[o].optional;return((Array.isArray(l)?l.some(t=>Array.isArray(B)?B.some(r=>r.includes(t)):null==B?void 0:B.includes(t)):null==B?void 0:B.includes(l))||void 0===B&&!(u&&r))&&(a=!1),u&&(!B||Array.isArray(B)&&1===B.length&&("index"===B[0]||B[0]===`[[...${o}]]`))&&(B=void 0,delete t[o]),B&&"string"==typeof B&&s.groups[o].repeat&&(B=B.split("/")),B&&(i[o]=B),i},{}),hasValidParams:a}:{params:t,hasValidParams:!1}}function so({page:t,i18n:r,basePath:s,rewrites:n,pageIsDynamic:a,trailingSlash:i,caseSensitive:o}){let B,l,u;function c(t,s,n){return ej(function(){let{groups:t,routeKeys:a}=B;return{re:{exec:i=>{let o=Object.fromEntries(new URLSearchParams(i)),B=r&&n&&o["1"]===n;for(let t of Object.keys(o)){let r=o[t];t!==e8.AA&&t.startsWith(e8.AA)&&(o[t.substring(e8.AA.length)]=r,delete o[t])}let l=Object.keys(a||{}),u=t=>{if(r){let a=Array.isArray(t),i=a?t[0]:t;if("string"==typeof i&&r.locales.some(t=>t.toLowerCase()===i.toLowerCase()&&(n=t,s.locale=n,!0)))return a&&t.splice(0,1),!a||0===t.length}return!1};return l.every(t=>o[t])?l.reduce((r,s)=>{let n=null==a?void 0:a[s];return n&&!u(o[s])&&(r[t[n].pos]=o[s]),r},{}):Object.keys(o).reduce((t,r)=>{if(!u(o[r])){let s=r;return B&&(s=parseInt(r,10)-1+""),Object.assign(t,{[s]:o[r]})}return t},{})}},groups:t}}())(t.headers["x-now-route-matches"])}return a&&(u=(l=ej(B=tq(t,!1)))(t)),{handleRewrites:function(B,u){let c={},d=u.pathname,p=()=>{let r=tH(d||"");return r===tH(t)||(null==l?void 0:l(r))},C=n=>{let p=r7(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!o})(u.pathname);if((n.has||n.missing)&&p){let t=st(B,u.query,n.has,n.missing);t?Object.assign(p,t):p=!1}if(p){let{parsedDestination:i,destQuery:o}=ss({appendParamsToQuery:!0,destination:n.destination,params:p,query:u.query});if(i.protocol)return!0;if(Object.assign(c,o,p),Object.assign(u.query,i.query),delete i.query,Object.assign(u,i),d=u.pathname,s&&(d=d.replace(RegExp(`^${s}`),"")||"/"),r){let t=rd(d,r.locales);d=t.pathname,u.query.nextInternalLocale=t.detectedLocale||p.nextInternalLocale}if(d===t)return!0;if(a&&l){let t=l(d);if(t)return u.query={...u.query,...t},!0}}return!1};for(let t of n.beforeFiles||[])C(t);if(d!==t){let t=!1;for(let r of n.afterFiles||[])if(t=C(r))break;if(!t&&!p()){for(let r of n.fallback||[])if(t=C(r))break}}return c},defaultRouteRegex:B,dynamicRouteMatcher:l,defaultRouteMatches:u,getParamsFromRouteMatches:c,normalizeDynamicRouteParams:(t,r)=>si(t,r,B,u),normalizeVercelUrl:(t,r,s)=>sn(t,r,s,a,B),interpolateDynamicPath:(t,r)=>sa(t,r,B)}}function sB(t){return Object.prototype.toString.call(t)}function sl(t){if("[object Object]"!==sB(t))return!1;let r=Object.getPrototypeOf(t);return null===r||r.hasOwnProperty("isPrototypeOf")}function su(t){return"object"==typeof t&&null!==t&&"name"in t&&"message"in t}function sc(t){let r=new WeakSet;return JSON.stringify(t,(t,s)=>{if("object"==typeof s&&null!==s){if(r.has(s))return"[Circular]";r.add(s)}return s})}function sd(t){return su(t)?t:Error(sl(t)?sc(t):t+"")}class sp{constructor(t){this.provider=t}normalize(t){return this.provider.analyze(t).pathname}}class sC{insert(t){this._insert(t.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(t){void 0===t&&(t="/");let r=[...this.children.keys()].sort();null!==this.slugName&&r.splice(r.indexOf("[]"),1),null!==this.restSlugName&&r.splice(r.indexOf("[...]"),1),null!==this.optionalRestSlugName&&r.splice(r.indexOf("[[...]]"),1);let s=r.map(r=>this.children.get(r)._smoosh(""+t+r+"/")).reduce((t,r)=>[...t,...r],[]);if(null!==this.slugName&&s.push(...this.children.get("[]")._smoosh(t+"["+this.slugName+"]/")),!this.placeholder){let r="/"===t?"/":t.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+r+'" and "'+r+"[[..."+this.optionalRestSlugName+']]").');s.unshift(r)}return null!==this.restSlugName&&s.push(...this.children.get("[...]")._smoosh(t+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&s.push(...this.children.get("[[...]]")._smoosh(t+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(t,r,s){if(0===t.length){this.placeholder=!1;return}if(s)throw Error("Catch-all must be the last part of the URL.");let n=t[0];if(n.startsWith("[")&&n.endsWith("]")){let i=n.slice(1,-1),o=!1;if(i.startsWith("[")&&i.endsWith("]")&&(i=i.slice(1,-1),o=!0),i.startsWith("…"))throw Error("Detected a three-dot character ('…') at ('"+i+"'). Did you mean ('...')?");if(i.startsWith("...")&&(i=i.substring(3),s=!0),i.startsWith("[")||i.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+i+"').");if(i.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+i+"').");function a(t,s){if(null!==t&&t!==s)throw Error("You cannot use different slug names for the same dynamic path ('"+t+"' !== '"+s+"').");r.forEach(t=>{if(t===s)throw Error('You cannot have the same slug name "'+s+'" repeat within a single dynamic path');if(t.replace(/\W/g,"")===n.replace(/\W/g,""))throw Error('You cannot have the slug names "'+t+'" and "'+s+'" differ only by non-word symbols within a single dynamic path')}),r.push(s)}if(s){if(o){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+t[0]+'" ).');a(this.optionalRestSlugName,i),this.optionalRestSlugName=i,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+t[0]+'").');a(this.restSlugName,i),this.restSlugName=i,n="[...]"}}else{if(o)throw Error('Optional route parameters are not yet supported ("'+t[0]+'").');a(this.slugName,i),this.slugName=i,n="[]"}}this.children.has(n)||this.children.set(n,new sC),this.children.get(n)._insert(t.slice(1),r,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function sf(t){let r=new sC;return t.forEach(t=>r.insert(t)),r.smoosh()}class sm{constructor(t){this.definition=t,r$(t.pathname)&&(this.dynamic=ej(tU(t.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(t){let r=this.test(t);return r?{definition:this.definition,params:r.params}:null}test(t){if(this.dynamic){let r=this.dynamic(t);return r?{params:r}:null}return t===this.definition.pathname?{}:null}}class sh extends sm{get identity(){var t;return`${this.definition.pathname}?__nextLocale=${null==(t=this.definition.i18n)?void 0:t.locale}`}match(t,r){var s,n;let a=this.test(t,r);return a?{definition:this.definition,params:a.params,detectedLocale:(null==r?void 0:null==(s=r.i18n)?void 0:s.detectedLocale)??(null==(n=this.definition.i18n)?void 0:n.locale)}:null}test(t,r){return this.definition.i18n&&(null==r?void 0:r.i18n)?this.definition.i18n.locale&&r.i18n.detectedLocale&&this.definition.i18n.locale!==r.i18n.detectedLocale?null:super.test(r.i18n.pathname):super.test(t)}}class sy{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let{promise:t,resolve:r,reject:s}=new tz;this.waitTillReadyPromise=t;let n=this.compilationID;try{let t=[],r=await Promise.all(this.providers.map(t=>t.matchers())),s=new Map,a={};for(let n of r)for(let r of n){r.duplicated&&delete r.duplicated;let n=s.get(r.definition.pathname);if(n){let t=a[r.definition.pathname]??[n];t.push(r),a[r.definition.pathname]=t,n.duplicated=t,r.duplicated=t}t.push(r),s.set(r.definition.pathname,r)}if(this.matchers.duplicates=a,this.previousMatchers.length===t.length&&this.previousMatchers.every((r,s)=>r===t[s]))return;this.previousMatchers=t,this.matchers.static=t.filter(t=>!t.isDynamic);let i=t.filter(t=>t.isDynamic),o=new Map,B=[];for(let t=0;t<i.length;t++){let r=i[t].definition.pathname,s=o.get(r)??[];s.push(t),1===s.length&&(o.set(r,s),B.push(r))}let l=sf(B),u=[];for(let t of l){let r=o.get(t);if(!Array.isArray(r))throw Error("Invariant: expected to find identity in indexes map");let s=r.map(t=>i[t]);u.push(...s)}if(this.matchers.dynamic=u,this.compilationID!==n)throw Error("Invariant: expected compilation to finish before new matchers were added, possible missing await")}catch(t){s(t)}finally{this.lastCompilationID=n,r()}}push(t){this.providers.push(t)}async test(t,r){return null!==await this.match(t,r)}async match(t,r){for await(let s of this.matchAll(t,r))return s;return null}validate(t,r,s){var n;return r instanceof sh?r.match(t,s):(null==(n=s.i18n)?void 0:n.inferredFromDefault)?r.match(s.i18n.pathname):r.match(t)}async *matchAll(t,r){if(this.lastCompilationID!==this.compilationID)throw Error("Invariant: expected routes to have been loaded before match");if(!r$(t=tw(t)))for(let s of this.matchers.static){let n=this.validate(t,s,r);n&&(yield n)}if(null==r?void 0:r.skipDynamic)return null;for(let s of this.matchers.dynamic){let n=this.validate(t,s,r);n&&(yield n)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}function sg(t){return t.endsWith("/page")}class sb{constructor(t=[]){this.normalizers=t}push(t){this.normalizers.push(t)}normalize(t){return this.normalizers.reduce((t,r)=>r.normalize(t),t)}}var sD=__webpack_require__("./dist/esm/shared/lib/isomorphic/path.js"),sx=__webpack_require__.n(sD);class sv{constructor(...t){this.prefix=sx().posix.join(...t)}normalize(t){return sx().posix.join(this.prefix,t)}}function sE(t){let r=/^\/index(\/|$)/.test(t)&&!r$(t)?"/index"+t:"/"===t?"/index":tw(t);{let{posix:t}=__webpack_require__("path"),s=t.normalize(r);if(s!==r)throw new ex("Requested and resolved page mismatch: "+r+" "+s)}return r}class sj extends sv{constructor(){super("app")}normalize(t){return super.normalize(sE(t))}}class sA extends sv{constructor(t){super(t,eJ)}normalize(t){return super.normalize(t)}}!function(t){t.PAGES="pages",t.ROOT="root",t.APP="app"}(c||(c={}));let sS={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},sP=["js","jsx","ts","tsx"],s_=(t,r)=>r?`(?:\\.(${t.join("|")})|((\\[\\])?\\.(${r.join("|")})))`:`\\.(?:${t.join("|")})`;function sw(t,r,s){let n=[RegExp(`^[\\\\/]robots${s?`${s_(r.concat("txt"),null)}$`:""}`),RegExp(`^[\\\\/]manifest${s?`${s_(r.concat("webmanifest","json"),null)}$`:""}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${s?`${s_(["xml"],r)}$`:""}`),RegExp(`[\\\\/]${sS.icon.filename}\\d?${s?`${s_(sS.icon.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sS.apple.filename}\\d?${s?`${s_(sS.apple.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sS.openGraph.filename}\\d?${s?`${s_(sS.openGraph.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sS.twitter.filename}\\d?${s?`${s_(sS.twitter.extensions,r)}$`:""}`)],a=r5(t);return n.some(t=>t.test(a))}function sI(t){let r=t.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==r[0]&&(r="/"+r),!r.endsWith("/page")&&sw(r,sP,!1)}function sO(t){return{normalize:t}}class sT{normalize(t){return t.replace(/%5F/g,"_")}}class sN extends sb{constructor(){super([sO(tO),new sT])}normalize(t){return super.normalize(t)}}class sF{constructor(t){this.filename=new sA(t),this.pathname=new sN,this.bundlePath=new sj}}class sk extends sm{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class sM{constructor(t){this.loader=t,this.cached=[]}async matchers(){let t=await this.loader.load();if(!t)return[];if(this.data&&this.loader.compare(this.data,t))return this.cached;this.data=t;let r=await this.transform(t);return this.cached=r,r}}class sL extends sM{constructor(t,r){super({load:async()=>r.load(t),compare:(t,r)=>t===r})}}class sR extends sL{constructor(t,r){super(ek,r),this.normalizers=new sF(t)}async transform(t){let r=Object.keys(t).filter(t=>sg(t)),s={};for(let t of r){let r=this.normalizers.pathname.normalize(t);r in s?s[r].push(t):s[r]=[t]}let n=[];for(let[r,a]of Object.entries(s)){let s=a[0],i=this.normalizers.filename.normalize(t[s]),o=this.normalizers.bundlePath.normalize(s);n.push(new sk({kind:u.APP_PAGE,pathname:r,page:s,bundlePath:o,filename:i,appPaths:a}))}return n}}function sH(t){return t.endsWith("/route")}class sG extends sm{}class sK extends sL{constructor(t,r){super(ek,r),this.normalizers=new sF(t)}async transform(t){let r=Object.keys(t).filter(t=>sH(t)),s=[];for(let n of r){let r=this.normalizers.filename.normalize(t[n]),a=this.normalizers.pathname.normalize(n),i=this.normalizers.bundlePath.normalize(n);s.push(new sG({kind:u.APP_ROUTE,pathname:a,page:n,bundlePath:i,filename:r}))}return s}}function sJ(t){return"/api"===t||!!(null==t?void 0:t.startsWith("/api/"))}class sU extends sm{}class sQ extends sh{}class sW extends sb{constructor(){super([sO(sE),new sv("pages")])}normalize(t){return super.normalize(t)}}class sV extends sv{constructor(t){super(t,eJ)}normalize(t){return super.normalize(t)}}class sq{constructor(t){this.filename=new sV(t),this.bundlePath=new sW}}class sY extends sL{constructor(t,r,s){super(eF,r),this.i18nProvider=s,this.normalizers=new sq(t)}async transform(t){let r=Object.keys(t).filter(t=>sJ(t)),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new sQ({kind:u.PAGES_API,pathname:a,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n]),i18n:{locale:r}}))}else s.push(new sU({kind:u.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class sX extends sm{}class sz extends sh{}class sZ extends sL{constructor(t,r,s){super(eF,r),this.i18nProvider=s,this.normalizers=new sq(t)}async transform(t){let r=Object.keys(t).filter(t=>!sJ(t)).filter(t=>{var r;let s=(null==(r=this.i18nProvider)?void 0:r.analyze(t).pathname)??t;return!eQ.includes(s)}),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new sz({kind:u.PAGES,pathname:a,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n]),i18n:{locale:r}}))}else s.push(new sX({kind:u.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s${constructor(t){this.getter=t}load(t){return this.getter(t)}}class s1{constructor(t){var r;if(this.config=t,!t.locales.length)throw Error("Invariant: No locales provided");this.lowerCaseLocales=t.locales.map(t=>t.toLowerCase()),this.lowerCaseDomains=null==(r=t.domains)?void 0:r.map(t=>{var r;let s=t.domain.toLowerCase();return{defaultLocale:t.defaultLocale.toLowerCase(),hostname:s.split(":",1)[0],domain:s,locales:null==(r=t.locales)?void 0:r.map(t=>t.toLowerCase()),http:t.http}})}detectDomainLocale(t,r){if(t&&this.lowerCaseDomains&&this.config.domains){r&&(r=r.toLowerCase());for(let n=0;n<this.lowerCaseDomains.length;n++){var s;let a=this.lowerCaseDomains[n];if(a.hostname===t||(null==(s=a.locales)?void 0:s.some(t=>t===r)))return this.config.domains[n]}}}fromQuery(t,r){let s=r.__nextLocale;if(s){let r=this.analyze(t);if(r.detectedLocale){if(r.detectedLocale!==s)throw Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${s}' in '${t}' but found '${r.detectedLocale}'}`);t=r.pathname}}return{pathname:t,detectedLocale:s,inferredFromDefault:"1"===r.__nextInferredLocaleFromDefault}}validate(t){return this.lowerCaseLocales.includes(t.toLowerCase())}validateQuery(t){return(!t.__nextLocale||!!this.validate(t.__nextLocale))&&(!t.__nextDefaultLocale||!!this.validate(t.__nextDefaultLocale))}analyze(t,r={}){let s=r.defaultLocale,n="string"==typeof s,a=t.split("/",2);if(!a[1])return{detectedLocale:s,pathname:t,inferredFromDefault:n};let i=a[1].toLowerCase(),o=this.lowerCaseLocales.indexOf(i);return o<0||(s=this.config.locales[o],n=!1,t=t.slice(s.length+1)||"/"),{detectedLocale:s,pathname:t,inferredFromDefault:n}}}async function s0(t,r,s,n){if(rA(r)){var a;r.statusCode=s.status,r.statusMessage=s.statusText;let i=["set-cookie","www-authenticate","proxy-authenticate"];null==(a=s.headers)||a.forEach((t,s)=>{if("set-cookie"===s.toLowerCase())for(let n of re(t))r.appendHeader(s,n);else{let n=void 0!==r.getHeader(s);(i.includes(s.toLowerCase())||!n)&&r.appendHeader(s,t)}});let{originalResponse:o}=r;s.body&&"HEAD"!==t.method?await rL(s.body,o,n):o.end()}}let s2=r7("/_next/data/:path*");function s3(t){return"string"==typeof t&&s2(t)}function s5(t,r){return void 0===r&&(r=""),t=t.replace(/\\/g,"/"),(t=r&&t.endsWith(r)?t.slice(0,-r.length):t).startsWith("/index/")&&!r$(t)?t=t.slice(6):"/index"===t&&(t="/"),t}function s4(t,r){return t.replace(RegExp("([/#?]"+(r?"|%(2f|23|3f|5c)":"")+")","gi"),t=>encodeURIComponent(t))}function s6(t){return t.split("/").map(t=>{try{t=s4(decodeURIComponent(t),!0)}catch(t){throw new eD("Failed to decode path param(s).")}return t}).join("/")}class s7{constructor(t){this.suffix=t}match(t){return!!t.endsWith(this.suffix)}normalize(t,r){return r||this.match(t)?t.substring(0,t.length-this.suffix.length):t}}class s9 extends s7{constructor(){super(e8.RM)}}function s8(t){for(let r of tB)delete t[r.toLowerCase()]}function ne(t){return t.definition.kind===u.APP_ROUTE}function nt(t){return t.definition.kind===u.APP_PAGE}function nr(t){return t.definition.kind===u.PAGES}class ns extends s7{constructor(){super(e8.pu)}match(t){return t==="/__index"+e8.pu||super.match(t)}normalize(t,r){return t==="/__index"+e8.pu?"/":super.normalize(t,r)}}class nn{constructor(t){if(this.prefix=t,t.endsWith("/"))throw Error(`PrefixPathnameNormalizer: prefix "${t}" should not end with a slash`)}match(t){return!!(t===this.prefix||t.startsWith(this.prefix+"/"))}normalize(t,r){return r||this.match(t)?t.length===this.prefix.length?"/":t.substring(this.prefix.length):t}}class na{constructor(t){if(this.suffix=new s7(".json"),!t)throw Error("Invariant: buildID is required");this.prefix=new nn(`/_next/data/${t}`)}match(t){return this.prefix.match(t)&&this.suffix.match(t)}normalize(t,r){return r||this.match(t)?(t=this.prefix.normalize(t,!0),r4(t=this.suffix.normalize(t,!0))):t}}function ni(t){let r,s;t.headers instanceof Headers?(r=t.headers.get(tr.toLowerCase())??null,s=t.headers.get("content-type")):(r=t.headers[tr.toLowerCase()]??null,s=t.headers["content-type"]??null);let n=!!("POST"===t.method&&"application/x-www-form-urlencoded"===s),a=!!("POST"===t.method&&(null==s?void 0:s.startsWith("multipart/form-data"))),i=!!(void 0!==r&&"string"==typeof r&&"POST"===t.method),o=!!(i||n||a);return{actionId:r,isURLEncodedAction:n,isMultipartAction:a,isFetchAction:i,isServerAction:o}}function no(t){return ni(t).isServerAction}function nB(t){return t.replace(/(?:\/index)?\/?$/,"")||"/"}function nl(t,r){let s=r.setHeader.bind(r);r.setHeader=(n,a)=>{if("headersSent"in r&&r.headersSent)return r;if("set-cookie"===n.toLowerCase()){let r=eS(t,"middlewareCookie");r&&Array.isArray(a)&&a.every((t,s)=>t===r[s])||(a=[...new Set([...r||[],..."string"==typeof a?[a]:Array.isArray(a)?a:[]])])}return s(n,a)}}function nu(t){return void 0!==t&&("boolean"==typeof t?t:"incremental"===t)}let nc=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class nd{disable(){throw nc}getStore(){}run(){throw nc}exit(){throw nc}enterWith(){throw nc}static bind(t){return t}}let np="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function nC(){return np?new np:new nd}function nf(){let t=globalThis,r=t[nm]??t[nh];return null==r?void 0:r.get()}let nm=Symbol.for("@next/request-context"),nh=Symbol.for("@vercel/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");var ny=__webpack_require__("./dist/esm/server/web/spec-extension/adapters/reflect.js");let ng=Symbol("internal response"),nb=new Set([301,302,303,307,308]);function nD(t,r){var s;if(null==t?void 0:null==(s=t.request)?void 0:s.headers){if(!(t.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");let s=[];for(let[n,a]of t.request.headers)r.set("x-middleware-request-"+n,a),s.push(n);r.set("x-middleware-override-headers",s.join(","))}}class nx extends Response{constructor(t,r={}){super(t,r);let s=this.headers,n=new Proxy(new rx.VO(s),{get(t,n,a){switch(n){case"delete":case"set":return(...a)=>{let i=Reflect.apply(t[n],t,a),o=new Headers(s);return i instanceof rx.VO&&s.set("x-middleware-set-cookie",i.getAll().map(t=>(0,rx.Ud)(t)).join(",")),nD(r,o),i};default:return ny.l.get(t,n,a)}}});this[ng]={cookies:n,url:r.url?new ry(r.url,{headers:rt(s),nextConfig:r.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[ng].cookies}static json(t,r){let s=Response.json(t,r);return new nx(s.body,s)}static redirect(t,r){let s="number"==typeof r?r:(null==r?void 0:r.status)??307;if(!nb.has(s))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let n="object"==typeof r?r:{},a=new Headers(null==n?void 0:n.headers);return a.set("Location",rr(t)),new nx(null,{...n,headers:a,status:s})}static rewrite(t,r){let s=new Headers(null==r?void 0:r.headers);return s.set("x-middleware-rewrite",rr(t)),nD(r,s),new nx(null,{...r,headers:s})}static next(t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-next","1"),nD(t,r),new nx(null,{...t,headers:r})}}async function nv(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}let nE=null;async function nj(){if("phase-production-build"===process.env.NEXT_PHASE)return;nE||(nE=nv());let t=await nE;if(null==t?void 0:t.register)try{await t.register()}catch(t){throw t.message=`An error occurred while loading instrumentation hook: ${t.message}`,t}}let nA=null;function nS(){return nA||(nA=nj()),nA}function nP(t){return`The edge runtime does not support Node.js '${t}' module.
|
|
2870
2870
|
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`}function n_(t){let r=new Proxy(function(){},{get(r,s){if("then"===s)return{};throw Error(nP(t))},construct(){throw Error(nP(t))},apply(s,n,a){if("function"==typeof a[0])return a[0](r);throw Error(nP(t))}});return new Proxy({},{get:()=>r})}(function(){process!==global.process&&(process.env=global.process.env,global.process=process),Object.defineProperty(globalThis,"__import_unsupported",{value:n_,enumerable:!1,configurable:!1}),nS()})(),__webpack_require__("./dist/esm/server/web/spec-extension/adapters/headers.js");class nw extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new nw}}Symbol.for("next.mutated.cookies"),__webpack_require__("./dist/compiled/p-queue/index.js");class nI extends rE{constructor(t){super(t.input,t.init),this.sourcePage=t.page}get request(){throw new rg({page:this.sourcePage})}respondWith(){throw new rg({page:this.sourcePage})}waitUntil(){throw new rg({page:this.sourcePage})}}function nO(t){return t.isOnDemandRevalidate?"on-demand":t.isRevalidate?"stale":void 0}function nT(t){if("string"==typeof t)return"PRERENDER";if(null===t)return"BLOCKING_STATIC_RENDER";if(!1===t)return"NOT_FOUND";if(void 0!==t)throw Error(`Invalid fallback option: ${t}. Fallback option must be a string, null, undefined, or false.`)}!function(t){t.BLOCKING_STATIC_RENDER="BLOCKING_STATIC_RENDER",t.PRERENDER="PRERENDER",t.NOT_FOUND="NOT_FOUND"}(d||(d={}));class nN extends Error{}class nF extends Error{constructor(t){super(),this.innerError=t}}class nk{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(t){var r,s,n;this.handleRSCRequest=(t,r,s)=>{var n,a;if(!s.pathname)return!1;if(null==(n=this.normalizers.prefetchRSC)?void 0:n.match(s.pathname))s.pathname=this.normalizers.prefetchRSC.normalize(s.pathname,!0),t.headers[tt.toLowerCase()]="1",t.headers[tn.toLowerCase()]="1",e_(t,"isRSCRequest",!0),e_(t,"isPrefetchRSCRequest",!0);else if(null==(a=this.normalizers.rsc)?void 0:a.match(s.pathname))s.pathname=this.normalizers.rsc.normalize(s.pathname,!0),t.headers[tt.toLowerCase()]="1",e_(t,"isRSCRequest",!0);else{if(t.headers["x-now-route-matches"])return s8(t.headers),!1;if("1"!==t.headers[tt.toLowerCase()])return!1;e_(t,"isRSCRequest",!0),"1"===t.headers[tn.toLowerCase()]&&e_(t,"isPrefetchRSCRequest",!0)}if(t.url){let r=(0,h.parse)(t.url);r.pathname=s.pathname,t.url=(0,h.format)(r)}return!1},this.handleNextDataRequest=async(t,r,s)=>{let n=this.getMiddleware(),a=s3(s.pathname);if(!a||!a.path)return!1;if(a.path[0]!==this.buildId)return!eS(t,"middlewareInvoke")&&(await this.render404(t,r,s),!0);a.path.shift();let i=a.path[a.path.length-1];if("string"!=typeof i||!i.endsWith(".json"))return await this.render404(t,r,s),!0;let o=`/${a.path.join("/")}`;if(o=s5(o,".json"),n&&(this.nextConfig.trailingSlash&&!o.endsWith("/")&&(o+="/"),!this.nextConfig.trailingSlash&&o.length>1&&o.endsWith("/")&&(o=o.substring(0,o.length-1))),this.i18nProvider){var B;let a=null==t?void 0:null==(B=t.headers.host)?void 0:B.split(":",1)[0].toLowerCase(),i=this.i18nProvider.detectDomainLocale(a),l=(null==i?void 0:i.defaultLocale)??this.i18nProvider.config.defaultLocale,u=this.i18nProvider.analyze(o);if(u.detectedLocale&&(o=u.pathname),s.query.__nextLocale=u.detectedLocale,s.query.__nextDefaultLocale=l,u.detectedLocale||delete s.query.__nextInferredLocaleFromDefault,!u.detectedLocale&&!n)return s.query.__nextLocale=l,await this.render404(t,r,s),!0}return s.pathname=o,s.query.__nextDataReq="1",!1},this.handleNextImageRequest=()=>!1,this.handleCatchallRenderRequest=()=>!1,this.handleCatchallMiddlewareRequest=()=>!1,this.normalize=t=>{let r=[];for(let s of(this.normalizers.data&&r.push(this.normalizers.data),this.normalizers.prefetchRSC&&r.push(this.normalizers.prefetchRSC),this.normalizers.rsc&&r.push(this.normalizers.rsc),r))if(s.match(t))return s.normalize(t,!0);return t},this.normalizeAndAttachMetadata=async(t,r,s)=>{let n=await this.handleNextImageRequest(t,r,s);return!!(n||this.enabledDirectories.pages&&(n=await this.handleNextDataRequest(t,r,s)))},this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=ey(()=>{tv(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
|
|
2871
2871
|
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:a=".",quiet:i=!1,conf:o,dev:B=!1,minimalMode:l=!1,customServer:u=!0,hostname:c,port:d,experimentalTestProxy:p}=t;this.experimentalTestProxy=p,this.serverOptions=t,this.dir=__webpack_require__("path").resolve(a),this.quiet=i,this.loadEnvConfig({dev:B}),this.nextConfig=o,this.hostname=c,this.hostname&&(this.fetchHostname=rY(this.hostname)),this.port=d,this.distDir=__webpack_require__("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(r=this.nextConfig.i18n)?void 0:r.locales)?new s1(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new sp(this.i18nProvider):void 0;let{serverRuntimeConfig:C={},publicRuntimeConfig:f,assetPrefix:m,generateEtags:y}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(B),this.isAppPPREnabled=this.enabledDirectories.app&&nu(this.nextConfig.experimental.ppr),this.normalizers={rsc:this.enabledDirectories.app?new s9:void 0,prefetchRSC:this.isAppPPREnabled?new ns:void 0,data:this.enabledDirectories.pages?new na(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,strictNextHead:this.nextConfig.experimental.strictNextHead??!0,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",buildId:this.buildId,generateEtags:y,previewProps:this.getPrerenderManifest().preview,customServer:!0===u||void 0,ampOptimizerConfig:null==(s=this.nextConfig.experimental.amp)?void 0:s.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(n=this.nextConfig.i18n)?void 0:n.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,cacheLifeProfiles:this.nextConfig.experimental.cacheLife,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(f).length>0?f:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,experimental:{expireTime:this.nextConfig.expireTime,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,after:this.nextConfig.experimental.after??!1,dynamicIO:this.nextConfig.experimental.dynamicIO??!1},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},(0,r1.setConfig)({serverRuntimeConfig:C,publicRuntimeConfig:f}),this.pagesManifest=this.getPagesManifest(),this.appPathsManifest=this.getAppPathsManifest(),this.appPathRoutes=this.getAppPathRoutes(),this.interceptionRoutePatterns=this.getinterceptionRoutePatterns(),this.matchers=this.getRouteMatchers(),this.matchers.reload(),this.setAssetPrefix(m),this.responseCache=this.getResponseCache({dev:B})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let t=new s$(t=>{switch(t){case eF:return this.getPagesManifest()??null;case ek:return this.getAppPathsManifest()??null;default:return null}}),r=new sy;return r.push(new sZ(this.distDir,t,this.i18nProvider)),r.push(new sY(this.distDir,t,this.i18nProvider)),this.enabledDirectories.app&&(r.push(new sR(this.distDir,t)),r.push(new sK(this.distDir,t))),r}async instrumentationOnRequestError(...t){let[r,s,n]=t;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,r,{path:s.url||"",method:s.method||"GET",headers:s instanceof nI?Object.fromEntries(s.headers.entries()):s.headers},n))}catch(t){console.error("Error in instrumentation.onRequestError:",t)}}logError(t){this.quiet||tx(t)}async handleRequest(t,r,s){await this.prepare();let n=t.method.toUpperCase(),a=(0,t1.getTracer)();return a.withPropagatedContext(t.headers,()=>a.trace(t0.Li.handleRequest,{spanName:`${n} ${t.url}`,kind:t1.SpanKind.SERVER,attributes:{"http.method":n,"http.target":t.url}},async i=>this.handleRequestImpl(t,r,s).finally(()=>{if(!i)return;let s=eS(t,"isRSCRequest")??!1;i.setAttributes({"http.status_code":r.statusCode,"next.rsc":s});let o=a.getRootSpanAttributes();if(!o)return;if(o.get("next.span_type")!==t0.Li.handleRequest){console.warn(`Unexpected root span type '${o.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);return}let B=o.get("next.route");if(B){let t=s?`RSC ${n} ${B}`:`${n} ${B}`;i.setAttributes({"next.route":B,"http.route":B,"next.span_name":t}),i.updateName(t)}else i.updateName(s?`RSC ${n} ${t.url}`:`${n} ${t.url}`)})))}async handleRequestImpl(t,r,s){try{var n,a,i,o,B,l,u,c,d,p,C;await this.matchers.waitTillReady(),nl(t,rA(r)?r.originalResponse:r);let f=(t.url||"").split("?",1)[0];if(null==f?void 0:f.match(/(\\|\/\/)/)){let s=eb(t.url);r.redirect(s,308).body(s).send();return}if(!s||"object"!=typeof s){if(!t.url)throw Error("Invariant: url can not be undefined");s=(0,h.parse)(t.url,!0)}if(!s.pathname)throw Error("Invariant: pathname can't be empty");"string"==typeof s.query&&(s.query=Object.fromEntries(new URLSearchParams(s.query)));let{originalRequest:m=null}=rj(t)?t:{},y=null==m?void 0:m.headers["x-forwarded-proto"],g=y?"https"===y:!!(null==m?void 0:null==(n=m.socket)?void 0:n.encrypted);t.headers["x-forwarded-host"]??=t.headers.host??this.hostname,t.headers["x-forwarded-port"]??=this.port?this.port.toString():g?"443":"80",t.headers["x-forwarded-proto"]??=g?"https":"http",t.headers["x-forwarded-for"]??=null==m?void 0:null==(a=m.socket)?void 0:a.remoteAddress,(null==(i=this.i18nProvider)?void 0:i.validateQuery(s.query))||(delete s.query.__nextLocale,delete s.query.__nextDefaultLocale,delete s.query.__nextInferredLocaleFromDefault),this.attachRequestMeta(t,s);let b=await this.handleRSCRequest(t,r,s);if(b)return;let D=null==(o=this.i18nProvider)?void 0:o.detectDomainLocale(rc(s,t.headers)),x=(null==D?void 0:D.defaultLocale)||(null==(B=this.nextConfig.i18n)?void 0:B.defaultLocale);s.query.__nextDefaultLocale=x;let v=tm(t.url.replace(/^\/+/,"/")),E=rC(v.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});v.pathname=E.pathname,E.basePath&&(t.url=rp(t.url,this.nextConfig.basePath));let j="string"==typeof t.headers[e8.vx];if(j)try{this.enabledDirectories.app&&(t.url.match(/^\/index($|\?)/)&&(t.url=t.url.replace(/^\/index/,"/")),s.pathname="/index"===s.pathname?"/":s.pathname);let{pathname:n}=new URL(t.headers[e8.vx],"http://localhost"),{pathname:a}=new URL(t.url,"http://localhost");if(null==(l=this.normalizers.data)?void 0:l.match(a))s.query.__nextDataReq="1";else if(this.isAppPPREnabled&&"1"===t.headers[e8.gs]&&"POST"===t.method){let r=[];for await(let s of t.body)r.push(s);let s=Buffer.concat(r).toString("utf8");e_(t,"postponed",s)}n=this.normalize(n);let i=this.stripNextDataPath(a),o=null==(u=this.i18nProvider)?void 0:u.analyze(n,{defaultLocale:x});o&&(s.query.__nextLocale=o.detectedLocale,o.inferredFromDefault?s.query.__nextInferredLocaleFromDefault="1":delete s.query.__nextInferredLocaleFromDefault);let B=n=r4(n),p=r$(B);if(!p){let t=await this.matchers.match(B,{i18n:o});t&&(B=t.definition.pathname,p=void 0!==t.params)}o&&(n=o.pathname);let C=so({pageIsDynamic:p,page:B,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(c=this.getRoutesManifest())?void 0:c.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});x&&!E.locale&&(s.pathname=`/${x}${s.pathname}`);let f=s.pathname,m=C.handleRewrites(t,s),h=Object.keys(m),y=f!==s.pathname;y&&s.pathname&&e_(t,"rewroteURL",s.pathname);let g=new Set;for(let t of Object.keys(s.query)){let r=s.query[t];rs(t,n=>{s&&(s.query[n]=r,g.add(n),delete s.query[t])})}if(p){let r={},a=C.normalizeDynamicRouteParams(s.query);if(!a.hasValidParams&&!r$(i)){let t=null==C.dynamicRouteMatcher?void 0:C.dynamicRouteMatcher.call(C,i);t&&(C.normalizeDynamicRouteParams(t),Object.assign(a.params,t),a.hasValidParams=!0)}if("/index"!==n&&!a.hasValidParams&&!r$(n)){let t=null==C.dynamicRouteMatcher?void 0:C.dynamicRouteMatcher.call(C,n);if(t){let s=C.normalizeDynamicRouteParams(t);s.hasValidParams&&(Object.assign(r,t),a=s)}}if(a.hasValidParams&&(r=a.params),t.headers["x-now-route-matches"]&&r$(n)&&!a.hasValidParams){let n={},i=C.getParamsFromRouteMatches(t,n,s.query.__nextLocale||"");n.locale&&(s.query.__nextLocale=n.locale,delete s.query.__nextInferredLocaleFromDefault),(a=C.normalizeDynamicRouteParams(i,!0)).hasValidParams&&(r=a.params)}!C.defaultRouteMatches||i!==B||a.hasValidParams||C.normalizeDynamicRouteParams({...r},!0).hasValidParams||(r=C.defaultRouteMatches,e_(t,"didSetDefaultRouteMatches",!0)),r&&(n=C.interpolateDynamicPath(B,r),t.url=C.interpolateDynamicPath(t.url,r))}for(let r of((p||y)&&C.normalizeVercelUrl(t,!0,[...h,...Object.keys((null==(d=C.defaultRouteRegex)?void 0:d.groups)||{})]),g))delete s.query[r];if(s.pathname=n,v.pathname=s.pathname,b=await this.normalizeAndAttachMetadata(t,r,s))return}catch(s){if(s instanceof eD||s instanceof ex)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}if(e_(t,"isLocaleDomain",!!D),E.locale&&(t.url=(0,h.format)(v),e_(t,"didStripLocale",!0)),!s.query.__nextLocale&&(E.locale?s.query.__nextLocale=E.locale:x&&(s.query.__nextLocale=x,s.query.__nextInferredLocaleFromDefault="1")),!this.serverOptions.webServerConfig&&!eS(t,"incrementalCache")){let r="https:";try{r=new URL(eS(t,"initURL")||"/","http://n").protocol}catch{}let s=await this.getIncrementalCache({requestHeaders:Object.assign({},t.headers),requestProtocol:r.substring(0,r.length-1)}),n=globalThis;if(n.__nextCacheHandlers){let r=(null==(p=t.headers[e8.vS])?void 0:p.split(","))||[];for(let t of Object.values(n.__nextCacheHandlers))"function"==typeof t.receiveExpiredTags&&await t.receiveExpiredTags(...r)}s.resetRequestCache(),e_(t,"incrementalCache",s),globalThis.__incrementalCache=s}eS(t,"serverComponentsHmrCache")||e_(t,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let A=eS(t,"invokePath");if(!j&&A){let n=eS(t,"invokeStatus");if(n){let a=eS(t,"invokeQuery");a&&Object.assign(s.query,a),r.statusCode=n;let i=eS(t,"invokeError")||null;return this.renderError(i,t,r,"/_error",s.query)}let a=new URL(A||"/","http://n"),i=rC(a.pathname,{nextConfig:this.nextConfig,parseData:!1});i.locale&&(s.query.__nextLocale=i.locale),s.pathname!==a.pathname&&(s.pathname=a.pathname,e_(t,"rewroteURL",i.pathname));let o=rd(rp(s.pathname,this.nextConfig.basePath||""),(null==(C=this.nextConfig.i18n)?void 0:C.locales)||[]);for(let t of(o.detectedLocale&&(s.query.__nextLocale=o.detectedLocale),s.pathname=o.pathname,Object.keys(s.query)))t.startsWith("__next")||t.startsWith("_next")||delete s.query[t];let B=eS(t,"invokeQuery");if(B&&Object.assign(s.query,B),b=await this.normalizeAndAttachMetadata(t,r,s))return;await this.handleCatchallRenderRequest(t,r,s);return}if(eS(t,"middlewareInvoke")){if((b=await this.normalizeAndAttachMetadata(t,r,s))||(b=await this.handleCatchallMiddlewareRequest(t,r,s)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!j&&E.basePath&&(s.pathname=rp(s.pathname,E.basePath)),r.statusCode=200,await this.run(t,r,s)}catch(s){if(s instanceof nN)throw s;if(s&&"object"==typeof s&&"ERR_INVALID_URL"===s.code||s instanceof eD||s instanceof ex)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}}getRequestHandlerWithMetadata(t){let r=this.getRequestHandler();return(s,n,a)=>(eP(s,t),r(s,n,a))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(t){this.renderOpts.assetPrefix=t?t.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return null===this.preparedPromise&&(this.instrumentation=await this.loadInstrumentationModule(),this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let t={};return Object.keys(this.appPathsManifest||{}).forEach(r=>{let s=tO(r);t[s]||(t[s]=[]),t[s].push(r)}),t}async run(t,r,s){return(0,t1.getTracer)().trace(t0.Li.run,async()=>this.runImpl(t,r,s))}async runImpl(t,r,s){await this.handleCatchallRenderRequest(t,r,s)}async pipe(t,r){return(0,t1.getTracer)().trace(t0.Li.pipe,async()=>this.pipeImpl(t,r))}async pipeImpl(t,r){let s=r3(r.req.headers["user-agent"]||""),n={...r,renderOpts:{...this.renderOpts,supportsDynamicResponse:!s,isBot:!!s}},a=await t(n);if(null===a)return;let{req:i,res:o}=n,B=o.statusCode,{body:l,type:u}=a,{revalidate:c}=a;if(!o.sent){let{generateEtags:t,poweredByHeader:r,dev:s}=this.renderOpts;s&&(o.setHeader("Cache-Control","no-store, must-revalidate"),c=void 0),await this.sendRenderResult(i,o,{result:l,type:u,generateEtags:t,poweredByHeader:r,revalidate:c,expireTime:this.nextConfig.expireTime}),o.statusCode=B}}async getStaticHTML(t,r){let s={...r,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await t(s);return null===n?null:n.body.toUnchunkedString()}async render(t,r,s,n={},a,i=!1){return(0,t1.getTracer)().trace(t0.Li.render,async()=>this.renderImpl(t,r,s,n,a,i))}getWaitUntil(){let t=nf();if(t)return t.waitUntil}static noopWaitUntil(t){t.catch(t=>{console.error(t)})}async renderImpl(t,r,s,n={},a,i=!1){return(s.startsWith("/")||console.warn(`Cannot render page with path "${s}", did you mean "/${s}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.renderOpts.customServer&&"/index"===s&&!await this.hasPage("/index")&&(s="/"),r0(s))?this.render404(t,r,a):this.pipe(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async getStaticPaths({pathname:t}){var r;return{staticPaths:void 0,fallbackMode:nT(null==(r=this.getPrerenderManifest().dynamicRoutes[t])?void 0:r.fallback)}}async renderToResponseWithComponents(t,r){return(0,t1.getTracer)().trace(t0.Li.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(t,r))}pathCouldBeIntercepted(t){return tF(t)||this.interceptionRoutePatterns.some(r=>r.test(t))}setVaryHeader(t,r,s,n){let a=`${tt}, ${ts}, ${tn}, ${ta}`,i=eS(t,"isRSCRequest")??!1,o=!1;s&&this.pathCouldBeIntercepted(n)?(r.setHeader("vary",`${a}, ${ti}`),o=!0):(s||i)&&r.setHeader("vary",a),o||delete t.headers[ti]}async renderToResponseWithComponentsImpl({req:t,res:r,pathname:s,renderOpts:n},{components:a,query:i}){var o,l,c,p,C,f,m,y,g,b;let D,x,v,E;s===eO&&(s="/404");let j="/_error"===s,A="/404"===s||j&&404===r.statusCode,S="/500"===s||j&&500===r.statusCode,P=!0===a.isAppPath,_=!!a.getServerSideProps,w=!!a.getStaticPaths,I=no(t),O=!!(null==(o=a.Component)?void 0:o.getInitialProps),T=!!a.getStaticProps,N=(0,h.parse)(t.url||"").pathname||"/",F=eS(t,"rewroteURL")||N;this.setVaryHeader(t,r,P,F);let k=!1,M=r$(a.page),L=this.getPrerenderManifest();if(P&&M){let r=await this.getStaticPaths({pathname:s,page:a.page,isAppPath:P,requestHeaders:t.headers});if(D=r.staticPaths,k=void 0!==(x=r.fallbackMode),"export"===this.nextConfig.output){let t=a.page;if(!D)throw Error(`Page "${t}" is missing exported function "generateStaticParams()", which is required with "output: export" config.`);let r=tH(F);if(!D.includes(r))throw Error(`Page "${t}" is missing param "${r}" in "generateStaticParams()", which is required with "output: export" config.`)}k&&(w=!0)}k||(null==D?void 0:D.includes(F))||t.headers["x-now-route-matches"]?T=!0:T||=!!L.routes[nB(s)];let R=!!(i.__nextDataReq||t.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(T||_),H=eS(t,"isPrefetchRSCRequest")??!1,G=eS(t,"isRSCRequest")??!1;if(!T&&t.headers["x-middleware-prefetch"]&&!(A||"/_error"===s))return r.setHeader(e8.vx,s),r.setHeader("x-middleware-skip","1"),r.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),r.body("{}").send(),null;delete i.__nextDataReq,T&&t.headers[e8.vx]&&t.url.startsWith("/_next/data")&&(t.url=this.stripNextDataPath(t.url)),t.headers["x-nextjs-data"]&&(!r.statusCode||200===r.statusCode)&&r.setHeader("x-nextjs-matched-path",`${i.__nextLocale?`/${i.__nextLocale}`:""}${s}`),a.routeModule&&(v=a.routeModule);let K=this.isAppPPREnabled&&void 0!==v&&nt(v),J="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==i.__nextppronly&&K,U=J&&"fallback"===i.__nextppronly,Q=K&&((null==(l=L.routes[s]??L.dynamicRoutes[s])?void 0:l.renderingMode)==="PARTIALLY_STATIC"||J&&!0===this.experimentalTestProxy),W=J&&Q,V=W&&!1,q=U&&Q,Y=Q?eS(t,"postponed"):void 0,X=Q&&G&&!H,z=t.headers[ta.toLowerCase()];if(!A||R||G||(r.statusCode=404),eX.includes(s)&&(r.statusCode=parseInt(s.slice(1),10)),!I&&!Y&&!A&&!S&&"/_error"!==s&&"HEAD"!==t.method&&"GET"!==t.method&&("string"==typeof a.Component||T))return r.statusCode=405,r.setHeader("Allow",["GET","HEAD"]),await this.renderError(null,t,r,s),null;if("string"==typeof a.Component)return{type:"html",body:rR.fromStatic(a.Component)};if("amp"in i&&!i.amp&&delete i.amp,!0===n.supportsDynamicResponse){let r=r3(t.headers["user-agent"]||""),s="function"!=typeof(null==(f=a.Document)?void 0:f.getInitialProps)||eV in a.Document;n.supportsDynamicResponse=!T&&!r&&!i.amp&&s,n.isBot=r}!R&&P&&n.dev&&(n.supportsDynamicResponse=!0);let Z=T?null==(c=this.nextConfig.i18n)?void 0:c.defaultLocale:i.__nextDefaultLocale,$=i.__nextLocale,ee=null==(p=this.nextConfig.i18n)?void 0:p.locales,et=!1;if(_||T||P){let{tryGetPreviewData:s}=__webpack_require__("./dist/esm/server/api-utils/node/try-get-preview-data.js");et=!1!==s(t,r,this.renderOpts.previewProps,!!this.nextConfig.experimental.multiZoneDraftMode)}P&&!n.dev&&!et&&T&&G&&!X&&(!rz(n.runtime)||this.serverOptions.webServerConfig)&&s8(t.headers);let er=!1,es=!1;T&&({isOnDemandRevalidate:er,revalidateOnlyGenerated:es}=(0,eZ.Gx)(t,this.renderOpts.previewProps)),T&&t.headers[e8.vx]&&(F=N),N=tH(N),F=tH(F),this.localeNormalizer&&(F=this.localeNormalizer.normalize(F));let en=t=>{let s={destination:t.pageProps.__N_REDIRECT,statusCode:t.pageProps.__N_REDIRECT_STATUS,basePath:t.pageProps.__N_REDIRECT_BASE_PATH},n=rX(s),{basePath:a}=this.nextConfig;a&&!1!==s.basePath&&s.destination.startsWith("/")&&(s.destination=`${a}${s.destination}`),s.destination.startsWith("/")&&(s.destination=eb(s.destination)),r.redirect(s.destination,n).body(s.destination).send()};R&&(F=this.stripNextDataPath(F),N=this.stripNextDataPath(N));let ea=null;et||!T||n.supportsDynamicResponse||I||Y||X||(ea=`${$?`/${$}`:""}${("/"===s||"/"===F)&&$?"":F}${i.amp?".amp":""}`),(A||S)&&T&&(ea=`${$?`/${$}`:""}${s}${i.amp?".amp":""}`),ea&&(ea="/index"===(ea=s6(ea))&&"/"===s?"/":ea);let ei="https:";try{ei=new URL(eS(t,"initURL")||"/","http://n").protocol}catch{}let eo=globalThis.__incrementalCache||await this.getIncrementalCache({requestHeaders:Object.assign({},t.headers),requestProtocol:ei.substring(0,ei.length-1)});eo.resetRequestCache();let eB=async({postponed:o,fallbackRouteParams:l})=>{let u,c=!R&&!0===n.dev||!T&&!w||"string"==typeof o||X,d=(0,h.parse)(t.url||"",!0).query;n.params&&Object.keys(n.params).forEach(t=>{delete d[t]});let p="/"!==N&&this.nextConfig.trailingSlash,C=(0,h.format)({pathname:`${F}${p?"/":""}`,query:d}),f={...a,...n,...P?{incrementalCache:eo,isRevalidate:T&&!o&&!X,serverActions:this.nextConfig.experimental.serverActions}:{},isNextDataRequest:R,resolvedUrl:C,locale:$,locales:ee,defaultLocale:Z,multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode,resolvedAsPath:_||O?(0,h.format)({pathname:`${N}${p?"/":""}`,query:d}):C,experimental:{...n.experimental,isRoutePPREnabled:Q},supportsDynamicResponse:c,isOnDemandRevalidate:er,isDraftMode:et,isServerAction:I,postponed:o,waitUntil:this.getWaitUntil(),onClose:r.onClose.bind(r),onAfterTaskError:void 0,setAppIsrStatus:this.setAppIsrStatus};if((W||V)&&(c=!1,f.nextExport=!0,f.supportsDynamicResponse=!1,f.isStaticGeneration=!0,f.isRevalidate=!0,f.isDebugStaticShell=W,f.isDebugDynamicAccesses=V),v){if(ne(v)){var m;if(!rj(t)||!rA(r))throw Error("Invariant: App Route Route Modules cannot be used in the edge runtime");let a={params:n.params,prerenderManifest:L,renderOpts:{experimental:{after:f.experimental.after,dynamicIO:f.experimental.dynamicIO},supportsDynamicResponse:c,incrementalCache:eo,cacheLifeProfiles:null==(m=this.nextConfig.experimental)?void 0:m.cacheLife,isRevalidate:T,waitUntil:this.getWaitUntil(),onClose:r.onClose.bind(r),onAfterTaskError:void 0,onInstrumentationRequestError:this.renderOpts.onInstrumentationRequestError,buildId:this.renderOpts.buildId}};try{let s=rI.fromNodeNextRequest(t,rw(r.originalResponse)),n=await v.handle(s,a);t.fetchMetrics=a.renderOpts.fetchMetrics;let i=a.renderOpts.collectedTags;if(T){let t=await n.blob(),r=rt(n.headers);i&&(r[e8.VC]=i),!r["content-type"]&&t.type&&(r["content-type"]=t.type);let s=void 0!==a.renderOpts.collectedRevalidate&&!(a.renderOpts.collectedRevalidate>=e8.AR)&&a.renderOpts.collectedRevalidate;return{value:{kind:B.APP_ROUTE,status:n.status,body:Buffer.from(await t.arrayBuffer()),headers:r},revalidate:s,isFallback:!1}}return await s0(t,r,n,a.renderOpts.pendingWaitUntil),null}catch(n){if(await this.instrumentationOnRequestError(n,t,{routerKind:"App Router",routePath:s,routeType:"route",revalidateReason:nO(f)}),T)throw n;return tx(n),await s0(t,r,new Response(null,{status:500})),null}}else if(nr(v)||nt(v)){if("OPTIONS"===t.method&&!A)return await s0(t,r,new Response(null,{status:400})),null;if(nr(v)){f.nextFontManifest=this.nextFontManifest,f.clientReferenceManifest=a.clientReferenceManifest;let o=rj(t)?t.originalRequest:t,B=rA(r)?r.originalResponse:r;try{u=await v.render(o,B,{page:s,params:n.params,query:i,renderOpts:f})}catch(r){throw await this.instrumentationOnRequestError(r,t,{routerKind:"Pages Router",routePath:s,routeType:"render",revalidateReason:nO({isRevalidate:T,isOnDemandRevalidate:f.isOnDemandRevalidate})}),r}}else{let o=a.routeModule;f.nextFontManifest=this.nextFontManifest;let B={page:A?"/404":s,params:n.params,query:i,fallbackRouteParams:l,renderOpts:f,serverComponentsHmrCache:this.getServerComponentsHmrCache()};this.nextConfig.experimental.dynamicIO,u=await o.render(t,r,B)}}else throw Error("Invariant: Unknown route module type")}else u=await this.renderHTML(t,r,s,i,f);let{metadata:y}=u,{headers:g={},fetchTags:b}=y;if(b&&(g[e8.VC]=b),t.fetchMetrics=y.fetchMetrics,P&&T&&0===y.revalidate&&!Q){let t=y.staticBailoutInfo,r=Error(`Page changed from static to dynamic at runtime ${N}${(null==t?void 0:t.description)?`, reason: ${t.description}`:""}
|
|
2872
|
-
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);if(null==t?void 0:t.stack){let s=t.stack;r.stack=r.message+s.substring(s.indexOf("\n"))}throw r}return"isNotFound"in y&&y.isNotFound?{value:null,revalidate:y.revalidate,isFallback:!1}:y.isRedirect?{value:{kind:B.REDIRECT,props:y.pageData??y.flightData},revalidate:y.revalidate,isFallback:!1}:u.isNull?null:P?{value:{kind:B.APP_PAGE,html:u,headers:g,rscData:y.flightData,postponed:y.postponed,status:r.statusCode,segmentData:void 0},revalidate:y.revalidate,isFallback:!!l}:{value:{kind:B.PAGES,html:u,pageData:y.pageData??y.flightData,headers:g,status:P?r.statusCode:void 0},revalidate:y.revalidate,isFallback:"true"===i.__nextFallback}},el=async({hasResolved:o,previousCacheEntry:l,isRevalidating:u})=>{if(o||r.sent,!D&&M){if(w){let r=await this.getStaticPaths({pathname:s,requestHeaders:t.headers,isAppPath:P,page:a.page});D=r.staticPaths,x=r.fallbackMode}else D=void 0,x=d.NOT_FOUND}x===d.PRERENDER&&r3(t.headers["user-agent"]||"")&&(x=d.BLOCKING_STATIC_RENDER),(null==l?void 0:l.isStale)===-1&&(er=!0),er&&(x!==d.NOT_FOUND||l)&&(x=d.BLOCKING_STATIC_RENDER);let c=ea;!c&&n.dev&&P&&(c=s6(F)),c&&i.amp&&(c=c.replace(/\.amp$/,"")),c&&(null==D||D.includes(c)),this.nextConfig.experimental.isExperimentalCompile&&(x=d.BLOCKING_STATIC_RENDER);let p=er||u||!Y?void 0:Y;if((W||V)&&void 0!==p)return{revalidate:1,isFallback:!1,value:{kind:B.PAGES,html:rR.fromStatic(""),pageData:{},headers:void 0,status:void 0}};let C=M&&Q&&(eS(t,"didSetDefaultRouteMatches")||q)?tX(s):null,f=await eB({postponed:p,fallbackRouteParams:C});return f?{...f,revalidate:f.revalidate}:null},eu=await this.responseCache.get(ea,el,{routeKind:(null==v?void 0:v.definition.kind)??(P?u.APP_PAGE:u.PAGES),incrementalCache:eo,isOnDemandRevalidate:er,isPrefetch:"prefetch"===t.headers.purpose,isRoutePPREnabled:Q});if(Q&&H&&"string"==typeof z){if((null==eu?void 0:null==(m=eu.value)?void 0:m.kind)!==B.APP_PAGE)return r.statusCode=404,{type:"rsc",body:rR.fromStatic("")};if(eu.value.segmentData){let t=eu.value.segmentData[z];if(void 0!==t)return{type:"rsc",body:rR.fromStatic(t),revalidate:eu.revalidate}}return r.statusCode=404,{type:"rsc",body:rR.fromStatic(""),revalidate:eu.revalidate}}if(et&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),!eu){if(ea&&!(er&&es))throw Error("invariant: cache entry required but not generated");return null}let ec=(null==(C=eu.value)?void 0:C.kind)===B.APP_PAGE&&"string"==typeof eu.value.postponed;T&&!X&&(!ec||H)&&r.setHeader(tc,"1");let{value:ed}=eu;if((null==ed?void 0:ed.kind)===B.IMAGE)throw Error("invariant SSG should not return an image cache value");if(Y)E=0;else if(G&&!H&&Q)E=0;else if(1){if(et)E=0;else if(T){if(A){let r=eS(t,"notFoundRevalidate");E=void 0===r?0:r}else if(S)E=0;else if("number"==typeof eu.revalidate){if(eu.revalidate<1)throw Error(`Invalid revalidate configuration provided: ${eu.revalidate} < 1`);E=eu.revalidate}else!1===eu.revalidate&&(E=e8.qF)}else r.getHeader("Cache-Control")||(E=0)}eu.revalidate=E;let ep=eS(t,"onCacheEntry");if(ep&&await ep({...eu,value:{...eu.value,kind:(null==(y=eu.value)?void 0:y.kind)===B.APP_PAGE?"PAGE":null==(g=eu.value)?void 0:g.kind}},{url:eS(t,"initURL")}))return null;if(ed){if(ed.kind===B.REDIRECT)return(eu.revalidate&&!r.getHeader("Cache-Control")&&r.setHeader("Cache-Control",te({revalidate:eu.revalidate,expireTime:this.nextConfig.expireTime})),R)?{type:"json",body:rR.fromStatic(JSON.stringify(ed.props)),revalidate:eu.revalidate}:(await en(ed.props),null);if(ed.kind===B.APP_ROUTE){let s={...ed.headers};return T||delete s[e8.VC],await s0(t,r,new Response(ed.body,{headers:t8(s),status:ed.status||200})),null}if(ed.kind===B.APP_PAGE){if(ec&&Y)throw Error("Invariant: postponed state should not be present on a resume request");if(ed.headers){let t={...ed.headers};for(let[s,n]of(T||delete t[e8.VC],Object.entries(t)))if(void 0!==n){if(Array.isArray(n))for(let t of n)r.appendHeader(s,t);else"number"==typeof n&&(n=n.toString()),r.appendHeader(s,n)}}if(T&&(null==(b=ed.headers)?void 0:b[e8.VC])&&r.setHeader(e8.VC,ed.headers[e8.VC]),!ed.status||G&&Q||(r.statusCode=ed.status),ec&&r.setHeader(tu,"1"),G&&!et){if(void 0===ed.rscData){if(ed.postponed)throw Error("Invariant: Expected postponed to be undefined");return{type:"rsc",body:ed.html,revalidate:X?0:eu.revalidate}}return{type:"rsc",body:rR.fromStatic(ed.rscData),revalidate:eu.revalidate}}return{type:"html",body:ed.html,revalidate:eu.revalidate}}return R?{type:"json",body:rR.fromStatic(JSON.stringify(ed.pageData)),revalidate:eu.revalidate}:{type:"html",body:ed.html,revalidate:eu.revalidate}}return(e_(t,"notFoundRevalidate",eu.revalidate),eu.revalidate&&!r.getHeader("Cache-Control")&&r.setHeader("Cache-Control",te({revalidate:eu.revalidate,expireTime:this.nextConfig.expireTime})),R)?(r.statusCode=404,r.body('{"notFound":true}').send()):await this.render404(t,r,{pathname:s,query:i},!1),null}stripNextDataPath(t,r=!0){return(t.includes(this.buildId)&&(t=r4(t.substring(t.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&r)?this.localeNormalizer.normalize(t):t}getOriginalAppPaths(t){if(this.enabledDirectories.app){var r;return(null==(r=this.appPathRoutes)?void 0:r[t])||null}return null}async renderPageComponent(t,r){var s;let{query:n,pathname:a}=t,i=this.getOriginalAppPaths(a),o=Array.isArray(i),B=a;o&&(B=i[i.length-1]);let l=await this.findPageComponents({page:B,query:n,params:t.renderOpts.params||{},isAppPath:o,sriEnabled:!!(null==(s=this.nextConfig.experimental.sri)?void 0:s.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,t1.getTracer)().setRootSpanAttribute("next.route",a);try{return await this.renderToResponseWithComponents(t,l)}catch(s){let t=s instanceof nN;if(!t||t&&r)throw s}}return!1}async renderToResponse(t){return(0,t1.getTracer)().trace(t0.Li.renderToResponse,{spanName:"rendering page",attributes:{"next.route":t.pathname}},async()=>this.renderToResponseImpl(t))}async renderToResponseImpl(t){var r;let{res:s,query:n,pathname:a}=t,i=a,o=!!n._nextBubbleNoFallback;delete n[tl],delete n._nextBubbleNoFallback;let B={i18n:null==(r=this.i18nProvider)?void 0:r.fromQuery(a,n)};try{for await(let r of this.matchers.matchAll(a,B)){eS(t.req,"invokeOutput");let s=await this.renderPageComponent({...t,pathname:r.definition.pathname,renderOpts:{...t.renderOpts,params:r.params}},o);if(!1!==s)return s}if(this.serverOptions.webServerConfig){t.pathname=this.serverOptions.webServerConfig.page;let r=await this.renderPageComponent(t,o);if(!1!==r)return r}}catch(a){let r=sd(a);if(a instanceof eE)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:t.req.url,matchedPath:t.req.headers[e8.vx],initUrl:eS(t.req,"initURL"),didRewrite:!!eS(t.req,"rewroteURL"),rewroteUrl:eS(t.req,"rewroteURL")},null,2)),r;if(r instanceof nN&&o)throw r;if(r instanceof eD||r instanceof ex)return s.statusCode=400,await this.renderErrorToResponse(t,r);s.statusCode=500,await this.hasPage("/500")&&(t.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(t,r),delete t.query.__nextCustomErrorRender);let n=r instanceof nF;if(!n)throw su(r)&&(r.page=i),r;return await this.renderErrorToResponse(t,n?r.innerError:r)}return this.getMiddleware()&&t.req.headers["x-nextjs-data"]&&(!s.statusCode||200===s.statusCode||404===s.statusCode)?(s.setHeader("x-nextjs-matched-path",`${n.__nextLocale?`/${n.__nextLocale}`:""}${a}`),s.statusCode=200,s.setHeader("content-type","application/json"),s.body("{}"),s.send(),null):(s.statusCode=404,this.renderErrorToResponse(t,null))}async renderToHTML(t,r,s,n={}){return(0,t1.getTracer)().trace(t0.Li.renderToHTML,async()=>this.renderToHTMLImpl(t,r,s,n))}async renderToHTMLImpl(t,r,s,n={}){return this.getStaticHTML(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async renderError(t,r,s,n,a={},i=!0){return(0,t1.getTracer)().trace(t0.Li.renderError,async()=>this.renderErrorImpl(t,r,s,n,a,i))}async renderErrorImpl(t,r,s,n,a={},i=!0){return i&&s.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async r=>{let n=await this.renderErrorToResponse(r,t);if(500===s.statusCode)throw t;return n},{req:r,res:s,pathname:n,query:a})}async renderErrorToResponse(t,r){return(0,t1.getTracer)().trace(t0.Li.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(t,r))}async renderErrorToResponseImpl(t,r){let{res:s,query:n}=t;try{let a=null,i=404===s.statusCode,o=!1;i&&(this.enabledDirectories.app&&(a=await this.findPageComponents({page:eT,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:t.req.url}),o=null!==a),!a&&await this.hasPage("/404")&&(a=await this.findPageComponents({page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),o=null!==a));let B=`/${s.statusCode}`;if(!t.query.__nextCustomErrorRender&&!a&&eX.includes(B)&&(a=await this.findPageComponents({page:B,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url})),a||(a=await this.findPageComponents({page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),B="/_error"),!a)throw new nF(Error("missing required error components"));a.components.routeModule?e_(t.req,"match",{definition:a.components.routeModule.definition,params:void 0}):ew(t.req,"match");try{return await this.renderToResponseWithComponents({...t,pathname:B,renderOpts:{...t.renderOpts,err:r}},a)}catch(t){if(t instanceof nN)throw Error("invariant: failed to render error page");throw t}}catch(o){let r=sd(o),a=r instanceof nF;a||this.logError(r),s.statusCode=500;let i=await this.getFallbackErrorComponents(t.req.url);if(i)return e_(t.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...t,pathname:"/_error",renderOpts:{...t.renderOpts,err:a?r.innerError:r}},{query:n,components:i});return{type:"html",body:rR.fromStatic("Internal Server Error")}}}async renderErrorToHTML(t,r,s,n,a={}){return this.getStaticHTML(r=>this.renderErrorToResponse(r,t),{req:r,res:s,pathname:n,query:a})}async render404(t,r,s,n=!0){let{pathname:a,query:i}=s||(0,h.parse)(t.url,!0);return this.nextConfig.i18n&&(i.__nextLocale||=this.nextConfig.i18n.defaultLocale,i.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),r.statusCode=404,this.renderError(null,t,r,a,i,n)}}class nM{constructor(t,r){this.cache=new Map,this.sizes=new Map,this.totalSize=0,this.maxSize=t,this.calculateSize=r||(()=>1)}set(t,r){if(!t||!r)return;let s=this.calculateSize(r);if(s>this.maxSize){console.warn("Single item size exceeds maxSize");return}this.cache.has(t)&&(this.totalSize-=this.sizes.get(t)||0),this.cache.set(t,r),this.sizes.set(t,s),this.totalSize+=s,this.touch(t)}has(t){return!!t&&(this.touch(t),!!this.cache.get(t))}get(t){if(!t)return;let r=this.cache.get(t);if(void 0!==r)return this.touch(t),r}touch(t){let r=this.cache.get(t);void 0!==r&&(this.cache.delete(t),this.cache.set(t,r),this.evictIfNecessary())}evictIfNecessary(){for(;this.totalSize>this.maxSize&&this.cache.size>0;)this.evictLeastRecentlyUsed()}evictLeastRecentlyUsed(){let t=this.cache.keys().next().value;if(void 0!==t){let r=this.sizes.get(t)||0;this.totalSize-=r,this.cache.delete(t),this.sizes.delete(t)}}reset(){this.cache.clear(),this.sizes.clear(),this.totalSize=0}keys(){return[...this.cache.keys()]}remove(t){this.cache.has(t)&&(this.totalSize-=this.sizes.get(t)||0,this.cache.delete(t),this.sizes.delete(t))}clear(){this.cache.clear(),this.sizes.clear(),this.totalSize=0}get size(){return this.cache.size}get currentSize(){return this.totalSize}}let nL=require("vm");function nR(t){if(Object.isFrozen(t))return t;if(Array.isArray(t)){for(let r of t)r&&"object"==typeof r&&nR(r);return Object.freeze(t)}for(let r of Object.values(t))r&&"object"==typeof r&&nR(r);return Object.freeze(t)}let nH=new Map;function nG(t,r=!0,s=nH){let n=r&&s.get(t);if(n)return n;let a=JSON.parse((0,g.readFileSync)(t,"utf8"));return r&&(a=nR(a)),r&&s.set(t,a),a}function nK(t,r=!0,s=nH){let n=r&&s.get(t);if(n)return n;let a=(0,g.readFileSync)(t,"utf8");if(0===a.length)throw Error("Manifest file is empty");let i={};return(0,nL.runInNewContext)(a,i),r&&(i=nR(i)),r&&s.set(t,i),i}let nJ=!1,nU=new nM(1e3);function nQ(t,r,s,n){let a;let i=`${t}:${r}:${s}:${n}`,o=null==nU?void 0:nU.get(i);if(o)return o;let B=m().join(r,eJ);n&&(a=nG(m().join(B,ek),!nJ));let l=nG(m().join(B,eF),!nJ);try{t=r4(sE(t))}catch(r){throw console.error(r),new ev(t)}let u=r=>{let n=r[t];if(!r[n]&&s){let a={};for(let t of Object.keys(r))a[rd(t,s).pathname]=l[t];n=a[t]}return n};return(a&&(o=u(a)),o||(o=u(l)),o)?(o=m().join(B,o),null==nU||nU.set(i,o),o):(null==nU||nU.set(i,null),null)}function nW(t,r,s,n){let a=nQ(t,r,s,n);if(!a)throw new ev(t);return a}async function nV(t,r,s){let n=nW(t,r,void 0,s);if(n.endsWith(".html"))return g.promises.readFile(n,"utf8").catch(r=>{throw new eE(t,r.message)});try{return process.env.__NEXT_PRIVATE_RUNTIME_TYPE=s?"app":"pages",require(n)}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function nq(t){return t.default||t}async function nY(t){return new Promise(r=>setTimeout(r,t))}let nX=Symbol.for("next.server.action-manifests");function nz({page:t,clientReferenceManifest:r,serverActionsManifest:s,serverModuleMap:n}){var a;let i=null==(a=globalThis[nX])?void 0:a.clientReferenceManifestsPerPage;globalThis[nX]={clientReferenceManifestsPerPage:{...i,[nZ(t)]:r},serverActionsManifest:s,serverModuleMap:n}}function nZ(t){return t.replace(/\/(page|route)$/,"")}function n$({serverActionsManifest:t}){return new Proxy({},{get:(r,s)=>{let n;let a=t.node[s].workers,i=Y.workAsyncStorage.getStore();if(!(n=i?a[n1(i.page)]:Object.values(a).at(0)))return;let{moduleId:o,async:B}=n;return{id:o,name:s,chunks:[],async:B}}})}function n1(t){return rB(t,"app")?t:"app"+t}async function n0(t,r=3){for(;;)try{return nG(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n2(t,r=3){for(;;)try{return nK(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n3(t,r){try{return(await n2(t)).__RSC_MANIFEST[r]}catch(t){return}}async function n5({distDir:t,page:r,isAppPath:s}){let n={},a={};s||([n,a]=await Promise.all([nV("/_document",t,!1),nV("/_app",t,!1)]));let i=s&&!sI(r),[o,B,l,u]=await Promise.all([n0((0,f.join)(t,eM)),n0((0,f.join)(t,eK)),i?n3((0,f.join)(t,"server","app",r.replace(/%5F/g,"_")+"_"+eq+".js"),r.replace(/%5F/g,"_")):void 0,s?n0((0,f.join)(t,"server",eY+".json")).catch(()=>null):null]);u&&l&&nz({page:r,clientReferenceManifest:l,serverActionsManifest:u,serverModuleMap:n$({serverActionsManifest:u})});let c=await nV(r,t,s),d=nq(c),p=nq(n),C=nq(a),{getServerSideProps:m,getStaticProps:h,getStaticPaths:y,routeModule:g}=c;return{App:C,Document:p,Component:d,buildManifest:o,reactLoadableManifest:B,pageConfig:c.config||{},ComponentMod:c,getServerSideProps:m,getStaticProps:h,getStaticPaths:y,clientReferenceManifest:l,serverActionsManifest:u,isAppPath:s,page:r,routeModule:g}}let n4=(0,t1.getTracer)().wrap(t0.p2.loadComponents,n5);function n6(t){return(r,s,n)=>{for(let a of t)if(new RegExp(a.regexp).exec(r)&&(!a.has&&!a.missing||st(s,n,a.has,a.missing)))return!0;return!1}}var n7=__webpack_require__("../next-env/dist/index.js");let n9=require("stream");var n8=__webpack_require__.n(n9);function ae(t,r){for(let s in r){let n=r[s];"function"==typeof n&&(n=n.bind(t)),t[s]=n}return t}function at(t){let r=null,s=new Promise((r,s)=>{t.on("end",r),t.on("error",s)}).catch(t=>({error:t}));return{async finalize(){if(r){let n=await s;if(n&&"object"==typeof n&&n.error)throw n.error;ae(t,r),r=t}},cloneBodyStream(){let s=r??t,n=new n9.PassThrough,a=new n9.PassThrough;return s.on("data",t=>{n.push(t),a.push(t)}),s.on("end",()=>{n.push(null),a.push(null)}),r=a,n}}}let ar=0,as="x-vercel-cache-tags",an="x-vercel-sc-headers",aa="x-vercel-cache-state",ai="x-vercel-revalidate",ao="x-vercel-cache-item-name",aB="x-vercel-cache-control",al=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;async function au(t,r,s=0){let n=new AbortController,a=setTimeout(()=>{n.abort()},500);return fetch(t,{...r||{},signal:n.signal}).catch(n=>{if(3!==s)return al&&console.log(`Fetch failed for ${t} retry ${s}`),au(t,r,s+1);throw n}).finally(()=>{clearTimeout(a)})}class ac{hasMatchingTags(t,r){if(t.length!==r.length)return!1;let s=new Set(t),n=new Set(r);if(s.size!==n.size)return!1;for(let t of s)if(!n.has(t))return!1;return!0}static isAvailable(t){return!!(t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL)}constructor(t){if(this.headers={},this.headers["Content-Type"]="application/json",an in t._requestHeaders){let r=JSON.parse(t._requestHeaders[an]);for(let t in r)this.headers[t]=r[t];delete t._requestHeaders[an]}let s=t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL,n=t._requestHeaders["x-vercel-sc-basepath"]||process.env.SUSPENSE_CACHE_BASEPATH;if(process.env.SUSPENSE_CACHE_AUTH_TOKEN&&(this.headers.Authorization=`Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`),s){let t=process.env.SUSPENSE_CACHE_PROTO||"https";this.cacheEndpoint=`${t}://${s}${n||""}`,al&&console.log("using cache endpoint",this.cacheEndpoint)}else al&&console.log("no cache endpoint available");t.maxMemoryCacheSize?r||(al&&console.log("using memory store for fetch cache"),r=new nM(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===B.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===B.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===B.FETCH?JSON.stringify(t.data||"").length:t.kind===B.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===B.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):al&&console.log("not using memory store for fetch cache")}resetRequestCache(){null==r||r.reset()}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,al&&console.log("revalidateTag",r),r.length){if(Date.now()<ar){al&&console.log("rate limited ",ar);return}for(let t=0;t<Math.ceil(r.length/64);t++){let s=r.slice(64*t,64*t+64);try{let t=await au(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${s.map(t=>encodeURIComponent(t)).join(",")}`,{method:"POST",headers:this.headers,next:{internal:!0}});if(429===t.status){let r=t.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(r)}if(!t.ok)throw Error(`Request failed with status ${t.status}.`)}catch(t){console.warn("Failed to revalidate tag",s,t)}}}}async get(...t){var s;let[n,a]=t,{tags:i,softTags:o,kind:u,fetchIdx:c,fetchUrl:d}=a;if(u!==l.FETCH)return null;if(Date.now()<ar)return al&&console.log("rate limited"),null;let p=null==r?void 0:r.get(n),C=(null==p?void 0:null==(s=p.value)?void 0:s.kind)===B.FETCH&&this.hasMatchingTags(i??[],p.value.tags??[]);if(this.cacheEndpoint&&(!p||!C))try{let t=Date.now(),s={internal:!0,fetchType:"cache-get",fetchUrl:d,fetchIdx:c},a=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${n}`,{method:"GET",headers:{...this.headers,[ao]:d,[as]:(null==i?void 0:i.join(","))||"",[e8.cS]:(null==o?void 0:o.join(","))||""},next:s});if(429===a.status){let t=a.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(t)}if(404===a.status)return al&&console.log(`no fetch cache entry for ${n}, duration: ${Date.now()-t}ms`),null;if(!a.ok)throw console.error(await a.text()),Error(`invalid response from cache ${a.status}`);let l=await a.json();if(!l||l.kind!==B.FETCH)throw al&&console.log({cached:l}),Error("invalid cache value");if(l.kind===B.FETCH)for(let t of(l.tags??=[],i??[]))l.tags.includes(t)||l.tags.push(t);let u=a.headers.get(aa),C=a.headers.get("age");p={value:l,lastModified:"fresh"!==u?Date.now()-e8.qF:Date.now()-1e3*parseInt(C||"0",10)},al&&console.log(`got fetch cache entry for ${n}, duration: ${Date.now()-t}ms, size: ${Object.keys(l).length}, cache-state: ${u} tags: ${null==i?void 0:i.join(",")} softTags: ${null==o?void 0:o.join(",")}`),p&&(null==r||r.set(n,p))}catch(t){al&&console.error("Failed to get from fetch-cache",t)}return p||null}async set(...t){let[s,n,a]=t,{fetchCache:i,fetchIdx:o,fetchUrl:B,tags:l}=a;if(i){if(Date.now()<ar){al&&console.log("rate limited");return}if(null==r||r.set(s,{value:n,lastModified:Date.now()}),this.cacheEndpoint)try{let t=Date.now();null!==n&&"revalidate"in n&&(this.headers[ai]=n.revalidate.toString()),!this.headers[ai]&&null!==n&&"data"in n&&(this.headers[aB]=n.data.headers["cache-control"]);let r=JSON.stringify({...n,tags:void 0});al&&console.log("set cache",s);let a={internal:!0,fetchType:"cache-set",fetchUrl:B,fetchIdx:o},i=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${s}`,{method:"POST",headers:{...this.headers,[ao]:B||"",[as]:(null==l?void 0:l.join(","))||""},body:r,next:a});if(429===i.status){let t=i.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(t)}if(!i.ok)throw al&&console.log(await i.text()),Error(`invalid response ${i.status}`);al&&console.log(`successfully set to fetch-cache for ${s}, duration: ${Date.now()-t}ms, size: ${r.length}`)}catch(t){al&&console.error("Failed to update fetch cache",t)}}}}let ad=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class ap{constructor(t){this.fs=t.fs,this.flushToDisk=t.flushToDisk,this.serverDistDir=t.serverDistDir,this.revalidatedTags=t.revalidatedTags,this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,t.maxMemoryCacheSize?s||(this.debug&&console.log("using memory store for fetch cache"),s=new nM(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===B.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===B.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===B.FETCH?JSON.stringify(t.data||"").length:t.kind===B.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===B.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):this.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,this.debug&&console.log("revalidateTag",r),0!==r.length)for(let t of r){let r=ad.tagsManifest.items[t]||{};r.revalidatedAt=Date.now(),ad.tagsManifest.items[t]=r}}async get(...t){var r,n,a,i,o,u;let[c,d]=t,{tags:p,softTags:C,kind:f,isRoutePPREnabled:m,isFallback:h}=d,y=null==s?void 0:s.get(c);if(this.debug&&console.log("get",c,p,f,!!y),!y){if(f===l.APP_ROUTE)try{let t=this.getFilePath(`${c}.body`,l.APP_ROUTE),r=await this.fs.readFile(t),{mtime:s}=await this.fs.stat(t),n=JSON.parse(await this.fs.readFile(t.replace(/\.body$/,e8.EP),"utf8"));return{lastModified:s.getTime(),value:{kind:B.APP_ROUTE,body:r,headers:n.headers,status:n.status}}}catch{return null}try{let t=this.getFilePath(f===l.FETCH?c:`${c}.html`,f),r=await this.fs.readFile(t,"utf8"),{mtime:n}=await this.fs.stat(t);if(f===l.FETCH){if(!this.flushToDisk)return null;let t=n.getTime(),s=JSON.parse(r);if(y={lastModified:t,value:s},(null==(i=y.value)?void 0:i.kind)===B.FETCH){let t=null==(o=y.value)?void 0:o.tags;(null==p?void 0:p.every(r=>null==t?void 0:t.includes(r)))||(this.debug&&console.log("tags vs storedTags mismatch",p,t),await this.set(c,y.value,{tags:p,isRoutePPREnabled:m}))}}else if(f===l.APP_PAGE){let s,a,i;try{s=JSON.parse(await this.fs.readFile(t.replace(/\.html$/,e8.EP),"utf8"))}catch{}if(null==s?void 0:s.segmentPaths){let t={};a=t;let r=c+e8.mH;await Promise.all(s.segmentPaths.map(async s=>{let n=this.getFilePath("/"===s?r+"/_index"+e8.tz:r+s+e8.tz,l.APP_PAGE);try{t[s]=await this.fs.readFile(n,"utf8")}catch{}}))}h||(i=await this.fs.readFile(this.getFilePath(`${c}${m?e8.pu:e8.RM}`,l.APP_PAGE))),y={lastModified:n.getTime(),value:{kind:B.APP_PAGE,html:r,rscData:i,postponed:null==s?void 0:s.postponed,headers:null==s?void 0:s.headers,status:null==s?void 0:s.status,segmentData:a}}}else if(f===l.PAGES){let t;let s={};h||(s=JSON.parse(await this.fs.readFile(this.getFilePath(`${c}${e8.x3}`,l.PAGES),"utf8"))),y={lastModified:n.getTime(),value:{kind:B.PAGES,html:r,pageData:s,headers:null==t?void 0:t.headers,status:null==t?void 0:t.status}}}else throw Error(`Invariant: Unexpected route kind ${f} in file system cache.`);y&&(null==s||s.set(c,y))}catch{return null}}if((null==y?void 0:null==(r=y.value)?void 0:r.kind)===B.APP_PAGE||(null==y?void 0:null==(n=y.value)?void 0:n.kind)===B.PAGES){let t;let r=null==(u=y.value.headers)?void 0:u[e8.VC];if("string"==typeof r&&(t=r.split(",")),(null==t?void 0:t.length)&&t.some(t=>{var r;return(null==ad.tagsManifest?void 0:null==(r=ad.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ad.tagsManifest?void 0:ad.tagsManifest.items[t].revalidatedAt)>=((null==y?void 0:y.lastModified)||Date.now())}))return null}else(null==y?void 0:null==(a=y.value)?void 0:a.kind)===B.FETCH&&[...p||[],...C||[]].some(t=>{var r;return!!this.revalidatedTags.includes(t)||(null==ad.tagsManifest?void 0:null==(r=ad.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ad.tagsManifest?void 0:ad.tagsManifest.items[t].revalidatedAt)>=((null==y?void 0:y.lastModified)||Date.now())})&&(y=void 0);return y??null}async set(...t){let[r,n,a]=t,{isFallback:i}=a;if(null==s||s.set(r,{value:n,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk&&n){if(n.kind===B.APP_ROUTE){let t=this.getFilePath(`${r}.body`,l.APP_ROUTE);await this.fs.mkdir(sx().dirname(t)),await this.fs.writeFile(t,n.body);let s={headers:n.headers,status:n.status,postponed:void 0,segmentPaths:void 0};await this.fs.writeFile(t.replace(/\.body$/,e8.EP),JSON.stringify(s,null,2))}else if(n.kind===B.PAGES||n.kind===B.APP_PAGE){let t=n.kind===B.APP_PAGE,s=this.getFilePath(`${r}.html`,t?l.APP_PAGE:l.PAGES);if(await this.fs.mkdir(sx().dirname(s)),await this.fs.writeFile(s,n.html),i||await this.fs.writeFile(this.getFilePath(`${r}${t?a.isRoutePPREnabled?e8.pu:e8.RM:e8.x3}`,t?l.APP_PAGE:l.PAGES),t?n.rscData:JSON.stringify(n.pageData)),(null==n?void 0:n.kind)===B.APP_PAGE){let t={headers:n.headers,status:n.status,postponed:n.postponed,segmentPaths:void 0};await this.fs.writeFile(s.replace(/\.html$/,e8.EP),JSON.stringify(t))}}else if(n.kind===B.FETCH){let t=this.getFilePath(r,l.FETCH);await this.fs.mkdir(sx().dirname(t)),await this.fs.writeFile(t,JSON.stringify({...n,tags:a.tags}))}}}getFilePath(t,r){switch(r){case l.FETCH:return sx().join(this.serverDistDir,"..","cache","fetch-cache",t);case l.PAGES:return sx().join(this.serverDistDir,"pages",t);case l.IMAGE:case l.APP_PAGE:case l.APP_ROUTE:return sx().join(this.serverDistDir,"app",t);default:throw Error(`Unexpected file path kind: ${r}`)}}}class aC{static #e=this.timings=new Map;constructor(t){this.prerenderManifest=t}get(t){var r,s;let n=aC.timings.get(t);if(void 0!==n||void 0!==(n=null==(r=this.prerenderManifest.routes[t])?void 0:r.initialRevalidateSeconds)||void 0!==(n=null==(s=this.prerenderManifest.dynamicRoutes[t])?void 0:s.fallbackRevalidate))return n}set(t,r){aC.timings.set(t,r)}clear(){aC.timings.clear()}}let af=nC();class am{constructor({fs:t,dev:r,dynamicIO:s,flushToDisk:n,fetchCache:a,minimalMode:i,serverDistDir:o,requestHeaders:B,requestProtocol:l,maxMemoryCacheSize:u,getPrerenderManifest:c,fetchCacheKeyPrefix:d,CurCacheHandler:p,allowedRevalidateHeaderKeys:C}){var f,m,h,y;this.locks=new Map;let g=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!p;let b=Symbol.for("@next/cache-handlers"),D=globalThis;if(p)g&&console.log("using custom cache handler",p.name);else{let r=D[b];(null==r?void 0:r.FetchCache)?p=r.FetchCache:(t&&o&&(g&&console.log("using filesystem cache handler"),p=ap),ac.isAvailable({_requestHeaders:B})&&i&&a&&(g&&console.log("using fetch cache handler"),p=ac))}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(u=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=r,this.hasDynamicIO=s,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=i,this.requestHeaders=B,this.requestProtocol=l,this.allowedRevalidateHeaderKeys=C,this.prerenderManifest=c(),this.revalidateTimings=new aC(this.prerenderManifest),this.fetchCacheKeyPrefix=d;let x=[];B[e8.kz]===(null==(m=this.prerenderManifest)?void 0:null==(f=m.preview)?void 0:f.previewModeId)&&(this.isOnDemandRevalidate=!0),i&&"string"==typeof B[e8.vS]&&B[e8.c1]===(null==(y=this.prerenderManifest)?void 0:null==(h=y.preview)?void 0:h.previewModeId)&&(x=B[e8.vS].split(",")),p&&(this.cacheHandler=new p({dev:r,fs:t,flushToDisk:n,serverDistDir:o,revalidatedTags:x,maxMemoryCacheSize:u,_requestHeaders:B,fetchCacheKeyPrefix:d}))}calculateRevalidate(t,r,s,n){if(s)return Math.floor(performance.timeOrigin+performance.now()-1e3);let a=this.revalidateTimings.get(nB(t))??(!n&&1);return"number"==typeof a?1e3*a+r:a}_getPathname(t,r){return r?t:sE(t)}resetRequestCache(){var t,r;null==(r=this.cacheHandler)||null==(t=r.resetRequestCache)||t.call(r)}async lock(t){let r=()=>Promise.resolve(),s=this.locks.get(t);s&&await s;let n=new Promise(s=>{r=async()=>{s(),this.locks.delete(t)}});return this.locks.set(t,n),r}async revalidateTag(t){var r,s;return null==(s=this.cacheHandler)?void 0:null==(r=s.revalidateTag)?void 0:r.call(s,t)}async generateCacheKey(t,r={}){let s="v3",n=[],a=new TextEncoder,i=new TextDecoder;if(r.body){if("function"==typeof r.body.getReader){let t=r.body,s=[];try{await t.pipeTo(new WritableStream({write(t){"string"==typeof t?(s.push(a.encode(t)),n.push(t)):(s.push(t),n.push(i.decode(t,{stream:!0})))}})),n.push(i.decode());let o=s.reduce((t,r)=>t+r.length,0),B=new Uint8Array(o),l=0;for(let t of s)B.set(t,l),l+=t.length;r._ogBody=B}catch(t){console.error("Problem reading body",t)}}else if("function"==typeof r.body.keys){let t=r.body;for(let s of(r._ogBody=r.body,new Set([...t.keys()]))){let r=t.getAll(s);n.push(`${s}=${(await Promise.all(r.map(async t=>"string"==typeof t?t:await t.text()))).join(",")}`)}}else if("function"==typeof r.body.arrayBuffer){let t=r.body,s=await t.arrayBuffer();n.push(await t.text()),r._ogBody=new Blob([s],{type:t.type})}else"string"==typeof r.body&&(n.push(r.body),r._ogBody=r.body)}let o="function"==typeof(r.headers||{}).keys?Object.fromEntries(r.headers):Object.assign({},r.headers);"traceparent"in o&&delete o.traceparent;let B=JSON.stringify([s,this.fetchCacheKeyPrefix||"",t,r.method,o,r.mode,r.redirect,r.credentials,r.referrer,r.referrerPolicy,r.integrity,r.cache,n]);return __webpack_require__("crypto").createHash("sha256").update(B).digest("hex")}async get(t,r){var s,n;let a,i;if(this.hasDynamicIO&&r.kind===l.FETCH){let r=af.getStore(),s=r?(0,G.getRenderResumeDataCache)(r):null;if(s){let r=s.fetch.get(t);if((null==r?void 0:r.kind)===B.FETCH)return{isStale:!1,value:r,revalidateAfter:!1,isFallback:!1}}}if(this.disableForTestmode||this.dev&&(r.kind!==l.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;let{isFallback:o}=r;t=this._getPathname(t,r.kind===l.FETCH);let u=null,c=r.revalidate,d=await (null==(s=this.cacheHandler)?void 0:s.get(t,r));if((null==d?void 0:null==(n=d.value)?void 0:n.kind)===B.FETCH){if([...r.tags||[],...r.softTags||[]].some(t=>{var r;return null==(r=this.revalidatedTags)?void 0:r.includes(t)}))return null;c=c||d.value.revalidate;let t=(performance.timeOrigin+performance.now()-(d.lastModified||0))/1e3>c,s=d.value.data;return{isStale:t,value:{kind:B.FETCH,data:s,revalidate:c},revalidateAfter:performance.timeOrigin+performance.now()+1e3*c,isFallback:o}}let p=this.revalidateTimings.get(nB(t));return(null==d?void 0:d.lastModified)===-1?(a=-1,i=-1*e8.qF):a=!!(!1!==(i=this.calculateRevalidate(t,(null==d?void 0:d.lastModified)||performance.timeOrigin+performance.now(),!!this.dev&&r.kind!==l.FETCH,r.isFallback))&&i<performance.timeOrigin+performance.now())||void 0,d&&(u={isStale:a,curRevalidate:p,revalidateAfter:i,value:d.value,isFallback:o}),!d&&this.prerenderManifest.notFoundRoutes.includes(t)&&(u={isStale:a,value:null,curRevalidate:p,revalidateAfter:i,isFallback:o},this.set(t,u.value,r)),u}async set(t,r,s){if(this.hasDynamicIO&&(null==r?void 0:r.kind)===B.FETCH){let s=af.getStore(),n=s?(0,G.getPrerenderResumeDataCache)(s):null;n&&n.fetch.set(t,r)}if(this.disableForTestmode||this.dev&&!s.fetchCache)return;t=this._getPathname(t,s.fetchCache);let n=JSON.stringify(r).length;if(s.fetchCache&&!this.hasCustomCacheHandler&&n>2097152){if(this.dev)throw Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${n} bytes)`);return}try{var a;void 0===s.revalidate||s.fetchCache||this.revalidateTimings.set(nB(t),s.revalidate),await (null==(a=this.cacheHandler)?void 0:a.set(t,r,s))}catch(r){console.warn("Failed to update prerender cache for",t,r)}}}let ah=require("http"),ay=require("https");function ag(t){if(!globalThis.__NEXT_HTTP_AGENT){if(!t)throw Error("Expected config.httpAgentOptions to be an object");globalThis.__NEXT_HTTP_AGENT_OPTIONS=t.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new ah.Agent(t.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new ay.Agent(t.httpAgentOptions)}}function ab(t){return t.definition.kind===u.PAGES_API}let aD={existsSync:b().existsSync,readFile:b().promises.readFile,readFileSync:b().readFileSync,writeFile:(t,r)=>b().promises.writeFile(t,r),mkdir:t=>b().promises.mkdir(t,{recursive:!0}),stat:t=>b().promises.stat(t)};class ax extends n8().Readable{constructor({url:t,headers:r,method:s,socket:n=null,readable:a}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(t,r)=>{if("encrypted"!==r&&"remoteAddress"!==r)throw Error("Method not implemented");if("remoteAddress"!==r)return!1}}),this.url=t,this.headers=r,this.method=s,a&&(this.bodyReadable=a,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let t={};for(let[r,s]of Object.entries(this.headers))s&&(t[r]=Array.isArray(s)?s:[s]);return t}_read(t){if(this.bodyReadable)return this.bodyReadable._read(t);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Error("Method not implemented")}get complete(){throw Error("Method not implemented")}get trailers(){throw Error("Method not implemented")}get trailersDistinct(){throw Error("Method not implemented")}get rawTrailers(){throw Error("Method not implemented")}get rawHeaders(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}}class av extends n8().Writable{constructor(t={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=t.statusCode??200,this.socket=t.socket??null,this.headers=t.headers?t8(t.headers):new Headers,this.headPromise=new Promise(t=>{this.headPromiseResolve=t}),this.hasStreamed=new Promise((t,r)=>{this.on("finish",()=>t(!0)),this.on("end",()=>t(!0)),this.on("error",t=>r(t))}).then(t=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),t)),t.resWriter&&(this.resWriter=t.resWriter)}appendHeader(t,r){for(let s of Array.isArray(r)?r:[r])this.headers.append(t,s);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(t){return this.resWriter?this.resWriter(t):(this.buffers.push(Buffer.isBuffer(t)?t:Buffer.from(t)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(t,r,s){this.write(t),s()}writeHead(t,r,s){if(s||"string"==typeof r?"string"==typeof r&&r.length>0&&(this.statusMessage=r):s=r,s){if(Array.isArray(s))for(let t=0;t<s.length;t+=2)this.setHeader(s[t],s[t+1]);else for(let[t,r]of Object.entries(s))void 0!==r&&this.setHeader(t,r)}return this.statusCode=t,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(t){return this.headers.has(t)}getHeader(t){return this.headers.get(t)??void 0}getHeaders(){return rt(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(t,r){if(Array.isArray(r))for(let s of(this.headers.delete(t),r))this.headers.append(t,s);else"number"==typeof r?this.headers.set(t,r.toString()):this.headers.set(t,r);return this}removeHeader(t){this.headers.delete(t)}flushHeaders(){}get strictContentLength(){throw Error("Method not implemented.")}writeEarlyHints(){throw Error("Method not implemented.")}get req(){throw Error("Method not implemented.")}assignSocket(){throw Error("Method not implemented.")}detachSocket(){throw Error("Method not implemented.")}writeContinue(){throw Error("Method not implemented.")}writeProcessing(){throw Error("Method not implemented.")}get upgrading(){throw Error("Method not implemented.")}get chunkedEncoding(){throw Error("Method not implemented.")}get shouldKeepAlive(){throw Error("Method not implemented.")}get useChunkedEncodingByDefault(){throw Error("Method not implemented.")}get sendDate(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}addTrailers(){throw Error("Method not implemented.")}setHeaders(){throw Error("Method not implemented.")}}function aE({url:t,headers:r={},method:s="GET",bodyReadable:n,resWriter:a,socket:i=null}){return{req:new ax({url:t,headers:r,method:s,socket:i,readable:n}),res:new av({socket:i,resWriter:a})}}class aj{async load(t){return await require(t)}}class aA{static async load(t,r=new aj){let s=await r.load(t);if("routeModule"in s)return s.routeModule;throw Error(`Module "${t}" does not export a routeModule.`)}}let aS=(t,r)=>{let s=m().isAbsolute(r)?r:m().join(t,r);return(0,h.pathToFileURL)(s).toString()};function aP(t){var r,s;return(null==(s=t.has)?void 0:null==(r=s[0])?void 0:r.key)===ti}let a_=t=>import(t).then(t=>t.default||t),aw=require,aI=new WeakMap;function aO(t){let r=aI.get(t);if(r)return r;if(!Array.isArray(t.matchers))throw Error(`Invariant: invalid matchers for middleware ${JSON.stringify(t)}`);let s=n6(t.matchers);return aI.set(t,s),s}class aT extends nk{constructor(t){super(t),this.registeredInstrumentation=!1,this.handleNextImageRequest=async(t,r,s)=>!!(s.pathname&&s.pathname.startsWith("/_next/image"))&&(r.statusCode=400,r.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(t,r,s)=>{let{pathname:n,query:a}=s;if(!n)throw Error("Invariant: pathname is undefined");a._nextBubbleNoFallback="1";try{var i;n=tH(n);let o={i18n:null==(i=this.i18nProvider)?void 0:i.fromQuery(n,a)},B=await this.matchers.match(n,o);if(!B)return await this.render(t,r,n,a,s,!0),!0;for(let n of(e_(t,"match",B),this.getEdgeFunctionsPages()))if(n===B.definition.page){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;delete a._nextBubbleNoFallback,delete a[tl];try{if(await this.runEdgeFunction({req:t,res:r,query:a,params:B.params,page:B.definition.page,match:B,appPaths:null}))return!0}catch(r){throw await this.instrumentationOnRequestError(r,t,{routePath:B.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),r}}if(ab(B)){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;if(delete a._nextBubbleNoFallback,await this.handleApiRequest(t,r,a,B))return!0}return await this.render(t,r,n,a,s,!0),!0}catch(s){if(s instanceof nN)throw s;try{return this.logError(s),r.statusCode=500,await this.renderError(s,t,r,n,a),!0}catch{}throw s}},this.handleCatchallMiddlewareRequest=async(t,r,s)=>{let n;let a=eS(t,"middlewareInvoke");if(!a)return!1;let i=()=>(e_(t,"middlewareInvoke",!0),r.body("").send(),!0),o=this.getMiddleware();if(!o)return i();let B=tm(eS(t,"initURL")),l=rC(B.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});B.pathname=l.pathname;let u=tH(s.pathname||"");if(!o.match(u,t,B.query))return i();let c=!1;try{if(await this.ensureMiddleware(t.url),n=await this.runMiddleware({request:t,response:r,parsedUrl:B,parsed:s}),"response"in n){if(a)throw c=!0,new t1.BubbledError(!0,n);for(let[t,s]of Object.entries(rt(n.response.headers)))"content-encoding"!==t&&void 0!==s&&r.setHeader(t,s);r.statusCode=n.response.status;let{originalResponse:t}=r;return n.response.body?await rL(n.response.body,t):t.end(),!0}}catch(a){if(c)throw a;if(su(a)&&"ENOENT"===a.code)return await this.render404(t,r,s),!0;if(a instanceof eD)return r.statusCode=400,await this.renderError(a,t,r,s.pathname||""),!0;let n=sd(a);return console.error(n),r.statusCode=500,await this.renderError(n,t,r,s.pathname||""),!0}return n.finished},this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"";let{appDocumentPreloading:r}=this.nextConfig.experimental,s=void 0===r;if(t.dev||!0!==r&&s||(n4({distDir:this.distDir,page:"/_document",isAppPath:!1}).catch(()=>{}),n4({distDir:this.distDir,page:"/_app",isAppPath:!1}).catch(()=>{})),t.dev,!t.dev){let{dynamicRoutes:t=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=t.map(t=>{let r=tU(t.page);return{match:ej(r),page:t.page,re:r.re}})}ag(this.nextConfig),this.middlewareManifestPath=(0,f.join)(this.serverDistDir,eG),t.dev||this.prepare().catch(t=>{console.error("Failed to prepare server",t)})}async unstable_preloadEntries(){let t=this.getAppPathsManifest();for(let t of Object.keys(this.getPagesManifest()||{}))await n4({distDir:this.distDir,page:t,isAppPath:!1}).catch(()=>{});for(let r of Object.keys(t||{}))await n4({distDir:this.distDir,page:r,isAppPath:!0}).then(async({ComponentMod:t})=>{t.patchFetch();let r=t.__next_app__.require;if(null==r?void 0:r.m)for(let t of Object.keys(r.m))await r(t)}).catch(()=>{})}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await aw((0,f.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e8.Hw))}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw Error("An error occurred while loading the instrumentation hook",{cause:t})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){var t,r;this.registeredInstrumentation||(this.registeredInstrumentation=!0,await (null==(r=this.instrumentation)?void 0:null==(t=r.register)?void 0:t.call(r)))}loadEnvConfig({dev:t,forceReload:r,silent:s}){(0,n7.loadEnvConfig)(this.dir,t,s?{info:()=>{},error:()=>{}}:p,r)}async getIncrementalCache({requestHeaders:t,requestProtocol:r}){let s;let n=!1,{cacheHandler:a}=this.nextConfig;a&&(s=nq(await a_(aS(this.distDir,a))));let{cacheHandlers:i}=this.nextConfig.experimental;if(!globalThis.__nextCacheHandlers&&i)for(let t of(globalThis.__nextCacheHandlers={},Object.keys(i)))i[t]&&(globalThis.__nextCacheHandlers[t]=nq(await a_(aS(this.distDir,i[t]))));return new am({fs:this.getCacheFilesystem(),dev:n,requestHeaders:t,requestProtocol:r,dynamicIO:!!this.nextConfig.experimental.dynamicIO,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCache:!0,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:s})}getResponseCache(){return new rJ(!0)}getPublicDir(){return(0,f.join)(this.dir,eW)}getHasStaticDir(){return b().existsSync((0,f.join)(this.dir,"static"))}getPagesManifest(){return nG((0,f.join)(this.serverDistDir,eF))}getAppPathsManifest(){if(this.enabledDirectories.app)return nG((0,f.join)(this.serverDistDir,ek))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let t=this.getRoutesManifest();return(null==t?void 0:t.rewrites.beforeFiles.filter(aP).map(t=>new RegExp(t.regex)))??[]}async hasPage(t){var r;return!!nQ(t,this.distDir,null==(r=this.nextConfig.i18n)?void 0:r.locales,this.enabledDirectories.app)}getBuildId(){let t=(0,f.join)(this.distDir,eU);try{return b().readFileSync(t,"utf8").trim()}catch(t){if("ENOENT"===t.code)throw Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);throw t}}getEnabledDirectories(t){let r=t?this.dir:this.serverDistDir;return{app:!!ez(r,"app"),pages:!!ez(r,"pages")}}sendRenderResult(t,r,s){return tp({req:t.originalRequest,res:r.originalResponse,result:s.result,type:s.type,generateEtags:s.generateEtags,poweredByHeader:s.poweredByHeader,revalidate:s.revalidate,expireTime:s.expireTime})}async runApi(t,r,s,n){for(let a of this.getEdgeFunctionsPages())if(a===n.definition.pathname&&await this.runEdgeFunction({req:t,res:r,query:s,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let a=await aA.load(n.definition.filename);return s={...s,...n.params},delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextInferredLocaleFromDefault,await a.render(t.originalRequest,r.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:s,params:n.params,page:n.definition.pathname,onError:this.instrumentationOnRequestError.bind(this),multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode}),!0}async renderHTML(t,r,s,n,a){return(0,t1.getTracer)().trace(t0.Fx.renderHTML,async()=>this.renderHTMLImpl(t,r,s,n,a))}async renderHTMLImpl(t,r,s,n,a){throw Error("Invariant: renderHTML should not be called in minimal mode")}async imageOptimizer(t,r,s,n){throw Error("invariant: imageOptimizer should not be called in minimal mode")}getPagePath(t,r){return nW(t,this.distDir,r,this.enabledDirectories.app)}async renderPageComponent(t,r){let s=this.getEdgeFunctionsPages()||[];if(s.length){let r=this.getOriginalAppPaths(t.pathname),n=Array.isArray(r),a=t.pathname;for(let i of(n&&(a=r[0]),s))if(i===a)return await this.runEdgeFunction({req:t.req,res:t.res,query:t.query,params:t.renderOpts.params,page:a,appPaths:r}),null}return super.renderPageComponent(t,r)}async findPageComponents({page:t,query:r,params:s,isAppPath:n,url:a}){return(0,t1.getTracer)().trace(t0.Fx.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":n?tO(t):t}},()=>this.findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}))}async findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}){let i=[t];for(let a of(r.amp&&i.unshift((n?tO(t):sE(t))+".amp"),r.__nextLocale&&i.unshift(...i.map(t=>`/${r.__nextLocale}${"/"===t?"":t}`)),i))try{let t=await n4({distDir:this.distDir,page:a,isAppPath:n});if(r.__nextLocale&&"string"==typeof t.Component&&!a.startsWith(`/${r.__nextLocale}`))continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp,__nextDataReq:r.__nextDataReq,__nextLocale:r.__nextLocale,__nextDefaultLocale:r.__nextDefaultLocale}:r,...(n?{}:s)||{}}}}catch(t){if(!(t instanceof ev))throw t}return null}getNextFontManifest(){return nG((0,f.join)(this.distDir,"server",eL+".json"))}async logErrorWithOriginalStack(t,r){throw Error("Invariant: logErrorWithOriginalStack can only be called on the development server")}async ensurePage(t){throw Error("Invariant: ensurePage can only be called on the development server")}async handleApiRequest(t,r,s,n){return this.runApi(t,r,s,n)}getCacheFilesystem(){return aD}normalizeReq(t){return t instanceof e3?t:new e3(t)}normalizeRes(t){return t instanceof e5?t:new e5(t)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(t=>{console.error("Failed to prepare server",t)});let t=super.getRequestHandler();return(r,s,n)=>t(this.normalizeReq(r),this.normalizeRes(s),n)}async revalidate({urlPath:t,revalidateHeaders:r,opts:s}){let n=aE({url:t,headers:r}),a=this.getRequestHandler();if(await a(new e3(n.req),new e5(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&!(404===n.res.statusCode&&s.unstable_onlyGenerated))throw Error(`Invalid response ${n.res.statusCode}`)}async render(t,r,s,n,a,i=!1){return super.render(this.normalizeReq(t),this.normalizeRes(r),s,n,a,i)}async renderToHTML(t,r,s,n){return super.renderToHTML(this.normalizeReq(t),this.normalizeRes(r),s,n)}async renderErrorToResponseImpl(t,r){let{req:s,res:n,query:a}=t;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eT)?(await this.runEdgeFunction({req:s,res:n,query:a||{},params:{},page:eT,appPaths:null}),null):super.renderErrorToResponseImpl(t,r)}async renderError(t,r,s,n,a,i){return super.renderError(t,this.normalizeReq(r),this.normalizeRes(s),n,a,i)}async renderErrorToHTML(t,r,s,n,a){return super.renderErrorToHTML(t,this.normalizeReq(r),this.normalizeRes(s),n,a)}async render404(t,r,s,n){return super.render404(this.normalizeReq(t),this.normalizeRes(r),s,n)}getMiddlewareManifest(){return null}getMiddleware(){var t;let r=this.getMiddlewareManifest(),s=null==r?void 0:null==(t=r.middleware)?void 0:t["/"];if(s)return{match:aO(s),page:"/"}}getEdgeFunctionsPages(){let t=this.getMiddlewareManifest();return t?Object.keys(t.functions):[]}getEdgeFunctionInfo(t){let r;let s=this.getMiddlewareManifest();if(!s)return null;try{r=r4(sE(t.page))}catch(t){return null}let n=t.middleware?s.middleware[r]:s.functions[r];if(!n){if(!t.middleware)throw new ev(r);return null}return{name:n.name,paths:n.files.map(t=>(0,f.join)(this.distDir,t)),wasm:(n.wasm??[]).map(t=>({...t,filePath:(0,f.join)(this.distDir,t.filePath)})),assets:n.assets&&n.assets.map(t=>({...t,filePath:(0,f.join)(this.distDir,t.filePath)})),env:n.env}}async hasMiddleware(t){let r=this.getEdgeFunctionInfo({page:t,middleware:!0});return!!(r&&r.paths.length>0)}async ensureMiddleware(t){}async ensureEdgeFunction(t){}async runMiddleware(t){throw Error("invariant: runMiddleware should not be called in minimal mode")}getPrerenderManifest(){var t,r;return this._cachedPreviewManifest||((t=this.renderOpts,(null==(r=this.serverOptions)?void 0:r.dev)||process.env.NEXT_PHASE===eN)?this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:__webpack_require__("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:__webpack_require__("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:__webpack_require__("crypto").randomBytes(32).toString("hex")}}:this._cachedPreviewManifest=nG((0,f.join)(this.distDir,eR))),this._cachedPreviewManifest}getRoutesManifest(){return(0,t1.getTracer)().trace(t0.Fx.getRoutesManifest,()=>{let t=nG((0,f.join)(this.distDir,eH)),r=t.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(r)&&(r={beforeFiles:[],afterFiles:r,fallback:[]}),{...t,rewrites:r}})}attachRequestMeta(t,r,s){var n;let a=(null==(n=t.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",i=this.fetchHostname&&this.port?`${a}://${this.fetchHostname}:${this.port}${t.url}`:this.nextConfig.experimental.trustHostHeader?`https://${t.headers.host||"localhost"}${t.url}`:t.url;e_(t,"initURL",i),e_(t,"initQuery",{...r.query}),e_(t,"initProtocol",a),s||e_(t,"clonableBody",at(t.originalRequest))}async runEdgeFunction(t){throw Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.")}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let t=(0,f.join)(this.distDir,eJ);return this._serverDistDir=t,t}async getFallbackErrorComponents(t){return null}async instrumentationOnRequestError(...t){await super.instrumentationOnRequestError(...t),this.logError(t[0])}}})(),module.exports=__webpack_exports__})();
|
|
2872
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);if(null==t?void 0:t.stack){let s=t.stack;r.stack=r.message+s.substring(s.indexOf("\n"))}throw r}return"isNotFound"in y&&y.isNotFound?{value:null,revalidate:y.revalidate,isFallback:!1}:y.isRedirect?{value:{kind:B.REDIRECT,props:y.pageData??y.flightData},revalidate:y.revalidate,isFallback:!1}:u.isNull?null:P?{value:{kind:B.APP_PAGE,html:u,headers:g,rscData:y.flightData,postponed:y.postponed,status:r.statusCode,segmentData:void 0},revalidate:y.revalidate,isFallback:!!l}:{value:{kind:B.PAGES,html:u,pageData:y.pageData??y.flightData,headers:g,status:P?r.statusCode:void 0},revalidate:y.revalidate,isFallback:"true"===i.__nextFallback}},el=async({hasResolved:o,previousCacheEntry:l,isRevalidating:u})=>{if(o||r.sent,!D&&M){if(w){let r=await this.getStaticPaths({pathname:s,requestHeaders:t.headers,isAppPath:P,page:a.page});D=r.staticPaths,x=r.fallbackMode}else D=void 0,x=d.NOT_FOUND}x===d.PRERENDER&&r3(t.headers["user-agent"]||"")&&(x=d.BLOCKING_STATIC_RENDER),(null==l?void 0:l.isStale)===-1&&(er=!0),er&&(x!==d.NOT_FOUND||l)&&(x=d.BLOCKING_STATIC_RENDER);let c=ea;!c&&n.dev&&P&&(c=s6(F)),c&&i.amp&&(c=c.replace(/\.amp$/,"")),c&&(null==D||D.includes(c)),this.nextConfig.experimental.isExperimentalCompile&&(x=d.BLOCKING_STATIC_RENDER);let p=er||u||!Y?void 0:Y;if((W||V)&&void 0!==p)return{revalidate:1,isFallback:!1,value:{kind:B.PAGES,html:rR.fromStatic(""),pageData:{},headers:void 0,status:void 0}};let C=M&&Q&&(eS(t,"didSetDefaultRouteMatches")||q)?tX(s):null,f=await eB({postponed:p,fallbackRouteParams:C});return f?{...f,revalidate:f.revalidate}:null},eu=await this.responseCache.get(ea,el,{routeKind:(null==v?void 0:v.definition.kind)??(P?u.APP_PAGE:u.PAGES),incrementalCache:eo,isOnDemandRevalidate:er,isPrefetch:"prefetch"===t.headers.purpose,isRoutePPREnabled:Q});if(Q&&H&&"string"==typeof z){if((null==eu?void 0:null==(m=eu.value)?void 0:m.kind)!==B.APP_PAGE)return r.statusCode=404,{type:"rsc",body:rR.fromStatic("")};if(eu.value.segmentData){let t=eu.value.segmentData[z];if(void 0!==t)return{type:"rsc",body:rR.fromStatic(t),revalidate:eu.revalidate}}return r.statusCode=404,{type:"rsc",body:rR.fromStatic(""),revalidate:eu.revalidate}}if(et&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),!eu){if(ea&&!(er&&es))throw Error("invariant: cache entry required but not generated");return null}let ec=(null==(C=eu.value)?void 0:C.kind)===B.APP_PAGE&&"string"==typeof eu.value.postponed;T&&!X&&(!ec||H)&&r.setHeader(tc,"1");let{value:ed}=eu;if((null==ed?void 0:ed.kind)===B.IMAGE)throw Error("invariant SSG should not return an image cache value");if(Y)E=0;else if(G&&!H&&Q)E=0;else if(1){if(et)E=0;else if(T){if(A){let r=eS(t,"notFoundRevalidate");E=void 0===r?0:r}else if(S)E=0;else if("number"==typeof eu.revalidate){if(eu.revalidate<1)throw Error(`Invalid revalidate configuration provided: ${eu.revalidate} < 1`);E=eu.revalidate}else!1===eu.revalidate&&(E=e8.qF)}else r.getHeader("Cache-Control")||(E=0)}eu.revalidate=E;let ep=eS(t,"onCacheEntry");if(ep&&await ep({...eu,value:{...eu.value,kind:(null==(y=eu.value)?void 0:y.kind)===B.APP_PAGE?"PAGE":null==(g=eu.value)?void 0:g.kind}},{url:eS(t,"initURL")}))return null;if(ed){if(ed.kind===B.REDIRECT)return(void 0===eu.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",te({revalidate:eu.revalidate,expireTime:this.nextConfig.expireTime})),R)?{type:"json",body:rR.fromStatic(JSON.stringify(ed.props)),revalidate:eu.revalidate}:(await en(ed.props),null);if(ed.kind===B.APP_ROUTE){let s=t8(ed.headers);return T||s.delete(e8.VC),void 0===eu.revalidate||r.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",te({revalidate:eu.revalidate,expireTime:this.nextConfig.expireTime})),await s0(t,r,new Response(ed.body,{headers:s,status:ed.status||200})),null}if(ed.kind===B.APP_PAGE){if(ec&&Y)throw Error("Invariant: postponed state should not be present on a resume request");if(ed.headers){let t={...ed.headers};for(let[s,n]of(T||delete t[e8.VC],Object.entries(t)))if(void 0!==n){if(Array.isArray(n))for(let t of n)r.appendHeader(s,t);else"number"==typeof n&&(n=n.toString()),r.appendHeader(s,n)}}if(T&&(null==(b=ed.headers)?void 0:b[e8.VC])&&r.setHeader(e8.VC,ed.headers[e8.VC]),!ed.status||G&&Q||(r.statusCode=ed.status),ec&&r.setHeader(tu,"1"),G&&!et){if(void 0===ed.rscData){if(ed.postponed)throw Error("Invariant: Expected postponed to be undefined");return{type:"rsc",body:ed.html,revalidate:X?0:eu.revalidate}}return{type:"rsc",body:rR.fromStatic(ed.rscData),revalidate:eu.revalidate}}return{type:"html",body:ed.html,revalidate:eu.revalidate}}return R?{type:"json",body:rR.fromStatic(JSON.stringify(ed.pageData)),revalidate:eu.revalidate}:{type:"html",body:ed.html,revalidate:eu.revalidate}}return(e_(t,"notFoundRevalidate",eu.revalidate),void 0===eu.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",te({revalidate:eu.revalidate,expireTime:this.nextConfig.expireTime})),R)?(r.statusCode=404,r.body('{"notFound":true}').send()):await this.render404(t,r,{pathname:s,query:i},!1),null}stripNextDataPath(t,r=!0){return(t.includes(this.buildId)&&(t=r4(t.substring(t.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&r)?this.localeNormalizer.normalize(t):t}getOriginalAppPaths(t){if(this.enabledDirectories.app){var r;return(null==(r=this.appPathRoutes)?void 0:r[t])||null}return null}async renderPageComponent(t,r){var s;let{query:n,pathname:a}=t,i=this.getOriginalAppPaths(a),o=Array.isArray(i),B=a;o&&(B=i[i.length-1]);let l=await this.findPageComponents({page:B,query:n,params:t.renderOpts.params||{},isAppPath:o,sriEnabled:!!(null==(s=this.nextConfig.experimental.sri)?void 0:s.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,t1.getTracer)().setRootSpanAttribute("next.route",a);try{return await this.renderToResponseWithComponents(t,l)}catch(s){let t=s instanceof nN;if(!t||t&&r)throw s}}return!1}async renderToResponse(t){return(0,t1.getTracer)().trace(t0.Li.renderToResponse,{spanName:"rendering page",attributes:{"next.route":t.pathname}},async()=>this.renderToResponseImpl(t))}async renderToResponseImpl(t){var r;let{res:s,query:n,pathname:a}=t,i=a,o=!!n._nextBubbleNoFallback;delete n[tl],delete n._nextBubbleNoFallback;let B={i18n:null==(r=this.i18nProvider)?void 0:r.fromQuery(a,n)};try{for await(let r of this.matchers.matchAll(a,B)){eS(t.req,"invokeOutput");let s=await this.renderPageComponent({...t,pathname:r.definition.pathname,renderOpts:{...t.renderOpts,params:r.params}},o);if(!1!==s)return s}if(this.serverOptions.webServerConfig){t.pathname=this.serverOptions.webServerConfig.page;let r=await this.renderPageComponent(t,o);if(!1!==r)return r}}catch(a){let r=sd(a);if(a instanceof eE)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:t.req.url,matchedPath:t.req.headers[e8.vx],initUrl:eS(t.req,"initURL"),didRewrite:!!eS(t.req,"rewroteURL"),rewroteUrl:eS(t.req,"rewroteURL")},null,2)),r;if(r instanceof nN&&o)throw r;if(r instanceof eD||r instanceof ex)return s.statusCode=400,await this.renderErrorToResponse(t,r);s.statusCode=500,await this.hasPage("/500")&&(t.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(t,r),delete t.query.__nextCustomErrorRender);let n=r instanceof nF;if(!n)throw su(r)&&(r.page=i),r;return await this.renderErrorToResponse(t,n?r.innerError:r)}return this.getMiddleware()&&t.req.headers["x-nextjs-data"]&&(!s.statusCode||200===s.statusCode||404===s.statusCode)?(s.setHeader("x-nextjs-matched-path",`${n.__nextLocale?`/${n.__nextLocale}`:""}${a}`),s.statusCode=200,s.setHeader("content-type","application/json"),s.body("{}"),s.send(),null):(s.statusCode=404,this.renderErrorToResponse(t,null))}async renderToHTML(t,r,s,n={}){return(0,t1.getTracer)().trace(t0.Li.renderToHTML,async()=>this.renderToHTMLImpl(t,r,s,n))}async renderToHTMLImpl(t,r,s,n={}){return this.getStaticHTML(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async renderError(t,r,s,n,a={},i=!0){return(0,t1.getTracer)().trace(t0.Li.renderError,async()=>this.renderErrorImpl(t,r,s,n,a,i))}async renderErrorImpl(t,r,s,n,a={},i=!0){return i&&s.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async r=>{let n=await this.renderErrorToResponse(r,t);if(500===s.statusCode)throw t;return n},{req:r,res:s,pathname:n,query:a})}async renderErrorToResponse(t,r){return(0,t1.getTracer)().trace(t0.Li.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(t,r))}async renderErrorToResponseImpl(t,r){let{res:s,query:n}=t;try{let a=null,i=404===s.statusCode,o=!1;i&&(this.enabledDirectories.app&&(a=await this.findPageComponents({page:eT,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:t.req.url}),o=null!==a),!a&&await this.hasPage("/404")&&(a=await this.findPageComponents({page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),o=null!==a));let B=`/${s.statusCode}`;if(!t.query.__nextCustomErrorRender&&!a&&eX.includes(B)&&(a=await this.findPageComponents({page:B,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url})),a||(a=await this.findPageComponents({page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),B="/_error"),!a)throw new nF(Error("missing required error components"));a.components.routeModule?e_(t.req,"match",{definition:a.components.routeModule.definition,params:void 0}):ew(t.req,"match");try{return await this.renderToResponseWithComponents({...t,pathname:B,renderOpts:{...t.renderOpts,err:r}},a)}catch(t){if(t instanceof nN)throw Error("invariant: failed to render error page");throw t}}catch(o){let r=sd(o),a=r instanceof nF;a||this.logError(r),s.statusCode=500;let i=await this.getFallbackErrorComponents(t.req.url);if(i)return e_(t.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...t,pathname:"/_error",renderOpts:{...t.renderOpts,err:a?r.innerError:r}},{query:n,components:i});return{type:"html",body:rR.fromStatic("Internal Server Error")}}}async renderErrorToHTML(t,r,s,n,a={}){return this.getStaticHTML(r=>this.renderErrorToResponse(r,t),{req:r,res:s,pathname:n,query:a})}async render404(t,r,s,n=!0){let{pathname:a,query:i}=s||(0,h.parse)(t.url,!0);return this.nextConfig.i18n&&(i.__nextLocale||=this.nextConfig.i18n.defaultLocale,i.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),r.statusCode=404,this.renderError(null,t,r,a,i,n)}}class nM{constructor(t,r){this.cache=new Map,this.sizes=new Map,this.totalSize=0,this.maxSize=t,this.calculateSize=r||(()=>1)}set(t,r){if(!t||!r)return;let s=this.calculateSize(r);if(s>this.maxSize){console.warn("Single item size exceeds maxSize");return}this.cache.has(t)&&(this.totalSize-=this.sizes.get(t)||0),this.cache.set(t,r),this.sizes.set(t,s),this.totalSize+=s,this.touch(t)}has(t){return!!t&&(this.touch(t),!!this.cache.get(t))}get(t){if(!t)return;let r=this.cache.get(t);if(void 0!==r)return this.touch(t),r}touch(t){let r=this.cache.get(t);void 0!==r&&(this.cache.delete(t),this.cache.set(t,r),this.evictIfNecessary())}evictIfNecessary(){for(;this.totalSize>this.maxSize&&this.cache.size>0;)this.evictLeastRecentlyUsed()}evictLeastRecentlyUsed(){let t=this.cache.keys().next().value;if(void 0!==t){let r=this.sizes.get(t)||0;this.totalSize-=r,this.cache.delete(t),this.sizes.delete(t)}}reset(){this.cache.clear(),this.sizes.clear(),this.totalSize=0}keys(){return[...this.cache.keys()]}remove(t){this.cache.has(t)&&(this.totalSize-=this.sizes.get(t)||0,this.cache.delete(t),this.sizes.delete(t))}clear(){this.cache.clear(),this.sizes.clear(),this.totalSize=0}get size(){return this.cache.size}get currentSize(){return this.totalSize}}let nL=require("vm");function nR(t){if(Object.isFrozen(t))return t;if(Array.isArray(t)){for(let r of t)r&&"object"==typeof r&&nR(r);return Object.freeze(t)}for(let r of Object.values(t))r&&"object"==typeof r&&nR(r);return Object.freeze(t)}let nH=new Map;function nG(t,r=!0,s=nH){let n=r&&s.get(t);if(n)return n;let a=JSON.parse((0,g.readFileSync)(t,"utf8"));return r&&(a=nR(a)),r&&s.set(t,a),a}function nK(t,r=!0,s=nH){let n=r&&s.get(t);if(n)return n;let a=(0,g.readFileSync)(t,"utf8");if(0===a.length)throw Error("Manifest file is empty");let i={};return(0,nL.runInNewContext)(a,i),r&&(i=nR(i)),r&&s.set(t,i),i}let nJ=!1,nU=new nM(1e3);function nQ(t,r,s,n){let a;let i=`${t}:${r}:${s}:${n}`,o=null==nU?void 0:nU.get(i);if(o)return o;let B=m().join(r,eJ);n&&(a=nG(m().join(B,ek),!nJ));let l=nG(m().join(B,eF),!nJ);try{t=r4(sE(t))}catch(r){throw console.error(r),new ev(t)}let u=r=>{let n=r[t];if(!r[n]&&s){let a={};for(let t of Object.keys(r))a[rd(t,s).pathname]=l[t];n=a[t]}return n};return(a&&(o=u(a)),o||(o=u(l)),o)?(o=m().join(B,o),null==nU||nU.set(i,o),o):(null==nU||nU.set(i,null),null)}function nW(t,r,s,n){let a=nQ(t,r,s,n);if(!a)throw new ev(t);return a}async function nV(t,r,s){let n=nW(t,r,void 0,s);if(n.endsWith(".html"))return g.promises.readFile(n,"utf8").catch(r=>{throw new eE(t,r.message)});try{return process.env.__NEXT_PRIVATE_RUNTIME_TYPE=s?"app":"pages",require(n)}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function nq(t){return t.default||t}async function nY(t){return new Promise(r=>setTimeout(r,t))}let nX=Symbol.for("next.server.action-manifests");function nz({page:t,clientReferenceManifest:r,serverActionsManifest:s,serverModuleMap:n}){var a;let i=null==(a=globalThis[nX])?void 0:a.clientReferenceManifestsPerPage;globalThis[nX]={clientReferenceManifestsPerPage:{...i,[nZ(t)]:r},serverActionsManifest:s,serverModuleMap:n}}function nZ(t){return t.replace(/\/(page|route)$/,"")}function n$({serverActionsManifest:t}){return new Proxy({},{get:(r,s)=>{let n;let a=t.node[s].workers,i=Y.workAsyncStorage.getStore();if(!(n=i?a[n1(i.page)]:Object.values(a).at(0)))return;let{moduleId:o,async:B}=n;return{id:o,name:s,chunks:[],async:B}}})}function n1(t){return rB(t,"app")?t:"app"+t}async function n0(t,r=3){for(;;)try{return nG(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n2(t,r=3){for(;;)try{return nK(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n3(t,r){try{return(await n2(t)).__RSC_MANIFEST[r]}catch(t){return}}async function n5({distDir:t,page:r,isAppPath:s}){let n={},a={};s||([n,a]=await Promise.all([nV("/_document",t,!1),nV("/_app",t,!1)]));let i=s&&!sI(r),[o,B,l,u]=await Promise.all([n0((0,f.join)(t,eM)),n0((0,f.join)(t,eK)),i?n3((0,f.join)(t,"server","app",r.replace(/%5F/g,"_")+"_"+eq+".js"),r.replace(/%5F/g,"_")):void 0,s?n0((0,f.join)(t,"server",eY+".json")).catch(()=>null):null]);u&&l&&nz({page:r,clientReferenceManifest:l,serverActionsManifest:u,serverModuleMap:n$({serverActionsManifest:u})});let c=await nV(r,t,s),d=nq(c),p=nq(n),C=nq(a),{getServerSideProps:m,getStaticProps:h,getStaticPaths:y,routeModule:g}=c;return{App:C,Document:p,Component:d,buildManifest:o,reactLoadableManifest:B,pageConfig:c.config||{},ComponentMod:c,getServerSideProps:m,getStaticProps:h,getStaticPaths:y,clientReferenceManifest:l,serverActionsManifest:u,isAppPath:s,page:r,routeModule:g}}let n4=(0,t1.getTracer)().wrap(t0.p2.loadComponents,n5);function n6(t){return(r,s,n)=>{for(let a of t)if(new RegExp(a.regexp).exec(r)&&(!a.has&&!a.missing||st(s,n,a.has,a.missing)))return!0;return!1}}var n7=__webpack_require__("../next-env/dist/index.js");let n9=require("stream");var n8=__webpack_require__.n(n9);function ae(t,r){for(let s in r){let n=r[s];"function"==typeof n&&(n=n.bind(t)),t[s]=n}return t}function at(t){let r=null,s=new Promise((r,s)=>{t.on("end",r),t.on("error",s)}).catch(t=>({error:t}));return{async finalize(){if(r){let n=await s;if(n&&"object"==typeof n&&n.error)throw n.error;ae(t,r),r=t}},cloneBodyStream(){let s=r??t,n=new n9.PassThrough,a=new n9.PassThrough;return s.on("data",t=>{n.push(t),a.push(t)}),s.on("end",()=>{n.push(null),a.push(null)}),r=a,n}}}let ar=0,as="x-vercel-cache-tags",an="x-vercel-sc-headers",aa="x-vercel-cache-state",ai="x-vercel-revalidate",ao="x-vercel-cache-item-name",aB="x-vercel-cache-control",al=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;async function au(t,r,s=0){let n=new AbortController,a=setTimeout(()=>{n.abort()},500);return fetch(t,{...r||{},signal:n.signal}).catch(n=>{if(3!==s)return al&&console.log(`Fetch failed for ${t} retry ${s}`),au(t,r,s+1);throw n}).finally(()=>{clearTimeout(a)})}class ac{hasMatchingTags(t,r){if(t.length!==r.length)return!1;let s=new Set(t),n=new Set(r);if(s.size!==n.size)return!1;for(let t of s)if(!n.has(t))return!1;return!0}static isAvailable(t){return!!(t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL)}constructor(t){if(this.headers={},this.headers["Content-Type"]="application/json",an in t._requestHeaders){let r=JSON.parse(t._requestHeaders[an]);for(let t in r)this.headers[t]=r[t];delete t._requestHeaders[an]}let s=t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL,n=t._requestHeaders["x-vercel-sc-basepath"]||process.env.SUSPENSE_CACHE_BASEPATH;if(process.env.SUSPENSE_CACHE_AUTH_TOKEN&&(this.headers.Authorization=`Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`),s){let t=process.env.SUSPENSE_CACHE_PROTO||"https";this.cacheEndpoint=`${t}://${s}${n||""}`,al&&console.log("using cache endpoint",this.cacheEndpoint)}else al&&console.log("no cache endpoint available");t.maxMemoryCacheSize?r||(al&&console.log("using memory store for fetch cache"),r=new nM(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===B.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===B.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===B.FETCH?JSON.stringify(t.data||"").length:t.kind===B.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===B.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):al&&console.log("not using memory store for fetch cache")}resetRequestCache(){null==r||r.reset()}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,al&&console.log("revalidateTag",r),r.length){if(Date.now()<ar){al&&console.log("rate limited ",ar);return}for(let t=0;t<Math.ceil(r.length/64);t++){let s=r.slice(64*t,64*t+64);try{let t=await au(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${s.map(t=>encodeURIComponent(t)).join(",")}`,{method:"POST",headers:this.headers,next:{internal:!0}});if(429===t.status){let r=t.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(r)}if(!t.ok)throw Error(`Request failed with status ${t.status}.`)}catch(t){console.warn("Failed to revalidate tag",s,t)}}}}async get(...t){var s;let[n,a]=t,{tags:i,softTags:o,kind:u,fetchIdx:c,fetchUrl:d}=a;if(u!==l.FETCH)return null;if(Date.now()<ar)return al&&console.log("rate limited"),null;let p=null==r?void 0:r.get(n),C=(null==p?void 0:null==(s=p.value)?void 0:s.kind)===B.FETCH&&this.hasMatchingTags(i??[],p.value.tags??[]);if(this.cacheEndpoint&&(!p||!C))try{let t=Date.now(),s={internal:!0,fetchType:"cache-get",fetchUrl:d,fetchIdx:c},a=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${n}`,{method:"GET",headers:{...this.headers,[ao]:d,[as]:(null==i?void 0:i.join(","))||"",[e8.cS]:(null==o?void 0:o.join(","))||""},next:s});if(429===a.status){let t=a.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(t)}if(404===a.status)return al&&console.log(`no fetch cache entry for ${n}, duration: ${Date.now()-t}ms`),null;if(!a.ok)throw console.error(await a.text()),Error(`invalid response from cache ${a.status}`);let l=await a.json();if(!l||l.kind!==B.FETCH)throw al&&console.log({cached:l}),Error("invalid cache value");if(l.kind===B.FETCH)for(let t of(l.tags??=[],i??[]))l.tags.includes(t)||l.tags.push(t);let u=a.headers.get(aa),C=a.headers.get("age");p={value:l,lastModified:"fresh"!==u?Date.now()-e8.qF:Date.now()-1e3*parseInt(C||"0",10)},al&&console.log(`got fetch cache entry for ${n}, duration: ${Date.now()-t}ms, size: ${Object.keys(l).length}, cache-state: ${u} tags: ${null==i?void 0:i.join(",")} softTags: ${null==o?void 0:o.join(",")}`),p&&(null==r||r.set(n,p))}catch(t){al&&console.error("Failed to get from fetch-cache",t)}return p||null}async set(...t){let[s,n,a]=t,{fetchCache:i,fetchIdx:o,fetchUrl:B,tags:l}=a;if(i){if(Date.now()<ar){al&&console.log("rate limited");return}if(null==r||r.set(s,{value:n,lastModified:Date.now()}),this.cacheEndpoint)try{let t=Date.now();null!==n&&"revalidate"in n&&(this.headers[ai]=n.revalidate.toString()),!this.headers[ai]&&null!==n&&"data"in n&&(this.headers[aB]=n.data.headers["cache-control"]);let r=JSON.stringify({...n,tags:void 0});al&&console.log("set cache",s);let a={internal:!0,fetchType:"cache-set",fetchUrl:B,fetchIdx:o},i=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${s}`,{method:"POST",headers:{...this.headers,[ao]:B||"",[as]:(null==l?void 0:l.join(","))||""},body:r,next:a});if(429===i.status){let t=i.headers.get("retry-after")||"60000";ar=Date.now()+parseInt(t)}if(!i.ok)throw al&&console.log(await i.text()),Error(`invalid response ${i.status}`);al&&console.log(`successfully set to fetch-cache for ${s}, duration: ${Date.now()-t}ms, size: ${r.length}`)}catch(t){al&&console.error("Failed to update fetch cache",t)}}}}let ad=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class ap{constructor(t){this.fs=t.fs,this.flushToDisk=t.flushToDisk,this.serverDistDir=t.serverDistDir,this.revalidatedTags=t.revalidatedTags,this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,t.maxMemoryCacheSize?s||(this.debug&&console.log("using memory store for fetch cache"),s=new nM(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===B.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===B.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===B.FETCH?JSON.stringify(t.data||"").length:t.kind===B.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===B.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):this.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,this.debug&&console.log("revalidateTag",r),0!==r.length)for(let t of r){let r=ad.tagsManifest.items[t]||{};r.revalidatedAt=Date.now(),ad.tagsManifest.items[t]=r}}async get(...t){var r,n,a,i,o,u;let[c,d]=t,{tags:p,softTags:C,kind:f,isRoutePPREnabled:m,isFallback:h}=d,y=null==s?void 0:s.get(c);if(this.debug&&console.log("get",c,p,f,!!y),!y){if(f===l.APP_ROUTE)try{let t=this.getFilePath(`${c}.body`,l.APP_ROUTE),r=await this.fs.readFile(t),{mtime:s}=await this.fs.stat(t),n=JSON.parse(await this.fs.readFile(t.replace(/\.body$/,e8.EP),"utf8"));return{lastModified:s.getTime(),value:{kind:B.APP_ROUTE,body:r,headers:n.headers,status:n.status}}}catch{return null}try{let t=this.getFilePath(f===l.FETCH?c:`${c}.html`,f),r=await this.fs.readFile(t,"utf8"),{mtime:n}=await this.fs.stat(t);if(f===l.FETCH){if(!this.flushToDisk)return null;let t=n.getTime(),s=JSON.parse(r);if(y={lastModified:t,value:s},(null==(i=y.value)?void 0:i.kind)===B.FETCH){let t=null==(o=y.value)?void 0:o.tags;(null==p?void 0:p.every(r=>null==t?void 0:t.includes(r)))||(this.debug&&console.log("tags vs storedTags mismatch",p,t),await this.set(c,y.value,{tags:p,isRoutePPREnabled:m}))}}else if(f===l.APP_PAGE){let s,a,i;try{s=JSON.parse(await this.fs.readFile(t.replace(/\.html$/,e8.EP),"utf8"))}catch{}if(null==s?void 0:s.segmentPaths){let t={};a=t;let r=c+e8.mH;await Promise.all(s.segmentPaths.map(async s=>{let n=this.getFilePath("/"===s?r+"/_index"+e8.tz:r+s+e8.tz,l.APP_PAGE);try{t[s]=await this.fs.readFile(n,"utf8")}catch{}}))}h||(i=await this.fs.readFile(this.getFilePath(`${c}${m?e8.pu:e8.RM}`,l.APP_PAGE))),y={lastModified:n.getTime(),value:{kind:B.APP_PAGE,html:r,rscData:i,postponed:null==s?void 0:s.postponed,headers:null==s?void 0:s.headers,status:null==s?void 0:s.status,segmentData:a}}}else if(f===l.PAGES){let t;let s={};h||(s=JSON.parse(await this.fs.readFile(this.getFilePath(`${c}${e8.x3}`,l.PAGES),"utf8"))),y={lastModified:n.getTime(),value:{kind:B.PAGES,html:r,pageData:s,headers:null==t?void 0:t.headers,status:null==t?void 0:t.status}}}else throw Error(`Invariant: Unexpected route kind ${f} in file system cache.`);y&&(null==s||s.set(c,y))}catch{return null}}if((null==y?void 0:null==(r=y.value)?void 0:r.kind)===B.APP_PAGE||(null==y?void 0:null==(n=y.value)?void 0:n.kind)===B.PAGES){let t;let r=null==(u=y.value.headers)?void 0:u[e8.VC];if("string"==typeof r&&(t=r.split(",")),(null==t?void 0:t.length)&&t.some(t=>{var r;return(null==ad.tagsManifest?void 0:null==(r=ad.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ad.tagsManifest?void 0:ad.tagsManifest.items[t].revalidatedAt)>=((null==y?void 0:y.lastModified)||Date.now())}))return null}else(null==y?void 0:null==(a=y.value)?void 0:a.kind)===B.FETCH&&[...p||[],...C||[]].some(t=>{var r;return!!this.revalidatedTags.includes(t)||(null==ad.tagsManifest?void 0:null==(r=ad.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ad.tagsManifest?void 0:ad.tagsManifest.items[t].revalidatedAt)>=((null==y?void 0:y.lastModified)||Date.now())})&&(y=void 0);return y??null}async set(...t){let[r,n,a]=t,{isFallback:i}=a;if(null==s||s.set(r,{value:n,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk&&n){if(n.kind===B.APP_ROUTE){let t=this.getFilePath(`${r}.body`,l.APP_ROUTE);await this.fs.mkdir(sx().dirname(t)),await this.fs.writeFile(t,n.body);let s={headers:n.headers,status:n.status,postponed:void 0,segmentPaths:void 0};await this.fs.writeFile(t.replace(/\.body$/,e8.EP),JSON.stringify(s,null,2))}else if(n.kind===B.PAGES||n.kind===B.APP_PAGE){let t=n.kind===B.APP_PAGE,s=this.getFilePath(`${r}.html`,t?l.APP_PAGE:l.PAGES);if(await this.fs.mkdir(sx().dirname(s)),await this.fs.writeFile(s,n.html),i||await this.fs.writeFile(this.getFilePath(`${r}${t?a.isRoutePPREnabled?e8.pu:e8.RM:e8.x3}`,t?l.APP_PAGE:l.PAGES),t?n.rscData:JSON.stringify(n.pageData)),(null==n?void 0:n.kind)===B.APP_PAGE){let t={headers:n.headers,status:n.status,postponed:n.postponed,segmentPaths:void 0};await this.fs.writeFile(s.replace(/\.html$/,e8.EP),JSON.stringify(t))}}else if(n.kind===B.FETCH){let t=this.getFilePath(r,l.FETCH);await this.fs.mkdir(sx().dirname(t)),await this.fs.writeFile(t,JSON.stringify({...n,tags:a.tags}))}}}getFilePath(t,r){switch(r){case l.FETCH:return sx().join(this.serverDistDir,"..","cache","fetch-cache",t);case l.PAGES:return sx().join(this.serverDistDir,"pages",t);case l.IMAGE:case l.APP_PAGE:case l.APP_ROUTE:return sx().join(this.serverDistDir,"app",t);default:throw Error(`Unexpected file path kind: ${r}`)}}}class aC{static #e=this.timings=new Map;constructor(t){this.prerenderManifest=t}get(t){var r,s;let n=aC.timings.get(t);if(void 0!==n||void 0!==(n=null==(r=this.prerenderManifest.routes[t])?void 0:r.initialRevalidateSeconds)||void 0!==(n=null==(s=this.prerenderManifest.dynamicRoutes[t])?void 0:s.fallbackRevalidate))return n}set(t,r){aC.timings.set(t,r)}clear(){aC.timings.clear()}}let af=nC();class am{constructor({fs:t,dev:r,dynamicIO:s,flushToDisk:n,fetchCache:a,minimalMode:i,serverDistDir:o,requestHeaders:B,requestProtocol:l,maxMemoryCacheSize:u,getPrerenderManifest:c,fetchCacheKeyPrefix:d,CurCacheHandler:p,allowedRevalidateHeaderKeys:C}){var f,m,h,y;this.locks=new Map;let g=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!p;let b=Symbol.for("@next/cache-handlers"),D=globalThis;if(p)g&&console.log("using custom cache handler",p.name);else{let r=D[b];(null==r?void 0:r.FetchCache)?p=r.FetchCache:(t&&o&&(g&&console.log("using filesystem cache handler"),p=ap),ac.isAvailable({_requestHeaders:B})&&i&&a&&(g&&console.log("using fetch cache handler"),p=ac))}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(u=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=r,this.hasDynamicIO=s,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=i,this.requestHeaders=B,this.requestProtocol=l,this.allowedRevalidateHeaderKeys=C,this.prerenderManifest=c(),this.revalidateTimings=new aC(this.prerenderManifest),this.fetchCacheKeyPrefix=d;let x=[];B[e8.kz]===(null==(m=this.prerenderManifest)?void 0:null==(f=m.preview)?void 0:f.previewModeId)&&(this.isOnDemandRevalidate=!0),i&&"string"==typeof B[e8.vS]&&B[e8.c1]===(null==(y=this.prerenderManifest)?void 0:null==(h=y.preview)?void 0:h.previewModeId)&&(x=B[e8.vS].split(",")),p&&(this.cacheHandler=new p({dev:r,fs:t,flushToDisk:n,serverDistDir:o,revalidatedTags:x,maxMemoryCacheSize:u,_requestHeaders:B,fetchCacheKeyPrefix:d}))}calculateRevalidate(t,r,s,n){if(s)return Math.floor(performance.timeOrigin+performance.now()-1e3);let a=this.revalidateTimings.get(nB(t))??(!n&&1);return"number"==typeof a?1e3*a+r:a}_getPathname(t,r){return r?t:sE(t)}resetRequestCache(){var t,r;null==(r=this.cacheHandler)||null==(t=r.resetRequestCache)||t.call(r)}async lock(t){let r=()=>Promise.resolve(),s=this.locks.get(t);s&&await s;let n=new Promise(s=>{r=async()=>{s(),this.locks.delete(t)}});return this.locks.set(t,n),r}async revalidateTag(t){var r,s;return null==(s=this.cacheHandler)?void 0:null==(r=s.revalidateTag)?void 0:r.call(s,t)}async generateCacheKey(t,r={}){let s="v3",n=[],a=new TextEncoder,i=new TextDecoder;if(r.body){if("function"==typeof r.body.getReader){let t=r.body,s=[];try{await t.pipeTo(new WritableStream({write(t){"string"==typeof t?(s.push(a.encode(t)),n.push(t)):(s.push(t),n.push(i.decode(t,{stream:!0})))}})),n.push(i.decode());let o=s.reduce((t,r)=>t+r.length,0),B=new Uint8Array(o),l=0;for(let t of s)B.set(t,l),l+=t.length;r._ogBody=B}catch(t){console.error("Problem reading body",t)}}else if("function"==typeof r.body.keys){let t=r.body;for(let s of(r._ogBody=r.body,new Set([...t.keys()]))){let r=t.getAll(s);n.push(`${s}=${(await Promise.all(r.map(async t=>"string"==typeof t?t:await t.text()))).join(",")}`)}}else if("function"==typeof r.body.arrayBuffer){let t=r.body,s=await t.arrayBuffer();n.push(await t.text()),r._ogBody=new Blob([s],{type:t.type})}else"string"==typeof r.body&&(n.push(r.body),r._ogBody=r.body)}let o="function"==typeof(r.headers||{}).keys?Object.fromEntries(r.headers):Object.assign({},r.headers);"traceparent"in o&&delete o.traceparent;let B=JSON.stringify([s,this.fetchCacheKeyPrefix||"",t,r.method,o,r.mode,r.redirect,r.credentials,r.referrer,r.referrerPolicy,r.integrity,r.cache,n]);return __webpack_require__("crypto").createHash("sha256").update(B).digest("hex")}async get(t,r){var s,n;let a,i;if(this.hasDynamicIO&&r.kind===l.FETCH){let r=af.getStore(),s=r?(0,G.getRenderResumeDataCache)(r):null;if(s){let r=s.fetch.get(t);if((null==r?void 0:r.kind)===B.FETCH)return{isStale:!1,value:r,revalidateAfter:!1,isFallback:!1}}}if(this.disableForTestmode||this.dev&&(r.kind!==l.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;let{isFallback:o}=r;t=this._getPathname(t,r.kind===l.FETCH);let u=null,c=r.revalidate,d=await (null==(s=this.cacheHandler)?void 0:s.get(t,r));if((null==d?void 0:null==(n=d.value)?void 0:n.kind)===B.FETCH){if([...r.tags||[],...r.softTags||[]].some(t=>{var r;return null==(r=this.revalidatedTags)?void 0:r.includes(t)}))return null;c=c||d.value.revalidate;let t=(performance.timeOrigin+performance.now()-(d.lastModified||0))/1e3>c,s=d.value.data;return{isStale:t,value:{kind:B.FETCH,data:s,revalidate:c},revalidateAfter:performance.timeOrigin+performance.now()+1e3*c,isFallback:o}}let p=this.revalidateTimings.get(nB(t));return(null==d?void 0:d.lastModified)===-1?(a=-1,i=-1*e8.qF):a=!!(!1!==(i=this.calculateRevalidate(t,(null==d?void 0:d.lastModified)||performance.timeOrigin+performance.now(),!!this.dev&&r.kind!==l.FETCH,r.isFallback))&&i<performance.timeOrigin+performance.now())||void 0,d&&(u={isStale:a,curRevalidate:p,revalidateAfter:i,value:d.value,isFallback:o}),!d&&this.prerenderManifest.notFoundRoutes.includes(t)&&(u={isStale:a,value:null,curRevalidate:p,revalidateAfter:i,isFallback:o},this.set(t,u.value,r)),u}async set(t,r,s){if(this.hasDynamicIO&&(null==r?void 0:r.kind)===B.FETCH){let s=af.getStore(),n=s?(0,G.getPrerenderResumeDataCache)(s):null;n&&n.fetch.set(t,r)}if(this.disableForTestmode||this.dev&&!s.fetchCache)return;t=this._getPathname(t,s.fetchCache);let n=JSON.stringify(r).length;if(s.fetchCache&&!this.hasCustomCacheHandler&&n>2097152){if(this.dev)throw Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${n} bytes)`);return}try{var a;void 0===s.revalidate||s.fetchCache||this.revalidateTimings.set(nB(t),s.revalidate),await (null==(a=this.cacheHandler)?void 0:a.set(t,r,s))}catch(r){console.warn("Failed to update prerender cache for",t,r)}}}let ah=require("http"),ay=require("https");function ag(t){if(!globalThis.__NEXT_HTTP_AGENT){if(!t)throw Error("Expected config.httpAgentOptions to be an object");globalThis.__NEXT_HTTP_AGENT_OPTIONS=t.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new ah.Agent(t.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new ay.Agent(t.httpAgentOptions)}}function ab(t){return t.definition.kind===u.PAGES_API}let aD={existsSync:b().existsSync,readFile:b().promises.readFile,readFileSync:b().readFileSync,writeFile:(t,r)=>b().promises.writeFile(t,r),mkdir:t=>b().promises.mkdir(t,{recursive:!0}),stat:t=>b().promises.stat(t)};class ax extends n8().Readable{constructor({url:t,headers:r,method:s,socket:n=null,readable:a}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(t,r)=>{if("encrypted"!==r&&"remoteAddress"!==r)throw Error("Method not implemented");if("remoteAddress"!==r)return!1}}),this.url=t,this.headers=r,this.method=s,a&&(this.bodyReadable=a,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let t={};for(let[r,s]of Object.entries(this.headers))s&&(t[r]=Array.isArray(s)?s:[s]);return t}_read(t){if(this.bodyReadable)return this.bodyReadable._read(t);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Error("Method not implemented")}get complete(){throw Error("Method not implemented")}get trailers(){throw Error("Method not implemented")}get trailersDistinct(){throw Error("Method not implemented")}get rawTrailers(){throw Error("Method not implemented")}get rawHeaders(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}}class av extends n8().Writable{constructor(t={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=t.statusCode??200,this.socket=t.socket??null,this.headers=t.headers?t8(t.headers):new Headers,this.headPromise=new Promise(t=>{this.headPromiseResolve=t}),this.hasStreamed=new Promise((t,r)=>{this.on("finish",()=>t(!0)),this.on("end",()=>t(!0)),this.on("error",t=>r(t))}).then(t=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),t)),t.resWriter&&(this.resWriter=t.resWriter)}appendHeader(t,r){for(let s of Array.isArray(r)?r:[r])this.headers.append(t,s);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(t){return this.resWriter?this.resWriter(t):(this.buffers.push(Buffer.isBuffer(t)?t:Buffer.from(t)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(t,r,s){this.write(t),s()}writeHead(t,r,s){if(s||"string"==typeof r?"string"==typeof r&&r.length>0&&(this.statusMessage=r):s=r,s){if(Array.isArray(s))for(let t=0;t<s.length;t+=2)this.setHeader(s[t],s[t+1]);else for(let[t,r]of Object.entries(s))void 0!==r&&this.setHeader(t,r)}return this.statusCode=t,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(t){return this.headers.has(t)}getHeader(t){return this.headers.get(t)??void 0}getHeaders(){return rt(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(t,r){if(Array.isArray(r))for(let s of(this.headers.delete(t),r))this.headers.append(t,s);else"number"==typeof r?this.headers.set(t,r.toString()):this.headers.set(t,r);return this}removeHeader(t){this.headers.delete(t)}flushHeaders(){}get strictContentLength(){throw Error("Method not implemented.")}writeEarlyHints(){throw Error("Method not implemented.")}get req(){throw Error("Method not implemented.")}assignSocket(){throw Error("Method not implemented.")}detachSocket(){throw Error("Method not implemented.")}writeContinue(){throw Error("Method not implemented.")}writeProcessing(){throw Error("Method not implemented.")}get upgrading(){throw Error("Method not implemented.")}get chunkedEncoding(){throw Error("Method not implemented.")}get shouldKeepAlive(){throw Error("Method not implemented.")}get useChunkedEncodingByDefault(){throw Error("Method not implemented.")}get sendDate(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}addTrailers(){throw Error("Method not implemented.")}setHeaders(){throw Error("Method not implemented.")}}function aE({url:t,headers:r={},method:s="GET",bodyReadable:n,resWriter:a,socket:i=null}){return{req:new ax({url:t,headers:r,method:s,socket:i,readable:n}),res:new av({socket:i,resWriter:a})}}class aj{async load(t){return await require(t)}}class aA{static async load(t,r=new aj){let s=await r.load(t);if("routeModule"in s)return s.routeModule;throw Error(`Module "${t}" does not export a routeModule.`)}}let aS=(t,r)=>{let s=m().isAbsolute(r)?r:m().join(t,r);return(0,h.pathToFileURL)(s).toString()};function aP(t){var r,s;return(null==(s=t.has)?void 0:null==(r=s[0])?void 0:r.key)===ti}let a_=t=>import(t).then(t=>t.default||t),aw=require,aI=new WeakMap;function aO(t){let r=aI.get(t);if(r)return r;if(!Array.isArray(t.matchers))throw Error(`Invariant: invalid matchers for middleware ${JSON.stringify(t)}`);let s=n6(t.matchers);return aI.set(t,s),s}class aT extends nk{constructor(t){super(t),this.registeredInstrumentation=!1,this.handleNextImageRequest=async(t,r,s)=>!!(s.pathname&&s.pathname.startsWith("/_next/image"))&&(r.statusCode=400,r.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(t,r,s)=>{let{pathname:n,query:a}=s;if(!n)throw Error("Invariant: pathname is undefined");a._nextBubbleNoFallback="1";try{var i;n=tH(n);let o={i18n:null==(i=this.i18nProvider)?void 0:i.fromQuery(n,a)},B=await this.matchers.match(n,o);if(!B)return await this.render(t,r,n,a,s,!0),!0;for(let n of(e_(t,"match",B),this.getEdgeFunctionsPages()))if(n===B.definition.page){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;delete a._nextBubbleNoFallback,delete a[tl];try{if(await this.runEdgeFunction({req:t,res:r,query:a,params:B.params,page:B.definition.page,match:B,appPaths:null}))return!0}catch(r){throw await this.instrumentationOnRequestError(r,t,{routePath:B.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),r}}if(ab(B)){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;if(delete a._nextBubbleNoFallback,await this.handleApiRequest(t,r,a,B))return!0}return await this.render(t,r,n,a,s,!0),!0}catch(s){if(s instanceof nN)throw s;try{return this.logError(s),r.statusCode=500,await this.renderError(s,t,r,n,a),!0}catch{}throw s}},this.handleCatchallMiddlewareRequest=async(t,r,s)=>{let n;let a=eS(t,"middlewareInvoke");if(!a)return!1;let i=()=>(e_(t,"middlewareInvoke",!0),r.body("").send(),!0),o=this.getMiddleware();if(!o)return i();let B=tm(eS(t,"initURL")),l=rC(B.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});B.pathname=l.pathname;let u=tH(s.pathname||"");if(!o.match(u,t,B.query))return i();let c=!1;try{if(await this.ensureMiddleware(t.url),n=await this.runMiddleware({request:t,response:r,parsedUrl:B,parsed:s}),"response"in n){if(a)throw c=!0,new t1.BubbledError(!0,n);for(let[t,s]of Object.entries(rt(n.response.headers)))"content-encoding"!==t&&void 0!==s&&r.setHeader(t,s);r.statusCode=n.response.status;let{originalResponse:t}=r;return n.response.body?await rL(n.response.body,t):t.end(),!0}}catch(a){if(c)throw a;if(su(a)&&"ENOENT"===a.code)return await this.render404(t,r,s),!0;if(a instanceof eD)return r.statusCode=400,await this.renderError(a,t,r,s.pathname||""),!0;let n=sd(a);return console.error(n),r.statusCode=500,await this.renderError(n,t,r,s.pathname||""),!0}return n.finished},this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"";let{appDocumentPreloading:r}=this.nextConfig.experimental,s=void 0===r;if(t.dev||!0!==r&&s||(n4({distDir:this.distDir,page:"/_document",isAppPath:!1}).catch(()=>{}),n4({distDir:this.distDir,page:"/_app",isAppPath:!1}).catch(()=>{})),t.dev,!t.dev){let{dynamicRoutes:t=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=t.map(t=>{let r=tU(t.page);return{match:ej(r),page:t.page,re:r.re}})}ag(this.nextConfig),this.middlewareManifestPath=(0,f.join)(this.serverDistDir,eG),t.dev||this.prepare().catch(t=>{console.error("Failed to prepare server",t)})}async unstable_preloadEntries(){let t=this.getAppPathsManifest();for(let t of Object.keys(this.getPagesManifest()||{}))await n4({distDir:this.distDir,page:t,isAppPath:!1}).catch(()=>{});for(let r of Object.keys(t||{}))await n4({distDir:this.distDir,page:r,isAppPath:!0}).then(async({ComponentMod:t})=>{t.patchFetch();let r=t.__next_app__.require;if(null==r?void 0:r.m)for(let t of Object.keys(r.m))await r(t)}).catch(()=>{})}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await aw((0,f.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e8.Hw))}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw Error("An error occurred while loading the instrumentation hook",{cause:t})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){var t,r;this.registeredInstrumentation||(this.registeredInstrumentation=!0,await (null==(r=this.instrumentation)?void 0:null==(t=r.register)?void 0:t.call(r)))}loadEnvConfig({dev:t,forceReload:r,silent:s}){(0,n7.loadEnvConfig)(this.dir,t,s?{info:()=>{},error:()=>{}}:p,r)}async getIncrementalCache({requestHeaders:t,requestProtocol:r}){let s;let n=!1,{cacheHandler:a}=this.nextConfig;a&&(s=nq(await a_(aS(this.distDir,a))));let{cacheHandlers:i}=this.nextConfig.experimental;if(!globalThis.__nextCacheHandlers&&i)for(let t of(globalThis.__nextCacheHandlers={},Object.keys(i)))i[t]&&(globalThis.__nextCacheHandlers[t]=nq(await a_(aS(this.distDir,i[t]))));return new am({fs:this.getCacheFilesystem(),dev:n,requestHeaders:t,requestProtocol:r,dynamicIO:!!this.nextConfig.experimental.dynamicIO,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCache:!0,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:s})}getResponseCache(){return new rJ(!0)}getPublicDir(){return(0,f.join)(this.dir,eW)}getHasStaticDir(){return b().existsSync((0,f.join)(this.dir,"static"))}getPagesManifest(){return nG((0,f.join)(this.serverDistDir,eF))}getAppPathsManifest(){if(this.enabledDirectories.app)return nG((0,f.join)(this.serverDistDir,ek))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let t=this.getRoutesManifest();return(null==t?void 0:t.rewrites.beforeFiles.filter(aP).map(t=>new RegExp(t.regex)))??[]}async hasPage(t){var r;return!!nQ(t,this.distDir,null==(r=this.nextConfig.i18n)?void 0:r.locales,this.enabledDirectories.app)}getBuildId(){let t=(0,f.join)(this.distDir,eU);try{return b().readFileSync(t,"utf8").trim()}catch(t){if("ENOENT"===t.code)throw Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);throw t}}getEnabledDirectories(t){let r=t?this.dir:this.serverDistDir;return{app:!!ez(r,"app"),pages:!!ez(r,"pages")}}sendRenderResult(t,r,s){return tp({req:t.originalRequest,res:r.originalResponse,result:s.result,type:s.type,generateEtags:s.generateEtags,poweredByHeader:s.poweredByHeader,revalidate:s.revalidate,expireTime:s.expireTime})}async runApi(t,r,s,n){for(let a of this.getEdgeFunctionsPages())if(a===n.definition.pathname&&await this.runEdgeFunction({req:t,res:r,query:s,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let a=await aA.load(n.definition.filename);return s={...s,...n.params},delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextInferredLocaleFromDefault,await a.render(t.originalRequest,r.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:s,params:n.params,page:n.definition.pathname,onError:this.instrumentationOnRequestError.bind(this),multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode}),!0}async renderHTML(t,r,s,n,a){return(0,t1.getTracer)().trace(t0.Fx.renderHTML,async()=>this.renderHTMLImpl(t,r,s,n,a))}async renderHTMLImpl(t,r,s,n,a){throw Error("Invariant: renderHTML should not be called in minimal mode")}async imageOptimizer(t,r,s,n){throw Error("invariant: imageOptimizer should not be called in minimal mode")}getPagePath(t,r){return nW(t,this.distDir,r,this.enabledDirectories.app)}async renderPageComponent(t,r){let s=this.getEdgeFunctionsPages()||[];if(s.length){let r=this.getOriginalAppPaths(t.pathname),n=Array.isArray(r),a=t.pathname;for(let i of(n&&(a=r[0]),s))if(i===a)return await this.runEdgeFunction({req:t.req,res:t.res,query:t.query,params:t.renderOpts.params,page:a,appPaths:r}),null}return super.renderPageComponent(t,r)}async findPageComponents({page:t,query:r,params:s,isAppPath:n,url:a}){return(0,t1.getTracer)().trace(t0.Fx.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":n?tO(t):t}},()=>this.findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}))}async findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}){let i=[t];for(let a of(r.amp&&i.unshift((n?tO(t):sE(t))+".amp"),r.__nextLocale&&i.unshift(...i.map(t=>`/${r.__nextLocale}${"/"===t?"":t}`)),i))try{let t=await n4({distDir:this.distDir,page:a,isAppPath:n});if(r.__nextLocale&&"string"==typeof t.Component&&!a.startsWith(`/${r.__nextLocale}`))continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp,__nextDataReq:r.__nextDataReq,__nextLocale:r.__nextLocale,__nextDefaultLocale:r.__nextDefaultLocale}:r,...(n?{}:s)||{}}}}catch(t){if(!(t instanceof ev))throw t}return null}getNextFontManifest(){return nG((0,f.join)(this.distDir,"server",eL+".json"))}async logErrorWithOriginalStack(t,r){throw Error("Invariant: logErrorWithOriginalStack can only be called on the development server")}async ensurePage(t){throw Error("Invariant: ensurePage can only be called on the development server")}async handleApiRequest(t,r,s,n){return this.runApi(t,r,s,n)}getCacheFilesystem(){return aD}normalizeReq(t){return t instanceof e3?t:new e3(t)}normalizeRes(t){return t instanceof e5?t:new e5(t)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(t=>{console.error("Failed to prepare server",t)});let t=super.getRequestHandler();return(r,s,n)=>t(this.normalizeReq(r),this.normalizeRes(s),n)}async revalidate({urlPath:t,revalidateHeaders:r,opts:s}){let n=aE({url:t,headers:r}),a=this.getRequestHandler();if(await a(new e3(n.req),new e5(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&!(404===n.res.statusCode&&s.unstable_onlyGenerated))throw Error(`Invalid response ${n.res.statusCode}`)}async render(t,r,s,n,a,i=!1){return super.render(this.normalizeReq(t),this.normalizeRes(r),s,n,a,i)}async renderToHTML(t,r,s,n){return super.renderToHTML(this.normalizeReq(t),this.normalizeRes(r),s,n)}async renderErrorToResponseImpl(t,r){let{req:s,res:n,query:a}=t;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eT)?(await this.runEdgeFunction({req:s,res:n,query:a||{},params:{},page:eT,appPaths:null}),null):super.renderErrorToResponseImpl(t,r)}async renderError(t,r,s,n,a,i){return super.renderError(t,this.normalizeReq(r),this.normalizeRes(s),n,a,i)}async renderErrorToHTML(t,r,s,n,a){return super.renderErrorToHTML(t,this.normalizeReq(r),this.normalizeRes(s),n,a)}async render404(t,r,s,n){return super.render404(this.normalizeReq(t),this.normalizeRes(r),s,n)}getMiddlewareManifest(){return null}getMiddleware(){var t;let r=this.getMiddlewareManifest(),s=null==r?void 0:null==(t=r.middleware)?void 0:t["/"];if(s)return{match:aO(s),page:"/"}}getEdgeFunctionsPages(){let t=this.getMiddlewareManifest();return t?Object.keys(t.functions):[]}getEdgeFunctionInfo(t){let r;let s=this.getMiddlewareManifest();if(!s)return null;try{r=r4(sE(t.page))}catch(t){return null}let n=t.middleware?s.middleware[r]:s.functions[r];if(!n){if(!t.middleware)throw new ev(r);return null}return{name:n.name,paths:n.files.map(t=>(0,f.join)(this.distDir,t)),wasm:(n.wasm??[]).map(t=>({...t,filePath:(0,f.join)(this.distDir,t.filePath)})),assets:n.assets&&n.assets.map(t=>({...t,filePath:(0,f.join)(this.distDir,t.filePath)})),env:n.env}}async hasMiddleware(t){let r=this.getEdgeFunctionInfo({page:t,middleware:!0});return!!(r&&r.paths.length>0)}async ensureMiddleware(t){}async ensureEdgeFunction(t){}async runMiddleware(t){throw Error("invariant: runMiddleware should not be called in minimal mode")}getPrerenderManifest(){var t,r;return this._cachedPreviewManifest||((t=this.renderOpts,(null==(r=this.serverOptions)?void 0:r.dev)||process.env.NEXT_PHASE===eN)?this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:__webpack_require__("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:__webpack_require__("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:__webpack_require__("crypto").randomBytes(32).toString("hex")}}:this._cachedPreviewManifest=nG((0,f.join)(this.distDir,eR))),this._cachedPreviewManifest}getRoutesManifest(){return(0,t1.getTracer)().trace(t0.Fx.getRoutesManifest,()=>{let t=nG((0,f.join)(this.distDir,eH)),r=t.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(r)&&(r={beforeFiles:[],afterFiles:r,fallback:[]}),{...t,rewrites:r}})}attachRequestMeta(t,r,s){var n;let a=(null==(n=t.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",i=this.fetchHostname&&this.port?`${a}://${this.fetchHostname}:${this.port}${t.url}`:this.nextConfig.experimental.trustHostHeader?`https://${t.headers.host||"localhost"}${t.url}`:t.url;e_(t,"initURL",i),e_(t,"initQuery",{...r.query}),e_(t,"initProtocol",a),s||e_(t,"clonableBody",at(t.originalRequest))}async runEdgeFunction(t){throw Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.")}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let t=(0,f.join)(this.distDir,eJ);return this._serverDistDir=t,t}async getFallbackErrorComponents(t){return null}async instrumentationOnRequestError(...t){await super.instrumentationOnRequestError(...t),this.logError(t[0])}}})(),module.exports=__webpack_exports__})();
|
|
2873
2873
|
//# sourceMappingURL=server.runtime.prod.js.map
|