next 15.6.0-canary.56 → 15.6.0-canary.57

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.
Files changed (49) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +3 -3
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +2 -2
  5. package/dist/client/app-bootstrap.js +1 -1
  6. package/dist/client/index.js +1 -1
  7. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
  8. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
  9. package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
  10. package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
  11. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  12. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  13. package/dist/esm/build/index.js +3 -3
  14. package/dist/esm/build/swc/index.js +1 -1
  15. package/dist/esm/build/webpack-config.js +2 -2
  16. package/dist/esm/client/app-bootstrap.js +1 -1
  17. package/dist/esm/client/index.js +1 -1
  18. package/dist/esm/server/body-streams.js +4 -7
  19. package/dist/esm/server/body-streams.js.map +1 -1
  20. package/dist/esm/server/config-schema.js +1 -0
  21. package/dist/esm/server/config-schema.js.map +1 -1
  22. package/dist/esm/server/config-shared.js +2 -1
  23. package/dist/esm/server/config-shared.js.map +1 -1
  24. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  25. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  26. package/dist/esm/server/lib/app-info-log.js +1 -1
  27. package/dist/esm/server/lib/incremental-cache/tags-manifest.external.js +10 -6
  28. package/dist/esm/server/lib/incremental-cache/tags-manifest.external.js.map +1 -1
  29. package/dist/esm/server/lib/start-server.js +1 -1
  30. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  31. package/dist/server/body-streams.js +4 -7
  32. package/dist/server/body-streams.js.map +1 -1
  33. package/dist/server/config-schema.d.ts +1 -0
  34. package/dist/server/config-schema.js +1 -0
  35. package/dist/server/config-schema.js.map +1 -1
  36. package/dist/server/config-shared.d.ts +1 -0
  37. package/dist/server/config-shared.js +2 -1
  38. package/dist/server/config-shared.js.map +1 -1
  39. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  40. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  41. package/dist/server/lib/app-info-log.js +1 -1
  42. package/dist/server/lib/incremental-cache/tags-manifest.external.js +10 -6
  43. package/dist/server/lib/incremental-cache/tags-manifest.external.js.map +1 -1
  44. package/dist/server/lib/start-server.js +1 -1
  45. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  46. package/dist/telemetry/anonymous-meta.js +1 -1
  47. package/dist/telemetry/events/session-stopped.js +2 -2
  48. package/dist/telemetry/events/version.js +2 -2
  49. package/package.json +15 -15
@@ -22,5 +22,5 @@ You can debug event listener operations by running Next.js with \`NEXT_UNHANDLED
22
22
  `)}}class ru extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
23
23
  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
