next 15.6.0-canary.7 → 15.6.0-canary.8

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 (43) 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 +4 -4
  5. package/dist/build/webpack-config.js.map +1 -1
  6. package/dist/client/app-bootstrap.js +1 -1
  7. package/dist/client/index.js +1 -1
  8. package/dist/compiled/babel-packages/packages-bundle.js +7 -7
  9. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  10. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  11. package/dist/esm/build/index.js +3 -3
  12. package/dist/esm/build/swc/index.js +1 -1
  13. package/dist/esm/build/webpack-config.js +4 -4
  14. package/dist/esm/build/webpack-config.js.map +1 -1
  15. package/dist/esm/client/app-bootstrap.js +1 -1
  16. package/dist/esm/client/index.js +1 -1
  17. package/dist/esm/server/base-server.js +0 -3
  18. package/dist/esm/server/base-server.js.map +1 -1
  19. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  20. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  21. package/dist/esm/server/lib/app-info-log.js +1 -1
  22. package/dist/esm/server/lib/start-server.js +1 -1
  23. package/dist/esm/server/route-matcher-managers/dev-route-matcher-manager.js +3 -0
  24. package/dist/esm/server/route-matcher-managers/dev-route-matcher-manager.js.map +1 -1
  25. package/dist/esm/server/web/spec-extension/unstable-cache.js +26 -6
  26. package/dist/esm/server/web/spec-extension/unstable-cache.js.map +1 -1
  27. package/dist/esm/shared/lib/canary-only.js +1 -1
  28. package/dist/server/base-server.d.ts +0 -1
  29. package/dist/server/base-server.js +0 -3
  30. package/dist/server/base-server.js.map +1 -1
  31. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  32. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  33. package/dist/server/lib/app-info-log.js +1 -1
  34. package/dist/server/lib/start-server.js +1 -1
  35. package/dist/server/route-matcher-managers/dev-route-matcher-manager.js +3 -0
  36. package/dist/server/route-matcher-managers/dev-route-matcher-manager.js.map +1 -1
  37. package/dist/server/web/spec-extension/unstable-cache.js +26 -6
  38. package/dist/server/web/spec-extension/unstable-cache.js.map +1 -1
  39. package/dist/shared/lib/canary-only.js +1 -1
  40. package/dist/telemetry/anonymous-meta.js +1 -1
  41. package/dist/telemetry/events/session-stopped.js +2 -2
  42. package/dist/telemetry/events/version.js +2 -2
  43. package/package.json +15 -15
@@ -10,5 +10,5 @@
10
10
  `)}}class rn extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
11
11
  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
12
12
  `)}}var ri=r("./dist/compiled/@edge-runtime/cookies/index.js");let rs=Symbol("internal request");class ra extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);tG(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new re(r,{headers:tB(this.headers),nextConfig:t.nextConfig});this[rs]={cookies:new ri.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[rs].cookies}get nextUrl(){return this[rs].nextUrl}get page(){throw new rr}get ua(){throw new rn}get url(){return this[rs].url}}let ro="ResponseAborted";class rl extends Error{constructor(...e){super(...e),this.name=ro}}class rd{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}var ru=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}(ru||{}),rc=function(e){return e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents",e}(rc||{}),rh=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}(rh||{});let rp=0,rf=0,rm=0;function rg(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===ro}async function ry(e,t,r){try{let{errored:n,destroyed:i}=t;if(n||i)return;let s=function(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new rl)}),t}(t),a=function(e,t){let r=!1,n=new rd;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let s=new rd;return e.once("finish",()=>{s.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===rp?void 0:{clientComponentLoadStart:rp,clientComponentLoadTimes:rf,clientComponentLoadCount:rm};return e.reset&&(rp=0,rf=0,rm=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,e7.getTracer)().trace(rh.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 rd)}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(),s.promise}})}(t,r);await e.pipeTo(a,{signal:s.signal})}catch(e){if(rg(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class rv{static #e=this.EMPTY=new rv(null,{metadata:{},contentType:null});static fromStatic(e,t){return new rv(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 eu("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return tW(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tH(this.response):Buffer.isBuffer(this.response)?tV(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}),i=1;for(;i<e.length-1;i++){let t=e[i];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let s=e[i];return(n=n.then(()=>s.pipeTo(r))).catch(tz),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tH(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[tV(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(rg(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await ry(this.readable,e,this.waitUntil)}}function r_(e){return e.replace(/\\/g,"/")}function rb(e){let t=r_(e);return t.startsWith("/index/")&&!tM(t)?t.slice(6):"/index"!==t?t:"/"}function rx(e,t){let r=[],n=(0,eT.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),i=(0,eT.regexpToFunction)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(n.source),n.flags):n,r);return(e,n)=>{if("string"!=typeof e)return!1;let s=i(e);if(!s)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete s.params[e.name];return{...n,...s.params}}}let rE=/[|\\{}()[\]^$+*?.-]/,rw=/[|\\{}()[\]^$+*?.-]/g;function rC(e){return rE.test(e)?e.replace(rw,"\\$&"):e}let rR=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function rP(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 rT(e,t){let{includeSuffix:r=!1,includePrefix:n=!1,excludeOptionalTrailingSlash:i=!1}=void 0===t?{}:t,{parameterizedRoute:s,groups:a}=function(e,t,r){let n={},i=1,s=[];for(let a of tY(e).slice(1).split("/")){let e=tj.find(e=>a.startsWith(e)),o=a.match(rR);if(e&&o&&o[2]){let{key:t,optional:r,repeat:a}=rP(o[2]);n[t]={pos:i++,repeat:a,optional:r},s.push("/"+rC(e)+"([^/]+?)")}else if(o&&o[2]){let{key:e,repeat:t,optional:a}=rP(o[2]);n[e]={pos:i++,repeat:t,optional:a},r&&o[1]&&s.push("/"+rC(o[1]));let l=t?a?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),s.push(l)}else s.push("/"+rC(a));t&&o&&o[3]&&s.push(rC(o[3]))}return{parameterizedRoute:s.join(""),groups:n}}(e,r,n),o=s;return i||(o+="(?:/)?"),{re:RegExp("^"+o+"$"),groups:a}}function rO(e){let t,{interceptionMarker:r,getSafeRouteKey:n,segment:i,routeKeys:s,keyPrefix:a,backreferenceDuplicateKeys:o}=e,{key:l,optional:d,repeat:u}=rP(i),c=l.replace(/\W/g,"");a&&(c=""+a+c);let h=!1;(0===c.length||c.length>30)&&(h=!0),isNaN(parseInt(c.slice(0,1)))||(h=!0),h&&(c=n());let p=c in s;a?s[c]=""+a+l:s[c]=l;let f=r?rC(r):"";return t=p&&o?"\\k<"+c+">":u?"(?<"+c+">.+?)":"(?<"+c+">[^/]+?)",d?"(?:/"+f+t+")?":"/"+f+t}function rS(e){return e.replace(/__ESC_COLON_/gi,":")}function rI(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},s=r=>{let n,s=r.key;switch(r.type){case"header":s=s.toLowerCase(),n=e.headers[s];break;case"cookie":n="cookies"in e?e.cookies[r.key]:tr(e.headers)()[r.key];break;case"query":n=t[s];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};n=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return i[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}(s)]=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=>{i[e]=t.groups[e]}):"host"===r.type&&t[0]&&(i.host=t[0])),!0}return!1};return!(!r.every(e=>s(e))||n.some(e=>s(e)))&&i}function rk(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 eA("/"+(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,"*")),{validate:!1})(t).slice(1)}function rA(e){try{return decodeURIComponent(e)}catch{return e}}let rj=/https?|ftp|gopher|file/;var rN=r("./dist/compiled/superstruct/index.cjs"),rD=r.n(rN);let r$=rD().enums(["c","ci","oc","d","di"]),rM=rD().union([rD().string(),rD().tuple([rD().string(),rD().string(),r$])]),rZ=rD().tuple([rM,rD().record(rD().string(),rD().lazy(()=>rZ)),rD().optional(rD().nullable(rD().string())),rD().optional(rD().nullable(rD().union([rD().literal("refetch"),rD().literal("refresh"),rD().literal("inside-shared-layout"),rD().literal("metadata-only")]))),rD().optional(rD().boolean())]),rL="next-action",rq="next-router-state-tree",rU="next-router-prefetch",rz="next-router-segment-prefetch",rF="next-url",rH=["rsc",rq,rU,"next-hmr-refresh",rz],rV="_rsc";function rW(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)===rF}function rX(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==eY&&r.startsWith(eY),i=r!==eJ&&r.startsWith(eJ);(n||i||t.includes(r))&&delete e[r]}}function rB(e,t){return"string"==typeof e[e5]&&e["x-next-revalidate-tag-token"]===t?e[e5].split(","):[]}function rG(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function rK(e){return rG(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})}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){void 0===e&&(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 s=n.slice(1,-1),a=!1;if(s.startsWith("[")&&s.endsWith("]")&&(s=s.slice(1,-1),a=!0),s.startsWith("…"))throw Object.defineProperty(Error("Detected a three-dot character ('…') at ('"+s+"'). Did you mean ('...')?"),"__NEXT_ERROR_CODE",{value:"E147",enumerable:!1,configurable:!0});if(s.startsWith("...")&&(s=s.substring(3),r=!0),s.startsWith("[")||s.endsWith("]"))throw Object.defineProperty(Error("Segment names may not start or end with extra brackets ('"+s+"')."),"__NEXT_ERROR_CODE",{value:"E421",enumerable:!1,configurable:!0});if(s.startsWith("."))throw Object.defineProperty(Error("Segment names may not start with erroneous periods ('"+s+"')."),"__NEXT_ERROR_CODE",{value:"E288",enumerable:!1,configurable:!0});function i(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});i(this.optionalRestSlugName,s),this.optionalRestSlugName=s,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});i(this.restSlugName,s),this.restSlugName=s,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});i(this.slugName,s),this.slugName=s,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,tM(e.pathname)&&(this.dynamic=ej(rT(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 i=this.test(e,t);return i?{definition:this.definition,params:i.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 rd;this.waitTillReadyPromise=e;let n=this.compilationID;try{let e=[],t=await Promise.all(this.providers.map(e=>e.matchers())),r=new Map,i={};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=i[t.definition.pathname]??[n];e.push(t),i[t.definition.pathname]=e,n.duplicated=e,t.duplicated=e}e.push(t),r.set(t.definition.pathname,t)}if(this.matchers.duplicates=i,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 s=e.filter(e=>e.isDynamic),a=new Map,o=[];for(let e=0;e<s.length;e++){let t=s[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=>s[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(!tM(e=tI(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)&&!tM(e)?"/index"+e:"/"===e?"/index":tI(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new eE("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,eF)}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("|")}))`;function nn(e){return{normalize:e}}class ni extends r4{constructor(){super([nn(tk),new r5])}normalize(e){return super.normalize(e)}}class ns{constructor(e){this.filename=new r7(e),this.pathname=new ni,this.bundlePath=new r6}}var na=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 no extends rQ{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class nl{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 nd extends nl{constructor(e,t){super({load:async()=>t.load(e),compare:(e,t)=>e===t})}}class nu extends nd{constructor(e,t){super(ez,t),this.normalizers=new ns(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,i]of Object.entries(r)){let r=i[0],s=this.normalizers.filename.normalize(e[r]),a=this.normalizers.bundlePath.normalize(r);n.push(new no({kind:na.APP_PAGE,pathname:t,page:r,bundlePath:a,filename:s,appPaths:i}))}return n}}class nc extends rQ{}class nh extends nd{constructor(e,t){super(ez,t),this.normalizers=new ns(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]),i=this.normalizers.pathname.normalize(n),s=this.normalizers.bundlePath.normalize(n);r.push(new nc({kind:na.APP_ROUTE,pathname:i,page:n,bundlePath:s,filename:t}))}return r}}function np(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}class nf extends rQ{}class nm extends r0{}class ng extends r4{constructor(){super([nn(r8),new r3("pages")])}normalize(e){return super.normalize(e)}}class ny extends r3{constructor(e){super(e,eF)}normalize(e){return super.normalize(e)}}class nv{constructor(e){this.filename=new ny(e),this.bundlePath=new ng}}class n_ extends nd{constructor(e,t,r){super(eU,t),this.i18nProvider=r,this.normalizers=new nv(e)}async transform(e){let t=Object.keys(e).filter(e=>np(e)),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new nm({kind:na.PAGES_API,pathname:i,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new nf({kind:na.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nb extends rQ{}class nx extends r0{}class nE extends nd{constructor(e,t,r){super(eU,t),this.i18nProvider=r,this.normalizers=new nv(e)}async transform(e){let t=Object.keys(e).filter(e=>!np(e)).filter(e=>{var t;let r=(null==(t=this.i18nProvider)?void 0:t.analyze(e).pathname)??e;return!eH.includes(r)}),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new nx({kind:na.PAGES,pathname:i,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new nb({kind:na.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nw{constructor(e){this.getter=e}load(e){return this.getter(e)}}class nC{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 i=this.lowerCaseDomains[n];if(i.hostname===e||(null==(r=i.locales)?void 0:r.some(e=>e===t)))return this.config.domains[n]}}}fromRequest(e,t){let r=eD(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:eD(e,"localeInferredFromDefault")??!1}}analyze(e,t={}){let r=t.defaultLocale,n="string"==typeof r,i=e.split("/",2);if(!i[1])return{detectedLocale:r,pathname:e,inferredFromDefault:n};let s=i[1].toLowerCase(),a=this.lowerCaseLocales.indexOf(s);return a<0||(r=this.config.locales[a],n=!1,e=e.slice(r.length+1)||"/"),{detectedLocale:r,pathname:e,inferredFromDefault:n}}}async function nR(e,t,r,n){{var i;t.statusCode=r.status,t.statusMessage=r.statusText;let s=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(i=r.headers)||i.forEach((e,r)=>{if("x-middleware-set-cookie"!==r.toLowerCase())if("set-cookie"===r.toLowerCase())for(let n of tX(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(s.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:a}=t;r.body&&"HEAD"!==e.method?await ry(r.body,a,n):a.end()}}let nP=rx("/_next/data/:path*");class nT{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 nO extends nT{constructor(){super(e2)}}class nS extends nT{constructor(){super(e0)}match(e){return e==="/__index"+e0||super.match(e)}normalize(e,t){return e==="/__index"+e0?"/":super.normalize(e,t)}}class nI{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 nk{constructor(e){if(this.suffix=new nT(".json"),!e)throw Object.defineProperty(Error("Invariant: buildID is required"),"__NEXT_ERROR_CODE",{value:"E200",enumerable:!1,configurable:!0});this.prefix=new nI(`/_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),rb(e=this.suffix.normalize(e,!0))):e}}function nA(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 nj=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");let nN=Symbol("internal response"),nD=new Set([301,302,303,307,308]);function n$(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,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class nM extends Response{constructor(e,t={}){super(e,t);let r=this.headers,n=new Proxy(new ri.ResponseCookies(r),{get(e,n,i){switch(n){case"delete":case"set":return(...i)=>{let s=Reflect.apply(e[n],e,i),a=new Headers(r);return s instanceof ri.ResponseCookies&&r.set("x-middleware-set-cookie",s.getAll().map(e=>(0,ri.stringifyCookie)(e)).join(",")),n$(t,a),s};default:return eX.get(e,n,i)}}});this[nN]={cookies:n,url:t.url?new re(t.url,{headers:tB(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[nN].cookies}static json(e,t){let r=Response.json(e,t);return new nM(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!nD.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:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",tG(e)),new nM(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",tG(e)),n$(t,r),new nM(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),n$(e,t),new nM(null,{...e,headers:t})}}Symbol.for("next.mutated.cookies"),r("./dist/compiled/p-queue/index.js");let nZ=require("next/dist/server/lib/cache-handlers/default.external.js");var nL=r.n(nZ);let nq=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,nU=Symbol.for("@next/cache-handlers"),nz=Symbol.for("@next/cache-handlers-map"),nF=Symbol.for("@next/cache-handlers-set"),nH=globalThis;require("next/dist/server/app-render/after-task-async-storage.external.js");class nV extends ra{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new rt({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new rt({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new rt({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let nW=RegExp(`^(/.*)${e1}(/.*)${e4}$`);class nX{match(e){return nW.test(e)}extract(e){let t=e.match(nW);return t?{originalPathname:t[1],segmentPath:t[2]}:null}normalize(e){let t=this.extract(e);return t?t.originalPathname:e}}let nB=require("next/dist/shared/lib/no-fallback-error.external.js");var nG=r("./dist/compiled/zod/index.cjs");r("./dist/compiled/zod-validation-error/index.js"),nG.z.object({revalidate:nG.z.union([nG.z.number().int().nonnegative(),nG.z.literal(!1)]).optional(),dynamicParams:nG.z.boolean().optional(),dynamic:nG.z.enum(["auto","error","force-static","force-dynamic"]).optional(),fetchCache:nG.z.enum(["auto","default-cache","only-cache","force-cache","force-no-store","default-no-store","only-no-store"]).optional(),unstable_prefetch:nG.z.enum(["unstable_static","unstable_runtime"]).optional(),preferredRegion:nG.z.union([nG.z.string(),nG.z.array(nG.z.string())]).optional(),experimental_ppr:nG.z.boolean().optional(),runtime:nG.z.enum(["edge","nodejs"]).optional(),maxDuration:nG.z.number().int().nonnegative().optional()}).keyof().options;let nK={catchall:"c","catchall-intercepted":"ci","optional-catchall":"oc",dynamic:"d","dynamic-intercepted":"di"};class nY extends Error{constructor(e){super(),this.innerError=e}}class nJ{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(e){var t,r,n;this.handleRSCRequest=(e,t,r)=>{var n,i,s;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:i}=t;r.pathname=n,e.headers.rsc="1",e.headers[rU]="1",e.headers[rz]=i,e$(e,"isRSCRequest",!0),e$(e,"isPrefetchRSCRequest",!0),e$(e,"segmentPrefetchRSCRequest",i)}else if(null==(i=this.normalizers.prefetchRSC)?void 0:i.match(r.pathname))r.pathname=this.normalizers.prefetchRSC.normalize(r.pathname,!0),e.headers.rsc="1",e.headers[rU]="1",e$(e,"isRSCRequest",!0),e$(e,"isPrefetchRSCRequest",!0);else if(null==(s=this.normalizers.rsc)?void 0:s.match(r.pathname))r.pathname=this.normalizers.rsc.normalize(r.pathname,!0),e.headers.rsc="1",e$(e,"isRSCRequest",!0);else if(e.headers["x-now-route-matches"]){var a=e.headers;for(let e of rH)delete a[e];return!1}else if("1"!==e.headers.rsc)return!1;else if(e$(e,"isRSCRequest",!0),"1"===e.headers[rU]){e$(e,"isPrefetchRSCRequest",!0);let t=e.headers[rz];"string"==typeof t&&e$(e,"segmentPrefetchRSCRequest",t)}if(e.url){let t=(0,v.parse)(e.url);t.pathname=r.pathname,e.url=(0,v.format)(t)}return!1},this.handleNextDataRequest=async(e,t,r)=>{let n=await this.getMiddleware(),i=function(e){return"string"==typeof e&&nP(e)}(r.pathname);if(!i||!i.path)return!1;if(i.path[0]!==this.buildId)return!eD(e,"middlewareInvoke")&&(await this.render404(e,t,r),!0);i.path.shift();let s=i.path[i.path.length-1];if("string"!=typeof s||!s.endsWith(".json"))return await this.render404(e,t,r),!0;let a=`/${i.path.join("/")}`;if(a=function(e,t){return void 0===t&&(t=""),e=e.replace(/\\/g,"/"),(e=t&&e.endsWith(t)?e.slice(0,-t.length):e).startsWith("/index/")&&!tM(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 i=null==e||null==(o=e.headers.host)?void 0:o.split(":",1)[0].toLowerCase(),s=this.i18nProvider.detectDomainLocale(i),l=(null==s?void 0:s.defaultLocale)??this.i18nProvider.config.defaultLocale,d=this.i18nProvider.analyze(a);if(d.detectedLocale&&(a=d.pathname),e$(e,"locale",d.detectedLocale),e$(e,"defaultLocale",l),d.detectedLocale||eM(e,"localeInferredFromDefault"),!d.detectedLocale&&!n)return e$(e,"locale",l),await this.render404(e,t,r),!0}return r.pathname=a,e$(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 function(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return r||(r=!0,t=e(...i)),t}}(()=>{t_(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
13
- See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:i=".",quiet:s=!1,conf:a,dev:o=!1,minimalMode:l=!1,hostname:d,port:u,experimentalTestProxy:c}=e;this.experimentalTestProxy=c,this.serverOptions=e,this.dir=g.resolve(i),this.quiet=s,this.loadEnvConfig({dev:o}),this.nextConfig=a,this.hostname=d,this.hostname&&(this.fetchHostname=function(e){return tS.test(e)?`[${e}]`:e}(this.hostname)),this.port=u,this.distDir=g.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nC(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rY(this.i18nProvider):void 0;let{serverRuntimeConfig:h={},publicRuntimeConfig:p,assetPrefix:f,generateEtags:m}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(o),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 nO:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nS:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nX:void 0,data:this.enabledDirectories.pages?new nk(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,canonicalBase:this.nextConfig.amp.canonicalBase||"",generateEtags:m,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(r=this.nextConfig.experimental.amp)?void 0:r.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(n=this.nextConfig.i18n)?void 0:n.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,cacheLifeProfiles:this.nextConfig.experimental.cacheLife,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(p).length>0?p:void 0,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},(0,tZ.setConfig)({serverRuntimeConfig:h,publicRuntimeConfig:p}),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(f),this.responseCache=this.getResponseCache({dev:o})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new nw(e=>{switch(e){case eU:return this.getPagesManifest()??null;case ez:return this.getAppPathsManifest()??null;default:return null}}),t=new r1;return t.push(new nE(this.distDir,e,this.i18nProvider)),t.push(new n_(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new nu(this.distDir,e)),t.push(new nh(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 nV?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tv(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,e7.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(ru.handleRequest,{spanName:`${n}`,kind:e7.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async s=>this.handleRequestImpl(e,t,r).finally(()=>{if(!s)return;let r=eD(e,"isRSCRequest")??!1;s.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(s.setStatus({code:e7.SpanStatusCode.ERROR}),s.setAttribute("error.type",t.statusCode.toString()));let a=i.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==ru.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}`;s.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),s.updateName(e)}else s.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,s,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=eD(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,v.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==(i=m.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let _=await this.handleRSCRequest(e,t,r);if(_)return;let b=null==(s=this.i18nProvider)?void 0:s.detectDomainLocale(t4(r,e.headers)),x=(null==b?void 0:b.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);e$(e,"defaultLocale",x);let E=th(e.url.replace(/^\/+/,"/")),w=t8(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=t3(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[eQ];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[eQ]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))e$(e,"isNextDataReq",!0);else if(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");e$(e,"postponed",r)}n=this.normalize(n);let s=this.stripNextDataPath(i);n=rb(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});a&&(e$(e,"locale",a.detectedLocale),a.inferredFromDefault?e$(e,"localeInferredFromDefault",!0):eM(e,"localeInferredFromDefault"));let c=n,h=tM(c),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(c,{i18n:a});e&&(c=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}a&&(n=a.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:a}){let o,l,d;return i&&(d=(l=ej(o=function(e,t){var r,n,i;let s=function(e,t,r,n,i){let s,a=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let s of tY(e).slice(1).split("/")){let e=tj.some(e=>s.startsWith(e)),d=s.match(rR);if(e&&d&&d[2])l.push(rO({getSafeRouteKey:a,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?eJ:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rC(d[1]));let e=rO({getSafeRouteKey:a,segment:d[2],routeKeys:o,keyPrefix:t?eY:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rC(s));r&&d&&d[3]&&l.push(rC(d[3]))}return{namedParameterizedRoute:l.join(""),routeKeys:o}}(e,t.prefixRouteKeys,null!=(r=t.includeSuffix)&&r,null!=(n=t.includePrefix)&&n,null!=(i=t.backreferenceDuplicateKeys)&&i),a=s.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(a+="(?:/)?"),{...rT(e,t),namedRegex:"^"+a+"$",routeKeys:s.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=rx(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rI(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rW(n)){let e=o.headers[rq];e&&(p={...function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],i=Array.isArray(t),s=i?t[1]:t;!s||s.startsWith("__PAGE__")||(i&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):i&&(r[t[0]]=t[1]),r=e(n,r))}return r}(function(e){if(void 0!==e){if(Array.isArray(e))throw Object.defineProperty(Error("Multiple router state headers were sent. This is not allowed."),"__NEXT_ERROR_CODE",{value:"E418",enumerable:!1,configurable:!0});if(e.length>4e4)throw Object.defineProperty(Error("The router state header was too large."),"__NEXT_ERROR_CODE",{value:"E142",enumerable:!1,configurable:!0});try{let t=JSON.parse(decodeURIComponent(e));return(0,rN.assert)(t,rZ),t}catch{throw Object.defineProperty(Error("The router state header was sent but could not be parsed."),"__NEXT_ERROR_CODE",{value:"E10",enumerable:!1,configurable:!0})}}}(e)),...p})}}catch(e){}let{parsedDestination:s,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(":"+rC(n),"g"),"__ESC_COLON_"+n)}let n=th(t),i=n.pathname;i&&(i=rS(i));let s=n.href;s&&(s=rS(s));let a=n.hostname;a&&(a=rS(a));let o=n.hash;o&&(o=rS(o));let l=n.search;l&&(l=rS(l));let d=n.origin;return d&&(d=rS(d)),{...n,pathname:i,hostname:a,href:s,hash:o,search:l,origin:d}}(e),{hostname:i,query:s,search:a}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(ek(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(ek(i,e),e))l.push(t.name)}let u=eA(o,{validate:!1});for(let[r,n]of(i&&(t=eA(i,{validate:!1})),Object.entries(s)))Array.isArray(n)?s[r]=n.map(t=>rk(rS(t),e.params)):"string"==typeof n&&(s[r]=rk(rS(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 s||(s[t]=e.params[t]);if(tN(o))for(let t of o.split("/")){let r=tj.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,s]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(s?"#":"")+(s||""),n.search=a?rk(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:s,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(s.protocol)return!0;if(Object.assign(u,a,p),Object.assign(d.query,s.query),delete s.query,Object.entries(d.query).forEach(([e,t])=>{if(t&&"string"==typeof t&&t.startsWith(":")){let r=u[t.slice(1)];r&&(d.query[e]=r)}}),Object.assign(d,s),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t9(c,t.locales);c=e.pathname,d.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(c===e)return!0;if(i&&l){let e=l(c);if(e)return d.query={...d.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])h(e);if(c!==e){let t=!1;for(let e of n.afterFiles||[])if(t=h(e))break;if(!t&&!(()=>{let t=tY(c||"");return t===tY(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=h(e))break}}return u},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=tK(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>rA(e)):rA(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=ej({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tK(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let s=r[e];if(!s)continue;let a=t[s],o=n[e];if(!a.optional&&!o)return null;i[a.pos]=o}return i}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let i={};for(let s of Object.keys(r.groups)){let a=e[s];"string"==typeof a?a=tA(a):Array.isArray(a)&&(a=a.map(tA));let o=n[s],l=r.groups[s].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]===`[[...${s}]]`))&&(a=void 0,delete e[s]),a&&"string"==typeof a&&r.groups[s].repeat&&(a=a.split("/")),a&&(i[s]=a)}return{params:i,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,rX(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=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,tc(e));else t.set(r,tc(n));return t}(a)));let l=e.search||a&&"?"+a||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rj.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),s&&"#"!==s[0]&&(s="#"+s),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+s}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let i,{optional:s,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;s&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||s)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rX(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});x&&!w.locale&&(r.pathname=`/${x}${r.pathname}`);let m={...r.query},g=r.pathname,y=Object.keys(f.handleRewrites(e,r)),v={...r.query},b=g!==r.pathname;b&&r.pathname&&e$(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tK(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(v[n]=Array.isArray(t)?t.map(e=>rA(e)):rA(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(v,!1)),!p.hasValidParams&&!tM(s)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,s);e&&(f.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tM(n)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,n);if(e){let r=f.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&&tM(n)&&!p.hasValidParams){let e=f.getParamsFromRouteMatches(r);e&&(p=f.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=f.normalizeDynamicRouteParams(v,!0)).hasValidParams&&(t=p.params),f.defaultRouteMatches&&s===c&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&e$(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(c,t),e.url=f.interpolateDynamicPath(e.url,t);let r=eD(e,"segmentPrefetchRSCRequest");r&&tM(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rz]=r,e$(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(u=f.defaultRouteRegex)?void 0:u.groups)||{})]),C))t in m||delete r.query[t];if(r.pathname=n,E.pathname=r.pathname,_=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof ex||r instanceof eE)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(e$(e,"isLocaleDomain",!!b),w.locale&&(e.url=(0,v.format)(E),e$(e,"didStripLocale",!0)),!eD(e,"locale")&&(w.locale?e$(e,"locale",w.locale):x&&(e$(e,"locale",x),e$(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eD(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),e$(e,"incrementalCache",t),globalThis.__incrementalCache=t}let R=function(){if(nH[nF])return nH[nF].values()}();R&&await Promise.all([...R].map(async t=>{if("refreshTags"in t);else{let r=rB(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),eD(e,"serverComponentsHmrCache")||e$(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let P=eD(e,"invokePath");if(!C&&P){let n=eD(e,"invokeStatus");if(n){let i=eD(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let s=eD(e,"invokeError")||null;return this.renderError(s,e,t,"/_error",r.query)}let i=new URL(P||"/","http://n"),s=t8(i.pathname,{nextConfig:this.nextConfig,parseData:!1});s.locale&&e$(e,"locale",s.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,e$(e,"rewroteURL",s.pathname));let a=t9(t3(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&e$(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eD(e,"invokeQuery");if(o&&Object.assign(r.query,o),_=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eD(e,"middlewareInvoke")){if((_=await this.normalizeAndAttachMetadata(e,t,r))||(_=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=t3(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nB.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ex||r instanceof eE)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[eN]=e,t(r,n,i))}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=tk(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,e7.getTracer)().trace(ru.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,e7.getTracer)().trace(ru.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||tU,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:s,res:a}=n,o=a.statusCode,{body:l}=i,{cacheControl:d}=i;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(s,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={},i,s=!1){return(0,e7.getTracer)().trace(ru.render,async()=>this.renderImpl(e,t,r,n,i,s))}getWaitUntil(){let e=function(){let e=globalThis[nj];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,s=!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 tq.test(e)?"dom":tL.test(e)?"html":void 0}(o),(a=r,eH.includes(a))?this.render404(e,t,i):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,e7.getTracer)().trace(ru.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return tN(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rq}, ${rU}, ${rz}`,s=eD(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rF}`),a=!0):(r||s)&&t.appendHeader("vary",i),a||delete e.headers[rF]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:s}){var a,o,l,d,u,c;let h,p;r===eZ&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===i.isAppPath,_=!!i.getServerSideProps,b=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rL)??null,r=e.headers.get("content-type")):(t=e.headers[rL]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,i=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),s=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:s,isPossibleServerAction:!!(s||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=eD(e,"isRSCRequest")??!1,w=(0,v.parse)(e.url||"").pathname||"/",C=eD(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"]?x=!0:x||=!!R.routes[nA(r)];let P=!!(eD(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||_);if(!x&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(eQ,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;x&&e.headers[eQ]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eD(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(p=i.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===na.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==s.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eD(e,"postponed"):void 0;if(!m||P||E||(t.statusCode=404),eV.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!b&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof i.Component||x))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof i.Component)return{body:rv.fromStatic(i.Component,eK)};if("amp"in s&&!s.amp&&delete s.amp,!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tq.test(u)||tL.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!s.amp&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[eQ]&&(C=w),w=tY(w),C=tY(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)&&tM(r)&&(i.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.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&&e$(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:i}of e)r.set(n,[`%%drp:${n}:${t}%%`,nK[i]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==na.APP_ROUTE))return await nR(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,v.parse)(eD(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=eD(e),k[eN]=c,e$(k,"distDir",this.distDir),e$(k,"query",s),e$(k,"params",n.params),e$(k,"ampValidator",this.renderOpts.ampValidator),e$(k,"minimalMode",!0),n.err&&e$(k,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rb(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:i}=e,s=this.getOriginalAppPaths(i),a=Array.isArray(s),o=i;a&&(o=s[s.length-1]);let l=await this.findPageComponents({locale:eD(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:s,shouldEnsure:!1});if(l){(0,e7.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nB.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,e7.getTracer)().trace(ru.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:i,pathname:s}=e,a=eD(e.req,"bubbleNoFallback")??!1;delete i[rV];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,s)};try{for await(let t of this.matchers.matchAll(s,o)){eD(e.req,"invokeOutput");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(i){let t=rK(i);if(i instanceof eC)throw console.error("Invariant: failed to load static page",JSON.stringify({page:s,url:e.req.url,matchedPath:e.req.headers[eQ],initUrl:eD(e.req,"initURL"),didRewrite:!!eD(e.req,"rewroteURL"),rewroteUrl:eD(e.req,"rewroteURL")},null,2)),t;if(t instanceof nB.NoFallbackError&&a)throw t;if(t instanceof ex||t instanceof eE)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(e$(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eM(e.req,"customErrorRender"));let r=t instanceof nY;if(!r)throw rG(t)&&(t.page=s),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=eD(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${s}`),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,e7.getTracer)().trace(ru.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,i={},s=!0){return(0,e7.getTracer)().trace(ru.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,s))}async renderErrorImpl(e,t,r,n,i={},s=!0){return s&&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:i})}async renderErrorToResponse(e,t){return(0,e7.getTracer)().trace(ru.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,s=404===r.statusCode,a=this.enabledDirectories.app;s&&(a&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:eL,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eD(e.req,"customErrorRender")&&!i&&eV.includes(o)&&(!i&&a&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:eD(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nY(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?e$(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eM(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nB.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=rK(a),i=t instanceof nY;i||this.logError(t),r.statusCode=500;let s=await this.getFallbackErrorComponents(e.req.url);if(s)return e$(e.req,"match",{definition:s.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:s});return{body:rv.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,i={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:i})}async render404(e,t,r,n=!0){let{pathname:i,query:s}=r||(0,v.parse)(e.url,!0);return this.nextConfig.i18n&&(eD(e,"locale")||e$(e,"locale",this.nextConfig.i18n.defaultLocale),e$(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,s,n)}}let nQ=require("next/dist/server/load-manifest.external.js"),n0=new E(1e3);function n1(e,t,r,n){let i,s=`${e}:${t}:${r}:${n}`,a=null==n0?void 0:n0.get(s);if(a)return a;let o=y().join(t,eF);n&&(i=(0,nQ.loadManifest)(y().join(o,ez),!0));let l=(0,nQ.loadManifest)(y().join(o,eU),!0);try{e=rb(r8(e))}catch(t){throw console.error(t),new ew(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t9(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(a=d(i)),a||(a=d(l)),a)?(y().isAbsolute(a)||(a=y().join(o,a)),null==n0||n0.set(s,a),a):(null==n0||n0.set(s,null),null)}function n4(e,t,r,n){let i=n1(e,t,r,n);if(!i)throw new ew(e);return i}async function n2(e,t,r){let n=n4(e,t,void 0,r);return n.endsWith(".html")?eR.promises.readFile(n,"utf8").catch(t=>{throw new eC(e,t.message)}):require(n)}function n9(e){return e.default||e}async function n3(e){return new Promise(t=>setTimeout(t,e))}let n8=Symbol.for("next.server.action-manifests");async function n5(e,t=3){for(;;)try{return(0,nQ.loadManifest)(e)}catch(e){if(--t<=0)throw e;await n3(100)}}async function n6(e,t=3){try{return await n5(e,t)}catch(e){return}}async function n7(e,t=3){for(;;)try{return(0,nQ.evalManifest)(e)}catch(e){if(--t<=0)throw e;await n3(100)}}async function ie(e,t,r){try{return(await n7(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function it({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i,needsManifestsForLegacyReasons:s}){let a={},o={};if(r||([a,o]=await Promise.all([n2("/_document",e,!1),n2("/_app",e,!1)])),s){let s,l=n?3:1;s=(0,g.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return ne(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,s=[RegExp(`^[\\\\/]robots${nr(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${nr(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${nr(["xml"],t)}${n}`),RegExp(`[\\\\/]${nt.icon.filename}${i}${nr(nt.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.apple.filename}${i}${nr(nt.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.openGraph.filename}${i}${nr(nt.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.twitter.filename}${i}${nr(nt.twitter.extensions,t)}${n}`)],a=r_(e);return s.some(e=>e.test(a))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([n5((0,g.join)(e,"build-manifest.json"),l),n6(s,l),r||0?void 0:n5((0,g.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?ie((0,g.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?n5((0,g.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,i?n5((0,g.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let s=null==(i=globalThis[n8])?void 0:i.clientReferenceManifestsPerPage;globalThis[n8]={clientReferenceManifestsPerPage:{...s,[tk(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,s;let a,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=el.workAsyncStorage.getStore();if(!(a=l?o[t1(s=l.page,"app")?s:"app"+s]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let y=await n2(t,e,r),v=n9(y),_=n9(a),b=n9(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=y;return{App:b,Document:_,Component:v,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:y.config||{},ComponentMod:y,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await n2(t,e,r),i=n9(n),s=n9(a),l=n9(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:s,Component:i,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let ir=(0,e7.getTracer)().wrap(rc.loadComponents,it);function ii(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rI(r,n,i.has,i.missing))continue;return!0}return!1}}var is=r("../next-env/dist/index.js");let ia=require("stream");var io=r.n(ia);class il{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new il(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:i,resolve:s,reject:a}=new rd;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:s,key:e});s(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),i}}let id=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var iu=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}({}),ic=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 ih(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===iu.PAGES?{kind:iu.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)===iu.APP_PAGE?{kind:iu.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 ip(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===iu.PAGES?{kind:iu.PAGES,html:rv.fromStatic(e.value.html,eK),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===iu.APP_PAGE?{kind:iu.APP_PAGE,html:rv.fromStatic(e.value.html,eK),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class im{constructor(e){this.getBatcher=il.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:id}),this.revalidateBatcher=il.create({schedulerFn:id}),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 ip(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:s=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return ip(await this.getBatcher.batch({key:e,isOnDemandRevalidate:s},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:s,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let i=null,s=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case na.PAGES:return ic.PAGES;case na.APP_PAGE:return ic.APP_PAGE;case na.IMAGE:return ic.IMAGE;case na.APP_ROUTE:return ic.APP_ROUTE;case na.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(i),s=!0,!i.isStale||r.isPrefetch))return i;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(s)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,s,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,s,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,s,a){try{let o=await i({hasResolved:a,previousCacheEntry:s,isRevalidating:!0});if(!o)return null;let l=await ih({...o,isMiss:!s});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(i){if(null==s?void 0:s.cacheControl){let i=Math.min(Math.max(s.cacheControl.revalidate||3,3),30),a=void 0===s.cacheControl.expire?void 0:Math.max(i+3,s.cacheControl.expire);await t.set(e,s.value,{cacheControl:{revalidate:i,expire:a},isRoutePPREnabled:r,isFallback:n})}throw i}}}let ig=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class iy{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 iv=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class i_{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?i_.memoryCache?i_.debug&&console.log("FileSystemCache: memory store already initialized"):(i_.debug&&console.log("FileSystemCache: using memory store for fetch cache"),i_.memoryCache=(0,iv.getMemoryCache)(e.maxMemoryCacheSize)):i_.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,i_.debug&&console.log("FileSystemCache: revalidateTag",t),0!==t.length)for(let e of t)ig.tagsManifest.has(e)||ig.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,s,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=i_.memoryCache)?void 0:t.get(u);if(i_.debug&&(h===ic.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===ic.APP_ROUTE){let e=this.getFilePath(`${u}.body`,ic.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$/,e3),"utf8"));p={lastModified:r.getTime(),value:{kind:iu.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ic.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ic.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let s=r.getTime(),l=JSON.parse(t);if(p={lastModified:s,value:l},(null==(a=p.value)?void 0:a.kind)===iu.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)))||(i_.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ic.APP_PAGE){let n,i,s;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,e3),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+e1;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+e4,ic.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(s=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e0:e2}`,ic.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:iu.APP_PAGE,html:t,rscData:s,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:i}}}else if(h===ic.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${e9}`,ic.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:iu.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=i_.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return i_.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===iu.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===iu.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===iu.PAGES){let e=null==(d=p.value.headers)?void 0:d[e8];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,ig.isStale)(t,p.lastModified))return i_.debug&&console.log("FileSystemCache: stale tags",t),null}}else if((null==p||null==(s=p.value)?void 0:s.kind)===iu.FETCH){let e=c.kind===ic.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return i_.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,ig.isStale)(e,p.lastModified))return i_.debug&&console.log("FileSystemCache: stale tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=i_.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),i_.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new iy(this.fs);if(t.kind===iu.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ic.APP_ROUTE);i.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};i.append(r.replace(/\.body$/,e3),JSON.stringify(n,null,2))}else if(t.kind===iu.PAGES||t.kind===iu.APP_PAGE){let n=t.kind===iu.APP_PAGE,s=this.getFilePath(`${e}.html`,n?ic.APP_PAGE:ic.PAGES);if(i.append(s,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e0:e2:e9}`,n?ic.APP_PAGE:ic.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===iu.APP_PAGE){let e;if(t.segmentData){e=[];let r=s.replace(/\.html$/,e1);for(let[n,s]of t.segmentData){e.push(n);let t=r+n+e4;i.append(t,s)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(s.replace(/\.html$/,e3),JSON.stringify(r))}}else if(t.kind===iu.FETCH){let n=this.getFilePath(e,ic.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ic.FETCH:return r9().join(this.serverDistDir,"..","cache","fetch-cache",e);case ic.PAGES:return r9().join(this.serverDistDir,"pages",e);case ic.IMAGE:case ic.APP_PAGE:case ic.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 ib=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class ix{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:s,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)ix.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&&i&&(ix.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=i_)}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=s,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new ib.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];s["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=rB(s,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:s,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nA(e)),s=i?i.revalidate:!n&&1;return"number"==typeof s?1e3*s+t:s}_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(ix.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rd;return ix.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e){var t;return null==(t=this.cacheHandler)?void 0:t.revalidateTag(e)}async generateCacheKey(e,t={}){let n=[],i=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(s.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(i.encode(e)),n.push(e)):(r.push(e),n.push(s.decode(e,{stream:!0})))}})),n.push(s.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,i,s,a,o,l;let d,u;if(t.kind===ic.FETCH){let t=k.workUnitAsyncStorage.getStore(),r=t?(0,k.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===iu.FETCH)return ix.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};ix.debug&&console.log("IncrementalCache: rdc:miss",e)}else ix.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ic.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ic.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ic.FETCH){if(!c)return null;if((null==(i=c.value)?void 0:i.kind)!==iu.FETCH)throw Object.defineProperty(new eu(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(s=c.value)?void 0:s.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=el.workAsyncStorage.getStore();if([...t.tags||[],...t.softTags||[]].some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.includes(e))}))return ix.debug&&console.log("IncrementalCache: stale tag",e),null;let n=k.workUnitAsyncStorage.getStore();if(n){let t=(0,k.getPrerenderResumeDataCache)(n);t&&(ix.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let a=t.revalidate||c.value.revalidate,o=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3,l=c.value.data;return{isStale:o>a,value:{kind:iu.FETCH,data:l,revalidate:a}}}if((null==c||null==(n=c.value)?void 0:n.kind)===iu.FETCH)throw Object.defineProperty(new eu(`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(nA(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)===iu.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===iu.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[e8];if("string"==typeof e){let t=e.split(",");t.length>0&&(0,ig.isStale)(t,n)&&(d=-1)}}}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)===iu.FETCH){let r=k.workUnitAsyncStorage.getStore(),n=r?(0,k.getPrerenderResumeDataCache)(r):null;n&&(ix.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 i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nA(e),r.cacheControl),await (null==(i=this.cacheHandler)?void 0:i.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let iE=require("http"),iw=require("https"),iC={existsSync:eP().existsSync,readFile:eP().promises.readFile,readFileSync:eP().readFileSync,writeFile:(e,t)=>eP().promises.writeFile(e,t),mkdir:e=>eP().promises.mkdir(e,{recursive:!0}),stat:e=>eP().promises.stat(e)};class iR extends io().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:i}){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,i&&(this.bodyReadable=i,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 iP extends io().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 tB(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 iT=(e,t)=>{let r=y().isAbsolute(t)?t:y().join(e,t);return(0,v.pathToFileURL)(r).toString()};class iO{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 iS=Symbol.for("react.postpone");function iI(e){return"object"==typeof e&&null!==e&&e.$$typeof===iS}class ik{async load(e){return await require(e)}}let iA=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),ij=Symbol.for("@next/router-server-methods"),iN=globalThis,iD=e=>import(e).then(e=>e.default||e),i$=new WeakMap;class iM extends nJ{constructor(e){var t,r,n;super(e),this.cleanupListeners=new iO,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eD(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});e$(e,"bubbleNoFallback",void 0),iN[ij]||(iN[ij]={});let s=(0,g.relative)(process.cwd(),this.dir);iN[ij][s]||(iN[ij][s]={render404:this.render404.bind(this)}),iN[ij][s].nextConfig=this.nextConfig;try{var a;n=tY(n);let s={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,s);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(e$(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete i[rV];try{if(await this.runEdgeFunction({req:e,res:t,query:i,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===na.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,i,o))return!0}return await this.render(e,t,n,i,r,!0),!0}catch(r){if(r instanceof nB.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,i),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,i=eD(e,"middlewareInvoke");if(!i)return!1;let s=()=>(e$(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return s();let o=th(eD(e,"initURL")),l=t8(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tY(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return s();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(i)throw c=!0,Object.defineProperty(new e7.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tB(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 ry(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rG(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ex)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rK(i);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let i=e.dev??!1;if(this.isDev=i,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=rT(e.page);return{match:ej(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 iE.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new iw.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,g.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 i=r[n];if(null!=i){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),s="NEXT_RUNTIME"===n;if(r||s)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}`]=i}}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=>{iI(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{iI(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 ir({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 ir({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,iA.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,iA.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,is.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:f,t)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nH[nz])return null==nq||nq("cache handlers already initialized"),!1;if(null==nq||nq("initializing cache handlers"),nH[nz]=new Map,nH[nU]){let e;nH[nU].DefaultCache?(null==nq||nq('setting "default" cache handler from symbol'),e=nH[nU].DefaultCache):(null==nq||nq('setting "default" cache handler from default'),e=nL()),nH[nz].set("default",e),nH[nU].RemoteCache?(null==nq||nq('setting "remote" cache handler from symbol'),nH[nz].set("remote",nH[nU].RemoteCache)):(null==nq||nq('setting "remote" cache handler from default'),nH[nz].set("remote",e))}else null==nq||nq('setting "default" cache handler from default'),nH[nz].set("default",nL()),null==nq||nq('setting "remote" cache handler from default'),nH[nz].set("remote",nL());return nH[nF]=new Set(nH[nz].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n9(await iD(iT(this.distDir,n)));if(!nH[nz]||!nH[nF])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nq||nq('setting cache handler for "%s"',r),nH[nz].set(r,t),nH[nF].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n9(await iD(iT(this.distDir,r)))),await this.loadCustomCacheHandlers(),new ix({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 im(!0)}getPublicDir(){return(0,g.join)(this.dir,"public")}getHasStaticDir(){return eP().existsSync((0,g.join)(this.dir,"static"))}getPagesManifest(){return(0,nQ.loadManifest)((0,g.join)(this.serverDistDir,eU))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,nQ.loadManifest)((0,g.join)(this.serverDistDir,ez))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rW).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!n1(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,g.join)(this.distDir,"BUILD_ID");try{return eP().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:!!eW(t,"app"),pages:!!eW(t,"pages")}}sendRenderResult(e,t,r){return td({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 i of this.getEdgeFunctionsPages())if(i===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let i=th(eD(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let s=new ik,a=await s.load(n.definition.filename);return e$(e.originalRequest,"relativeProjectDir",(0,g.relative)(process.cwd(),this.dir)),e$(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,e7.getTracer)().trace(rh.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,i))}async renderHTMLImpl(e,t,r,n,i){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 n4(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),i=e.pathname;for(let s of(n&&(i=t[0]),r))if(s===i)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:i,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){return(0,e7.getTracer)().trace(rh.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?tk(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){let a=[t];for(let s of(r.amp&&a.unshift((i?tk(t):r8(t))+".amp"),e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let t=await ir({distDir:this.distDir,page:s,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof t.Component&&!s.startsWith(`/${e}/`)&&s!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof ew))throw e}return null}getNextFontManifest(){return(0,nQ.loadManifest)((0,g.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 iC}normalizeReq(e){return e instanceof ts?e:new ts(e)}normalizeRes(e){return e instanceof ta?e:new ta(e)}getRequestHandler(){return this.makeRequestHandler()}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:i,socket:s=null}){return{req:new iR({url:e,headers:t,method:r,socket:s,readable:n}),res:new iP({socket:s,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new ts(n.req),new ta(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,i,s=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,s)}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:i}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eL)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:eL,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,s){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,s)}async renderErrorToHTML(e,t,r,n,i){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,i)}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:ii((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=i$.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=ii(e.matchers);return i$.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=rb(r8(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new ew(t);return null}return{name:n.name,paths:n.files.map(e=>(0,g.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,g.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,g.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,nQ.loadManifest)((0,g.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,e7.getTracer)().trace(rh.getRoutesManifest,()=>(0,nQ.loadManifest)((0,g.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",s=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;e$(e,"initURL",s),e$(e,"initQuery",{...t.query}),e$(e,"initProtocol",i),r||e$(e,"clonableBody",function(e){let t=null,r=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(t){let n=await r;if(n&&"object"==typeof n&&n.error)throw n.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,t),t=e}},cloneBodyStream(){let r=t??e,n=new ia.PassThrough,i=new ia.PassThrough;return r.on("data",e=>{n.push(e),i.push(e)}),r.on("end",()=>{n.push(null),i.push(null)}),t=i,n}}}(e.originalRequest))}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,g.join)(this.distDir,eF);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 eu("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
13
+ See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:i=".",quiet:s=!1,conf:a,dev:o=!1,minimalMode:l=!1,hostname:d,port:u,experimentalTestProxy:c}=e;this.experimentalTestProxy=c,this.serverOptions=e,this.dir=g.resolve(i),this.quiet=s,this.loadEnvConfig({dev:o}),this.nextConfig=a,this.hostname=d,this.hostname&&(this.fetchHostname=function(e){return tS.test(e)?`[${e}]`:e}(this.hostname)),this.port=u,this.distDir=g.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nC(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rY(this.i18nProvider):void 0;let{serverRuntimeConfig:h={},publicRuntimeConfig:p,assetPrefix:f,generateEtags:m}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(o),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 nO:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nS:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nX:void 0,data:this.enabledDirectories.pages?new nk(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,canonicalBase:this.nextConfig.amp.canonicalBase||"",generateEtags:m,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(r=this.nextConfig.experimental.amp)?void 0:r.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(n=this.nextConfig.i18n)?void 0:n.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,cacheLifeProfiles:this.nextConfig.experimental.cacheLife,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(p).length>0?p:void 0,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},(0,tZ.setConfig)({serverRuntimeConfig:h,publicRuntimeConfig:p}),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(f),this.responseCache=this.getResponseCache({dev:o})}getRouteMatchers(){let e=new nw(e=>{switch(e){case eU:return this.getPagesManifest()??null;case ez:return this.getAppPathsManifest()??null;default:return null}}),t=new r1;return t.push(new nE(this.distDir,e,this.i18nProvider)),t.push(new n_(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new nu(this.distDir,e)),t.push(new nh(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 nV?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tv(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,e7.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(ru.handleRequest,{spanName:`${n}`,kind:e7.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async s=>this.handleRequestImpl(e,t,r).finally(()=>{if(!s)return;let r=eD(e,"isRSCRequest")??!1;s.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(s.setStatus({code:e7.SpanStatusCode.ERROR}),s.setAttribute("error.type",t.statusCode.toString()));let a=i.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==ru.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}`;s.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),s.updateName(e)}else s.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,s,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=eD(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,v.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==(i=m.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let _=await this.handleRSCRequest(e,t,r);if(_)return;let b=null==(s=this.i18nProvider)?void 0:s.detectDomainLocale(t4(r,e.headers)),x=(null==b?void 0:b.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);e$(e,"defaultLocale",x);let E=th(e.url.replace(/^\/+/,"/")),w=t8(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=t3(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[eQ];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[eQ]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))e$(e,"isNextDataReq",!0);else if(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");e$(e,"postponed",r)}n=this.normalize(n);let s=this.stripNextDataPath(i);n=rb(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});a&&(e$(e,"locale",a.detectedLocale),a.inferredFromDefault?e$(e,"localeInferredFromDefault",!0):eM(e,"localeInferredFromDefault"));let c=n,h=tM(c),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(c,{i18n:a});e&&(c=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}a&&(n=a.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:a}){let o,l,d;return i&&(d=(l=ej(o=function(e,t){var r,n,i;let s=function(e,t,r,n,i){let s,a=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let s of tY(e).slice(1).split("/")){let e=tj.some(e=>s.startsWith(e)),d=s.match(rR);if(e&&d&&d[2])l.push(rO({getSafeRouteKey:a,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?eJ:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rC(d[1]));let e=rO({getSafeRouteKey:a,segment:d[2],routeKeys:o,keyPrefix:t?eY:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rC(s));r&&d&&d[3]&&l.push(rC(d[3]))}return{namedParameterizedRoute:l.join(""),routeKeys:o}}(e,t.prefixRouteKeys,null!=(r=t.includeSuffix)&&r,null!=(n=t.includePrefix)&&n,null!=(i=t.backreferenceDuplicateKeys)&&i),a=s.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(a+="(?:/)?"),{...rT(e,t),namedRegex:"^"+a+"$",routeKeys:s.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=rx(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rI(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rW(n)){let e=o.headers[rq];e&&(p={...function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],i=Array.isArray(t),s=i?t[1]:t;!s||s.startsWith("__PAGE__")||(i&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):i&&(r[t[0]]=t[1]),r=e(n,r))}return r}(function(e){if(void 0!==e){if(Array.isArray(e))throw Object.defineProperty(Error("Multiple router state headers were sent. This is not allowed."),"__NEXT_ERROR_CODE",{value:"E418",enumerable:!1,configurable:!0});if(e.length>4e4)throw Object.defineProperty(Error("The router state header was too large."),"__NEXT_ERROR_CODE",{value:"E142",enumerable:!1,configurable:!0});try{let t=JSON.parse(decodeURIComponent(e));return(0,rN.assert)(t,rZ),t}catch{throw Object.defineProperty(Error("The router state header was sent but could not be parsed."),"__NEXT_ERROR_CODE",{value:"E10",enumerable:!1,configurable:!0})}}}(e)),...p})}}catch(e){}let{parsedDestination:s,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(":"+rC(n),"g"),"__ESC_COLON_"+n)}let n=th(t),i=n.pathname;i&&(i=rS(i));let s=n.href;s&&(s=rS(s));let a=n.hostname;a&&(a=rS(a));let o=n.hash;o&&(o=rS(o));let l=n.search;l&&(l=rS(l));let d=n.origin;return d&&(d=rS(d)),{...n,pathname:i,hostname:a,href:s,hash:o,search:l,origin:d}}(e),{hostname:i,query:s,search:a}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(ek(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(ek(i,e),e))l.push(t.name)}let u=eA(o,{validate:!1});for(let[r,n]of(i&&(t=eA(i,{validate:!1})),Object.entries(s)))Array.isArray(n)?s[r]=n.map(t=>rk(rS(t),e.params)):"string"==typeof n&&(s[r]=rk(rS(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 s||(s[t]=e.params[t]);if(tN(o))for(let t of o.split("/")){let r=tj.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,s]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(s?"#":"")+(s||""),n.search=a?rk(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:s,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(s.protocol)return!0;if(Object.assign(u,a,p),Object.assign(d.query,s.query),delete s.query,Object.entries(d.query).forEach(([e,t])=>{if(t&&"string"==typeof t&&t.startsWith(":")){let r=u[t.slice(1)];r&&(d.query[e]=r)}}),Object.assign(d,s),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t9(c,t.locales);c=e.pathname,d.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(c===e)return!0;if(i&&l){let e=l(c);if(e)return d.query={...d.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])h(e);if(c!==e){let t=!1;for(let e of n.afterFiles||[])if(t=h(e))break;if(!t&&!(()=>{let t=tY(c||"");return t===tY(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=h(e))break}}return u},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=tK(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>rA(e)):rA(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=ej({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tK(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let s=r[e];if(!s)continue;let a=t[s],o=n[e];if(!a.optional&&!o)return null;i[a.pos]=o}return i}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let i={};for(let s of Object.keys(r.groups)){let a=e[s];"string"==typeof a?a=tA(a):Array.isArray(a)&&(a=a.map(tA));let o=n[s],l=r.groups[s].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]===`[[...${s}]]`))&&(a=void 0,delete e[s]),a&&"string"==typeof a&&r.groups[s].repeat&&(a=a.split("/")),a&&(i[s]=a)}return{params:i,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,rX(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=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,tc(e));else t.set(r,tc(n));return t}(a)));let l=e.search||a&&"?"+a||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rj.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),s&&"#"!==s[0]&&(s="#"+s),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+s}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let i,{optional:s,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;s&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||s)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rX(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});x&&!w.locale&&(r.pathname=`/${x}${r.pathname}`);let m={...r.query},g=r.pathname,y=Object.keys(f.handleRewrites(e,r)),v={...r.query},b=g!==r.pathname;b&&r.pathname&&e$(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tK(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(v[n]=Array.isArray(t)?t.map(e=>rA(e)):rA(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(v,!1)),!p.hasValidParams&&!tM(s)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,s);e&&(f.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tM(n)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,n);if(e){let r=f.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&&tM(n)&&!p.hasValidParams){let e=f.getParamsFromRouteMatches(r);e&&(p=f.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=f.normalizeDynamicRouteParams(v,!0)).hasValidParams&&(t=p.params),f.defaultRouteMatches&&s===c&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&e$(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(c,t),e.url=f.interpolateDynamicPath(e.url,t);let r=eD(e,"segmentPrefetchRSCRequest");r&&tM(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rz]=r,e$(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(u=f.defaultRouteRegex)?void 0:u.groups)||{})]),C))t in m||delete r.query[t];if(r.pathname=n,E.pathname=r.pathname,_=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof ex||r instanceof eE)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(e$(e,"isLocaleDomain",!!b),w.locale&&(e.url=(0,v.format)(E),e$(e,"didStripLocale",!0)),!eD(e,"locale")&&(w.locale?e$(e,"locale",w.locale):x&&(e$(e,"locale",x),e$(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eD(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),e$(e,"incrementalCache",t),globalThis.__incrementalCache=t}let R=function(){if(nH[nF])return nH[nF].values()}();R&&await Promise.all([...R].map(async t=>{if("refreshTags"in t);else{let r=rB(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),eD(e,"serverComponentsHmrCache")||e$(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let P=eD(e,"invokePath");if(!C&&P){let n=eD(e,"invokeStatus");if(n){let i=eD(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let s=eD(e,"invokeError")||null;return this.renderError(s,e,t,"/_error",r.query)}let i=new URL(P||"/","http://n"),s=t8(i.pathname,{nextConfig:this.nextConfig,parseData:!1});s.locale&&e$(e,"locale",s.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,e$(e,"rewroteURL",s.pathname));let a=t9(t3(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&e$(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eD(e,"invokeQuery");if(o&&Object.assign(r.query,o),_=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eD(e,"middlewareInvoke")){if((_=await this.normalizeAndAttachMetadata(e,t,r))||(_=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=t3(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nB.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ex||r instanceof eE)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[eN]=e,t(r,n,i))}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=tk(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,e7.getTracer)().trace(ru.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,e7.getTracer)().trace(ru.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||tU,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:s,res:a}=n,o=a.statusCode,{body:l}=i,{cacheControl:d}=i;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(s,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={},i,s=!1){return(0,e7.getTracer)().trace(ru.render,async()=>this.renderImpl(e,t,r,n,i,s))}getWaitUntil(){let e=function(){let e=globalThis[nj];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,s=!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 tq.test(e)?"dom":tL.test(e)?"html":void 0}(o),(a=r,eH.includes(a))?this.render404(e,t,i):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,e7.getTracer)().trace(ru.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return tN(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rq}, ${rU}, ${rz}`,s=eD(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rF}`),a=!0):(r||s)&&t.appendHeader("vary",i),a||delete e.headers[rF]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:s}){var a,o,l,d,u,c;let h,p;r===eZ&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===i.isAppPath,_=!!i.getServerSideProps,b=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rL)??null,r=e.headers.get("content-type")):(t=e.headers[rL]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,i=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),s=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:s,isPossibleServerAction:!!(s||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=eD(e,"isRSCRequest")??!1,w=(0,v.parse)(e.url||"").pathname||"/",C=eD(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"]?x=!0:x||=!!R.routes[nA(r)];let P=!!(eD(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||_);if(!x&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(eQ,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;x&&e.headers[eQ]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eD(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(p=i.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===na.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==s.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eD(e,"postponed"):void 0;if(!m||P||E||(t.statusCode=404),eV.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!b&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof i.Component||x))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof i.Component)return{body:rv.fromStatic(i.Component,eK)};if("amp"in s&&!s.amp&&delete s.amp,!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tq.test(u)||tL.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!s.amp&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[eQ]&&(C=w),w=tY(w),C=tY(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)&&tM(r)&&(i.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.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&&e$(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:i}of e)r.set(n,[`%%drp:${n}:${t}%%`,nK[i]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==na.APP_ROUTE))return await nR(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,v.parse)(eD(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=eD(e),k[eN]=c,e$(k,"distDir",this.distDir),e$(k,"query",s),e$(k,"params",n.params),e$(k,"ampValidator",this.renderOpts.ampValidator),e$(k,"minimalMode",!0),n.err&&e$(k,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rb(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:i}=e,s=this.getOriginalAppPaths(i),a=Array.isArray(s),o=i;a&&(o=s[s.length-1]);let l=await this.findPageComponents({locale:eD(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:s,shouldEnsure:!1});if(l){(0,e7.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nB.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,e7.getTracer)().trace(ru.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:i,pathname:s}=e,a=eD(e.req,"bubbleNoFallback")??!1;delete i[rV];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,s)};try{for await(let t of this.matchers.matchAll(s,o)){eD(e.req,"invokeOutput");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(i){let t=rK(i);if(i instanceof eC)throw console.error("Invariant: failed to load static page",JSON.stringify({page:s,url:e.req.url,matchedPath:e.req.headers[eQ],initUrl:eD(e.req,"initURL"),didRewrite:!!eD(e.req,"rewroteURL"),rewroteUrl:eD(e.req,"rewroteURL")},null,2)),t;if(t instanceof nB.NoFallbackError&&a)throw t;if(t instanceof ex||t instanceof eE)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(e$(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eM(e.req,"customErrorRender"));let r=t instanceof nY;if(!r)throw rG(t)&&(t.page=s),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=eD(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${s}`),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,e7.getTracer)().trace(ru.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,i={},s=!0){return(0,e7.getTracer)().trace(ru.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,s))}async renderErrorImpl(e,t,r,n,i={},s=!0){return s&&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:i})}async renderErrorToResponse(e,t){return(0,e7.getTracer)().trace(ru.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,s=404===r.statusCode,a=this.enabledDirectories.app;s&&(a&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:eL,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eD(e.req,"customErrorRender")&&!i&&eV.includes(o)&&(!i&&a&&(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:eD(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:eD(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nY(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?e$(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eM(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nB.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=rK(a),i=t instanceof nY;i||this.logError(t),r.statusCode=500;let s=await this.getFallbackErrorComponents(e.req.url);if(s)return e$(e.req,"match",{definition:s.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:s});return{body:rv.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,i={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:i})}async render404(e,t,r,n=!0){let{pathname:i,query:s}=r||(0,v.parse)(e.url,!0);return this.nextConfig.i18n&&(eD(e,"locale")||e$(e,"locale",this.nextConfig.i18n.defaultLocale),e$(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,s,n)}}let nQ=require("next/dist/server/load-manifest.external.js"),n0=new E(1e3);function n1(e,t,r,n){let i,s=`${e}:${t}:${r}:${n}`,a=null==n0?void 0:n0.get(s);if(a)return a;let o=y().join(t,eF);n&&(i=(0,nQ.loadManifest)(y().join(o,ez),!0));let l=(0,nQ.loadManifest)(y().join(o,eU),!0);try{e=rb(r8(e))}catch(t){throw console.error(t),new ew(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t9(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(a=d(i)),a||(a=d(l)),a)?(y().isAbsolute(a)||(a=y().join(o,a)),null==n0||n0.set(s,a),a):(null==n0||n0.set(s,null),null)}function n4(e,t,r,n){let i=n1(e,t,r,n);if(!i)throw new ew(e);return i}async function n2(e,t,r){let n=n4(e,t,void 0,r);return n.endsWith(".html")?eR.promises.readFile(n,"utf8").catch(t=>{throw new eC(e,t.message)}):require(n)}function n9(e){return e.default||e}async function n3(e){return new Promise(t=>setTimeout(t,e))}let n8=Symbol.for("next.server.action-manifests");async function n5(e,t=3){for(;;)try{return(0,nQ.loadManifest)(e)}catch(e){if(--t<=0)throw e;await n3(100)}}async function n6(e,t=3){try{return await n5(e,t)}catch(e){return}}async function n7(e,t=3){for(;;)try{return(0,nQ.evalManifest)(e)}catch(e){if(--t<=0)throw e;await n3(100)}}async function ie(e,t,r){try{return(await n7(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function it({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i,needsManifestsForLegacyReasons:s}){let a={},o={};if(r||([a,o]=await Promise.all([n2("/_document",e,!1),n2("/_app",e,!1)])),s){let s,l=n?3:1;s=(0,g.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return ne(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,s=[RegExp(`^[\\\\/]robots${nr(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${nr(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${nr(["xml"],t)}${n}`),RegExp(`[\\\\/]${nt.icon.filename}${i}${nr(nt.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.apple.filename}${i}${nr(nt.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.openGraph.filename}${i}${nr(nt.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${nt.twitter.filename}${i}${nr(nt.twitter.extensions,t)}${n}`)],a=r_(e);return s.some(e=>e.test(a))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([n5((0,g.join)(e,"build-manifest.json"),l),n6(s,l),r||0?void 0:n5((0,g.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?ie((0,g.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?n5((0,g.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,i?n5((0,g.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let s=null==(i=globalThis[n8])?void 0:i.clientReferenceManifestsPerPage;globalThis[n8]={clientReferenceManifestsPerPage:{...s,[tk(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,s;let a,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=el.workAsyncStorage.getStore();if(!(a=l?o[t1(s=l.page,"app")?s:"app"+s]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let y=await n2(t,e,r),v=n9(y),_=n9(a),b=n9(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=y;return{App:b,Document:_,Component:v,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:y.config||{},ComponentMod:y,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await n2(t,e,r),i=n9(n),s=n9(a),l=n9(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:s,Component:i,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let ir=(0,e7.getTracer)().wrap(rc.loadComponents,it);function ii(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rI(r,n,i.has,i.missing))continue;return!0}return!1}}var is=r("../next-env/dist/index.js");let ia=require("stream");var io=r.n(ia);class il{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new il(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:i,resolve:s,reject:a}=new rd;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:s,key:e});s(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),i}}let id=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var iu=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}({}),ic=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 ih(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===iu.PAGES?{kind:iu.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)===iu.APP_PAGE?{kind:iu.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 ip(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===iu.PAGES?{kind:iu.PAGES,html:rv.fromStatic(e.value.html,eK),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===iu.APP_PAGE?{kind:iu.APP_PAGE,html:rv.fromStatic(e.value.html,eK),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class im{constructor(e){this.getBatcher=il.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:id}),this.revalidateBatcher=il.create({schedulerFn:id}),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 ip(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:s=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return ip(await this.getBatcher.batch({key:e,isOnDemandRevalidate:s},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:s,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let i=null,s=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case na.PAGES:return ic.PAGES;case na.APP_PAGE:return ic.APP_PAGE;case na.IMAGE:return ic.IMAGE;case na.APP_ROUTE:return ic.APP_ROUTE;case na.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(i),s=!0,!i.isStale||r.isPrefetch))return i;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(s)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,s,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,s,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,s,a){try{let o=await i({hasResolved:a,previousCacheEntry:s,isRevalidating:!0});if(!o)return null;let l=await ih({...o,isMiss:!s});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(i){if(null==s?void 0:s.cacheControl){let i=Math.min(Math.max(s.cacheControl.revalidate||3,3),30),a=void 0===s.cacheControl.expire?void 0:Math.max(i+3,s.cacheControl.expire);await t.set(e,s.value,{cacheControl:{revalidate:i,expire:a},isRoutePPREnabled:r,isFallback:n})}throw i}}}let ig=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class iy{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 iv=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class i_{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?i_.memoryCache?i_.debug&&console.log("FileSystemCache: memory store already initialized"):(i_.debug&&console.log("FileSystemCache: using memory store for fetch cache"),i_.memoryCache=(0,iv.getMemoryCache)(e.maxMemoryCacheSize)):i_.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,i_.debug&&console.log("FileSystemCache: revalidateTag",t),0!==t.length)for(let e of t)ig.tagsManifest.has(e)||ig.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,s,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=i_.memoryCache)?void 0:t.get(u);if(i_.debug&&(h===ic.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===ic.APP_ROUTE){let e=this.getFilePath(`${u}.body`,ic.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$/,e3),"utf8"));p={lastModified:r.getTime(),value:{kind:iu.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ic.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ic.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let s=r.getTime(),l=JSON.parse(t);if(p={lastModified:s,value:l},(null==(a=p.value)?void 0:a.kind)===iu.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)))||(i_.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ic.APP_PAGE){let n,i,s;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,e3),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+e1;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+e4,ic.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(s=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e0:e2}`,ic.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:iu.APP_PAGE,html:t,rscData:s,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:i}}}else if(h===ic.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${e9}`,ic.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:iu.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=i_.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return i_.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===iu.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===iu.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===iu.PAGES){let e=null==(d=p.value.headers)?void 0:d[e8];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,ig.isStale)(t,p.lastModified))return i_.debug&&console.log("FileSystemCache: stale tags",t),null}}else if((null==p||null==(s=p.value)?void 0:s.kind)===iu.FETCH){let e=c.kind===ic.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return i_.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,ig.isStale)(e,p.lastModified))return i_.debug&&console.log("FileSystemCache: stale tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=i_.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),i_.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new iy(this.fs);if(t.kind===iu.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ic.APP_ROUTE);i.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};i.append(r.replace(/\.body$/,e3),JSON.stringify(n,null,2))}else if(t.kind===iu.PAGES||t.kind===iu.APP_PAGE){let n=t.kind===iu.APP_PAGE,s=this.getFilePath(`${e}.html`,n?ic.APP_PAGE:ic.PAGES);if(i.append(s,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e0:e2:e9}`,n?ic.APP_PAGE:ic.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===iu.APP_PAGE){let e;if(t.segmentData){e=[];let r=s.replace(/\.html$/,e1);for(let[n,s]of t.segmentData){e.push(n);let t=r+n+e4;i.append(t,s)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(s.replace(/\.html$/,e3),JSON.stringify(r))}}else if(t.kind===iu.FETCH){let n=this.getFilePath(e,ic.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ic.FETCH:return r9().join(this.serverDistDir,"..","cache","fetch-cache",e);case ic.PAGES:return r9().join(this.serverDistDir,"pages",e);case ic.IMAGE:case ic.APP_PAGE:case ic.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 ib=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class ix{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:s,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)ix.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&&i&&(ix.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=i_)}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=s,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new ib.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];s["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=rB(s,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:s,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nA(e)),s=i?i.revalidate:!n&&1;return"number"==typeof s?1e3*s+t:s}_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(ix.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rd;return ix.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e){var t;return null==(t=this.cacheHandler)?void 0:t.revalidateTag(e)}async generateCacheKey(e,t={}){let n=[],i=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(s.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(i.encode(e)),n.push(e)):(r.push(e),n.push(s.decode(e,{stream:!0})))}})),n.push(s.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,i,s,a,o,l;let d,u;if(t.kind===ic.FETCH){let t=k.workUnitAsyncStorage.getStore(),r=t?(0,k.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===iu.FETCH)return ix.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};ix.debug&&console.log("IncrementalCache: rdc:miss",e)}else ix.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ic.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ic.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ic.FETCH){if(!c)return null;if((null==(i=c.value)?void 0:i.kind)!==iu.FETCH)throw Object.defineProperty(new eu(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(s=c.value)?void 0:s.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=el.workAsyncStorage.getStore();if([...t.tags||[],...t.softTags||[]].some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.includes(e))}))return ix.debug&&console.log("IncrementalCache: stale tag",e),null;let n=k.workUnitAsyncStorage.getStore();if(n){let t=(0,k.getPrerenderResumeDataCache)(n);t&&(ix.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let a=t.revalidate||c.value.revalidate,o=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3,l=c.value.data;return{isStale:o>a,value:{kind:iu.FETCH,data:l,revalidate:a}}}if((null==c||null==(n=c.value)?void 0:n.kind)===iu.FETCH)throw Object.defineProperty(new eu(`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(nA(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)===iu.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===iu.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[e8];if("string"==typeof e){let t=e.split(",");t.length>0&&(0,ig.isStale)(t,n)&&(d=-1)}}}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)===iu.FETCH){let r=k.workUnitAsyncStorage.getStore(),n=r?(0,k.getPrerenderResumeDataCache)(r):null;n&&(ix.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 i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nA(e),r.cacheControl),await (null==(i=this.cacheHandler)?void 0:i.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let iE=require("http"),iw=require("https"),iC={existsSync:eP().existsSync,readFile:eP().promises.readFile,readFileSync:eP().readFileSync,writeFile:(e,t)=>eP().promises.writeFile(e,t),mkdir:e=>eP().promises.mkdir(e,{recursive:!0}),stat:e=>eP().promises.stat(e)};class iR extends io().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:i}){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,i&&(this.bodyReadable=i,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 iP extends io().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 tB(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 iT=(e,t)=>{let r=y().isAbsolute(t)?t:y().join(e,t);return(0,v.pathToFileURL)(r).toString()};class iO{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 iS=Symbol.for("react.postpone");function iI(e){return"object"==typeof e&&null!==e&&e.$$typeof===iS}class ik{async load(e){return await require(e)}}let iA=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),ij=Symbol.for("@next/router-server-methods"),iN=globalThis,iD=e=>import(e).then(e=>e.default||e),i$=new WeakMap;class iM extends nJ{constructor(e){var t,r,n;super(e),this.cleanupListeners=new iO,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eD(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});e$(e,"bubbleNoFallback",void 0),iN[ij]||(iN[ij]={});let s=(0,g.relative)(process.cwd(),this.dir);iN[ij][s]||(iN[ij][s]={render404:this.render404.bind(this)}),iN[ij][s].nextConfig=this.nextConfig;try{var a;n=tY(n);let s={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,s);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(e$(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete i[rV];try{if(await this.runEdgeFunction({req:e,res:t,query:i,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===na.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,i,o))return!0}return await this.render(e,t,n,i,r,!0),!0}catch(r){if(r instanceof nB.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,i),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,i=eD(e,"middlewareInvoke");if(!i)return!1;let s=()=>(e$(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return s();let o=th(eD(e,"initURL")),l=t8(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tY(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return s();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(i)throw c=!0,Object.defineProperty(new e7.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tB(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 ry(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rG(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ex)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rK(i);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let i=e.dev??!1;if(this.isDev=i,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=rT(e.page);return{match:ej(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 iE.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new iw.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,g.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 i=r[n];if(null!=i){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),s="NEXT_RUNTIME"===n;if(r||s)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}`]=i}}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=>{iI(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{iI(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 ir({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 ir({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,iA.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,iA.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,is.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:f,t)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nH[nz])return null==nq||nq("cache handlers already initialized"),!1;if(null==nq||nq("initializing cache handlers"),nH[nz]=new Map,nH[nU]){let e;nH[nU].DefaultCache?(null==nq||nq('setting "default" cache handler from symbol'),e=nH[nU].DefaultCache):(null==nq||nq('setting "default" cache handler from default'),e=nL()),nH[nz].set("default",e),nH[nU].RemoteCache?(null==nq||nq('setting "remote" cache handler from symbol'),nH[nz].set("remote",nH[nU].RemoteCache)):(null==nq||nq('setting "remote" cache handler from default'),nH[nz].set("remote",e))}else null==nq||nq('setting "default" cache handler from default'),nH[nz].set("default",nL()),null==nq||nq('setting "remote" cache handler from default'),nH[nz].set("remote",nL());return nH[nF]=new Set(nH[nz].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n9(await iD(iT(this.distDir,n)));if(!nH[nz]||!nH[nF])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nq||nq('setting cache handler for "%s"',r),nH[nz].set(r,t),nH[nF].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n9(await iD(iT(this.distDir,r)))),await this.loadCustomCacheHandlers(),new ix({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 im(!0)}getPublicDir(){return(0,g.join)(this.dir,"public")}getHasStaticDir(){return eP().existsSync((0,g.join)(this.dir,"static"))}getPagesManifest(){return(0,nQ.loadManifest)((0,g.join)(this.serverDistDir,eU))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,nQ.loadManifest)((0,g.join)(this.serverDistDir,ez))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rW).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!n1(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,g.join)(this.distDir,"BUILD_ID");try{return eP().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:!!eW(t,"app"),pages:!!eW(t,"pages")}}sendRenderResult(e,t,r){return td({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 i of this.getEdgeFunctionsPages())if(i===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let i=th(eD(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let s=new ik,a=await s.load(n.definition.filename);return e$(e.originalRequest,"relativeProjectDir",(0,g.relative)(process.cwd(),this.dir)),e$(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,e7.getTracer)().trace(rh.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,i))}async renderHTMLImpl(e,t,r,n,i){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 n4(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),i=e.pathname;for(let s of(n&&(i=t[0]),r))if(s===i)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:i,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){return(0,e7.getTracer)().trace(rh.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?tk(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){let a=[t];for(let s of(r.amp&&a.unshift((i?tk(t):r8(t))+".amp"),e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let t=await ir({distDir:this.distDir,page:s,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof t.Component&&!s.startsWith(`/${e}/`)&&s!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof ew))throw e}return null}getNextFontManifest(){return(0,nQ.loadManifest)((0,g.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 iC}normalizeReq(e){return e instanceof ts?e:new ts(e)}normalizeRes(e){return e instanceof ta?e:new ta(e)}getRequestHandler(){return this.makeRequestHandler()}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:i,socket:s=null}){return{req:new iR({url:e,headers:t,method:r,socket:s,readable:n}),res:new iP({socket:s,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new ts(n.req),new ta(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,i,s=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,s)}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:i}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eL)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:eL,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,s){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,s)}async renderErrorToHTML(e,t,r,n,i){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,i)}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:ii((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=i$.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=ii(e.matchers);return i$.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=rb(r8(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new ew(t);return null}return{name:n.name,paths:n.files.map(e=>(0,g.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,g.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,g.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,nQ.loadManifest)((0,g.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,e7.getTracer)().trace(rh.getRoutesManifest,()=>(0,nQ.loadManifest)((0,g.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",s=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;e$(e,"initURL",s),e$(e,"initQuery",{...t.query}),e$(e,"initProtocol",i),r||e$(e,"clonableBody",function(e){let t=null,r=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(t){let n=await r;if(n&&"object"==typeof n&&n.error)throw n.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,t),t=e}},cloneBodyStream(){let r=t??e,n=new ia.PassThrough,i=new ia.PassThrough;return r.on("data",e=>{n.push(e),i.push(e)}),r.on("end",()=>{n.push(null),i.push(null)}),t=i,n}}}(e.originalRequest))}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,g.join)(this.distDir,eF);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 eu("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
14
14
  //# sourceMappingURL=server.runtime.prod.js.map