24
24
  `)}}var rc=r("./dist/compiled/@edge-runtime/cookies/index.js");let rh=Symbol("internal request");class rp extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);t4(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new ro(r,{headers:t1(this.headers),nextConfig:t.nextConfig});this[rh]={cookies:new rc.RequestCookies(this.headers),nextUrl:n,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?r: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[rh].cookies}get nextUrl(){return this[rh].nextUrl}get page(){throw new rd}get ua(){throw new ru}get url(){return this[rh].url}}let rf="ResponseAborted";class rm extends Error{constructor(...e){super(...e),this.name=rf}}class rg{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}var ry=function(e){return e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404",e}(ry||{}),rv=function(e){return e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents",e}(rv||{}),r_=function(e){return e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch",e}(r_||{});let rb=0,rx=0,rE=0;function rw(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===rf}async function rC(e,t,r){try{let{errored:n,destroyed:s}=t;if(n||s)return;let i=function(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new rm)}),t}(t),a=function(e,t){let r=!1,n=new rg;function s(){n.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),n.resolve()});let i=new rg;return e.once("finish",()=>{i.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===rb?void 0:{clientComponentLoadStart:rb,clientComponentLoadTimes:rx,clientComponentLoadCount:rE};return e.reset&&(rb=0,rx=0,rE=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),(0,to.getTracer)().trace(r_.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new rg)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),i.promise}})}(t,r);await e.pipeTo(a,{signal:i.signal})}catch(e){if(rw(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class rR{static #e=this.EMPTY=new rR(null,{metadata:{},contentType:null});static fromStatic(e,t){return new rR(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new e_("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return tQ(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tY(this.response):Buffer.isBuffer(this.response)?tJ(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),s=1;for(;s<e.length-1;s++){let t=e[s];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let i=e[s];return(n=n.then(()=>i.pipeTo(r))).catch(tG),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tY(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[tJ(this.response)]:[this.response]}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(rw(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await rC(this.readable,e,this.waitUntil)}}function rP(e){return e.replace(/\\/g,"/")}function rT(e){let t=rP(e);return t.startsWith("/index/")&&!tV(t)?t.slice(6):"/index"!==t?t:"/"}function rO(e,t){let r=[],n=(0,eN.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof t?.sensitive&&t.sensitive,strict:t?.strict}),s=(0,eN.regexpToFunction)(t?.regexModifier?new RegExp(t.regexModifier(n.source),n.flags):n,r);return(e,n)=>{if("string"!=typeof e)return!1;let i=s(e);if(!i)return!1;if(t?.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete i.params[e.name];return{...n,...i.params}}}let rS=/[|\\{}()[\]^$+*?.-]/,rI=/[|\\{}()[\]^$+*?.-]/g;function rk(e){return rS.test(e)?e.replace(rI,"\\$&"):e}let rA=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function rj(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function rN(e,{includeSuffix:t=!1,includePrefix:r=!1,excludeOptionalTrailingSlash:n=!1}={}){let{parameterizedRoute:s,groups:i}=function(e,t,r){let n={},s=1,i=[];for(let a of t9(e).slice(1).split("/")){let e=tU.find(e=>a.startsWith(e)),o=a.match(rA);if(e&&o&&o[2]){let{key:t,optional:r,repeat:a}=rj(o[2]);n[t]={pos:s++,repeat:a,optional:r},i.push(`/${rk(e)}([^/]+?)`)}else if(o&&o[2]){let{key:e,repeat:t,optional:a}=rj(o[2]);n[e]={pos:s++,repeat:t,optional:a},r&&o[1]&&i.push(`/${rk(o[1])}`);let l=t?a?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),i.push(l)}else i.push(`/${rk(a)}`);t&&o&&o[3]&&i.push(rk(o[3]))}return{parameterizedRoute:i.join(""),groups:n}}(e,t,r),a=s;return n||(a+="(?:/)?"),{re:RegExp(`^${a}$`),groups:i}}function rD({interceptionMarker:e,getSafeRouteKey:t,segment:r,routeKeys:n,keyPrefix:s,backreferenceDuplicateKeys:i}){let a,{key:o,optional:l,repeat:d}=rj(r),u=o.replace(/\W/g,"");s&&(u=`${s}${u}`);let c=!1;(0===u.length||u.length>30)&&(c=!0),isNaN(parseInt(u.slice(0,1)))||(c=!0),c&&(u=t());let h=u in n;s?n[u]=`${s}${o}`:n[u]=o;let p=e?rk(e):"";return a=h&&i?`\\k<${u}>`:d?`(?<${u}>.+?)`:`(?<${u}>[^/]+?)`,{key:o,pattern:l?`(?:/${p}${a})?`:`/${p}${a}`,cleanedKey:u,optional:l,repeat:d}}function r$(e){return e.replace(/__ESC_COLON_/gi,":")}function rM(e,t,r=[],n=[]){let s={},i=r=>{let n,i=r.key;switch(r.type){case"header":i=i.toLowerCase(),n=e.headers[i];break;case"cookie":n="cookies"in e?e.cookies[r.key]:tu(e.headers)()[r.key];break;case"query":n=t[i];break;case"host":{let{host:t}=e?.headers||{};n=t?.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return s[function(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n>64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(i)]=n,!0;if(n){let e=RegExp(`^${r.value}$`),t=Array.isArray(n)?n.slice(-1)[0].match(e):n.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{s[e]=t.groups[e]}):"host"===r.type&&t[0]&&(s.host=t[0])),!0}return!1};return!(!r.every(e=>i(e))||n.some(e=>i(e)))&&s}function rZ(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(`:${r}`)&&(e=e.replace(RegExp(`:${r}\\*`,"g"),`:${r}--ESCAPED_PARAM_ASTERISKS`).replace(RegExp(`:${r}\\?`,"g"),`:${r}--ESCAPED_PARAM_QUESTION`).replace(RegExp(`:${r}\\+`,"g"),`:${r}--ESCAPED_PARAM_PLUS`).replace(RegExp(`:${r}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${r}`));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),eq(`/${e}`,{validate:!1})(t).slice(1)}function rL(e){try{return decodeURIComponent(e)}catch{return e}}let rq=/https?|ftp|gopher|file/;function rU(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==e3&&r.startsWith(e3),s=r!==e8&&r.startsWith(e8);(n||s||t.includes(r))&&delete e[r]}}function rz(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function rF(e){return rz(e)?e:Object.defineProperty(Error(!function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}(e)?e+"":function(e){let t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}(e)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}let rH="next-action",rV="next-router-state-tree",rW="next-router-prefetch",rX="next-router-segment-prefetch",rB="next-url",rG=["rsc",rV,rW,"next-hmr-refresh",rX],rK="_rsc";class rY{constructor(e){this.provider=e}normalize(e){return this.provider.analyze(e).pathname}}class rJ{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e="/"){let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(`${e}${t}/`)).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(`${e}[${this.slugName}]/`)),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error(`You cannot define a route with the same specificity as a optional catch-all route ("${t}" and "${t}[[...${this.optionalRestSlugName}]]").`),"__NEXT_ERROR_CODE",{value:"E458",enumerable:!1,configurable:!0});r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(`${e}[...${this.restSlugName}]/`)),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(`${e}[[...${this.optionalRestSlugName}]]/`)),r}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Object.defineProperty(Error("Catch-all must be the last part of the URL."),"__NEXT_ERROR_CODE",{value:"E392",enumerable:!1,configurable:!0});let n=e[0];if(n.startsWith("[")&&n.endsWith("]")){let i=n.slice(1,-1),a=!1;if(i.startsWith("[")&&i.endsWith("]")&&(i=i.slice(1,-1),a=!0),i.startsWith("…"))throw Object.defineProperty(Error(`Detected a three-dot character ('…') at ('${i}'). Did you mean ('...')?`),"__NEXT_ERROR_CODE",{value:"E147",enumerable:!1,configurable:!0});if(i.startsWith("...")&&(i=i.substring(3),r=!0),i.startsWith("[")||i.endsWith("]"))throw Object.defineProperty(Error(`Segment names may not start or end with extra brackets ('${i}').`),"__NEXT_ERROR_CODE",{value:"E421",enumerable:!1,configurable:!0});if(i.startsWith("."))throw Object.defineProperty(Error(`Segment names may not start with erroneous periods ('${i}').`),"__NEXT_ERROR_CODE",{value:"E288",enumerable:!1,configurable:!0});function s(e,r){if(null!==e&&e!==r)throw Object.defineProperty(Error(`You cannot use different slug names for the same dynamic path ('${e}' !== '${r}').`),"__NEXT_ERROR_CODE",{value:"E337",enumerable:!1,configurable:!0});t.forEach(e=>{if(e===r)throw Object.defineProperty(Error(`You cannot have the same slug name "${r}" repeat within a single dynamic path`),"__NEXT_ERROR_CODE",{value:"E247",enumerable:!1,configurable:!0});if(e.replace(/\W/g,"")===n.replace(/\W/g,""))throw Object.defineProperty(Error(`You cannot have the slug names "${e}" and "${r}" differ only by non-word symbols within a single dynamic path`),"__NEXT_ERROR_CODE",{value:"E499",enumerable:!1,configurable:!0})}),t.push(r)}if(r)if(a){if(null!=this.restSlugName)throw Object.defineProperty(Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${e[0]}" ).`),"__NEXT_ERROR_CODE",{value:"E299",enumerable:!1,configurable:!0});s(this.optionalRestSlugName,i),this.optionalRestSlugName=i,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${e[0]}").`),"__NEXT_ERROR_CODE",{value:"E300",enumerable:!1,configurable:!0});s(this.restSlugName,i),this.restSlugName=i,n="[...]"}else{if(a)throw Object.defineProperty(Error(`Optional route parameters are not yet supported ("${e[0]}").`),"__NEXT_ERROR_CODE",{value:"E435",enumerable:!1,configurable:!0});s(this.slugName,i),this.slugName=i,n="[]"}}this.children.has(n)||this.children.set(n,new rJ),this.children.get(n)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}class rQ{constructor(e){this.definition=e,tV(e.pathname)&&(this.dynamic=eU(rN(e.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(e){let t=this.test(e);return t?{definition:this.definition,params:t.params}:null}test(e){if(this.dynamic){let t=this.dynamic(e);return t?{params:t}:null}return e===this.definition.pathname?{}:null}}class r0 extends rQ{get identity(){var e;return`${this.definition.pathname}?__nextLocale=${null==(e=this.definition.i18n)?void 0:e.locale}`}match(e,t){var r,n;let s=this.test(e,t);return s?{definition:this.definition,params:s.params,detectedLocale:(null==t||null==(r=t.i18n)?void 0:r.detectedLocale)??(null==(n=this.definition.i18n)?void 0:n.locale)}:null}test(e,t){return this.definition.i18n&&(null==t?void 0:t.i18n)?this.definition.i18n.locale&&t.i18n.detectedLocale&&this.definition.i18n.locale!==t.i18n.detectedLocale?null:super.test(t.i18n.pathname):super.test(e)}}class r1{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let{promise:e,resolve:t,reject:r}=new rg;this.waitTillReadyPromise=e;let n=this.compilationID;try{let e=[],t=await Promise.all(this.providers.map(e=>e.matchers())),r=new Map,s={};for(let n of t)for(let t of n){t.duplicated&&delete t.duplicated;let n=r.get(t.definition.pathname);if(n){let e=s[t.definition.pathname]??[n];e.push(t),s[t.definition.pathname]=e,n.duplicated=e,t.duplicated=e}e.push(t),r.set(t.definition.pathname,t)}if(this.matchers.duplicates=s,this.previousMatchers.length===e.length&&this.previousMatchers.every((t,r)=>t===e[r]))return;this.previousMatchers=e,this.matchers.static=e.filter(e=>!e.isDynamic);let i=e.filter(e=>e.isDynamic),a=new Map,o=[];for(let e=0;e<i.length;e++){let t=i[e].definition.pathname,r=a.get(t)??[];r.push(e),1===r.length&&(a.set(t,r),o.push(t))}let l=function(e){let t=new rJ;return e.forEach(e=>t.insert(e)),t.smoosh()}(o),d=[];for(let e of l){let t=a.get(e);if(!Array.isArray(t))throw Object.defineProperty(Error("Invariant: expected to find identity in indexes map"),"__NEXT_ERROR_CODE",{value:"E271",enumerable:!1,configurable:!0});let r=t.map(e=>i[e]);d.push(...r)}if(this.matchers.dynamic=d,this.compilationID!==n)throw Object.defineProperty(Error("Invariant: expected compilation to finish before new matchers were added, possible missing await"),"__NEXT_ERROR_CODE",{value:"E242",enumerable:!1,configurable:!0})}catch(e){r(e)}finally{this.lastCompilationID=n,t()}}push(e){this.providers.push(e)}async test(e,t){return null!==await this.match(e,t)}async match(e,t){for await(let r of this.matchAll(e,t))return r;return null}validate(e,t,r){var n;return t instanceof r0?t.match(e,r):(null==(n=r.i18n)?void 0:n.inferredFromDefault)?t.match(r.i18n.pathname):t.match(e)}async *matchAll(e,t){if(this.lastCompilationID!==this.compilationID)throw Object.defineProperty(Error("Invariant: expected routes to have been loaded before match"),"__NEXT_ERROR_CODE",{value:"E235",enumerable:!1,configurable:!0});if(!tV(e=tZ(e)))for(let r of this.matchers.static){let n=this.validate(e,r,t);n&&(yield n)}if(null==t?void 0:t.skipDynamic)return null;for(let r of this.matchers.dynamic){let n=this.validate(e,r,t);n&&(yield n)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}class r4{constructor(e=[]){this.normalizers=e}push(e){this.normalizers.push(e)}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}var r2=r("./dist/esm/shared/lib/isomorphic/path.js"),r9=r.n(r2);class r3{constructor(...e){this.prefix=r9().posix.join(...e)}normalize(e){return r9().posix.join(this.prefix,e)}}function r8(e){let t=/^\/index(\/|$)/.test(e)&&!tV(e)?`/index${e}`:"/"===e?"/index":tZ(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new ek(`Requested and resolved page mismatch: ${t} ${n}`)}return t}class r5{normalize(e){return e.replace(/%5F/g,"_")}}class r6 extends r3{constructor(){super("app")}normalize(e){return super.normalize(r8(e))}}class r7 extends r3{constructor(e){super(e,eY)}normalize(e){return super.normalize(e)}}function ne(e){return e.endsWith("/route")}let nt={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"]}},nr=(e,t)=>t&&0!==t.length?`(?:\\.(${e.join("|")})|(\\.(${t.join("|")})))`:`(\\.(?:${e.join("|")}))`,nn=/^[\\/]favicon\.ico$/,ns=/^[\\/]robots\.txt$/,ni=/^[\\/]manifest\.json$/,na=/^[\\/]manifest\.webmanifest$/,no=/[\\/]sitemap\.xml$/,nl=new Map;function nd(e){return{normalize:e}}class nu extends r4{constructor(){super([nd(tL),new r5])}normalize(e){return super.normalize(e)}}class nc{constructor(e){this.filename=new r7(e),this.pathname=new nu,this.bundlePath=new r6}}var nh=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({});class np extends rQ{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class nf{constructor(e){this.loader=e,this.cached=[]}async matchers(){let e=await this.loader.load();if(!e)return[];if(this.data&&this.loader.compare(this.data,e))return this.cached;this.data=e;let t=await this.transform(e);return this.cached=t,t}}class nm extends nf{constructor(e,t){super({load:async()=>t.load(e),compare:(e,t)=>e===t})}}class ng extends nm{constructor(e,t){super(eK,t),this.normalizers=new nc(e)}async transform(e){let t=Object.keys(e).filter(e=>e.endsWith("/page")),r={};for(let e of t){let t=this.normalizers.pathname.normalize(e);t in r?r[t].push(e):r[t]=[e]}let n=[];for(let[t,s]of Object.entries(r)){let r=s[0],i=this.normalizers.filename.normalize(e[r]),a=this.normalizers.bundlePath.normalize(r);n.push(new np({kind:nh.APP_PAGE,pathname:t,page:r,bundlePath:a,filename:i,appPaths:s}))}return n}}class ny extends rQ{}class nv extends nm{constructor(e,t){super(eK,t),this.normalizers=new nc(e)}async transform(e){let t=Object.keys(e).filter(e=>ne(e)),r=[];for(let n of t){let t=this.normalizers.filename.normalize(e[n]),s=this.normalizers.pathname.normalize(n),i=this.normalizers.bundlePath.normalize(n);r.push(new ny({kind:nh.APP_ROUTE,pathname:s,page:n,bundlePath:i,filename:t}))}return r}}function n_(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}class nb extends rQ{}class nx extends r0{}class nE extends r4{constructor(){super([nd(r8),new r3("pages")])}normalize(e){return super.normalize(e)}}class nw extends r3{constructor(e){super(e,eY)}normalize(e){return super.normalize(e)}}class nC{constructor(e){this.filename=new nw(e),this.bundlePath=new nE}}class nR extends nm{constructor(e,t,r){super(eG,t),this.i18nProvider=r,this.normalizers=new nC(e)}async transform(e){let t=Object.keys(e).filter(e=>n_(e)),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:s}=this.i18nProvider.analyze(n);r.push(new nx({kind:nh.PAGES_API,pathname:s,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new nb({kind:nh.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nP extends rQ{}class nT extends r0{}class nO extends nm{constructor(e,t,r){super(eG,t),this.i18nProvider=r,this.normalizers=new nC(e)}async transform(e){let t=Object.keys(e).filter(e=>!n_(e)).filter(e=>{var t;let r=(null==(t=this.i18nProvider)?void 0:t.analyze(e).pathname)??e;return!eJ.includes(r)}),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:s}=this.i18nProvider.analyze(n);r.push(new nT({kind:nh.PAGES,pathname:s,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new nP({kind:nh.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nS{constructor(e){this.getter=e}load(e){return this.getter(e)}}class nI{constructor(e){var t;if(this.config=e,!e.locales.length)throw Object.defineProperty(Error("Invariant: No locales provided"),"__NEXT_ERROR_CODE",{value:"E510",enumerable:!1,configurable:!0});this.lowerCaseLocales=e.locales.map(e=>e.toLowerCase()),this.lowerCaseDomains=null==(t=e.domains)?void 0:t.map(e=>{var t;let r=e.domain.toLowerCase();return{defaultLocale:e.defaultLocale.toLowerCase(),hostname:r.split(":",1)[0],domain:r,locales:null==(t=e.locales)?void 0:t.map(e=>e.toLowerCase()),http:e.http}})}detectDomainLocale(e,t){if(e&&this.lowerCaseDomains&&this.config.domains){t&&(t=t.toLowerCase());for(let n=0;n<this.lowerCaseDomains.length;n++){var r;let s=this.lowerCaseDomains[n];if(s.hostname===e||(null==(r=s.locales)?void 0:r.some(e=>e===t)))return this.config.domains[n]}}}fromRequest(e,t){let r=eF(e,"locale");if(r){let e=this.analyze(t);e.detectedLocale&&(e.detectedLocale!==r&&console.warn(`The detected locale does not match the locale in the query. Expected to find '${r}' in '${t}' but found '${e.detectedLocale}'}`),t=e.pathname)}return{pathname:t,detectedLocale:r,inferredFromDefault:eF(e,"localeInferredFromDefault")??!1}}analyze(e,t={}){let r=t.defaultLocale,n="string"==typeof r,s=e.split("/",2);if(!s[1])return{detectedLocale:r,pathname:e,inferredFromDefault:n};let i=s[1].toLowerCase(),a=this.lowerCaseLocales.indexOf(i);return a<0||(r=this.config.locales[a],n=!1,e=e.slice(r.length+1)||"/"),{detectedLocale:r,pathname:e,inferredFromDefault:n}}}async function nk(e,t,r,n){{var s;t.statusCode=r.status,t.statusMessage=r.statusText;let i=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(s=r.headers)||s.forEach((e,r)=>{if("x-middleware-set-cookie"!==r.toLowerCase())if("set-cookie"===r.toLowerCase())for(let n of t0(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(i.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:a}=t;r.body&&"HEAD"!==e.method?await rC(r.body,a,n):a.end()}}let nA=rO("/_next/data/:path*");class nj{constructor(e){this.suffix=e}match(e){return!!e.endsWith(this.suffix)}normalize(e,t){return t||this.match(e)?e.substring(0,e.length-this.suffix.length):e}}class nN extends nj{constructor(){super(tt)}}class nD extends nj{constructor(){super(e6)}match(e){return e==="/__index"+e6||super.match(e)}normalize(e,t){return e==="/__index"+e6?"/":super.normalize(e,t)}}class n${constructor(e){if(this.prefix=e,e.endsWith("/"))throw Object.defineProperty(Error(`PrefixPathnameNormalizer: prefix "${e}" should not end with a slash`),"__NEXT_ERROR_CODE",{value:"E219",enumerable:!1,configurable:!0})}match(e){return e===this.prefix||!!e.startsWith(this.prefix+"/")}normalize(e,t){return t||this.match(e)?e.length===this.prefix.length?"/":e.substring(this.prefix.length):e}}class nM{constructor(e){if(this.suffix=new nj(".json"),!e)throw Object.defineProperty(Error("Invariant: buildID is required"),"__NEXT_ERROR_CODE",{value:"E200",enumerable:!1,configurable:!0});this.prefix=new n$(`/_next/data/${e}`)}match(e){return this.prefix.match(e)&&this.suffix.match(e)}normalize(e,t){return t||this.match(e)?(e=this.prefix.normalize(e,!0),rT(e=this.suffix.normalize(e,!0))):e}}function nZ(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0}),"undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;let nL=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");let nq=Symbol("internal response"),nU=new Set([301,302,303,307,308]);function nz(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,s]of e.request.headers)t.set("x-middleware-request-"+n,s),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class nF extends Response{constructor(e,t={}){super(e,t);let r=this.headers,n=new Proxy(new rc.ResponseCookies(r),{get(e,n,s){switch(n){case"delete":case"set":return(...s)=>{let i=Reflect.apply(e[n],e,s),a=new Headers(r);return i instanceof rc.ResponseCookies&&r.set("x-middleware-set-cookie",i.getAll().map(e=>(0,rc.stringifyCookie)(e)).join(",")),nz(t,a),i};default:return e1.get(e,n,s)}}});this[nq]={cookies:n,url:t.url?new ro(t.url,{headers:t1(r),nextConfig:t.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[nq].cookies}static json(e,t){let r=Response.json(e,t);return new nF(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!nU.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},s=new Headers(null==n?void 0:n.headers);return s.set("Location",t4(e)),new nF(null,{...n,headers:s,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",t4(e)),nz(t,r),new nF(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),nz(e,t),new nF(null,{...e,headers:t})}}Symbol.for("next.mutated.cookies"),r("./dist/compiled/p-queue/index.js");let nH=require("next/dist/server/lib/cache-handlers/default.external.js");var nV=r.n(nH);let nW=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,nX=Symbol.for("@next/cache-handlers"),nB=Symbol.for("@next/cache-handlers-map"),nG=Symbol.for("@next/cache-handlers-set"),nK=globalThis;require("next/dist/server/app-render/after-task-async-storage.external.js");class nY extends rp{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new rl({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new rl({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new rl({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let nJ=RegExp(`^(/.*)${e7}(/.*)${te}$`);class nQ{match(e){return nJ.test(e)}extract(e){let t=e.match(nJ);return t?{originalPathname:t[1],segmentPath:t[2]}:null}normalize(e){let t=this.extract(e);return t?t.originalPathname:e}}let n0=require("next/dist/shared/lib/no-fallback-error.external.js");var n1=r("./dist/compiled/zod/index.cjs");r("./dist/compiled/zod-validation-error/index.js");let n4=n1.z.object({name:n1.z.string(),value:n1.z.string(),httpOnly:n1.z.boolean().optional(),path:n1.z.string().optional()}).strict(),n2=n1.z.object({cookies:n1.z.array(n4).optional(),headers:n1.z.array(n1.z.tuple([n1.z.string(),n1.z.string()])).optional(),params:n1.z.record(n1.z.union([n1.z.string(),n1.z.array(n1.z.string())])).optional(),searchParams:n1.z.record(n1.z.union([n1.z.string(),n1.z.array(n1.z.string()),n1.z.undefined()])).optional()}).strict(),n9=n1.z.object({mode:n1.z.literal("static"),from:n1.z.array(n1.z.string()).optional(),expectUnableToVerify:n1.z.boolean().optional()}).strict(),n3=n1.z.object({mode:n1.z.literal("runtime"),samples:n1.z.array(n2).min(1),from:n1.z.array(n1.z.string()).optional(),expectUnableToVerify:n1.z.boolean().optional()}).strict(),n8=n1.z.discriminatedUnion("mode",[n9,n3]);n1.z.object({revalidate:n1.z.union([n1.z.number().int().nonnegative(),n1.z.literal(!1)]).optional(),dynamicParams:n1.z.boolean().optional(),dynamic:n1.z.enum(["auto","error","force-static","force-dynamic"]).optional(),fetchCache:n1.z.enum(["auto","default-cache","only-cache","force-cache","force-no-store","default-no-store","only-no-store"]).optional(),unstable_prefetch:n8.optional(),preferredRegion:n1.z.union([n1.z.string(),n1.z.array(n1.z.string())]).optional(),experimental_ppr:n1.z.boolean().optional(),runtime:n1.z.enum(["edge","nodejs"]).optional(),maxDuration:n1.z.number().int().nonnegative().optional()}).keyof().options;let n5={catchall:"c","catchall-intercepted":"ci","optional-catchall":"oc",dynamic:"d","dynamic-intercepted":"di"};class n6 extends Error{constructor(e){super(),this.innerError=e}}class n7{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(e){var t,r;this.handleRSCRequest=(e,t,r)=>{var n,s,i;if(!r.pathname)return!1;if(null==(n=this.normalizers.segmentPrefetchRSC)?void 0:n.match(r.pathname)){let t=this.normalizers.segmentPrefetchRSC.extract(r.pathname);if(!t)return!1;let{originalPathname:n,segmentPath:s}=t;r.pathname=n,e.headers.rsc="1",e.headers[rW]="1",e.headers[rX]=s,eH(e,"isRSCRequest",!0),eH(e,"isPrefetchRSCRequest",!0),eH(e,"segmentPrefetchRSCRequest",s)}else if(null==(s=this.normalizers.prefetchRSC)?void 0:s.match(r.pathname))r.pathname=this.normalizers.prefetchRSC.normalize(r.pathname,!0),e.headers.rsc="1",e.headers[rW]="1",eH(e,"isRSCRequest",!0),eH(e,"isPrefetchRSCRequest",!0);else if(null==(i=this.normalizers.rsc)?void 0:i.match(r.pathname))r.pathname=this.normalizers.rsc.normalize(r.pathname,!0),e.headers.rsc="1",eH(e,"isRSCRequest",!0);else if(e.headers["x-now-route-matches"]){var a=e.headers;for(let e of rG)delete a[e];return!1}else if("1"!==e.headers.rsc)return!1;else if(eH(e,"isRSCRequest",!0),"1"===e.headers[rW]){eH(e,"isPrefetchRSCRequest",!0);let t=e.headers[rX];"string"==typeof t&&eH(e,"segmentPrefetchRSCRequest",t)}if(e.url){let t=(0,E.parse)(e.url);t.pathname=r.pathname,e.url=(0,E.format)(t)}return!1},this.handleNextDataRequest=async(e,t,r)=>{let n=await this.getMiddleware(),s=function(e){return"string"==typeof e&&nA(e)}(r.pathname);if(!s||!s.path)return!1;if(s.path[0]!==this.buildId)return!eF(e,"middlewareInvoke")&&(await this.render404(e,t,r),!0);s.path.shift();let i=s.path[s.path.length-1];if("string"!=typeof i||!i.endsWith(".json"))return await this.render404(e,t,r),!0;let a=`/${s.path.join("/")}`;if(a=function(e,t=""){return e=e.replace(/\\/g,"/"),(e=t&&e.endsWith(t)?e.slice(0,-t.length):e).startsWith("/index/")&&!tV(e)?e=e.slice(6):"/index"===e&&(e="/"),e}(a,".json"),n&&(this.nextConfig.trailingSlash&&!a.endsWith("/")&&(a+="/"),!this.nextConfig.trailingSlash&&a.length>1&&a.endsWith("/")&&(a=a.substring(0,a.length-1))),this.i18nProvider){var o;let s=null==e||null==(o=e.headers.host)?void 0:o.split(":",1)[0].toLowerCase(),i=this.i18nProvider.detectDomainLocale(s),l=(null==i?void 0:i.defaultLocale)??this.i18nProvider.config.defaultLocale,d=this.i18nProvider.analyze(a);if(d.detectedLocale&&(a=d.pathname),eH(e,"locale",d.detectedLocale),eH(e,"defaultLocale",l),d.detectedLocale||eV(e,"localeInferredFromDefault"),!d.detectedLocale&&!n)return eH(e,"locale",l),await this.render404(e,t,r),!0}return r.pathname=a,eH(e,"isNextDataReq",!0),!1},this.handleNextImageRequest=()=>!1,this.handleCatchallRenderRequest=()=>!1,this.handleCatchallMiddlewareRequest=()=>!1,this.normalize=e=>{let t=[];for(let r of(this.normalizers.data&&t.push(this.normalizers.data),this.normalizers.segmentPrefetchRSC&&t.push(this.normalizers.segmentPrefetchRSC),this.normalizers.prefetchRSC&&t.push(this.normalizers.prefetchRSC),this.normalizers.rsc&&t.push(this.normalizers.rsc),t))if(r.match(e))return r.normalize(e,!0);return e},this.normalizeAndAttachMetadata=async(e,t,r)=>{let n=await this.handleNextImageRequest(e,t,r);return!!(n||this.enabledDirectories.pages&&(n=await this.handleNextDataRequest(e,t,r)))||!1},this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=function(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}(()=>{tT(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
25
- See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:n=".",quiet:s=!1,conf:i,dev:a=!1,minimalMode:o=!1,hostname:l,port:d,experimentalTestProxy:u}=e;this.experimentalTestProxy=u,this.serverOptions=e,this.dir=b.resolve(n),this.quiet=s,this.loadEnvConfig({dev:a,forceReload:!1}),this.nextConfig=i,this.hostname=l,this.hostname&&(this.fetchHostname=function(e){return tM.test(e)?`[${e}]`:e}(this.hostname)),this.port=d,this.distDir=b.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!o&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nI(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rY(this.i18nProvider):void 0;let{assetPrefix:c,generateEtags:h}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=o||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(a),this.isAppPPREnabled=this.enabledDirectories.app&&function(e){return void 0!==e&&("boolean"==typeof e?e:"incremental"===e)}(this.nextConfig.experimental.ppr),this.isAppSegmentPrefetchEnabled=this.enabledDirectories.app&&!0===this.nextConfig.experimental.clientSegmentCache,this.normalizers={rsc:this.enabledDirectories.app&&1?new nN:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nD:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nQ:void 0,data:this.enabledDirectories.pages?new nM(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={dir:this.dir,supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,poweredByHeader:this.nextConfig.poweredByHeader,generateEtags:h,previewProps:this.getPrerenderManifest().preview,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==(r=this.nextConfig.i18n)?void 0:r.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,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,htmlLimitedBots:this.nextConfig.htmlLimitedBots,experimental:{expireTime:this.nextConfig.expireTime,staleTimes:this.nextConfig.experimental.staleTimes,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,cacheComponents:this.nextConfig.experimental.cacheComponents??!1,clientSegmentCache:"client-only"===this.nextConfig.experimental.clientSegmentCache?"client-only":!!this.nextConfig.experimental.clientSegmentCache,clientParamParsing:this.nextConfig.experimental.clientParamParsing??!1,clientParamParsingOrigins:this.nextConfig.experimental.clientParamParsingOrigins,dynamicOnHover:this.nextConfig.experimental.dynamicOnHover??!1,inlineCss:this.nextConfig.experimental.inlineCss??!1,authInterrupts:!!this.nextConfig.experimental.authInterrupts},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},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(c),this.responseCache=this.getResponseCache({dev:a})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new nS(e=>{switch(e){case eG:return this.getPagesManifest()??null;case eK:return this.getAppPathsManifest()??null;default:return null}}),t=new r1;return t.push(new nO(this.distDir,e,this.i18nProvider)),t.push(new nR(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new ng(this.distDir,e)),t.push(new nv(this.distDir,e))),t}async instrumentationOnRequestError(...e){let[t,r,n]=e;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,t,{path:r.url||"",method:r.method||"GET",headers:r instanceof nY?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tP(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),s=(0,to.getTracer)();return s.withPropagatedContext(e.headers,()=>s.trace(ry.handleRequest,{spanName:`${n}`,kind:to.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async i=>this.handleRequestImpl(e,t,r).finally(()=>{if(!i)return;let r=eF(e,"isRSCRequest")??!1;i.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(i.setStatus({code:to.SpanStatusCode.ERROR}),i.setAttribute("error.type",t.statusCode.toString()));let a=s.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==ry.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=a.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;i.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),i.updateName(e)}else i.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,s,i,a,o,l,d,u,c,h=t.originalResponse;let p=h.setHeader.bind(h);h.setHeader=(t,r)=>{if("headersSent"in h&&h.headersSent)return h;if("set-cookie"===t.toLowerCase()){let t=eF(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return p(t,r)};let f=(e.url||"").split("?",1)[0];if(null==f?void 0:f.match(/(\\|\/\/)/)){let r=function(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}(e.url);t.redirect(r,308).body(r).send();return}if(!r||"object"!=typeof r){if(!e.url)throw Object.defineProperty(Error("Invariant: url can not be undefined"),"__NEXT_ERROR_CODE",{value:"E123",enumerable:!1,configurable:!0});r=(0,E.parse)(e.url,!0)}if(!r.pathname)throw Object.defineProperty(Error("Invariant: pathname can't be empty"),"__NEXT_ERROR_CODE",{value:"E412",enumerable:!1,configurable:!0});"string"==typeof r.query&&(r.query=Object.fromEntries(new URLSearchParams(r.query)));let{originalRequest:m=null}=e,g=null==m?void 0:m.headers["x-forwarded-proto"],y=g?"https"===g:!!(null==m||null==(n=m.socket)?void 0:n.encrypted);e.headers["x-forwarded-host"]??=e.headers.host??this.hostname,e.headers["x-forwarded-port"]??=this.port?this.port.toString():y?"443":"80",e.headers["x-forwarded-proto"]??=y?"https":"http",e.headers["x-forwarded-for"]??=null==m||null==(s=m.socket)?void 0:s.remoteAddress,this.attachRequestMeta(e,r);let v=await this.handleRSCRequest(e,t,r);if(v)return;let _=null==(i=this.i18nProvider)?void 0:i.detectDomainLocale(t7(r,e.headers)),b=(null==_?void 0:_.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);eH(e,"defaultLocale",b);let x=tb(e.url.replace(/^\/+/,"/")),w=rn(x.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});x.pathname=w.pathname,w.basePath&&(e.url=rr(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[e5];if(C)try{this.enabledDirectories.app&&(e.url.match(/^\/index($|\?)/)&&(e.url=e.url.replace(/^\/index/,"/")),r.pathname="/index"===r.pathname?"/":r.pathname);let{pathname:n}=new URL(function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new TextDecoder("utf-8").decode(t)}(e.headers[e5]),"http://localhost"),{pathname:s}=new URL(e.url,"http://localhost");if((null==(o=this.normalizers.data)?void 0:o.match(s))&&eH(e,"isNextDataReq",!0),this.isAppPPREnabled&&"1"===e.headers["next-resume"]&&"POST"===e.method){let t=[];for await(let r of e.body)t.push(r);let r=Buffer.concat(t).toString("utf8");eH(e,"postponed",r)}if(eF(e,"isNextDataReq")&&eF(e,"postponed")){t.statusCode=422,t.send();return}n=this.normalize(n);let i=this.stripNextDataPath(s);n=rT(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:b});a&&(eH(e,"locale",a.detectedLocale),a.inferredFromDefault?eH(e,"localeInferredFromDefault",!0):eV(e,"localeInferredFromDefault"));let c=n,h=tV(c),p={params:!1,hasValidParams:!1},f=await this.matchers.match(c,{i18n:a});!h&&f&&(c=f.definition.pathname,void 0!==f.params&&(h=!0,p.params=f.params,p.hasValidParams=!0)),a&&(n=a.pathname);let m=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:s,trailingSlash:i,caseSensitive:a}){let o,l,d;return s&&(d=(l=eU(o=function(e,t){let r=function(e,t,r,n,s,i={}){let a,o=(a=0,()=>{let e="",t=++a;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={},d=[],u=[];for(let a of(i=structuredClone(i),t9(e).slice(1).split("/"))){let e=tU.some(e=>a.startsWith(e)),c=a.match(rA);if(e&&c&&c[2]){let{key:e,pattern:r,cleanedKey:n,repeat:a,optional:h}=rD({getSafeRouteKey:o,interceptionMarker:c[1],segment:c[2],routeKeys:l,keyPrefix:t?e8:void 0,backreferenceDuplicateKeys:s});d.push(r),u.push(`/${c[1]}:${i[e]??n}${a?h?"*":"+":""}`),i[e]??=n}else if(c&&c[2]){n&&c[1]&&(d.push(`/${rk(c[1])}`),u.push(`/${c[1]}`));let{key:e,pattern:r,cleanedKey:a,repeat:h,optional:p}=rD({getSafeRouteKey:o,segment:c[2],routeKeys:l,keyPrefix:t?e3:void 0,backreferenceDuplicateKeys:s}),f=r;n&&c[1]&&(f=f.substring(1)),d.push(f),u.push(`/:${i[e]??a}${h?p?"*":"+":""}`),i[e]??=a}else d.push(`/${rk(a)}`),u.push(`/${a}`);r&&c&&c[3]&&(d.push(rk(c[3])),u.push(c[3]))}return{namedParameterizedRoute:d.join(""),routeKeys:l,pathToRegexpPattern:u.join(""),reference:i}}(e,t.prefixRouteKeys,t.includeSuffix??!1,t.includePrefix??!1,t.backreferenceDuplicateKeys??!1,t.reference),n=r.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(n+="(?:/)?"),{...rN(e,t),namedRegex:`^${n}$`,routeKeys:r.routeKeys,pathToRegexpPattern:r.pathToRegexpPattern,reference:r.reference}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u=structuredClone(d),c={},h=u.pathname,p=n=>{let d=rO(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!u.pathname)return!1;let p=d(u.pathname);if((n.has||n.missing)&&p){let e=rM(o,u.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){let{parsedDestination:i,destQuery:a}=function(e){let t,r,n=function(e){let t=e.destination;for(let n of Object.keys({...e.params,...e.query}))if(n){var r;r=t,t=r.replace(RegExp(`:${rk(n)}`,"g"),`__ESC_COLON_${n}`)}let n=tb(t),s=n.pathname;s&&(s=r$(s));let i=n.href;i&&(i=r$(i));let a=n.hostname;a&&(a=r$(a));let o=n.hash;o&&(o=r$(o));let l=n.search;l&&(l=r$(l));let d=n.origin;return d&&(d=r$(d)),{...n,pathname:s,hostname:a,href:i,hash:o,search:l,origin:d}}(e),{hostname:s,query:i,search:a}=n,o=n.pathname;n.hash&&(o=`${o}${n.hash}`);let l=[],d=[];for(let e of(eL(o,d),d))l.push(e.name);if(s){let e=[];for(let t of(eL(s,e),e))l.push(t.name)}let u=eq(o,{validate:!1});for(let[r,n]of(s&&(t=eq(s,{validate:!1})),Object.entries(i)))Array.isArray(n)?i[r]=n.map(t=>rZ(r$(t),e.params)):"string"==typeof n&&(i[r]=rZ(r$(n),e.params));let c=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!c.some(e=>l.includes(e)))for(let t of c)t in i||(i[t]=e.params[t]);if(tz(o))for(let t of o.split("/")){let r=tU.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[s,i]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=s,n.hash=`${i?"#":""}${i||""}`,n.search=a?rZ(a,e.params):""}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(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"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1,configurable:!0});throw e}return n.query={...e.query,...n.query},{newUrl:r,destQuery:i,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:u.query});if(i.protocol)return!0;if(Object.assign(c,a,p),Object.assign(u.query,i.query),delete i.query,Object.assign(u,i),!(h=u.pathname))return!1;if(r&&(h=h.replace(RegExp(`^${r}`),"")||"/"),t){let e=rt(h,t.locales);h=e.pathname,u.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(h===e)return!0;if(s&&l){let e=l(h);if(e)return u.query={...u.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])p(e);if(h!==e){let t=!1;for(let e of n.afterFiles||[])if(t=p(e))break;if(!t&&!(()=>{let t=t9(h||"");return t===t9(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=p(e))break}}return{rewriteParams:c,rewrittenParsedUrl:u}},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let s=t2(r);s&&(delete e[r],t.add(s),void 0!==n&&(e[s]=Array.isArray(n)?n.map(e=>rL(e)):rL(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eU({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=t2(e);r&&(n[r]=t,delete n[e])}let s={};for(let e of Object.keys(r)){let i=r[e];if(!i)continue;let a=t[i],o=n[e];if(!a.optional&&!o)return null;s[a.pos]=o}return s}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let s={};for(let i of Object.keys(r.groups)){let a=e[i];"string"==typeof a?a=tq(a):Array.isArray(a)&&(a=a.map(tq));let o=n[i],l=r.groups[i].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(a)?a.some(t=>t.includes(e)):null==a?void 0:a.includes(e)):null==a?void 0:a.includes(o))||void 0===a&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!a||Array.isArray(a)&&1===a.length&&("index"===a[0]||a[0]===`[[...${i}]]`))&&(a=void 0,delete e[i]),a&&"string"==typeof a&&r.groups[i].repeat&&(a=a.split("/")),a&&(s[i]=a)}return{params:s,hasValidParams:!0}},normalizeCdnUrl:(e,t)=>(function(e,t){let r=function(e){let t=function(e){let t;try{t=new URL(e,"http://n")}catch{}return t}(e);if(!t)return;let r={};for(let e of t.searchParams.keys()){let n=t.searchParams.getAll(e);r[e]=n.length>1?n:n[0]}return{query:r,hash:t.hash,search:t.search,path:t.pathname,pathname:t.pathname,href:`${t.pathname}${t.search}${t.hash}`,host:"",hostname:"",auth:"",protocol:"",slashes:null,port:""}}(e.url);if(!r)return e.url;delete r.search,rU(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",a=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:r&&(o=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(o+=":"+e.port)),a&&"object"==typeof a&&(a=String(function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,t_(e));else t.set(r,t_(n));return t}(a)));let l=e.search||a&&`?${a}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rq.test(n))&&!1!==o?(o="//"+(o||""),s&&"/"!==s[0]&&(s="/"+s)):o||(o=""),i&&"#"!==i[0]&&(i="#"+i),l&&"?"!==l[0]&&(l="?"+l),s=s.replace(/[?#]/g,encodeURIComponent),l=l.replace("#","%23"),`${n}${o}${s}${l}${i}`}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let s,{optional:i,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;i&&(o=`[${o}]`);let l=t[n];((s=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||i)&&(e=e.replaceAll(o,s))}return e})(e,t,o),filterInternalQuery:(e,t)=>rU(e,t)}}({pageIsDynamic:h,page:c,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(d=this.getRoutesManifest())?void 0:d.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});b&&!w.locale&&(r.pathname=`/${b}${r.pathname}`);let g={...r.query},y=r.pathname,{rewriteParams:_,rewrittenParsedUrl:E}=m.handleRewrites(e,r),C=Object.keys(_),R={...E.query},P=y!==E.pathname;P&&E.pathname&&eH(e,"rewroteURL",E.pathname);let T=new Set;for(let[e,t]of Object.entries(r.query)){let n=t2(e);n&&(delete r.query[e],T.add(n),void 0!==t&&(R[n]=Array.isArray(t)?t.map(e=>rL(e)):rL(t)))}if(h){let t={};if(p.hasValidParams||(p=m.normalizeDynamicRouteParams(R,!1)),!p.hasValidParams&&!tV(i)){let e=null==m.dynamicRouteMatcher?void 0:m.dynamicRouteMatcher.call(m,i);e&&(m.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tV(n)){let e=null==m.dynamicRouteMatcher?void 0:m.dynamicRouteMatcher.call(m,n);if(e){let r=m.normalizeDynamicRouteParams(e,!1);r.hasValidParams&&(Object.assign(t,e),p=r)}}p.hasValidParams&&(t=p.params);let r=e.headers["x-now-route-matches"];if("string"==typeof r&&r&&tV(n)&&!p.hasValidParams){let e=m.getParamsFromRouteMatches(r);e&&(p=m.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=m.normalizeDynamicRouteParams(R,!0)).hasValidParams&&(t=p.params),m.defaultRouteMatches&&i===c&&!p.hasValidParams&&(t=m.defaultRouteMatches,""===r&&eH(e,"renderFallbackShell",!0)),t){n=m.interpolateDynamicPath(c,t),e.url=m.interpolateDynamicPath(e.url,t);let r=eF(e,"segmentPrefetchRSCRequest");r&&tV(r,!1)&&(r=m.interpolateDynamicPath(r,t),e.headers[rX]=r,eH(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||P)&&m.normalizeCdnUrl(e,[...C,...Object.keys((null==(u=m.defaultRouteRegex)?void 0:u.groups)||{})]),T))t in g||delete r.query[t];if(r.pathname=n,x.pathname=r.pathname,((null==f?void 0:f.definition.kind)===nh.PAGES||(null==f?void 0:f.definition.kind)===nh.PAGES_API)&&(r.query=R),v=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof eI||r instanceof ek)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(eH(e,"isLocaleDomain",!!_),w.locale&&(e.url=(0,E.format)(x),eH(e,"didStripLocale",!0)),!eF(e,"locale")&&(w.locale?eH(e,"locale",w.locale):b&&(eH(e,"locale",b),eH(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eF(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),eH(e,"incrementalCache",t),globalThis.__incrementalCache=t}eF(e,"serverComponentsHmrCache")||eH(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let R=eF(e,"invokePath");if(!C&&R){let n=eF(e,"invokeStatus");if(n){let s=eF(e,"invokeQuery");s&&Object.assign(r.query,s),t.statusCode=n;let i=eF(e,"invokeError")||null;return this.renderError(i,e,t,"/_error",r.query)}let s=new URL(R||"/","http://n"),i=rn(s.pathname,{nextConfig:this.nextConfig,parseData:!1});i.locale&&eH(e,"locale",i.locale),r.pathname!==s.pathname&&(r.pathname=s.pathname,eH(e,"rewroteURL",i.pathname));let a=rt(rr(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&eH(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eF(e,"invokeQuery");if(o&&Object.assign(r.query,o),v=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eF(e,"middlewareInvoke")){if((v=await this.normalizeAndAttachMetadata(e,t,r))||(v=await this.handleCatchallMiddlewareRequest(e,t,r)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!C&&w.basePath&&(r.pathname=rr(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof n0.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof eI||r instanceof ek)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,s)=>(r[ez]=e,t(r,n,s))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(e){this.nextConfig.assetPrefix=e?e.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return this.instrumentation||(this.instrumentation=await this.loadInstrumentationModule()),null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let e={};return Object.keys(this.appPathsManifest||{}).forEach(t=>{let r=tL(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,to.getTracer)().trace(ry.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,to.getTracer)().trace(ry.pipe,async()=>this.pipeImpl(e,t))}async pipeImpl(e,t){let r=t.req.headers["user-agent"]||"",n={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!this.renderOpts.botType,serveStreamingMetadata:function(e,t){let r=RegExp(t||tB,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},s=await e(n);if(null===s)return;let{req:i,res:a}=n,o=a.statusCode,{body:l}=s,{cacheControl:d}=s;if(!a.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(a.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(i,a,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),a.statusCode=o}}async getStaticHTML(e,t){let r={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await e(r);return null===n?null:n.body.toUnchunkedString()}async render(e,t,r,n={},s,i=!1){return(0,to.getTracer)().trace(ry.render,async()=>this.renderImpl(e,t,r,n,s,i))}getWaitUntil(){let e=function(){let e=globalThis[nL];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},s,i=!1){var a;r.startsWith("/")||console.warn(`Cannot render page with path "${r}", did you mean "/${r}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.serverOptions.customServer&&"/index"===r&&!await this.hasPage("/index")&&(r="/");let o=e.headers["user-agent"]||"";return this.renderOpts.botType=function(e){return tX.test(e)?"dom":tW.test(e)?"html":void 0}(o),(a=r,eJ.includes(a))?this.render404(e,t,s):this.pipe(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async getStaticPaths({pathname:e}){var t;return{staticPaths:void 0,fallbackMode:function(e){if("string"==typeof e)return"PRERENDER";if(null===e)return"BLOCKING_STATIC_RENDER";if(!1===e)return"NOT_FOUND";if(void 0!==e)throw Object.defineProperty(Error(`Invalid fallback option: ${e}. Fallback option must be a string, null, undefined, or false.`),"__NEXT_ERROR_CODE",{value:"E285",enumerable:!1,configurable:!0})}(null==(t=this.getPrerenderManifest().dynamicRoutes[e])?void 0:t.fallback)}}async renderToResponseWithComponents(e,t){return(0,to.getTracer)().trace(ry.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return tz(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let s=`rsc, ${rV}, ${rW}, ${rX}`,i=eF(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${s}, ${rB}`),a=!0):(r||i)&&t.appendHeader("vary",s),a||delete e.headers[rB]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:s,query:i}){var a,o,l,d,u,c;let h,p;r===eW&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===s.isAppPath,v=!!s.getServerSideProps,_=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rH)??null,r=e.headers.get("content-type")):(t=e.headers[rH]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,s=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),i=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:s,isFetchAction:i,isPossibleServerAction:!!(i||n||s)}}(e).isPossibleServerAction,b=!!s.getStaticProps,x=eF(e,"isRSCRequest")??!1,w=(0,E.parse)(e.url||"").pathname||"/",C=eF(e,"rewroteURL")||w;this.setVaryHeader(e,t,y,C);let R=this.getPrerenderManifest();(null==h?void 0:h.includes(C))||e.headers["x-now-route-matches"]?b=!0:b||=!!R.routes[nZ(r)];let P=!!(eF(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(b||v);if(!b&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(e5,r),t.setHeader("x-middleware-skip","1"),t.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),t.body("{}").send(),null;b&&e.headers[e5]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eF(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),s.routeModule&&(p=s.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===nh.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==i.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eF(e,"postponed"):void 0;if(!m||P||x||(t.statusCode=404),eQ.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!_&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof s.Component||b))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof s.Component)return{body:rR.fromStatic(s.Component,e9)};if(!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tX.test(u)||tW.test(d)),r="function"!=typeof(null==(o=s.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in s.Document;n.supportsDynamicResponse=!b&&!t&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),b&&e.headers[e5]&&(C=w),w=t9(w),C=t9(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),P&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==p?void 0:p.isDev)&&tV(r)&&(s.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:s.page,isAppPath:y});if(y&&this.nextConfig.experimental.cacheComponents&&(null==(l=t.prerenderedRoutes)?void 0:l.length)){let r=null;for(let e of t.prerenderedRoutes){let t=e.fallbackRouteParams;if(!t||0===t.length){r=null;break}(null===r||t.length<r.length)&&(r=t)}r&&eH(e,"devValidatingFallbackParams",function(e){if(0===e.length)return null;let t=Math.random().toString(16).slice(2),r=new Map;for(let{paramName:n,paramType:s}of e)r.set(n,[`%%drp:${n}:${t}%%`,n5[s]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==nh.APP_ROUTE))return await nk(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,E.parse)(eF(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));f||(k.url=`${N}${j.search||""}`),c=eF(e),k[ez]=c,eH(k,"distDir",this.distDir),eH(k,"query",i),eH(k,"params",n.params),eH(k,"minimalMode",!0),n.err&&eH(k,"invokeError",n.err);let D=s.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rT(e.substring(e.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&t)?this.localeNormalizer.normalize(e):e}getOriginalAppPaths(e){if(this.enabledDirectories.app){var t;let r=null==(t=this.appPathRoutes)?void 0:t[e];return r||null}return null}async renderPageComponent(e,t){var r;let{query:n,pathname:s}=e,i=this.getOriginalAppPaths(s),a=Array.isArray(i),o=s;a&&(o=i[i.length-1]);let l=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:a,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,to.getTracer)().setRootSpanAttribute("next.route",s);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof n0.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,to.getTracer)().trace(ry.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:s,pathname:i}=e,a=eF(e.req,"bubbleNoFallback")??!1;delete s[rK];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,i)},l=eF(e.req,"match"),d=!0;eF(e.req,"invokeOutput"),(null==l?void 0:l.definition.page.includes("/@"))&&(d=!1);try{for await(let t of d&&l?[l]:this.matchers.matchAll(i,o)){let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},a);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,a);if(!1!==t)return t}}catch(s){let t=rF(s);if(s instanceof ej)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:e.req.url,matchedPath:e.req.headers[e5],initUrl:eF(e.req,"initURL"),didRewrite:!!eF(e.req,"rewroteURL"),rewroteUrl:eF(e.req,"rewroteURL")},null,2)),t;if(t instanceof n0.NoFallbackError&&a)throw t;if(t instanceof eI||t instanceof ek)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(eH(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eV(e.req,"customErrorRender"));let r=t instanceof n6;if(!r)throw rz(t)&&(t.page=i),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=eF(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${i}`),n.statusCode=200,n.setHeader("Content-Type","application/json; charset=utf-8"),n.body("{}"),n.send(),null}return n.statusCode=404,this.renderErrorToResponse(e,null)}async renderToHTML(e,t,r,n={}){return(0,to.getTracer)().trace(ry.renderToHTML,async()=>this.renderToHTMLImpl(e,t,r,n))}async renderToHTMLImpl(e,t,r,n={}){return this.getStaticHTML(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async renderError(e,t,r,n,s={},i=!0){return(0,to.getTracer)().trace(ry.renderError,async()=>this.renderErrorImpl(e,t,r,n,s,i))}async renderErrorImpl(e,t,r,n,s={},i=!0){return i&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async t=>{let n=await this.renderErrorToResponse(t,e);if(500===r.statusCode)throw e;return n},{req:t,res:r,pathname:n,query:s})}async renderErrorToResponse(e,t){return(0,to.getTracer)().trace(ry.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let s=null,i=404===r.statusCode,a=this.enabledDirectories.app;i&&(a&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:eX,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!s&&await this.hasPage("/404")&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eF(e.req,"customErrorRender")&&!s&&eQ.includes(o)&&(!s&&a&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),s=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),s||(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!s)throw new n6(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));s.components.routeModule?eH(e.req,"match",{definition:s.components.routeModule.definition,params:void 0}):eV(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},s)}catch(e){if(e instanceof n0.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(a){let t=rF(a),s=t instanceof n6;s||this.logError(t),r.statusCode=500;let i=await this.getFallbackErrorComponents(e.req.url);if(i)return eH(e.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:s?t.innerError:t}},{query:n,components:i});return{body:rR.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,s={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:s})}async render404(e,t,r,n=!0){let{pathname:s,query:i}=r||(0,E.parse)(e.url,!0);return this.nextConfig.i18n&&(eF(e,"locale")||eH(e,"locale",this.nextConfig.i18n.defaultLocale),eH(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,s,i,n)}}let se=require("next/dist/server/load-manifest.external.js"),st=new P(1e3);function sr(e,t,r,n){let s,i=`${e}:${t}:${r}:${n}`,a=null==st?void 0:st.get(i);if(a)return a;let o=x().join(t,eY);n&&(s=(0,se.loadManifest)(x().join(o,eK),!0));let l=(0,se.loadManifest)(x().join(o,eG),!0);try{e=rT(r8(e))}catch(t){throw console.error(t),new eA(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let s={};for(let e of Object.keys(t))s[rt(e,r).pathname]=l[e];n=s[e]}return n};return(s&&(a=d(s)),a||(a=d(l)),a)?(x().isAbsolute(a)||(a=x().join(o,a)),null==st||st.set(i,a),a):(null==st||st.set(i,null),null)}function sn(e,t,r,n){let s=sr(e,t,r,n);if(!s)throw new eA(e);return s}async function ss(e,t,r){let n=sn(e,t,void 0,r);return n.endsWith(".html")?Q.promises.readFile(n,"utf8").catch(t=>{throw new ej(e,t.message)}):require(n)}function si(e){return e.default||e}async function sa(e){return new Promise(t=>setTimeout(t,e))}let so=Symbol.for("next.server.action-manifests");async function sl(e,t=3){for(;;)try{return(0,se.loadManifest)(e)}catch(e){if(--t<=0)throw e;await sa(100)}}async function sd(e,t=3){try{return await sl(e,t)}catch(e){return}}async function su(e,t=3){for(;;)try{return(0,se.evalManifest)(e)}catch(e){if(--t<=0)throw e;await sa(100)}}async function sc(e,t,r){try{return(await su(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function sh({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:s,needsManifestsForLegacyReasons:i}){let a={},o={};if(r||([a,o]=await Promise.all([ss("/_document",e,!1),ss("/_app",e,!1)])),i){let i,l=n?3:1;i=(0,b.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return ne(e)&&function(e,t,r){if(!e||e.length<2)return!1;let n=rP(e),s=!!(nn.test(n)||ns.test(n)||ni.test(n)||na.test(n)||no.test(n))||(!!n.includes("robots")||!!n.includes("manifest")||!!n.includes("sitemap")||!!n.includes("icon")||!!n.includes("apple-icon")||!!n.includes("opengraph-image")||!!n.includes("twitter-image")||!!n.includes("favicon"))&&null;if(null!==s)return s;let i=function(e,t){let r=`${e.join(",")}|${t}`,n=nl.get(r);if(n)return n;let s=t?"$":"?$",i="\\d?"+(t?"":"(-\\w{6})?"),a=e.length>0?[...e,"txt"]:["txt"],o=e.length>0?[...e,"webmanifest","json"]:["webmanifest","json"],l=[RegExp(`^[\\\\/]robots${nr(a,null)}${s}`),RegExp(`^[\\\\/]manifest${nr(o,null)}${s}`),RegExp(`[\\\\/]sitemap${nr(["xml"],e)}${s}`),RegExp(`[\\\\/]icon${i}${nr(nt.icon.extensions,e)}${s}`),RegExp(`[\\\\/]apple-icon${i}${nr(nt.apple.extensions,e)}${s}`),RegExp(`[\\\\/]opengraph-image${i}${nr(nt.openGraph.extensions,e)}${s}`),RegExp(`[\\\\/]twitter-image${i}${nr(nt.twitter.extensions,e)}${s}`)];return nl.set(r,l),l}(t,r);for(let e=0;e<i.length;e++)if(i[e].test(n))return!0;return!1}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([sl((0,b.join)(e,"build-manifest.json"),l),sd(i,l),r||0?void 0:sl((0,b.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?sc((0,b.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?sl((0,b.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,s?sl((0,b.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var s;let i=null==(s=globalThis[so])?void 0:s.clientReferenceManifestsPerPage;globalThis[so]={clientReferenceManifestsPerPage:{...i,[tL(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,s,i;let a,o=null==(s=e.node)||null==(n=s[r])?void 0:n.workers;if(!o)return;let l=ey.workAsyncStorage.getStore();if(!(a=l?o[t6(i=l.page,"app")?i:"app"+i]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let g=await ss(t,e,r),y=si(g),v=si(a),_=si(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=g;return{App:_,Document:v,Component:y,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:g.config||{},ComponentMod:g,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await ss(t,e,r),s=si(n),i=si(a),l=si(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:i,Component:s,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let sp=(0,to.getTracer)().wrap(rv.loadComponents,sh);function sf(e){return(t,r,n)=>{for(let s of e)if(new RegExp(s.regexp).exec(t)){if((s.has||s.missing)&&!rM(r,n,s.has,s.missing))continue;return!0}return!1}}var sm=r("../next-env/dist/index.js");let sg=require("stream");var sy=r.n(sg),sv=r("./dist/compiled/bytes/index.js"),s_=r.n(sv);class sb{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new sb(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:s,resolve:i,reject:a}=new rg;return this.pending.set(r,s),this.schedulerFn(async()=>{try{let r=await t({resolve:i,key:e});i(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),s}}let sx=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var sE=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.REDIRECT="REDIRECT",e.IMAGE="IMAGE",e}({}),sw=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({});async function sC(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===sE.PAGES?{kind:sE.PAGES,html:await e.value.html.toUnchunkedString(!0),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===sE.APP_PAGE?{kind:sE.APP_PAGE,html:await e.value.html.toUnchunkedString(!0),postponed:e.value.postponed,rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,segmentData:e.value.segmentData}:e.value}}async function sR(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===sE.PAGES?{kind:sE.PAGES,html:rR.fromStatic(e.value.html,e9),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===sE.APP_PAGE?{kind:sE.APP_PAGE,html:rR.fromStatic(e.value.html,e9),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class sP{constructor(e){this.getBatcher=sb.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:sx}),this.revalidateBatcher=sb.create({schedulerFn:sx}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return sR(this.previousCacheItem.entry);let{incrementalCache:s,isOnDemandRevalidate:i=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return sR(await this.getBatcher.batch({key:e,isOnDemandRevalidate:i},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:s,isOnDemandRevalidate:i,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let s=null,i=!1;try{if((s=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case nh.PAGES:return sw.PAGES;case nh.APP_PAGE:return sw.APP_PAGE;case nh.IMAGE:return sw.IMAGE;case nh.APP_ROUTE:return sw.APP_ROUTE;case nh.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(s),i=!0,!s.isStale||r.isPrefetch))return s;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,s,null!==s&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(i)return console.error(e),null;throw e}}async revalidate(e,t,r,n,s,i,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,s,i,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,s,i,a){try{let o=await s({hasResolved:a,previousCacheEntry:i,isRevalidating:!0});if(!o)return null;let l=await sC({...o,isMiss:!i});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(s){if(null==i?void 0:i.cacheControl){let s=Math.min(Math.max(i.cacheControl.revalidate||3,3),30),a=void 0===i.cacheControl.expire?void 0:Math.max(s+3,i.cacheControl.expire);await t.set(e,i.value,{cacheControl:{revalidate:s,expire:a},isRoutePPREnabled:r,isFallback:n})}throw s}}}let sT=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class sO{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(r9().dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}let sS=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class sI{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?sI.memoryCache?sI.debug&&console.log("FileSystemCache: memory store already initialized"):(sI.debug&&console.log("FileSystemCache: using memory store for fetch cache"),sI.memoryCache=(0,sS.getMemoryCache)(e.maxMemoryCacheSize)):sI.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,sI.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=sT.tagsManifest.get(n)||{};if(t){let s={...e};s.stale=r,void 0!==t.expire&&(s.expired=r+1e3*t.expire),sT.tagsManifest.set(n,s)}else sT.tagsManifest.set(n,{...e,expired:r})}}async get(...e){var t,r,n,s,i,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=sI.memoryCache)?void 0:t.get(u);if(sI.debug&&(h===sw.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===sw.APP_ROUTE){let e=this.getFilePath(`${u}.body`,sw.APP_ROUTE),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),n=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,tn),"utf8"));p={lastModified:r.getTime(),value:{kind:sE.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===sw.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===sw.FETCH){let{tags:e,fetchIdx:n,fetchUrl:s}=c;if(!this.flushToDisk)return null;let i=r.getTime(),l=JSON.parse(t);if(p={lastModified:i,value:l},(null==(a=p.value)?void 0:a.kind)===sE.FETCH){let t=null==(o=p.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(sI.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:s}))}}else if(h===sw.APP_PAGE){let n,s,i;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,tn),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;s=e;let t=u+e7;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+te,sw.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(i=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e6:tt}`,sw.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:sE.APP_PAGE,html:t,rscData:i,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:s}}}else if(h===sw.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${tr}`,sw.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:sE.PAGES,html:t,pageData:n,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${h} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1,configurable:!0})}p&&(null==(l=sI.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return sI.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===sE.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===sE.APP_ROUTE||(null==p||null==(s=p.value)?void 0:s.kind)===sE.PAGES){let e=null==(d=p.value.headers)?void 0:d[ts];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,sT.areTagsExpired)(t,p.lastModified))return sI.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==p||null==(i=p.value)?void 0:i.kind)===sE.FETCH){let e=c.kind===sw.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return sI.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,sT.areTagsExpired)(e,p.lastModified))return sI.debug&&console.log("FileSystemCache: expired tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=sI.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),sI.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let s=new sO(this.fs);if(t.kind===sE.APP_ROUTE){let r=this.getFilePath(`${e}.body`,sw.APP_ROUTE);s.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};s.append(r.replace(/\.body$/,tn),JSON.stringify(n,null,2))}else if(t.kind===sE.PAGES||t.kind===sE.APP_PAGE){let n=t.kind===sE.APP_PAGE,i=this.getFilePath(`${e}.html`,n?sw.APP_PAGE:sw.PAGES);if(s.append(i,t.html),r.fetchCache||r.isFallback||s.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e6:tt:tr}`,n?sw.APP_PAGE:sw.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===sE.APP_PAGE){let e;if(t.segmentData){e=[];let r=i.replace(/\.html$/,e7);for(let[n,i]of t.segmentData){e.push(n);let t=r+n+te;s.append(t,i)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};s.append(i.replace(/\.html$/,tn),JSON.stringify(r))}}else if(t.kind===sE.FETCH){let n=this.getFilePath(e,sw.FETCH);s.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await s.wait()}getFilePath(e,t){switch(t){case sw.FETCH:return r9().join(this.serverDistDir,"..","cache","fetch-cache",e);case sw.PAGES:return r9().join(this.serverDistDir,"pages",e);case sw.IMAGE:case sw.APP_PAGE:case sw.APP_ROUTE:return r9().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let sk=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class sA{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:s,requestHeaders:i,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:d,allowedRevalidateHeaderKeys:u}){var c,h,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!d;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(d)sA.debug&&console.log("IncrementalCache: using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&s&&(sA.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=sI)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=i,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new sk.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];i["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=function(e,t){return"string"==typeof e[ti]&&e["x-next-revalidate-tag-token"]===t?e[ti].split(","):[]}(i,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:s,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:i,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let s=this.cacheControls.get(nZ(e)),i=s?s.revalidate:!n&&1;return"number"==typeof i?1e3*i+t:i}_getPathname(e,t){return t?e:r8(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(sA.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rg;return sA.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let n=[],s=new TextEncoder,i=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(i.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,r=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(r.push(s.encode(e)),n.push(e)):(r.push(e),n.push(i.decode(e,{stream:!0})))}})),n.push(i.decode());let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of r)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let r of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(r);n.push(`${r}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,r=await e.arrayBuffer();n.push(await e.text()),t._ogBody=new Blob([r],{type:e.type})}else"string"==typeof t.body&&(n.push(t.body),t._ogBody=t.body);let a="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in a&&delete a.traceparent,"tracestate"in a&&delete a.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,a,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,n]);return r("crypto").createHash("sha256").update(o).digest("hex")}async get(e,t){var r,n,s,i,a,o,l;let d,u;if(t.kind===sw.FETCH){let t=D.workUnitAsyncStorage.getStore(),r=t?(0,D.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===sE.FETCH)return sA.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};sA.debug&&console.log("IncrementalCache: rdc:miss",e)}else sA.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==sw.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===sw.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===sw.FETCH){if(!c)return null;if((null==(s=c.value)?void 0:s.kind)!==sE.FETCH)throw Object.defineProperty(new e_(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(i=c.value)?void 0:i.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=ey.workAsyncStorage.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return sA.debug&&console.log("IncrementalCache: expired tag",e),null;let a=D.workUnitAsyncStorage.getStore();if(a){let t=(0,D.getPrerenderResumeDataCache)(a);t&&(sA.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let o=t.revalidate||c.value.revalidate,l=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3>o,d=c.value.data;return(0,sT.areTagsExpired)(n,c.lastModified)?null:((0,sT.areTagsStale)(n,c.lastModified)&&(l=!0),{isStale:l,value:{kind:sE.FETCH,data:d,revalidate:o}})}if((null==c||null==(n=c.value)?void 0:n.kind)===sE.FETCH)throw Object.defineProperty(new e_(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,p=this.cacheControls.get(nZ(e));if((null==c?void 0:c.lastModified)===-1)d=-1,u=-31536e3;else{let r=performance.timeOrigin+performance.now(),n=(null==c?void 0:c.lastModified)||r;if(void 0===(d=!1!==(u=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&u<r||void 0)&&((null==c||null==(a=c.value)?void 0:a.kind)===sE.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===sE.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[ts];if("string"==typeof e){let t=e.split(",");t.length>0&&((0,sT.areTagsExpired)(t,n)?d=-1:(0,sT.areTagsStale)(t,n)&&(d=!0))}}}return c&&(h={isStale:d,cacheControl:p,revalidateAfter:u,value:c.value}),!c&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:d,value:null,cacheControl:p,revalidateAfter:u},this.set(e,h.value,{...t,cacheControl:p})),h}async set(e,t,r){if((null==t?void 0:t.kind)===sE.FETCH){let r=D.workUnitAsyncStorage.getStore(),n=r?(0,D.getPrerenderResumeDataCache)(r):null;n&&(sA.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var s;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nZ(e),r.cacheControl),await (null==(s=this.cacheHandler)?void 0:s.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let sj=require("http"),sN=require("https"),sD={existsSync:ee().existsSync,readFile:ee().promises.readFile,readFileSync:ee().readFileSync,writeFile:(e,t)=>ee().promises.writeFile(e,t),mkdir:e=>ee().promises.mkdir(e,{recursive:!0}),stat:e=>ee().promises.stat(e)};class s$ extends sy().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:s}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(e,t)=>{if("encrypted"!==t&&"remoteAddress"!==t)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0});if("remoteAddress"!==t)return!1}}),this.url=e,this.headers=t,this.method=r,s&&(this.bodyReadable=s,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let e={};for(let[t,r]of Object.entries(this.headers))r&&(e[t]=Array.isArray(r)?r:[r]);return e}_read(e){if(this.bodyReadable)return this.bodyReadable._read(e);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}class sM extends sy().Writable{constructor(e={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=e.statusCode??200,this.socket=e.socket??null,this.headers=e.headers?function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(e.headers):new Headers,this.headPromise=new Promise(e=>{this.headPromiseResolve=e}),this.hasStreamed=new Promise((e,t)=>{this.on("finish",()=>e(!0)),this.on("end",()=>e(!0)),this.on("error",e=>t(e))}).then(e=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),e)),e.resWriter&&(this.resWriter=e.resWriter)}appendHeader(e,t){for(let r of Array.isArray(t)?t:[t])this.headers.append(e,r);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(e){return this.resWriter?this.resWriter(e):(this.buffers.push(Buffer.isBuffer(e)?e:Buffer.from(e)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(e,t,r){this.write(e),r()}writeHead(e,t,r){if(r||"string"==typeof t?"string"==typeof t&&t.length>0&&(this.statusMessage=t):r=t,r)if(Array.isArray(r))for(let e=0;e<r.length;e+=2)this.setHeader(r[e],r[e+1]);else for(let[e,t]of Object.entries(r))void 0!==t&&this.setHeader(e,t);return this.statusCode=e,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(e){return this.headers.has(e)}getHeader(e){return this.headers.get(e)??void 0}getHeaders(){return t1(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(e,t){if(Array.isArray(t))for(let r of(this.headers.delete(e),t))this.headers.append(e,r);else"number"==typeof t?this.headers.set(e,t.toString()):this.headers.set(e,t);return this}removeHeader(e){this.headers.delete(e)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}let sZ=(e,t)=>{let r=x().isAbsolute(t)?t:x().join(e,t);return(0,E.pathToFileURL)(r).toString()};function sL(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)===rB}class sq{add(e){this.callbacks.push(e)}async runAll(){if(!this.callbacks.length)return;let e=this.callbacks;this.callbacks=[],await Promise.allSettled(e.map(async e=>e()))}constructor(){this.callbacks=[]}}let sU=Symbol.for("react.postpone");function sz(e){return"object"==typeof e&&null!==e&&e.$$typeof===sU}class sF{async load(e){return await require(e)}}let sH=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),sV=Symbol.for("@next/router-server-methods"),sW=globalThis,sX=e=>import(e).then(e=>e.default||e),sB=new WeakMap;class sG extends n7{constructor(e){var t,r,n;super(e),this.cleanupListeners=new sq,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eF(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:s}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});eH(e,"bubbleNoFallback",void 0),sW[sV]||(sW[sV]={});let i=(0,b.relative)(process.cwd(),this.dir);sW[sV][i]||(sW[sV][i]={render404:this.render404.bind(this)}),sW[sV][i].nextConfig=this.nextConfig;try{var a;n=t9(n);let i={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,i);if(!o)return await this.render(e,t,n,s,r,!0),!0;for(let n of(eH(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete s[rK];try{if(await this.runEdgeFunction({req:e,res:t,query:s,params:o.params,page:o.definition.page,match:o,appPaths:null}))return!0}catch(t){throw await this.instrumentationOnRequestError(t,e,{routePath:o.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),t}}if(o.definition.kind===nh.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,s,o))return!0}return await this.render(e,t,n,s,r,!0),!0}catch(r){if(r instanceof n0.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,s),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,s=eF(e,"middlewareInvoke");if(!s)return!1;let i=()=>(eH(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return i();let o=tb(eF(e,"initURL")),l=rn(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=t9(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return i();let c=!1;try{if(await this.ensureMiddleware(e.url),n=await this.runMiddleware({request:e,response:t,parsedUrl:o,parsed:r}),"response"in n){if(s)throw c=!0,Object.defineProperty(new to.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(t1(n.response.headers)))"content-encoding"!==e&&void 0!==r&&t.setHeader(e,r);t.statusCode=n.response.status;let{originalResponse:e}=t;return n.response.body?await rC(n.response.body,e):e.end(),!0}}catch(s){if(c)throw s;if(rz(s)&&"ENOENT"===s.code)return await this.render404(e,t,r),!0;if(s instanceof eI)return t.statusCode=400,await this.renderError(s,e,t,r.pathname||""),!0;let n=rF(s);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let s=e.dev??!1;if(this.isDev=s,this.sriEnabled=!!(null==(r=e.conf.experimental)||null==(t=r.sri)?void 0:t.algorithm),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.experimental.useSkewCookie?"":this.nextConfig.deploymentId||"",e.dev,!e.dev){let{dynamicRoutes:e=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=e.map(e=>{let t=rN(e.page);return{match:eU(t),page:e.page,re:t.re}})}!function(e){if(!globalThis.__NEXT_HTTP_AGENT){if(!e)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1,configurable:!0});globalThis.__NEXT_HTTP_AGENT_OPTIONS=e.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new sj.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new sN.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,b.join)(this.serverDistDir,"middleware-manifest.json"),e.dev||this.prepare().catch(e=>{console.error("Failed to prepare server",e)}),this.renderOpts.isExperimentalCompile&&function(e){let t={...function(){let e=[];for(let t in process.env)if(t.startsWith("NEXT_PUBLIC_")){let r=process.env[t];null!=r&&e.push([`process.env.${t}`,r])}return e.sort((e,t)=>e[0].localeCompare(t[0])),Object.fromEntries(e)}(),...function(e){let t={},r=e.env;for(let n in r){let s=r[n];if(null!=s){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),i="NEXT_RUNTIME"===n;if(r||i)throw Object.defineProperty(Error(`The key "${n}" under "env" in ${e.configFileName} is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`),"__NEXT_ERROR_CODE",{value:"E170",enumerable:!1,configurable:!0});t[`process.env.${n}`]=s}}return t}(e),"process.env.NEXT_DEPLOYMENT_ID":e.deploymentId||""};for(let e in t){let r=e.split(".").pop()||"";process.env[r]||(process.env[r]=t[e]||"")}}(this.nextConfig),(null==(n=e.conf.experimental)?void 0:n.removeUncaughtErrorAndRejectionListeners)&&(process.removeAllListeners("uncaughtException"),process.removeAllListeners("unhandledRejection")),process.on("unhandledRejection",e=>{sz(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{sz(e)||console.error(e)})}async unstable_preloadEntries(){await this.prepare();let e=this.getAppPathsManifest(),t=this.getPagesManifest();for(let e of(await this.loadCustomCacheHandlers(),Object.keys(t||{})))try{await sp({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await sp({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});e.patchFetch()}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,sH.getInstrumentationModule)(this.dir,this.nextConfig.distDir)}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:e}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1,configurable:!0})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){await (0,sH.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t}){(0,sm.loadEnvConfig)(this.dir,e,v,t,t?e=>{tS(`Reload env: ${e}`)}:void 0)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nK[nB])return null==nW||nW("cache handlers already initialized"),!1;if(null==nW||nW("initializing cache handlers"),nK[nB]=new Map,nK[nX]){let e;nK[nX].DefaultCache?(null==nW||nW('setting "default" cache handler from symbol'),e=nK[nX].DefaultCache):(null==nW||nW('setting "default" cache handler from default'),e=nV()),nK[nB].set("default",e),nK[nX].RemoteCache?(null==nW||nW('setting "remote" cache handler from symbol'),nK[nB].set("remote",nK[nX].RemoteCache)):(null==nW||nW('setting "remote" cache handler from default'),nK[nB].set("remote",e))}else null==nW||nW('setting "default" cache handler from default'),nK[nB].set("default",nV()),null==nW||nW('setting "remote" cache handler from default'),nK[nB].set("remote",nV());return nK[nG]=new Set(nK[nB].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=si(await sX(sZ(this.distDir,n)));if(!nK[nB]||!nK[nG])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nW||nW('setting cache handler for "%s"',r),nK[nB].set(r,t),nK[nG].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=si(await sX(sZ(this.distDir,r)))),await this.loadCustomCacheHandlers(),new sA({fs:this.getCacheFilesystem(),dev:!1,requestHeaders:e,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:t})}getResponseCache(){return new sP(!0)}getPublicDir(){return(0,b.join)(this.dir,"public")}getHasStaticDir(){return ee().existsSync((0,b.join)(this.dir,"static"))}getPagesManifest(){return(0,se.loadManifest)((0,b.join)(this.serverDistDir,eG))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,se.loadManifest)((0,b.join)(this.serverDistDir,eK))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(sL).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!sr(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,b.join)(this.distDir,"BUILD_ID");try{return ee().readFileSync(e,"utf8").trim()}catch(e){if("ENOENT"===e.code)throw Object.defineProperty(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`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1,configurable:!0});throw e}}getEnabledDirectories(e){let t=e?this.dir:this.serverDistDir;return{app:!!e0(t,"app"),pages:!!e0(t,"pages")}}sendRenderResult(e,t,r){return ty({req:e.originalRequest,res:t.originalResponse,result:r.result,generateEtags:r.generateEtags,poweredByHeader:r.poweredByHeader,cacheControl:r.cacheControl})}async runApi(e,t,r,n){for(let s of this.getEdgeFunctionsPages())if(s===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let s=tb(eF(e,"initURL")||e.url);e.url=`${s.pathname}${s.search||""}`;let i=new sF,a=await i.load(n.definition.filename);return eH(e.originalRequest,"relativeProjectDir",(0,b.relative)(process.cwd(),this.dir)),eH(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,s){return(0,to.getTracer)().trace(r_.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,s))}async renderHTMLImpl(e,t,r,n,s){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1,configurable:!0})}async imageOptimizer(e,t,r,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1,configurable:!0})}getPagePath(e,t){return sn(e,this.distDir,t,this.enabledDirectories.app)}async renderPageComponent(e,t){let r=this.getEdgeFunctionsPages()||[];if(r.length){let t=this.getOriginalAppPaths(e.pathname),n=Array.isArray(t),s=e.pathname;for(let i of(n&&(s=t[0]),r))if(i===s)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:s,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}){return(0,to.getTracer)().trace(r_.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":s?tL(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}){let a=[t];for(let t of(e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let i=await sp({distDir:this.distDir,page:t,isAppPath:s,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof i.Component&&!t.startsWith(`/${e}/`)&&t!==`/${e}`)continue;return{components:i,query:{...!this.renderOpts.isExperimentalCompile&&i.getStaticProps?{}:r,...(s?{}:n)||{}}}}catch(e){if(!(e instanceof eA))throw e}return null}getNextFontManifest(){return(0,se.loadManifest)((0,b.join)(this.distDir,"server","next-font-manifest.json"))}logErrorWithOriginalStack(e,t){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1,configurable:!0})}async ensurePage(e){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1,configurable:!0})}async handleApiRequest(e,t,r,n){return this.runApi(e,t,r,n)}getCacheFilesystem(){return sD}normalizeReq(e){return e instanceof tp?e:new tp(e)}normalizeRes(e){return e instanceof tf?e:new tf(e)}getRequestHandler(){return this.makeRequestHandler()}getRequestHandlerWithMetadata(e){let t=this.makeRequestHandler();return(r,n,s)=>(r[ez]=e,t(r,n,s))}makeRequestHandler(){this.prepare().catch(e=>{console.error("Failed to prepare server",e)});let e=super.getRequestHandler();return(t,r,n)=>e(this.normalizeReq(t),this.normalizeRes(r),n)}async revalidate({urlPath:e,revalidateHeaders:t,opts:r}){let n=function({url:e,headers:t={},method:r="GET",bodyReadable:n,resWriter:s,socket:i=null}){return{req:new s$({url:e,headers:t,method:r,socket:i,readable:n}),res:new sM({socket:i,resWriter:s})}}({url:e,headers:t}),s=this.getRequestHandler();if(await s(new tp(n.req),new tf(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&200!==n.res.statusCode&&!(404===n.res.statusCode&&r.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}async render(e,t,r,n,s,i=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,s,i)}async renderToHTML(e,t,r,n){return super.renderToHTML(this.normalizeReq(e),this.normalizeRes(t),r,n)}async renderErrorToResponseImpl(e,t){let{req:r,res:n,query:s}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eX)?(await this.runEdgeFunction({req:r,res:n,query:s||{},params:{},page:eX,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,s,i){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,s,i)}async renderErrorToHTML(e,t,r,n,s){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,s)}async render404(e,t,r,n){return super.render404(this.normalizeReq(e),this.normalizeRes(t),r,n)}getMiddlewareManifest(){return null}async getMiddleware(){var e,t;let r=this.getMiddlewareManifest(),n=null==r||null==(e=r.middleware)?void 0:e["/"];if(!n){let e=await this.loadNodeMiddleware();return e?{match:sf((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=sB.get(e);if(t)return t;if(!Array.isArray(e.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(e)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1,configurable:!0});let r=sf(e.matchers);return sB.set(e,r),r}(n),page:"/"}}getEdgeFunctionsPages(){let e=this.getMiddlewareManifest();return e?Object.keys(e.functions):[]}getEdgeFunctionInfo(e){let t,r=this.getMiddlewareManifest();if(!r)return null;try{t=rT(r8(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new eA(t);return null}return{name:n.name,paths:n.files.map(e=>(0,b.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,b.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,b.join)(this.distDir,e.filePath)})),env:n.env}}async loadNodeMiddleware(){}async hasMiddleware(e){let t=this.getEdgeFunctionInfo({page:e,middleware:!0}),r=await this.loadNodeMiddleware();return!t&&!!r||!!(t&&t.paths.length>0)}async ensureMiddleware(e){}async ensureEdgeFunction(e){}async runMiddleware(e){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1,configurable:!0})}getPrerenderManifest(){return this._cachedPreviewManifest||(this._cachedPreviewManifest=(0,se.loadManifest)((0,b.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,to.getTracer)().trace(r_.getRoutesManifest,()=>(0,se.loadManifest)((0,b.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n,s;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",a=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;if(eH(e,"initURL",a),eH(e,"initQuery",{...t.query}),eH(e,"initProtocol",i),!r){let t=null==(s=this.nextConfig.experimental)?void 0:s.middlewareClientMaxBodySize;eH(e,"clonableBody",function(e,t){let r=null,n=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(r){let t=await n;if(t&&"object"==typeof t&&t.error)throw t.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,r),r=e}},cloneBodyStream(){let n=r??e,s=new sg.PassThrough,i=new sg.PassThrough,a=0,o=t??0xa00000,l=!1;return n.on("data",e=>{if(!l){if((a+=e.length)>o){l=!0;let e=Object.defineProperty(Error(`Request body exceeded ${s_().format(o)}`),"__NEXT_ERROR_CODE",{value:"E862",enumerable:!1,configurable:!0});s.destroy(e),i.destroy(e);return}s.push(e),i.push(e)}}),n.on("end",()=>{l||(s.push(null),i.push(null))}),r=i,s}}}(e.originalRequest,t))}}async runEdgeFunction(e){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1,configurable:!0})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let e=(0,b.join)(this.distDir,eY);return this._serverDistDir=e,e}async getFallbackErrorComponents(e){return null}async instrumentationOnRequestError(...e){await super.instrumentationOnRequestError(...e),this.logError(e[0])}onServerClose(e){this.cleanupListeners.add(e)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new e_("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
25
+ See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:n=".",quiet:s=!1,conf:i,dev:a=!1,minimalMode:o=!1,hostname:l,port:d,experimentalTestProxy:u}=e;this.experimentalTestProxy=u,this.serverOptions=e,this.dir=b.resolve(n),this.quiet=s,this.loadEnvConfig({dev:a,forceReload:!1}),this.nextConfig=i,this.hostname=l,this.hostname&&(this.fetchHostname=function(e){return tM.test(e)?`[${e}]`:e}(this.hostname)),this.port=d,this.distDir=b.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!o&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nI(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rY(this.i18nProvider):void 0;let{assetPrefix:c,generateEtags:h}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=o||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(a),this.isAppPPREnabled=this.enabledDirectories.app&&function(e){return void 0!==e&&("boolean"==typeof e?e:"incremental"===e)}(this.nextConfig.experimental.ppr),this.isAppSegmentPrefetchEnabled=this.enabledDirectories.app&&!0===this.nextConfig.experimental.clientSegmentCache,this.normalizers={rsc:this.enabledDirectories.app&&1?new nN:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nD:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nQ:void 0,data:this.enabledDirectories.pages?new nM(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={dir:this.dir,supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,poweredByHeader:this.nextConfig.poweredByHeader,generateEtags:h,previewProps:this.getPrerenderManifest().preview,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==(r=this.nextConfig.i18n)?void 0:r.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,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,htmlLimitedBots:this.nextConfig.htmlLimitedBots,experimental:{expireTime:this.nextConfig.expireTime,staleTimes:this.nextConfig.experimental.staleTimes,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,cacheComponents:this.nextConfig.experimental.cacheComponents??!1,clientSegmentCache:"client-only"===this.nextConfig.experimental.clientSegmentCache?"client-only":!!this.nextConfig.experimental.clientSegmentCache,clientParamParsing:this.nextConfig.experimental.clientParamParsing??!1,clientParamParsingOrigins:this.nextConfig.experimental.clientParamParsingOrigins,dynamicOnHover:this.nextConfig.experimental.dynamicOnHover??!1,inlineCss:this.nextConfig.experimental.inlineCss??!1,authInterrupts:!!this.nextConfig.experimental.authInterrupts},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},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(c),this.responseCache=this.getResponseCache({dev:a})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new nS(e=>{switch(e){case eG:return this.getPagesManifest()??null;case eK:return this.getAppPathsManifest()??null;default:return null}}),t=new r1;return t.push(new nO(this.distDir,e,this.i18nProvider)),t.push(new nR(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new ng(this.distDir,e)),t.push(new nv(this.distDir,e))),t}async instrumentationOnRequestError(...e){let[t,r,n]=e;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,t,{path:r.url||"",method:r.method||"GET",headers:r instanceof nY?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tP(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),s=(0,to.getTracer)();return s.withPropagatedContext(e.headers,()=>s.trace(ry.handleRequest,{spanName:`${n}`,kind:to.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async i=>this.handleRequestImpl(e,t,r).finally(()=>{if(!i)return;let r=eF(e,"isRSCRequest")??!1;i.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(i.setStatus({code:to.SpanStatusCode.ERROR}),i.setAttribute("error.type",t.statusCode.toString()));let a=s.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==ry.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=a.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;i.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),i.updateName(e)}else i.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,s,i,a,o,l,d,u,c,h=t.originalResponse;let p=h.setHeader.bind(h);h.setHeader=(t,r)=>{if("headersSent"in h&&h.headersSent)return h;if("set-cookie"===t.toLowerCase()){let t=eF(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return p(t,r)};let f=(e.url||"").split("?",1)[0];if(null==f?void 0:f.match(/(\\|\/\/)/)){let r=function(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}(e.url);t.redirect(r,308).body(r).send();return}if(!r||"object"!=typeof r){if(!e.url)throw Object.defineProperty(Error("Invariant: url can not be undefined"),"__NEXT_ERROR_CODE",{value:"E123",enumerable:!1,configurable:!0});r=(0,E.parse)(e.url,!0)}if(!r.pathname)throw Object.defineProperty(Error("Invariant: pathname can't be empty"),"__NEXT_ERROR_CODE",{value:"E412",enumerable:!1,configurable:!0});"string"==typeof r.query&&(r.query=Object.fromEntries(new URLSearchParams(r.query)));let{originalRequest:m=null}=e,g=null==m?void 0:m.headers["x-forwarded-proto"],y=g?"https"===g:!!(null==m||null==(n=m.socket)?void 0:n.encrypted);e.headers["x-forwarded-host"]??=e.headers.host??this.hostname,e.headers["x-forwarded-port"]??=this.port?this.port.toString():y?"443":"80",e.headers["x-forwarded-proto"]??=y?"https":"http",e.headers["x-forwarded-for"]??=null==m||null==(s=m.socket)?void 0:s.remoteAddress,this.attachRequestMeta(e,r);let v=await this.handleRSCRequest(e,t,r);if(v)return;let _=null==(i=this.i18nProvider)?void 0:i.detectDomainLocale(t7(r,e.headers)),b=(null==_?void 0:_.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);eH(e,"defaultLocale",b);let x=tb(e.url.replace(/^\/+/,"/")),w=rn(x.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});x.pathname=w.pathname,w.basePath&&(e.url=rr(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[e5];if(C)try{this.enabledDirectories.app&&(e.url.match(/^\/index($|\?)/)&&(e.url=e.url.replace(/^\/index/,"/")),r.pathname="/index"===r.pathname?"/":r.pathname);let{pathname:n}=new URL(function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new TextDecoder("utf-8").decode(t)}(e.headers[e5]),"http://localhost"),{pathname:s}=new URL(e.url,"http://localhost");if((null==(o=this.normalizers.data)?void 0:o.match(s))&&eH(e,"isNextDataReq",!0),this.isAppPPREnabled&&"1"===e.headers["next-resume"]&&"POST"===e.method){let t=[];for await(let r of e.body)t.push(r);let r=Buffer.concat(t).toString("utf8");eH(e,"postponed",r)}if(eF(e,"isNextDataReq")&&eF(e,"postponed")){t.statusCode=422,t.send();return}n=this.normalize(n);let i=this.stripNextDataPath(s);n=rT(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:b});a&&(eH(e,"locale",a.detectedLocale),a.inferredFromDefault?eH(e,"localeInferredFromDefault",!0):eV(e,"localeInferredFromDefault"));let c=n,h=tV(c),p={params:!1,hasValidParams:!1},f=await this.matchers.match(c,{i18n:a});!h&&f&&(c=f.definition.pathname,void 0!==f.params&&(h=!0,p.params=f.params,p.hasValidParams=!0)),a&&(n=a.pathname);let m=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:s,trailingSlash:i,caseSensitive:a}){let o,l,d;return s&&(d=(l=eU(o=function(e,t){let r=function(e,t,r,n,s,i={}){let a,o=(a=0,()=>{let e="",t=++a;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={},d=[],u=[];for(let a of(i=structuredClone(i),t9(e).slice(1).split("/"))){let e=tU.some(e=>a.startsWith(e)),c=a.match(rA);if(e&&c&&c[2]){let{key:e,pattern:r,cleanedKey:n,repeat:a,optional:h}=rD({getSafeRouteKey:o,interceptionMarker:c[1],segment:c[2],routeKeys:l,keyPrefix:t?e8:void 0,backreferenceDuplicateKeys:s});d.push(r),u.push(`/${c[1]}:${i[e]??n}${a?h?"*":"+":""}`),i[e]??=n}else if(c&&c[2]){n&&c[1]&&(d.push(`/${rk(c[1])}`),u.push(`/${c[1]}`));let{key:e,pattern:r,cleanedKey:a,repeat:h,optional:p}=rD({getSafeRouteKey:o,segment:c[2],routeKeys:l,keyPrefix:t?e3:void 0,backreferenceDuplicateKeys:s}),f=r;n&&c[1]&&(f=f.substring(1)),d.push(f),u.push(`/:${i[e]??a}${h?p?"*":"+":""}`),i[e]??=a}else d.push(`/${rk(a)}`),u.push(`/${a}`);r&&c&&c[3]&&(d.push(rk(c[3])),u.push(c[3]))}return{namedParameterizedRoute:d.join(""),routeKeys:l,pathToRegexpPattern:u.join(""),reference:i}}(e,t.prefixRouteKeys,t.includeSuffix??!1,t.includePrefix??!1,t.backreferenceDuplicateKeys??!1,t.reference),n=r.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(n+="(?:/)?"),{...rN(e,t),namedRegex:`^${n}$`,routeKeys:r.routeKeys,pathToRegexpPattern:r.pathToRegexpPattern,reference:r.reference}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u=structuredClone(d),c={},h=u.pathname,p=n=>{let d=rO(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!u.pathname)return!1;let p=d(u.pathname);if((n.has||n.missing)&&p){let e=rM(o,u.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){let{parsedDestination:i,destQuery:a}=function(e){let t,r,n=function(e){let t=e.destination;for(let n of Object.keys({...e.params,...e.query}))if(n){var r;r=t,t=r.replace(RegExp(`:${rk(n)}`,"g"),`__ESC_COLON_${n}`)}let n=tb(t),s=n.pathname;s&&(s=r$(s));let i=n.href;i&&(i=r$(i));let a=n.hostname;a&&(a=r$(a));let o=n.hash;o&&(o=r$(o));let l=n.search;l&&(l=r$(l));let d=n.origin;return d&&(d=r$(d)),{...n,pathname:s,hostname:a,href:i,hash:o,search:l,origin:d}}(e),{hostname:s,query:i,search:a}=n,o=n.pathname;n.hash&&(o=`${o}${n.hash}`);let l=[],d=[];for(let e of(eL(o,d),d))l.push(e.name);if(s){let e=[];for(let t of(eL(s,e),e))l.push(t.name)}let u=eq(o,{validate:!1});for(let[r,n]of(s&&(t=eq(s,{validate:!1})),Object.entries(i)))Array.isArray(n)?i[r]=n.map(t=>rZ(r$(t),e.params)):"string"==typeof n&&(i[r]=rZ(r$(n),e.params));let c=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!c.some(e=>l.includes(e)))for(let t of c)t in i||(i[t]=e.params[t]);if(tz(o))for(let t of o.split("/")){let r=tU.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[s,i]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=s,n.hash=`${i?"#":""}${i||""}`,n.search=a?rZ(a,e.params):""}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(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"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1,configurable:!0});throw e}return n.query={...e.query,...n.query},{newUrl:r,destQuery:i,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:u.query});if(i.protocol)return!0;if(Object.assign(c,a,p),Object.assign(u.query,i.query),delete i.query,Object.assign(u,i),!(h=u.pathname))return!1;if(r&&(h=h.replace(RegExp(`^${r}`),"")||"/"),t){let e=rt(h,t.locales);h=e.pathname,u.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(h===e)return!0;if(s&&l){let e=l(h);if(e)return u.query={...u.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])p(e);if(h!==e){let t=!1;for(let e of n.afterFiles||[])if(t=p(e))break;if(!t&&!(()=>{let t=t9(h||"");return t===t9(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=p(e))break}}return{rewriteParams:c,rewrittenParsedUrl:u}},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let s=t2(r);s&&(delete e[r],t.add(s),void 0!==n&&(e[s]=Array.isArray(n)?n.map(e=>rL(e)):rL(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eU({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=t2(e);r&&(n[r]=t,delete n[e])}let s={};for(let e of Object.keys(r)){let i=r[e];if(!i)continue;let a=t[i],o=n[e];if(!a.optional&&!o)return null;s[a.pos]=o}return s}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let s={};for(let i of Object.keys(r.groups)){let a=e[i];"string"==typeof a?a=tq(a):Array.isArray(a)&&(a=a.map(tq));let o=n[i],l=r.groups[i].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(a)?a.some(t=>t.includes(e)):null==a?void 0:a.includes(e)):null==a?void 0:a.includes(o))||void 0===a&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!a||Array.isArray(a)&&1===a.length&&("index"===a[0]||a[0]===`[[...${i}]]`))&&(a=void 0,delete e[i]),a&&"string"==typeof a&&r.groups[i].repeat&&(a=a.split("/")),a&&(s[i]=a)}return{params:s,hasValidParams:!0}},normalizeCdnUrl:(e,t)=>(function(e,t){let r=function(e){let t=function(e){let t;try{t=new URL(e,"http://n")}catch{}return t}(e);if(!t)return;let r={};for(let e of t.searchParams.keys()){let n=t.searchParams.getAll(e);r[e]=n.length>1?n:n[0]}return{query:r,hash:t.hash,search:t.search,path:t.pathname,pathname:t.pathname,href:`${t.pathname}${t.search}${t.hash}`,host:"",hostname:"",auth:"",protocol:"",slashes:null,port:""}}(e.url);if(!r)return e.url;delete r.search,rU(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",a=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:r&&(o=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(o+=":"+e.port)),a&&"object"==typeof a&&(a=String(function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,t_(e));else t.set(r,t_(n));return t}(a)));let l=e.search||a&&`?${a}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rq.test(n))&&!1!==o?(o="//"+(o||""),s&&"/"!==s[0]&&(s="/"+s)):o||(o=""),i&&"#"!==i[0]&&(i="#"+i),l&&"?"!==l[0]&&(l="?"+l),s=s.replace(/[?#]/g,encodeURIComponent),l=l.replace("#","%23"),`${n}${o}${s}${l}${i}`}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let s,{optional:i,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;i&&(o=`[${o}]`);let l=t[n];((s=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||i)&&(e=e.replaceAll(o,s))}return e})(e,t,o),filterInternalQuery:(e,t)=>rU(e,t)}}({pageIsDynamic:h,page:c,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(d=this.getRoutesManifest())?void 0:d.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});b&&!w.locale&&(r.pathname=`/${b}${r.pathname}`);let g={...r.query},y=r.pathname,{rewriteParams:_,rewrittenParsedUrl:E}=m.handleRewrites(e,r),C=Object.keys(_),R={...E.query},P=y!==E.pathname;P&&E.pathname&&eH(e,"rewroteURL",E.pathname);let T=new Set;for(let[e,t]of Object.entries(r.query)){let n=t2(e);n&&(delete r.query[e],T.add(n),void 0!==t&&(R[n]=Array.isArray(t)?t.map(e=>rL(e)):rL(t)))}if(h){let t={};if(p.hasValidParams||(p=m.normalizeDynamicRouteParams(R,!1)),!p.hasValidParams&&!tV(i)){let e=null==m.dynamicRouteMatcher?void 0:m.dynamicRouteMatcher.call(m,i);e&&(m.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tV(n)){let e=null==m.dynamicRouteMatcher?void 0:m.dynamicRouteMatcher.call(m,n);if(e){let r=m.normalizeDynamicRouteParams(e,!1);r.hasValidParams&&(Object.assign(t,e),p=r)}}p.hasValidParams&&(t=p.params);let r=e.headers["x-now-route-matches"];if("string"==typeof r&&r&&tV(n)&&!p.hasValidParams){let e=m.getParamsFromRouteMatches(r);e&&(p=m.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=m.normalizeDynamicRouteParams(R,!0)).hasValidParams&&(t=p.params),m.defaultRouteMatches&&i===c&&!p.hasValidParams&&(t=m.defaultRouteMatches,""===r&&eH(e,"renderFallbackShell",!0)),t){n=m.interpolateDynamicPath(c,t),e.url=m.interpolateDynamicPath(e.url,t);let r=eF(e,"segmentPrefetchRSCRequest");r&&tV(r,!1)&&(r=m.interpolateDynamicPath(r,t),e.headers[rX]=r,eH(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||P)&&m.normalizeCdnUrl(e,[...C,...Object.keys((null==(u=m.defaultRouteRegex)?void 0:u.groups)||{})]),T))t in g||delete r.query[t];if(r.pathname=n,x.pathname=r.pathname,((null==f?void 0:f.definition.kind)===nh.PAGES||(null==f?void 0:f.definition.kind)===nh.PAGES_API)&&(r.query=R),v=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof eI||r instanceof ek)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(eH(e,"isLocaleDomain",!!_),w.locale&&(e.url=(0,E.format)(x),eH(e,"didStripLocale",!0)),!eF(e,"locale")&&(w.locale?eH(e,"locale",w.locale):b&&(eH(e,"locale",b),eH(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eF(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),eH(e,"incrementalCache",t),globalThis.__incrementalCache=t}eF(e,"serverComponentsHmrCache")||eH(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let R=eF(e,"invokePath");if(!C&&R){let n=eF(e,"invokeStatus");if(n){let s=eF(e,"invokeQuery");s&&Object.assign(r.query,s),t.statusCode=n;let i=eF(e,"invokeError")||null;return this.renderError(i,e,t,"/_error",r.query)}let s=new URL(R||"/","http://n"),i=rn(s.pathname,{nextConfig:this.nextConfig,parseData:!1});i.locale&&eH(e,"locale",i.locale),r.pathname!==s.pathname&&(r.pathname=s.pathname,eH(e,"rewroteURL",i.pathname));let a=rt(rr(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&eH(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eF(e,"invokeQuery");if(o&&Object.assign(r.query,o),v=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eF(e,"middlewareInvoke")){if((v=await this.normalizeAndAttachMetadata(e,t,r))||(v=await this.handleCatchallMiddlewareRequest(e,t,r)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!C&&w.basePath&&(r.pathname=rr(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof n0.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof eI||r instanceof ek)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,s)=>(r[ez]=e,t(r,n,s))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(e){this.nextConfig.assetPrefix=e?e.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return this.instrumentation||(this.instrumentation=await this.loadInstrumentationModule()),null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let e={};return Object.keys(this.appPathsManifest||{}).forEach(t=>{let r=tL(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,to.getTracer)().trace(ry.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,to.getTracer)().trace(ry.pipe,async()=>this.pipeImpl(e,t))}async pipeImpl(e,t){let r=t.req.headers["user-agent"]||"",n={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!this.renderOpts.botType,serveStreamingMetadata:function(e,t){let r=RegExp(t||tB,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},s=await e(n);if(null===s)return;let{req:i,res:a}=n,o=a.statusCode,{body:l}=s,{cacheControl:d}=s;if(!a.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(a.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(i,a,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),a.statusCode=o}}async getStaticHTML(e,t){let r={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await e(r);return null===n?null:n.body.toUnchunkedString()}async render(e,t,r,n={},s,i=!1){return(0,to.getTracer)().trace(ry.render,async()=>this.renderImpl(e,t,r,n,s,i))}getWaitUntil(){let e=function(){let e=globalThis[nL];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},s,i=!1){var a;r.startsWith("/")||console.warn(`Cannot render page with path "${r}", did you mean "/${r}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.serverOptions.customServer&&"/index"===r&&!await this.hasPage("/index")&&(r="/");let o=e.headers["user-agent"]||"";return this.renderOpts.botType=function(e){return tX.test(e)?"dom":tW.test(e)?"html":void 0}(o),(a=r,eJ.includes(a))?this.render404(e,t,s):this.pipe(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async getStaticPaths({pathname:e}){var t;return{staticPaths:void 0,fallbackMode:function(e){if("string"==typeof e)return"PRERENDER";if(null===e)return"BLOCKING_STATIC_RENDER";if(!1===e)return"NOT_FOUND";if(void 0!==e)throw Object.defineProperty(Error(`Invalid fallback option: ${e}. Fallback option must be a string, null, undefined, or false.`),"__NEXT_ERROR_CODE",{value:"E285",enumerable:!1,configurable:!0})}(null==(t=this.getPrerenderManifest().dynamicRoutes[e])?void 0:t.fallback)}}async renderToResponseWithComponents(e,t){return(0,to.getTracer)().trace(ry.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return tz(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let s=`rsc, ${rV}, ${rW}, ${rX}`,i=eF(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${s}, ${rB}`),a=!0):(r||i)&&t.appendHeader("vary",s),a||delete e.headers[rB]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:s,query:i}){var a,o,l,d,u,c;let h,p;r===eW&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===s.isAppPath,v=!!s.getServerSideProps,_=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rH)??null,r=e.headers.get("content-type")):(t=e.headers[rH]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,s=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),i=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:s,isFetchAction:i,isPossibleServerAction:!!(i||n||s)}}(e).isPossibleServerAction,b=!!s.getStaticProps,x=eF(e,"isRSCRequest")??!1,w=(0,E.parse)(e.url||"").pathname||"/",C=eF(e,"rewroteURL")||w;this.setVaryHeader(e,t,y,C);let R=this.getPrerenderManifest();(null==h?void 0:h.includes(C))||e.headers["x-now-route-matches"]?b=!0:b||=!!R.routes[nZ(r)];let P=!!(eF(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(b||v);if(!b&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(e5,r),t.setHeader("x-middleware-skip","1"),t.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),t.body("{}").send(),null;b&&e.headers[e5]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eF(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),s.routeModule&&(p=s.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===nh.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==i.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eF(e,"postponed"):void 0;if(!m||P||x||(t.statusCode=404),eQ.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!_&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof s.Component||b))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof s.Component)return{body:rR.fromStatic(s.Component,e9)};if(!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tX.test(u)||tW.test(d)),r="function"!=typeof(null==(o=s.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in s.Document;n.supportsDynamicResponse=!b&&!t&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),b&&e.headers[e5]&&(C=w),w=t9(w),C=t9(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),P&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==p?void 0:p.isDev)&&tV(r)&&(s.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:s.page,isAppPath:y});if(y&&this.nextConfig.experimental.cacheComponents&&(null==(l=t.prerenderedRoutes)?void 0:l.length)){let r=null;for(let e of t.prerenderedRoutes){let t=e.fallbackRouteParams;if(!t||0===t.length){r=null;break}(null===r||t.length<r.length)&&(r=t)}r&&eH(e,"devValidatingFallbackParams",function(e){if(0===e.length)return null;let t=Math.random().toString(16).slice(2),r=new Map;for(let{paramName:n,paramType:s}of e)r.set(n,[`%%drp:${n}:${t}%%`,n5[s]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==nh.APP_ROUTE))return await nk(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,E.parse)(eF(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));f||(k.url=`${N}${j.search||""}`),c=eF(e),k[ez]=c,eH(k,"distDir",this.distDir),eH(k,"query",i),eH(k,"params",n.params),eH(k,"minimalMode",!0),n.err&&eH(k,"invokeError",n.err);let D=s.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rT(e.substring(e.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&t)?this.localeNormalizer.normalize(e):e}getOriginalAppPaths(e){if(this.enabledDirectories.app){var t;let r=null==(t=this.appPathRoutes)?void 0:t[e];return r||null}return null}async renderPageComponent(e,t){var r;let{query:n,pathname:s}=e,i=this.getOriginalAppPaths(s),a=Array.isArray(i),o=s;a&&(o=i[i.length-1]);let l=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:a,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,to.getTracer)().setRootSpanAttribute("next.route",s);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof n0.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,to.getTracer)().trace(ry.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:s,pathname:i}=e,a=eF(e.req,"bubbleNoFallback")??!1;delete s[rK];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,i)},l=eF(e.req,"match"),d=!0;eF(e.req,"invokeOutput"),(null==l?void 0:l.definition.page.includes("/@"))&&(d=!1);try{for await(let t of d&&l?[l]:this.matchers.matchAll(i,o)){let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},a);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,a);if(!1!==t)return t}}catch(s){let t=rF(s);if(s instanceof ej)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:e.req.url,matchedPath:e.req.headers[e5],initUrl:eF(e.req,"initURL"),didRewrite:!!eF(e.req,"rewroteURL"),rewroteUrl:eF(e.req,"rewroteURL")},null,2)),t;if(t instanceof n0.NoFallbackError&&a)throw t;if(t instanceof eI||t instanceof ek)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(eH(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eV(e.req,"customErrorRender"));let r=t instanceof n6;if(!r)throw rz(t)&&(t.page=i),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=eF(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${i}`),n.statusCode=200,n.setHeader("Content-Type","application/json; charset=utf-8"),n.body("{}"),n.send(),null}return n.statusCode=404,this.renderErrorToResponse(e,null)}async renderToHTML(e,t,r,n={}){return(0,to.getTracer)().trace(ry.renderToHTML,async()=>this.renderToHTMLImpl(e,t,r,n))}async renderToHTMLImpl(e,t,r,n={}){return this.getStaticHTML(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async renderError(e,t,r,n,s={},i=!0){return(0,to.getTracer)().trace(ry.renderError,async()=>this.renderErrorImpl(e,t,r,n,s,i))}async renderErrorImpl(e,t,r,n,s={},i=!0){return i&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async t=>{let n=await this.renderErrorToResponse(t,e);if(500===r.statusCode)throw e;return n},{req:t,res:r,pathname:n,query:s})}async renderErrorToResponse(e,t){return(0,to.getTracer)().trace(ry.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let s=null,i=404===r.statusCode,a=this.enabledDirectories.app;i&&(a&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:eX,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!s&&await this.hasPage("/404")&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eF(e.req,"customErrorRender")&&!s&&eQ.includes(o)&&(!s&&a&&(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),s=await this.findPageComponents({locale:eF(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),s||(s=await this.findPageComponents({locale:eF(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!s)throw new n6(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));s.components.routeModule?eH(e.req,"match",{definition:s.components.routeModule.definition,params:void 0}):eV(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},s)}catch(e){if(e instanceof n0.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(a){let t=rF(a),s=t instanceof n6;s||this.logError(t),r.statusCode=500;let i=await this.getFallbackErrorComponents(e.req.url);if(i)return eH(e.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:s?t.innerError:t}},{query:n,components:i});return{body:rR.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,s={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:s})}async render404(e,t,r,n=!0){let{pathname:s,query:i}=r||(0,E.parse)(e.url,!0);return this.nextConfig.i18n&&(eF(e,"locale")||eH(e,"locale",this.nextConfig.i18n.defaultLocale),eH(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,s,i,n)}}let se=require("next/dist/server/load-manifest.external.js"),st=new P(1e3);function sr(e,t,r,n){let s,i=`${e}:${t}:${r}:${n}`,a=null==st?void 0:st.get(i);if(a)return a;let o=x().join(t,eY);n&&(s=(0,se.loadManifest)(x().join(o,eK),!0));let l=(0,se.loadManifest)(x().join(o,eG),!0);try{e=rT(r8(e))}catch(t){throw console.error(t),new eA(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let s={};for(let e of Object.keys(t))s[rt(e,r).pathname]=l[e];n=s[e]}return n};return(s&&(a=d(s)),a||(a=d(l)),a)?(x().isAbsolute(a)||(a=x().join(o,a)),null==st||st.set(i,a),a):(null==st||st.set(i,null),null)}function sn(e,t,r,n){let s=sr(e,t,r,n);if(!s)throw new eA(e);return s}async function ss(e,t,r){let n=sn(e,t,void 0,r);return n.endsWith(".html")?Q.promises.readFile(n,"utf8").catch(t=>{throw new ej(e,t.message)}):require(n)}function si(e){return e.default||e}async function sa(e){return new Promise(t=>setTimeout(t,e))}let so=Symbol.for("next.server.action-manifests");async function sl(e,t=3){for(;;)try{return(0,se.loadManifest)(e)}catch(e){if(--t<=0)throw e;await sa(100)}}async function sd(e,t=3){try{return await sl(e,t)}catch(e){return}}async function su(e,t=3){for(;;)try{return(0,se.evalManifest)(e)}catch(e){if(--t<=0)throw e;await sa(100)}}async function sc(e,t,r){try{return(await su(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function sh({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:s,needsManifestsForLegacyReasons:i}){let a={},o={};if(r||([a,o]=await Promise.all([ss("/_document",e,!1),ss("/_app",e,!1)])),i){let i,l=n?3:1;i=(0,b.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return ne(e)&&function(e,t,r){if(!e||e.length<2)return!1;let n=rP(e),s=!!(nn.test(n)||ns.test(n)||ni.test(n)||na.test(n)||no.test(n))||(!!n.includes("robots")||!!n.includes("manifest")||!!n.includes("sitemap")||!!n.includes("icon")||!!n.includes("apple-icon")||!!n.includes("opengraph-image")||!!n.includes("twitter-image")||!!n.includes("favicon"))&&null;if(null!==s)return s;let i=function(e,t){let r=`${e.join(",")}|${t}`,n=nl.get(r);if(n)return n;let s=t?"$":"?$",i="\\d?"+(t?"":"(-\\w{6})?"),a=e.length>0?[...e,"txt"]:["txt"],o=e.length>0?[...e,"webmanifest","json"]:["webmanifest","json"],l=[RegExp(`^[\\\\/]robots${nr(a,null)}${s}`),RegExp(`^[\\\\/]manifest${nr(o,null)}${s}`),RegExp(`[\\\\/]sitemap${nr(["xml"],e)}${s}`),RegExp(`[\\\\/]icon${i}${nr(nt.icon.extensions,e)}${s}`),RegExp(`[\\\\/]apple-icon${i}${nr(nt.apple.extensions,e)}${s}`),RegExp(`[\\\\/]opengraph-image${i}${nr(nt.openGraph.extensions,e)}${s}`),RegExp(`[\\\\/]twitter-image${i}${nr(nt.twitter.extensions,e)}${s}`)];return nl.set(r,l),l}(t,r);for(let e=0;e<i.length;e++)if(i[e].test(n))return!0;return!1}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([sl((0,b.join)(e,"build-manifest.json"),l),sd(i,l),r||0?void 0:sl((0,b.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?sc((0,b.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?sl((0,b.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,s?sl((0,b.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var s;let i=null==(s=globalThis[so])?void 0:s.clientReferenceManifestsPerPage;globalThis[so]={clientReferenceManifestsPerPage:{...i,[tL(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,s,i;let a,o=null==(s=e.node)||null==(n=s[r])?void 0:n.workers;if(!o)return;let l=ey.workAsyncStorage.getStore();if(!(a=l?o[t6(i=l.page,"app")?i:"app"+i]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let g=await ss(t,e,r),y=si(g),v=si(a),_=si(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=g;return{App:_,Document:v,Component:y,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:g.config||{},ComponentMod:g,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await ss(t,e,r),s=si(n),i=si(a),l=si(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:i,Component:s,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let sp=(0,to.getTracer)().wrap(rv.loadComponents,sh);function sf(e){return(t,r,n)=>{for(let s of e)if(new RegExp(s.regexp).exec(t)){if((s.has||s.missing)&&!rM(r,n,s.has,s.missing))continue;return!0}return!1}}var sm=r("../next-env/dist/index.js");let sg=require("stream");var sy=r.n(sg),sv=r("./dist/compiled/bytes/index.js"),s_=r.n(sv);class sb{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new sb(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:s,resolve:i,reject:a}=new rg;return this.pending.set(r,s),this.schedulerFn(async()=>{try{let r=await t({resolve:i,key:e});i(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),s}}let sx=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var sE=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.REDIRECT="REDIRECT",e.IMAGE="IMAGE",e}({}),sw=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({});async function sC(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===sE.PAGES?{kind:sE.PAGES,html:await e.value.html.toUnchunkedString(!0),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===sE.APP_PAGE?{kind:sE.APP_PAGE,html:await e.value.html.toUnchunkedString(!0),postponed:e.value.postponed,rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,segmentData:e.value.segmentData}:e.value}}async function sR(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===sE.PAGES?{kind:sE.PAGES,html:rR.fromStatic(e.value.html,e9),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===sE.APP_PAGE?{kind:sE.APP_PAGE,html:rR.fromStatic(e.value.html,e9),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class sP{constructor(e){this.getBatcher=sb.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:sx}),this.revalidateBatcher=sb.create({schedulerFn:sx}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return sR(this.previousCacheItem.entry);let{incrementalCache:s,isOnDemandRevalidate:i=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return sR(await this.getBatcher.batch({key:e,isOnDemandRevalidate:i},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:s,isOnDemandRevalidate:i,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let s=null,i=!1;try{if((s=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case nh.PAGES:return sw.PAGES;case nh.APP_PAGE:return sw.APP_PAGE;case nh.IMAGE:return sw.IMAGE;case nh.APP_ROUTE:return sw.APP_ROUTE;case nh.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(s),i=!0,!s.isStale||r.isPrefetch))return s;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,s,null!==s&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(i)return console.error(e),null;throw e}}async revalidate(e,t,r,n,s,i,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,s,i,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,s,i,a){try{let o=await s({hasResolved:a,previousCacheEntry:i,isRevalidating:!0});if(!o)return null;let l=await sC({...o,isMiss:!i});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(s){if(null==i?void 0:i.cacheControl){let s=Math.min(Math.max(i.cacheControl.revalidate||3,3),30),a=void 0===i.cacheControl.expire?void 0:Math.max(s+3,i.cacheControl.expire);await t.set(e,i.value,{cacheControl:{revalidate:s,expire:a},isRoutePPREnabled:r,isFallback:n})}throw s}}}let sT=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class sO{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(r9().dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}let sS=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class sI{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?sI.memoryCache?sI.debug&&console.log("FileSystemCache: memory store already initialized"):(sI.debug&&console.log("FileSystemCache: using memory store for fetch cache"),sI.memoryCache=(0,sS.getMemoryCache)(e.maxMemoryCacheSize)):sI.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,sI.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=sT.tagsManifest.get(n)||{};if(t){let s={...e};s.stale=r,void 0!==t.expire&&(s.expired=r+1e3*t.expire),sT.tagsManifest.set(n,s)}else sT.tagsManifest.set(n,{...e,expired:r})}}async get(...e){var t,r,n,s,i,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=sI.memoryCache)?void 0:t.get(u);if(sI.debug&&(h===sw.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===sw.APP_ROUTE){let e=this.getFilePath(`${u}.body`,sw.APP_ROUTE),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),n=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,tn),"utf8"));p={lastModified:r.getTime(),value:{kind:sE.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===sw.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===sw.FETCH){let{tags:e,fetchIdx:n,fetchUrl:s}=c;if(!this.flushToDisk)return null;let i=r.getTime(),l=JSON.parse(t);if(p={lastModified:i,value:l},(null==(a=p.value)?void 0:a.kind)===sE.FETCH){let t=null==(o=p.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(sI.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:s}))}}else if(h===sw.APP_PAGE){let n,s,i;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,tn),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;s=e;let t=u+e7;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+te,sw.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(i=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e6:tt}`,sw.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:sE.APP_PAGE,html:t,rscData:i,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:s}}}else if(h===sw.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${tr}`,sw.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:sE.PAGES,html:t,pageData:n,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${h} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1,configurable:!0})}p&&(null==(l=sI.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return sI.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===sE.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===sE.APP_ROUTE||(null==p||null==(s=p.value)?void 0:s.kind)===sE.PAGES){let e=null==(d=p.value.headers)?void 0:d[ts];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,sT.areTagsExpired)(t,p.lastModified))return sI.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==p||null==(i=p.value)?void 0:i.kind)===sE.FETCH){let e=c.kind===sw.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return sI.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,sT.areTagsExpired)(e,p.lastModified))return sI.debug&&console.log("FileSystemCache: expired tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=sI.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),sI.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let s=new sO(this.fs);if(t.kind===sE.APP_ROUTE){let r=this.getFilePath(`${e}.body`,sw.APP_ROUTE);s.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};s.append(r.replace(/\.body$/,tn),JSON.stringify(n,null,2))}else if(t.kind===sE.PAGES||t.kind===sE.APP_PAGE){let n=t.kind===sE.APP_PAGE,i=this.getFilePath(`${e}.html`,n?sw.APP_PAGE:sw.PAGES);if(s.append(i,t.html),r.fetchCache||r.isFallback||s.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e6:tt:tr}`,n?sw.APP_PAGE:sw.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===sE.APP_PAGE){let e;if(t.segmentData){e=[];let r=i.replace(/\.html$/,e7);for(let[n,i]of t.segmentData){e.push(n);let t=r+n+te;s.append(t,i)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};s.append(i.replace(/\.html$/,tn),JSON.stringify(r))}}else if(t.kind===sE.FETCH){let n=this.getFilePath(e,sw.FETCH);s.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await s.wait()}getFilePath(e,t){switch(t){case sw.FETCH:return r9().join(this.serverDistDir,"..","cache","fetch-cache",e);case sw.PAGES:return r9().join(this.serverDistDir,"pages",e);case sw.IMAGE:case sw.APP_PAGE:case sw.APP_ROUTE:return r9().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let sk=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class sA{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:s,requestHeaders:i,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:d,allowedRevalidateHeaderKeys:u}){var c,h,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!d;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(d)sA.debug&&console.log("IncrementalCache: using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&s&&(sA.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=sI)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=i,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new sk.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];i["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=function(e,t){return"string"==typeof e[ti]&&e["x-next-revalidate-tag-token"]===t?e[ti].split(","):[]}(i,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:s,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:i,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let s=this.cacheControls.get(nZ(e)),i=s?s.revalidate:!n&&1;return"number"==typeof i?1e3*i+t:i}_getPathname(e,t){return t?e:r8(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(sA.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rg;return sA.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let n=[],s=new TextEncoder,i=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(i.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,r=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(r.push(s.encode(e)),n.push(e)):(r.push(e),n.push(i.decode(e,{stream:!0})))}})),n.push(i.decode());let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of r)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let r of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(r);n.push(`${r}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,r=await e.arrayBuffer();n.push(await e.text()),t._ogBody=new Blob([r],{type:e.type})}else"string"==typeof t.body&&(n.push(t.body),t._ogBody=t.body);let a="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in a&&delete a.traceparent,"tracestate"in a&&delete a.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,a,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,n]);return r("crypto").createHash("sha256").update(o).digest("hex")}async get(e,t){var r,n,s,i,a,o,l;let d,u;if(t.kind===sw.FETCH){let t=D.workUnitAsyncStorage.getStore(),r=t?(0,D.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===sE.FETCH)return sA.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};sA.debug&&console.log("IncrementalCache: rdc:miss",e)}else sA.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==sw.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===sw.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===sw.FETCH){if(!c)return null;if((null==(s=c.value)?void 0:s.kind)!==sE.FETCH)throw Object.defineProperty(new e_(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(i=c.value)?void 0:i.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=ey.workAsyncStorage.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return sA.debug&&console.log("IncrementalCache: expired tag",e),null;let a=D.workUnitAsyncStorage.getStore();if(a){let t=(0,D.getPrerenderResumeDataCache)(a);t&&(sA.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let o=t.revalidate||c.value.revalidate,l=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3>o,d=c.value.data;return(0,sT.areTagsExpired)(n,c.lastModified)?null:((0,sT.areTagsStale)(n,c.lastModified)&&(l=!0),{isStale:l,value:{kind:sE.FETCH,data:d,revalidate:o}})}if((null==c||null==(n=c.value)?void 0:n.kind)===sE.FETCH)throw Object.defineProperty(new e_(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,p=this.cacheControls.get(nZ(e));if((null==c?void 0:c.lastModified)===-1)d=-1,u=-31536e3;else{let r=performance.timeOrigin+performance.now(),n=(null==c?void 0:c.lastModified)||r;if(void 0===(d=!1!==(u=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&u<r||void 0)&&((null==c||null==(a=c.value)?void 0:a.kind)===sE.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===sE.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[ts];if("string"==typeof e){let t=e.split(",");t.length>0&&((0,sT.areTagsExpired)(t,n)?d=-1:(0,sT.areTagsStale)(t,n)&&(d=!0))}}}return c&&(h={isStale:d,cacheControl:p,revalidateAfter:u,value:c.value}),!c&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:d,value:null,cacheControl:p,revalidateAfter:u},this.set(e,h.value,{...t,cacheControl:p})),h}async set(e,t,r){if((null==t?void 0:t.kind)===sE.FETCH){let r=D.workUnitAsyncStorage.getStore(),n=r?(0,D.getPrerenderResumeDataCache)(r):null;n&&(sA.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var s;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nZ(e),r.cacheControl),await (null==(s=this.cacheHandler)?void 0:s.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let sj=require("http"),sN=require("https"),sD={existsSync:ee().existsSync,readFile:ee().promises.readFile,readFileSync:ee().readFileSync,writeFile:(e,t)=>ee().promises.writeFile(e,t),mkdir:e=>ee().promises.mkdir(e,{recursive:!0}),stat:e=>ee().promises.stat(e)};class s$ extends sy().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:s}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(e,t)=>{if("encrypted"!==t&&"remoteAddress"!==t)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0});if("remoteAddress"!==t)return!1}}),this.url=e,this.headers=t,this.method=r,s&&(this.bodyReadable=s,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let e={};for(let[t,r]of Object.entries(this.headers))r&&(e[t]=Array.isArray(r)?r:[r]);return e}_read(e){if(this.bodyReadable)return this.bodyReadable._read(e);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}class sM extends sy().Writable{constructor(e={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=e.statusCode??200,this.socket=e.socket??null,this.headers=e.headers?function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(e.headers):new Headers,this.headPromise=new Promise(e=>{this.headPromiseResolve=e}),this.hasStreamed=new Promise((e,t)=>{this.on("finish",()=>e(!0)),this.on("end",()=>e(!0)),this.on("error",e=>t(e))}).then(e=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),e)),e.resWriter&&(this.resWriter=e.resWriter)}appendHeader(e,t){for(let r of Array.isArray(t)?t:[t])this.headers.append(e,r);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(e){return this.resWriter?this.resWriter(e):(this.buffers.push(Buffer.isBuffer(e)?e:Buffer.from(e)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(e,t,r){this.write(e),r()}writeHead(e,t,r){if(r||"string"==typeof t?"string"==typeof t&&t.length>0&&(this.statusMessage=t):r=t,r)if(Array.isArray(r))for(let e=0;e<r.length;e+=2)this.setHeader(r[e],r[e+1]);else for(let[e,t]of Object.entries(r))void 0!==t&&this.setHeader(e,t);return this.statusCode=e,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(e){return this.headers.has(e)}getHeader(e){return this.headers.get(e)??void 0}getHeaders(){return t1(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(e,t){if(Array.isArray(t))for(let r of(this.headers.delete(e),t))this.headers.append(e,r);else"number"==typeof t?this.headers.set(e,t.toString()):this.headers.set(e,t);return this}removeHeader(e){this.headers.delete(e)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}let sZ=(e,t)=>{let r=x().isAbsolute(t)?t:x().join(e,t);return(0,E.pathToFileURL)(r).toString()};function sL(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)===rB}class sq{add(e){this.callbacks.push(e)}async runAll(){if(!this.callbacks.length)return;let e=this.callbacks;this.callbacks=[],await Promise.allSettled(e.map(async e=>e()))}constructor(){this.callbacks=[]}}let sU=Symbol.for("react.postpone");function sz(e){return"object"==typeof e&&null!==e&&e.$$typeof===sU}class sF{async load(e){return await require(e)}}let sH=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),sV=Symbol.for("@next/router-server-methods"),sW=globalThis,sX=e=>import(e).then(e=>e.default||e),sB=new WeakMap;class sG extends n7{constructor(e){var t,r,n;super(e),this.cleanupListeners=new sq,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eF(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:s}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});eH(e,"bubbleNoFallback",void 0),sW[sV]||(sW[sV]={});let i=(0,b.relative)(process.cwd(),this.dir);sW[sV][i]||(sW[sV][i]={render404:this.render404.bind(this)}),sW[sV][i].nextConfig=this.nextConfig;try{var a;n=t9(n);let i={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,i);if(!o)return await this.render(e,t,n,s,r,!0),!0;for(let n of(eH(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete s[rK];try{if(await this.runEdgeFunction({req:e,res:t,query:s,params:o.params,page:o.definition.page,match:o,appPaths:null}))return!0}catch(t){throw await this.instrumentationOnRequestError(t,e,{routePath:o.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),t}}if(o.definition.kind===nh.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,s,o))return!0}return await this.render(e,t,n,s,r,!0),!0}catch(r){if(r instanceof n0.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,s),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,s=eF(e,"middlewareInvoke");if(!s)return!1;let i=()=>(eH(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return i();let o=tb(eF(e,"initURL")),l=rn(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=t9(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return i();let c=!1;try{if(await this.ensureMiddleware(e.url),n=await this.runMiddleware({request:e,response:t,parsedUrl:o,parsed:r}),"response"in n){if(s)throw c=!0,Object.defineProperty(new to.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(t1(n.response.headers)))"content-encoding"!==e&&void 0!==r&&t.setHeader(e,r);t.statusCode=n.response.status;let{originalResponse:e}=t;return n.response.body?await rC(n.response.body,e):e.end(),!0}}catch(s){if(c)throw s;if(rz(s)&&"ENOENT"===s.code)return await this.render404(e,t,r),!0;if(s instanceof eI)return t.statusCode=400,await this.renderError(s,e,t,r.pathname||""),!0;let n=rF(s);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let s=e.dev??!1;if(this.isDev=s,this.sriEnabled=!!(null==(r=e.conf.experimental)||null==(t=r.sri)?void 0:t.algorithm),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.experimental.useSkewCookie?"":this.nextConfig.deploymentId||"",e.dev,!e.dev){let{dynamicRoutes:e=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=e.map(e=>{let t=rN(e.page);return{match:eU(t),page:e.page,re:t.re}})}!function(e){if(!globalThis.__NEXT_HTTP_AGENT){if(!e)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1,configurable:!0});globalThis.__NEXT_HTTP_AGENT_OPTIONS=e.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new sj.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new sN.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,b.join)(this.serverDistDir,"middleware-manifest.json"),e.dev||this.prepare().catch(e=>{console.error("Failed to prepare server",e)}),this.renderOpts.isExperimentalCompile&&function(e){let t={...function(){let e=[];for(let t in process.env)if(t.startsWith("NEXT_PUBLIC_")){let r=process.env[t];null!=r&&e.push([`process.env.${t}`,r])}return e.sort((e,t)=>e[0].localeCompare(t[0])),Object.fromEntries(e)}(),...function(e){let t={},r=e.env;for(let n in r){let s=r[n];if(null!=s){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),i="NEXT_RUNTIME"===n;if(r||i)throw Object.defineProperty(Error(`The key "${n}" under "env" in ${e.configFileName} is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`),"__NEXT_ERROR_CODE",{value:"E170",enumerable:!1,configurable:!0});t[`process.env.${n}`]=s}}return t}(e),"process.env.NEXT_DEPLOYMENT_ID":e.deploymentId||""};for(let e in t){let r=e.split(".").pop()||"";process.env[r]||(process.env[r]=t[e]||"")}}(this.nextConfig),(null==(n=e.conf.experimental)?void 0:n.removeUncaughtErrorAndRejectionListeners)&&(process.removeAllListeners("uncaughtException"),process.removeAllListeners("unhandledRejection")),process.on("unhandledRejection",e=>{sz(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{sz(e)||console.error(e)})}async unstable_preloadEntries(){await this.prepare();let e=this.getAppPathsManifest(),t=this.getPagesManifest();for(let e of(await this.loadCustomCacheHandlers(),Object.keys(t||{})))try{await sp({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await sp({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});e.patchFetch()}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,sH.getInstrumentationModule)(this.dir,this.nextConfig.distDir)}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:e}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1,configurable:!0})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){await (0,sH.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t}){(0,sm.loadEnvConfig)(this.dir,e,v,t,t?e=>{tS(`Reload env: ${e}`)}:void 0)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nK[nB])return null==nW||nW("cache handlers already initialized"),!1;if(null==nW||nW("initializing cache handlers"),nK[nB]=new Map,nK[nX]){let e;nK[nX].DefaultCache?(null==nW||nW('setting "default" cache handler from symbol'),e=nK[nX].DefaultCache):(null==nW||nW('setting "default" cache handler from default'),e=nV()),nK[nB].set("default",e),nK[nX].RemoteCache?(null==nW||nW('setting "remote" cache handler from symbol'),nK[nB].set("remote",nK[nX].RemoteCache)):(null==nW||nW('setting "remote" cache handler from default'),nK[nB].set("remote",e))}else null==nW||nW('setting "default" cache handler from default'),nK[nB].set("default",nV()),null==nW||nW('setting "remote" cache handler from default'),nK[nB].set("remote",nV());return nK[nG]=new Set(nK[nB].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=si(await sX(sZ(this.distDir,n)));if(!nK[nB]||!nK[nG])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nW||nW('setting cache handler for "%s"',r),nK[nB].set(r,t),nK[nG].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=si(await sX(sZ(this.distDir,r)))),await this.loadCustomCacheHandlers(),new sA({fs:this.getCacheFilesystem(),dev:!1,requestHeaders:e,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:t})}getResponseCache(){return new sP(!0)}getPublicDir(){return(0,b.join)(this.dir,"public")}getHasStaticDir(){return ee().existsSync((0,b.join)(this.dir,"static"))}getPagesManifest(){return(0,se.loadManifest)((0,b.join)(this.serverDistDir,eG))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,se.loadManifest)((0,b.join)(this.serverDistDir,eK))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(sL).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!sr(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,b.join)(this.distDir,"BUILD_ID");try{return ee().readFileSync(e,"utf8").trim()}catch(e){if("ENOENT"===e.code)throw Object.defineProperty(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`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1,configurable:!0});throw e}}getEnabledDirectories(e){let t=e?this.dir:this.serverDistDir;return{app:!!e0(t,"app"),pages:!!e0(t,"pages")}}sendRenderResult(e,t,r){return ty({req:e.originalRequest,res:t.originalResponse,result:r.result,generateEtags:r.generateEtags,poweredByHeader:r.poweredByHeader,cacheControl:r.cacheControl})}async runApi(e,t,r,n){for(let s of this.getEdgeFunctionsPages())if(s===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let s=tb(eF(e,"initURL")||e.url);e.url=`${s.pathname}${s.search||""}`;let i=new sF,a=await i.load(n.definition.filename);return eH(e.originalRequest,"relativeProjectDir",(0,b.relative)(process.cwd(),this.dir)),eH(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,s){return(0,to.getTracer)().trace(r_.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,s))}async renderHTMLImpl(e,t,r,n,s){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1,configurable:!0})}async imageOptimizer(e,t,r,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1,configurable:!0})}getPagePath(e,t){return sn(e,this.distDir,t,this.enabledDirectories.app)}async renderPageComponent(e,t){let r=this.getEdgeFunctionsPages()||[];if(r.length){let t=this.getOriginalAppPaths(e.pathname),n=Array.isArray(t),s=e.pathname;for(let i of(n&&(s=t[0]),r))if(i===s)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:s,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}){return(0,to.getTracer)().trace(r_.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":s?tL(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:s,url:i}){let a=[t];for(let t of(e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let i=await sp({distDir:this.distDir,page:t,isAppPath:s,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof i.Component&&!t.startsWith(`/${e}/`)&&t!==`/${e}`)continue;return{components:i,query:{...!this.renderOpts.isExperimentalCompile&&i.getStaticProps?{}:r,...(s?{}:n)||{}}}}catch(e){if(!(e instanceof eA))throw e}return null}getNextFontManifest(){return(0,se.loadManifest)((0,b.join)(this.distDir,"server","next-font-manifest.json"))}logErrorWithOriginalStack(e,t){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1,configurable:!0})}async ensurePage(e){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1,configurable:!0})}async handleApiRequest(e,t,r,n){return this.runApi(e,t,r,n)}getCacheFilesystem(){return sD}normalizeReq(e){return e instanceof tp?e:new tp(e)}normalizeRes(e){return e instanceof tf?e:new tf(e)}getRequestHandler(){return this.makeRequestHandler()}getRequestHandlerWithMetadata(e){let t=this.makeRequestHandler();return(r,n,s)=>(r[ez]=e,t(r,n,s))}makeRequestHandler(){this.prepare().catch(e=>{console.error("Failed to prepare server",e)});let e=super.getRequestHandler();return(t,r,n)=>e(this.normalizeReq(t),this.normalizeRes(r),n)}async revalidate({urlPath:e,revalidateHeaders:t,opts:r}){let n=function({url:e,headers:t={},method:r="GET",bodyReadable:n,resWriter:s,socket:i=null}){return{req:new s$({url:e,headers:t,method:r,socket:i,readable:n}),res:new sM({socket:i,resWriter:s})}}({url:e,headers:t}),s=this.getRequestHandler();if(await s(new tp(n.req),new tf(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&200!==n.res.statusCode&&!(404===n.res.statusCode&&r.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}async render(e,t,r,n,s,i=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,s,i)}async renderToHTML(e,t,r,n){return super.renderToHTML(this.normalizeReq(e),this.normalizeRes(t),r,n)}async renderErrorToResponseImpl(e,t){let{req:r,res:n,query:s}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eX)?(await this.runEdgeFunction({req:r,res:n,query:s||{},params:{},page:eX,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,s,i){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,s,i)}async renderErrorToHTML(e,t,r,n,s){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,s)}async render404(e,t,r,n){return super.render404(this.normalizeReq(e),this.normalizeRes(t),r,n)}getMiddlewareManifest(){return null}async getMiddleware(){var e,t;let r=this.getMiddlewareManifest(),n=null==r||null==(e=r.middleware)?void 0:e["/"];if(!n){let e=await this.loadNodeMiddleware();return e?{match:sf((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=sB.get(e);if(t)return t;if(!Array.isArray(e.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(e)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1,configurable:!0});let r=sf(e.matchers);return sB.set(e,r),r}(n),page:"/"}}getEdgeFunctionsPages(){let e=this.getMiddlewareManifest();return e?Object.keys(e.functions):[]}getEdgeFunctionInfo(e){let t,r=this.getMiddlewareManifest();if(!r)return null;try{t=rT(r8(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new eA(t);return null}return{name:n.name,paths:n.files.map(e=>(0,b.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,b.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,b.join)(this.distDir,e.filePath)})),env:n.env}}async loadNodeMiddleware(){}async hasMiddleware(e){let t=this.getEdgeFunctionInfo({page:e,middleware:!0}),r=await this.loadNodeMiddleware();return!t&&!!r||!!(t&&t.paths.length>0)}async ensureMiddleware(e){}async ensureEdgeFunction(e){}async runMiddleware(e){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1,configurable:!0})}getPrerenderManifest(){return this._cachedPreviewManifest||(this._cachedPreviewManifest=(0,se.loadManifest)((0,b.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,to.getTracer)().trace(r_.getRoutesManifest,()=>(0,se.loadManifest)((0,b.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n,s;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",a=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;if(eH(e,"initURL",a),eH(e,"initQuery",{...t.query}),eH(e,"initProtocol",i),!r){let t=null==(s=this.nextConfig.experimental)?void 0:s.middlewareClientMaxBodySize;eH(e,"clonableBody",function(e,t){let r=null,n=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(r){let t=await n;if(t&&"object"==typeof t&&t.error)throw t.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,r),r=e}},cloneBodyStream(){let n=r??e,s=new sg.PassThrough,i=new sg.PassThrough,a=0,o=t??0xa00000,l=!1;return n.on("data",t=>{if(!l){if((a+=t.length)>o){l=!0;let t=e.url?` for ${e.url}`:"";console.warn(`Request body exceeded ${s_().format(o)}${t}. Only the first ${s_().format(o)} will be available unless configured. See https://nextjs.org/docs/app/api-reference/config/next-config-js/middlewareClientMaxBodySize for more details.`),s.push(null),i.push(null);return}s.push(t),i.push(t)}}),n.on("end",()=>{l||(s.push(null),i.push(null))}),r=i,s}}}(e.originalRequest,t))}}async runEdgeFunction(e){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1,configurable:!0})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let e=(0,b.join)(this.distDir,eY);return this._serverDistDir=e,e}async getFallbackErrorComponents(e){return null}async instrumentationOnRequestError(...e){await super.instrumentationOnRequestError(...e),this.logError(e[0])}onServerClose(e){this.cleanupListeners.add(e)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new e_("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
26
26
  //# sourceMappingURL=server.runtime.prod.js.map