next 15.5.1-canary.16 → 15.5.1-canary.17

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 +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +2 -2
  5. package/dist/client/app-bootstrap.js +1 -1
  6. package/dist/client/index.js +1 -1
  7. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  8. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  9. package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
  10. package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
  11. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  12. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  13. package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
  14. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  15. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  16. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  17. package/dist/esm/build/index.js +2 -2
  18. package/dist/esm/build/swc/index.js +1 -1
  19. package/dist/esm/build/webpack-config.js +2 -2
  20. package/dist/esm/client/app-bootstrap.js +1 -1
  21. package/dist/esm/client/index.js +1 -1
  22. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  23. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  24. package/dist/esm/server/lib/app-info-log.js +1 -1
  25. package/dist/esm/server/lib/start-server.js +1 -1
  26. package/dist/esm/server/next-server.js +0 -6
  27. package/dist/esm/server/next-server.js.map +1 -1
  28. package/dist/esm/server/typescript/rules/config.js +8 -0
  29. package/dist/esm/server/typescript/rules/config.js.map +1 -1
  30. package/dist/esm/shared/lib/canary-only.js +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/next-server.js +0 -6
  36. package/dist/server/next-server.js.map +1 -1
  37. package/dist/server/typescript/rules/config.js +8 -0
  38. package/dist/server/typescript/rules/config.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 tV 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 tW=r("./dist/compiled/@edge-runtime/cookies/index.js");let tX=Symbol("internal request");class tB extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);tT(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new tU(r,{headers:tR(this.headers),nextConfig:t.nextConfig});this[tX]={cookies:new tW.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[tX].cookies}get nextUrl(){return this[tX].nextUrl}get page(){throw new tH}get ua(){throw new tV}get url(){return this[tX].url}}let tG="ResponseAborted";class tK extends Error{constructor(...e){super(...e),this.name=tG}}class tY{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}var tJ=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}(tJ||{}),tQ=function(e){return e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents",e}(tQ||{}),t0=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}(t0||{});let t1=0,t4=0,t2=0;function t9(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===tG}async function t3(e,t,r){try{let{errored:n,destroyed:i}=t;if(n||i)return;let a=function(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new tK)}),t}(t),s=function(e,t){let r=!1,n=new tY;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let a=new tY;return e.once("finish",()=>{a.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===t1?void 0:{clientComponentLoadStart:t1,clientComponentLoadTimes:t4,clientComponentLoadCount:t2};return e.reset&&(t1=0,t4=0,t2=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,ez.getTracer)().trace(t0.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 tY)}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(),a.promise}})}(t,r);await e.pipeTo(s,{signal:a.signal})}catch(e){if(t9(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class t8{static #e=this.EMPTY=new t8(null,{metadata:{},contentType:null});static fromStatic(e,t){return new t8(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 F("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return tC(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tE(this.response):Buffer.isBuffer(this.response)?tw(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 a=e[i];return(n=n.then(()=>a.pipeTo(r))).catch(tb),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tE(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[tw(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(t9(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await t3(this.readable,e,this.waitUntil)}}function t5(e){return e.replace(/\\/g,"/")}function t6(e){let t=t5(e);return t.startsWith("/index/")&&!tm(t)?t.slice(6):"/index"!==t?t:"/"}function t7(e,t){let r=[],n=(0,es.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),i=(0,es.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 a=i(e);if(!a)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete a.params[e.name];return{...n,...a.params}}}let re=/[|\\{}()[\]^$+*?.-]/,rt=/[|\\{}()[\]^$+*?.-]/g;function rr(e){return re.test(e)?e.replace(rt,"\\$&"):e}let rn=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function ri(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 ra(e,t){let{includeSuffix:r=!1,includePrefix:n=!1,excludeOptionalTrailingSlash:i=!1}=void 0===t?{}:t,{parameterizedRoute:a,groups:s}=function(e,t,r){let n={},i=1,a=[];for(let s of tS(e).slice(1).split("/")){let e=tc.find(e=>s.startsWith(e)),o=s.match(rn);if(e&&o&&o[2]){let{key:t,optional:r,repeat:s}=ri(o[2]);n[t]={pos:i++,repeat:s,optional:r},a.push("/"+rr(e)+"([^/]+?)")}else if(o&&o[2]){let{key:e,repeat:t,optional:s}=ri(o[2]);n[e]={pos:i++,repeat:t,optional:s},r&&o[1]&&a.push("/"+rr(o[1]));let l=t?s?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),a.push(l)}else a.push("/"+rr(s));t&&o&&o[3]&&a.push(rr(o[3]))}return{parameterizedRoute:a.join(""),groups:n}}(e,r,n),o=a;return i||(o+="(?:/)?"),{re:RegExp("^"+o+"$"),groups:s}}function rs(e){let t,{interceptionMarker:r,getSafeRouteKey:n,segment:i,routeKeys:a,keyPrefix:s,backreferenceDuplicateKeys:o}=e,{key:l,optional:d,repeat:u}=ri(i),c=l.replace(/\W/g,"");s&&(c=""+s+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 a;s?a[c]=""+s+l:a[c]=l;let f=r?rr(r):"";return t=p&&o?"\\k<"+c+">":u?"(?<"+c+">.+?)":"(?<"+c+">[^/]+?)",d?"(?:/"+f+t+")?":"/"+f+t}function ro(e){return e.replace(/__ESC_COLON_/gi,":")}function rl(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},a=r=>{let n,a=r.key;switch(r.type){case"header":a=a.toLowerCase(),n=e.headers[a];break;case"cookie":n="cookies"in e?e.cookies[r.key]:eH(e.headers)()[r.key];break;case"query":n=t[a];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}(a)]=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=>a(e))||n.some(e=>a(e)))&&i}function rd(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 ec("/"+(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 ru(e){try{return decodeURIComponent(e)}catch{return e}}let rc=/https?|ftp|gopher|file/;var rh=r("./dist/compiled/superstruct/index.cjs"),rp=r.n(rh);let rf=rp().enums(["c","ci","oc","d","di"]),rm=rp().union([rp().string(),rp().tuple([rp().string(),rp().string(),rf])]),rg=rp().tuple([rm,rp().record(rp().string(),rp().lazy(()=>rg)),rp().optional(rp().nullable(rp().string())),rp().optional(rp().nullable(rp().union([rp().literal("refetch"),rp().literal("refresh"),rp().literal("inside-shared-layout"),rp().literal("metadata-only")]))),rp().optional(rp().boolean())]),ry="next-action",rv="next-router-state-tree",r_="next-router-prefetch",rb="next-router-segment-prefetch",rx="next-url",rE=["rsc",rv,r_,"next-hmr-refresh",rb],rw="_rsc";function rC(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)===rx}function rP(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==ek&&r.startsWith(ek),i=r!==eI&&r.startsWith(eI);(n||i||t.includes(r))&&delete e[r]}}function rR(e,t){return"string"==typeof e[eL]&&e["x-next-revalidate-tag-token"]===t?e[eL].split(","):[]}function rT(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function rO(e){return rT(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 rS{constructor(e){this.provider=e}normalize(e){return this.provider.analyze(e).pathname}}class rk{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 a=n.slice(1,-1),s=!1;if(a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1),s=!0),a.startsWith("…"))throw Object.defineProperty(Error("Detected a three-dot character ('…') at ('"+a+"'). Did you mean ('...')?"),"__NEXT_ERROR_CODE",{value:"E147",enumerable:!1,configurable:!0});if(a.startsWith("...")&&(a=a.substring(3),r=!0),a.startsWith("[")||a.endsWith("]"))throw Object.defineProperty(Error("Segment names may not start or end with extra brackets ('"+a+"')."),"__NEXT_ERROR_CODE",{value:"E421",enumerable:!1,configurable:!0});if(a.startsWith("."))throw Object.defineProperty(Error("Segment names may not start with erroneous periods ('"+a+"')."),"__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(s){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,a),this.optionalRestSlugName=a,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,a),this.restSlugName=a,n="[...]"}else{if(s)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,a),this.slugName=a,n="[]"}}this.children.has(n)||this.children.set(n,new rk),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 rI{constructor(e){this.definition=e,tm(e.pathname)&&(this.dynamic=eh(ra(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 rA extends rI{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 rj{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 tY;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 a=e.filter(e=>e.isDynamic),s=new Map,o=[];for(let e=0;e<a.length;e++){let t=a[e].definition.pathname,r=s.get(t)??[];r.push(e),1===r.length&&(s.set(t,r),o.push(t))}let l=function(e){let t=new rk;return e.forEach(e=>t.insert(e)),t.smoosh()}(o),d=[];for(let e of l){let t=s.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=>a[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 rA?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=tl(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 rN{constructor(e=[]){this.normalizers=e}push(e){this.normalizers.push(e)}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}var rD=r("./dist/esm/shared/lib/isomorphic/path.js"),r$=r.n(rD);class rM{constructor(...e){this.prefix=r$().posix.join(...e)}normalize(e){return r$().posix.join(this.prefix,e)}}function rZ(e){let t=/^\/index(\/|$)/.test(e)&&!tm(e)?"/index"+e:"/"===e?"/index":tl(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new et("Requested and resolved page mismatch: "+t+" "+n)}return t}class rL{normalize(e){return e.replace(/%5F/g,"_")}}class rq extends rM{constructor(){super("app")}normalize(e){return super.normalize(rZ(e))}}class rz extends rM{constructor(e){super(e,eE)}normalize(e){return super.normalize(e)}}function rU(e){return e.endsWith("/route")}let rF={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"]}},rH=(e,t)=>t&&0!==t.length?`(?:\\.(${e.join("|")})|(\\.(${t.join("|")})))`:`(\\.(?:${e.join("|")}))`;function rV(e){return{normalize:e}}class rW extends rN{constructor(){super([rV(td),new rL])}normalize(e){return super.normalize(e)}}class rX{constructor(e){this.filename=new rz(e),this.pathname=new rW,this.bundlePath=new rq}}var rB=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 rG extends rI{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class rK{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 rY extends rK{constructor(e,t){super({load:async()=>t.load(e),compare:(e,t)=>e===t})}}class rJ extends rY{constructor(e,t){super(ex,t),this.normalizers=new rX(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],a=this.normalizers.filename.normalize(e[r]),s=this.normalizers.bundlePath.normalize(r);n.push(new rG({kind:rB.APP_PAGE,pathname:t,page:r,bundlePath:s,filename:a,appPaths:i}))}return n}}class rQ extends rI{}class r0 extends rY{constructor(e,t){super(ex,t),this.normalizers=new rX(e)}async transform(e){let t=Object.keys(e).filter(e=>rU(e)),r=[];for(let n of t){let t=this.normalizers.filename.normalize(e[n]),i=this.normalizers.pathname.normalize(n),a=this.normalizers.bundlePath.normalize(n);r.push(new rQ({kind:rB.APP_ROUTE,pathname:i,page:n,bundlePath:a,filename:t}))}return r}}function r1(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}class r4 extends rI{}class r2 extends rA{}class r9 extends rN{constructor(){super([rV(rZ),new rM("pages")])}normalize(e){return super.normalize(e)}}class r3 extends rM{constructor(e){super(e,eE)}normalize(e){return super.normalize(e)}}class r8{constructor(e){this.filename=new r3(e),this.bundlePath=new r9}}class r5 extends rY{constructor(e,t,r){super(eb,t),this.i18nProvider=r,this.normalizers=new r8(e)}async transform(e){let t=Object.keys(e).filter(e=>r1(e)),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new r2({kind:rB.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 r4({kind:rB.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class r6 extends rI{}class r7 extends rA{}class ne extends rY{constructor(e,t,r){super(eb,t),this.i18nProvider=r,this.normalizers=new r8(e)}async transform(e){let t=Object.keys(e).filter(e=>!r1(e)).filter(e=>{var t;let r=(null==(t=this.i18nProvider)?void 0:t.analyze(e).pathname)??e;return!ew.includes(r)}),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new r7({kind:rB.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 r6({kind:rB.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nt{constructor(e){this.getter=e}load(e){return this.getter(e)}}class nr{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=ef(e,"locale");if(r){let e=this.analyze(t);e.detectedLocale&&(e.detectedLocale!==r&&console.warn(`The detected locale does not match the locale in the query. Expected to find '${r}' in '${t}' but found '${e.detectedLocale}'}`),t=e.pathname)}return{pathname:t,detectedLocale:r,inferredFromDefault:ef(e,"localeInferredFromDefault")??!1}}analyze(e,t={}){let r=t.defaultLocale,n="string"==typeof r,i=e.split("/",2);if(!i[1])return{detectedLocale:r,pathname:e,inferredFromDefault:n};let a=i[1].toLowerCase(),s=this.lowerCaseLocales.indexOf(a);return s<0||(r=this.config.locales[s],n=!1,e=e.slice(r.length+1)||"/"),{detectedLocale:r,pathname:e,inferredFromDefault:n}}}async function nn(e,t,r,n){{var i;t.statusCode=r.status,t.statusMessage=r.statusText;let a=["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 tP(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(a.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:s}=t;r.body&&"HEAD"!==e.method?await t3(r.body,s,n):s.end()}}let ni=t7("/_next/data/:path*");class na{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 ns extends na{constructor(){super(e$)}}class no extends na{constructor(){super(ej)}match(e){return e==="/__index"+ej||super.match(e)}normalize(e,t){return e==="/__index"+ej?"/":super.normalize(e,t)}}class nl{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 nd{constructor(e){if(this.suffix=new na(".json"),!e)throw Object.defineProperty(Error("Invariant: buildID is required"),"__NEXT_ERROR_CODE",{value:"E200",enumerable:!1,configurable:!0});this.prefix=new nl(`/_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),t6(e=this.suffix.normalize(e,!0))):e}}function nu(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 nc=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");let nh=Symbol("internal response"),np=new Set([301,302,303,307,308]);function nf(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 tW.ResponseCookies(r),{get(e,n,i){switch(n){case"delete":case"set":return(...i)=>{let a=Reflect.apply(e[n],e,i),s=new Headers(r);return a instanceof tW.ResponseCookies&&r.set("x-middleware-set-cookie",a.getAll().map(e=>(0,tW.stringifyCookie)(e)).join(",")),nf(t,s),a};default:return eR.get(e,n,i)}}});this[nh]={cookies:n,url:t.url?new tU(t.url,{headers:tR(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[nh].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(!np.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",tT(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",tT(e)),nf(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"),nf(e,t),new nm(null,{...e,headers:t})}}Symbol.for("next.mutated.cookies"),r("./dist/compiled/p-queue/index.js");let ng=require("next/dist/server/lib/cache-handlers/default.external.js");var ny=r.n(ng);let nv=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,n_=Symbol.for("@next/cache-handlers"),nb=Symbol.for("@next/cache-handlers-map"),nx=Symbol.for("@next/cache-handlers-set"),nE=globalThis;require("next/dist/server/app-render/after-task-async-storage.external.js");class nw extends tB{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new tF({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new tF({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new tF({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let nC=RegExp(`^(/.*)${eN}(/.*)${eD}$`);class nP{match(e){return nC.test(e)}extract(e){let t=e.match(nC);return t?{originalPathname:t[1],segmentPath:t[2]}:null}normalize(e){let t=this.extract(e);return t?t.originalPathname:e}}let nR=require("next/dist/shared/lib/no-fallback-error.external.js");var nT=r("./dist/compiled/zod/index.cjs");r("./dist/compiled/zod-validation-error/index.js"),nT.z.object({revalidate:nT.z.union([nT.z.number().int().nonnegative(),nT.z.literal(!1)]).optional(),dynamicParams:nT.z.boolean().optional(),dynamic:nT.z.enum(["auto","error","force-static","force-dynamic"]).optional(),fetchCache:nT.z.enum(["auto","default-cache","only-cache","force-cache","force-no-store","default-no-store","only-no-store"]).optional(),unstable_prefetch:nT.z.enum(["unstable_static","unstable_runtime"]).optional(),preferredRegion:nT.z.union([nT.z.string(),nT.z.array(nT.z.string())]).optional(),experimental_ppr:nT.z.boolean().optional(),runtime:nT.z.enum(["edge","nodejs"]).optional(),maxDuration:nT.z.number().int().nonnegative().optional()}).keyof().options;let nO={catchall:"c","catchall-intercepted":"ci","optional-catchall":"oc",dynamic:"d","dynamic-intercepted":"di"};class nS extends Error{constructor(e){super(),this.innerError=e}}class nk{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(e){var t,n,i;this.handleRSCRequest=(e,t,r)=>{var n,i,a;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[r_]="1",e.headers[rb]=i,em(e,"isRSCRequest",!0),em(e,"isPrefetchRSCRequest",!0),em(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[r_]="1",em(e,"isRSCRequest",!0),em(e,"isPrefetchRSCRequest",!0);else if(null==(a=this.normalizers.rsc)?void 0:a.match(r.pathname))r.pathname=this.normalizers.rsc.normalize(r.pathname,!0),e.headers.rsc="1",em(e,"isRSCRequest",!0);else if(e.headers["x-now-route-matches"]){var s=e.headers;for(let e of rE)delete s[e];return!1}else if("1"!==e.headers.rsc)return!1;else if(em(e,"isRSCRequest",!0),"1"===e.headers[r_]){em(e,"isPrefetchRSCRequest",!0);let t=e.headers[rb];"string"==typeof t&&em(e,"segmentPrefetchRSCRequest",t)}if(e.url){let t=(0,u.parse)(e.url);t.pathname=r.pathname,e.url=(0,u.format)(t)}return!1},this.handleNextDataRequest=async(e,t,r)=>{let n=await this.getMiddleware(),i=function(e){return"string"==typeof e&&ni(e)}(r.pathname);if(!i||!i.path)return!1;if(i.path[0]!==this.buildId)return!ef(e,"middlewareInvoke")&&(await this.render404(e,t,r),!0);i.path.shift();let a=i.path[i.path.length-1];if("string"!=typeof a||!a.endsWith(".json"))return await this.render404(e,t,r),!0;let s=`/${i.path.join("/")}`;if(s=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}(s,".json"),n&&(this.nextConfig.trailingSlash&&!s.endsWith("/")&&(s+="/"),!this.nextConfig.trailingSlash&&s.length>1&&s.endsWith("/")&&(s=s.substring(0,s.length-1))),this.i18nProvider){var o;let i=null==e||null==(o=e.headers.host)?void 0:o.split(":",1)[0].toLowerCase(),a=this.i18nProvider.detectDomainLocale(i),l=(null==a?void 0:a.defaultLocale)??this.i18nProvider.config.defaultLocale,d=this.i18nProvider.analyze(s);if(d.detectedLocale&&(s=d.pathname),em(e,"locale",d.detectedLocale),em(e,"defaultLocale",l),d.detectedLocale||eg(e,"localeInferredFromDefault"),!d.detectedLocale&&!n)return em(e,"locale",l),await this.render404(e,t,r),!0}return r.pathname=s,em(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),a=0;a<n;a++)i[a]=arguments[a];return r||(r=!0,t=e(...i)),t}}(()=>{e5(`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:a=".",quiet:s=!1,conf:o,dev:l=!1,minimalMode:d=!1,hostname:c,port:h,experimentalTestProxy:p}=e;this.experimentalTestProxy=p,this.serverOptions=e,this.dir=r("path").resolve(a),this.quiet=s,this.loadEnvConfig({dev:l}),this.nextConfig=o,this.hostname=c,this.hostname&&(this.fetchHostname=function(e){return to.test(e)?`[${e}]`:e}(this.hostname)),this.port=h,this.distDir=r("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!d&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nr(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rS(this.i18nProvider):void 0;let{serverRuntimeConfig:f={},publicRuntimeConfig:m,assetPrefix:g,generateEtags:y}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=d||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(l),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 ns:void 0,prefetchRSC:this.isAppPPREnabled&&1?new no:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nP:void 0,data:this.enabledDirectories.pages?new nd(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:y,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(n=this.nextConfig.experimental.amp)?void 0:n.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==(i=this.nextConfig.i18n)?void 0:i.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(m).length>0?m: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,devtoolSegmentExplorer:this.nextConfig.experimental.devtoolSegmentExplorer},(0,tg.setConfig)({serverRuntimeConfig:f,publicRuntimeConfig:m}),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(g),this.responseCache=this.getResponseCache({dev:l})}getRouteMatchers(){let e=new nt(e=>{switch(e){case eb:return this.getPagesManifest()??null;case ex:return this.getAppPathsManifest()??null;default:return null}}),t=new rj;return t.push(new ne(this.distDir,e,this.i18nProvider)),t.push(new r5(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new rJ(this.distDir,e)),t.push(new r0(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 nw?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||e8(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,ez.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(tJ.handleRequest,{spanName:`${n} ${e.url}`,kind:ez.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async a=>this.handleRequestImpl(e,t,r).finally(()=>{if(!a)return;let r=ef(e,"isRSCRequest")??!1;a.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(a.setStatus({code:ez.SpanStatusCode.ERROR}),a.setAttribute("error.type",t.statusCode.toString()));let s=i.getRootSpanAttributes();if(!s)return;if(s.get("next.span_type")!==tJ.handleRequest)return void console.warn(`Unexpected root span type '${s.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=s.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;a.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),a.updateName(e)}else a.updateName(r?`RSC ${n} ${e.url}`:`${n} ${e.url}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,a,s,o,l,d,c,h,p=t.originalResponse;let f=p.setHeader.bind(p);p.setHeader=(t,r)=>{if("headersSent"in p&&p.headersSent)return p;if("set-cookie"===t.toLowerCase()){let t=ef(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return f(t,r)};let m=(e.url||"").split("?",1)[0];if(null==m?void 0:m.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,u.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:g=null}=e,y=null==g?void 0:g.headers["x-forwarded-proto"],v=y?"https"===y:!!(null==g||null==(n=g.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():v?"443":"80",e.headers["x-forwarded-proto"]??=v?"https":"http",e.headers["x-forwarded-for"]??=null==g||null==(i=g.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let _=await this.handleRSCRequest(e,t,r);if(_)return;let b=null==(a=this.i18nProvider)?void 0:a.detectDomainLocale(tN(r,e.headers)),x=(null==b?void 0:b.defaultLocale)||(null==(s=this.nextConfig.i18n)?void 0:s.defaultLocale);em(e,"defaultLocale",x);let E=e0(e.url.replace(/^\/+/,"/")),w=tZ(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=tM(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[eA];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[eA]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))em(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");em(e,"postponed",r)}n=this.normalize(n);let a=this.stripNextDataPath(i);n=t6(n);let s=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});s&&(em(e,"locale",s.detectedLocale),s.inferredFromDefault?em(e,"localeInferredFromDefault",!0):eg(e,"localeInferredFromDefault"));let u=n,h=tm(u),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(u,{i18n:s});e&&(u=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}s&&(n=s.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:a,caseSensitive:s}){let o,l,d;return i&&(d=(l=eh(o=function(e,t){var r,n,i;let a=function(e,t,r,n,i){let a,s=(a=0,()=>{let e="",t=++a;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let a of tS(e).slice(1).split("/")){let e=tc.some(e=>a.startsWith(e)),d=a.match(rn);if(e&&d&&d[2])l.push(rs({getSafeRouteKey:s,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?eI:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rr(d[1]));let e=rs({getSafeRouteKey:s,segment:d[2],routeKeys:o,keyPrefix:t?ek:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rr(a));r&&d&&d[3]&&l.push(rr(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),s=a.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(s+="(?:/)?"),{...ra(e,t),namedRegex:"^"+s+"$",routeKeys:a.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=t7(n.source+(a?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!s});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rl(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rC(n)){let e=o.headers[rv];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),a=i?t[1]:t;!a||a.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,rh.assert)(t,rg),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:a,destQuery:s}=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(":"+rr(n),"g"),"__ESC_COLON_"+n)}let n=e0(t),i=n.pathname;i&&(i=ro(i));let a=n.href;a&&(a=ro(a));let s=n.hostname;s&&(s=ro(s));let o=n.hash;o&&(o=ro(o));let l=n.search;l&&(l=ro(l));let d=n.origin;return d&&(d=ro(d)),{...n,pathname:i,hostname:s,href:a,hash:o,search:l,origin:d}}(e),{hostname:i,query:a,search:s}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(eu(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(eu(i,e),e))l.push(t.name)}let u=ec(o,{validate:!1});for(let[r,n]of(i&&(t=ec(i,{validate:!1})),Object.entries(a)))Array.isArray(n)?a[r]=n.map(t=>rd(ro(t),e.params)):"string"==typeof n&&(a[r]=rd(ro(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 a||(a[t]=e.params[t]);if(th(o))for(let t of o.split("/")){let r=tc.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,a]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(a?"#":"")+(a||""),n.search=s?rd(s,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:a,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(a.protocol)return!0;if(Object.assign(u,s,p),Object.assign(d.query,a.query),delete a.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,a),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t$(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=tS(c||"");return t===tS(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=tO(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>ru(e)):ru(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eh({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tO(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let a=r[e];if(!a)continue;let s=t[a],o=n[e];if(!s.optional&&!o)return null;i[s.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 a of Object.keys(r.groups)){let s=e[a];"string"==typeof s?s=tu(s):Array.isArray(s)&&(s=s.map(tu));let o=n[a],l=r.groups[a].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(s)?s.some(t=>t.includes(e)):null==s?void 0:s.includes(e)):null==s?void 0:s.includes(o))||void 0===s&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!s||Array.isArray(s)&&1===s.length&&("index"===s[0]||s[0]===`[[...${a}]]`))&&(s=void 0,delete e[a]),s&&"string"==typeof s&&r.groups[a].repeat&&(s=s.split("/")),s&&(i[a]=s)}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,rP(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",a=e.hash||"",s=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)),s&&"object"==typeof s&&(s=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,eQ(e));else t.set(r,eQ(n));return t}(s)));let l=e.search||s&&"?"+s||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rc.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),a&&"#"!==a[0]&&(a="#"+a),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+a}(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:a,repeat:s}=r.groups[n],o=`[${s?"...":""}${n}]`;a&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||a)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rP(e,t)}}({pageIsDynamic:h,page:u,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&&em(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tO(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(v[n]=Array.isArray(t)?t.map(e=>ru(e)):ru(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(v,!1)),!p.hasValidParams&&!tm(a)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,a);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&&a===u&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&em(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(u,t),e.url=f.interpolateDynamicPath(e.url,t);let r=ef(e,"segmentPrefetchRSCRequest");r&&tm(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rb]=r,em(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(c=f.defaultRouteRegex)?void 0:c.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 ee||r instanceof et)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(em(e,"isLocaleDomain",!!b),w.locale&&(e.url=(0,u.format)(E),em(e,"didStripLocale",!0)),!ef(e,"locale")&&(w.locale?em(e,"locale",w.locale):x&&(em(e,"locale",x),em(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!ef(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),em(e,"incrementalCache",t),globalThis.__incrementalCache=t}let P=function(){if(nE[nx])return nE[nx].values()}();P&&await Promise.all([...P].map(async t=>{if("refreshTags"in t);else{let r=rR(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),ef(e,"serverComponentsHmrCache")||em(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let R=ef(e,"invokePath");if(!C&&R){let n=ef(e,"invokeStatus");if(n){let i=ef(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let a=ef(e,"invokeError")||null;return this.renderError(a,e,t,"/_error",r.query)}let i=new URL(R||"/","http://n"),a=tZ(i.pathname,{nextConfig:this.nextConfig,parseData:!1});a.locale&&em(e,"locale",a.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,em(e,"rewroteURL",a.pathname));let s=t$(tM(r.pathname,this.nextConfig.basePath||""),null==(h=this.nextConfig.i18n)?void 0:h.locales);for(let t of(s.detectedLocale&&em(e,"locale",s.detectedLocale),r.pathname=s.pathname,Object.keys(r.query)))delete r.query[t];let o=ef(e,"invokeQuery");if(o&&Object.assign(r.query,o),_=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(ef(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=tM(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nR.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ee||r instanceof et)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[ep]=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=td(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,ez.getTracer)().trace(tJ.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,ez.getTracer)().trace(tJ.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||t_,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:a,res:s}=n,o=s.statusCode,{body:l}=i,{cacheControl:d}=i;if(!s.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(s.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(a,s,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),s.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,a=!1){return(0,ez.getTracer)().trace(tJ.render,async()=>this.renderImpl(e,t,r,n,i,a))}getWaitUntil(){let e=function(){let e=globalThis[nc];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,a=!1){var s;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 tv.test(e)?"dom":ty.test(e)?"html":void 0}(o),(s=r,ew.includes(s))?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,ez.getTracer)().trace(tJ.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return th(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rv}, ${r_}, ${rb}`,a=ef(e,"isRSCRequest")??!1,s=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rx}`),s=!0):(r||a)&&t.appendHeader("vary",i),s||delete e.headers[rx]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:a}){var s,o,l,d,c,h;let p,f;r===ey&&(r="/404");let m="/_error"===r,g="/404"===r||m&&404===t.statusCode,y="/500"===r||m&&500===t.statusCode,v=!0===i.isAppPath,_=!!i.getServerSideProps,b=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(ry)??null,r=e.headers.get("content-type")):(t=e.headers[ry]??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"))),a=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:a,isPossibleServerAction:!!(a||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=ef(e,"isRSCRequest")??!1,w=(0,u.parse)(e.url||"").pathname||"/",C=ef(e,"rewroteURL")||w;this.setVaryHeader(e,t,v,C);let P=this.getPrerenderManifest();(null==p?void 0:p.includes(C))||e.headers["x-now-route-matches"]?x=!0:x||=!!P.routes[nu(r)];let R=!!(ef(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||_);if(!x&&e.headers["x-middleware-prefetch"]&&!(g||"/_error"===r))return t.setHeader(eA,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[eA]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=ef(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(f=i.routeModule);let O=this.isAppPPREnabled&&void 0!==f&&f.definition.kind===rB.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==a.__nextppronly&&O,k=O&&((null==(s=P.routes[r]??P.dynamicRoutes[r])?void 0:s.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?ef(e,"postponed"):void 0;if(!g||R||E||(t.statusCode=404),eC.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!b&&!k&&!g&&!y&&"/_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:t8.fromStatic(i.Component,eS)};if("amp"in a&&!a.amp&&delete a.amp,!0===n.supportsDynamicResponse){let t=(c=d=e.headers["user-agent"]||"",tv.test(c)||ty.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!a.amp&&r}if(!R&&v&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[eA]&&(C=w),w=tS(w),C=tS(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),R&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==f?void 0:f.isDev)&&tm(r)&&(i.getStaticPaths||v)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.page,isAppPath:v});if(v&&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&&em(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}%%`,nO[i]]);return r}(r))}}if("OPTIONS"===e.method&&!g&&(!f||f.definition.kind!==rB.APP_ROUTE))return await nn(e,t,new Response(null,{status:400})),null;let I=e.originalRequest,A=t.originalResponse,j=(0,u.parse)(ef(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));m||(I.url=`${N}${j.search||""}`),h=ef(e),I[ep]=h,em(I,"distDir",this.distDir),em(I,"query",a),em(I,"params",n.params),em(I,"ampValidator",this.renderOpts.ampValidator),em(I,"minimalMode",!0),n.err&&em(I,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(I,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=t6(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,a=this.getOriginalAppPaths(i),s=Array.isArray(a),o=i;s&&(o=a[a.length-1]);let l=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:s,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:a,shouldEnsure:!1});if(l){(0,ez.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nR.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,ez.getTracer)().trace(tJ.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:a}=e,s=ef(e.req,"bubbleNoFallback")??!1;delete i[rw];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,a)};try{for await(let t of this.matchers.matchAll(a,o)){ef(e.req,"invokeOutput");let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},s);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,s);if(!1!==t)return t}}catch(i){let t=rO(i);if(i instanceof en)throw console.error("Invariant: failed to load static page",JSON.stringify({page:a,url:e.req.url,matchedPath:e.req.headers[eA],initUrl:ef(e.req,"initURL"),didRewrite:!!ef(e.req,"rewroteURL"),rewroteUrl:ef(e.req,"rewroteURL")},null,2)),t;if(t instanceof nR.NoFallbackError&&s)throw t;if(t instanceof ee||t instanceof et)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(em(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eg(e.req,"customErrorRender"));let r=t instanceof nS;if(!r)throw rT(t)&&(t.page=a),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=ef(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${a}`),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,ez.getTracer)().trace(tJ.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={},a=!0){return(0,ez.getTracer)().trace(tJ.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,a))}async renderErrorImpl(e,t,r,n,i={},a=!0){return a&&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,ez.getTracer)().trace(tJ.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,a=404===r.statusCode,s=this.enabledDirectories.app;a&&(s&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:ev,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!ef(e.req,"customErrorRender")&&!i&&eC.includes(o)&&(!i&&s&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nS(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?em(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eg(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nR.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(s){let t=rO(s),i=t instanceof nS;i||this.logError(t),r.statusCode=500;let a=await this.getFallbackErrorComponents(e.req.url);if(a)return em(e.req,"match",{definition:a.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:a});return{body:t8.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:a}=r||(0,u.parse)(e.url,!0);return this.nextConfig.i18n&&(ef(e,"locale")||em(e,"locale",this.nextConfig.i18n.defaultLocale),em(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,a,n)}}let nI=require("next/dist/server/load-manifest.external.js"),nA=new f(1e3);function nj(e,t,r,n){let i,a=`${e}:${t}:${r}:${n}`,s=null==nA?void 0:nA.get(a);if(s)return s;let o=d().join(t,eE);n&&(i=(0,nI.loadManifest)(d().join(o,ex),!0));let l=(0,nI.loadManifest)(d().join(o,eb),!0);try{e=t6(rZ(e))}catch(t){throw console.error(t),new er(e)}let u=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t$(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(s=u(i)),s||(s=u(l)),s)?(d().isAbsolute(s)||(s=d().join(o,s)),null==nA||nA.set(a,s),s):(null==nA||nA.set(a,null),null)}function nN(e,t,r,n){let i=nj(e,t,r,n);if(!i)throw new er(e);return i}async function nD(e,t,r){let n=nN(e,t,void 0,r);return n.endsWith(".html")?ei.promises.readFile(n,"utf8").catch(t=>{throw new en(e,t.message)}):require(n)}function n$(e){return e.default||e}async function nM(e){return new Promise(t=>setTimeout(t,e))}let nZ=Symbol.for("next.server.action-manifests");async function nL(e,t=3){for(;;)try{return(0,nI.loadManifest)(e)}catch(e){if(--t<=0)throw e;await nM(100)}}async function nq(e,t=3){try{return await nL(e,t)}catch(e){return}}async function nz(e,t=3){for(;;)try{return(0,nI.evalManifest)(e)}catch(e){if(--t<=0)throw e;await nM(100)}}async function nU(e,t,r){try{return(await nz(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function nF({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i}){let a,s={},o={};r||([s,o]=await Promise.all([nD("/_document",e,!1),nD("/_app",e,!1)]));let d=n?3:1;a=(0,l.join)(e,"react-loadable-manifest.json");let u=!function(e){let t=e.replace(/\/route$/,"");return rU(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,a=[RegExp(`^[\\\\/]robots${rH(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${rH(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${rH(["xml"],t)}${n}`),RegExp(`[\\\\/]${rF.icon.filename}${i}${rH(rF.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.apple.filename}${i}${rH(rF.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.openGraph.filename}${i}${rH(rF.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.twitter.filename}${i}${rH(rF.twitter.extensions,t)}${n}`)],s=t5(e);return a.some(e=>e.test(s))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[c,h,p,f,m,g]=await Promise.all([nL((0,l.join)(e,"build-manifest.json"),d),nq(a,d),r||0?void 0:nL((0,l.join)(e,"dynamic-css-manifest.json"),d).catch(()=>void 0),r&&u?nU((0,l.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),d):void 0,r?nL((0,l.join)(e,"server","server-reference-manifest.json"),d).catch(()=>null):null,i?nL((0,l.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);m&&f&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let a=null==(i=globalThis[nZ])?void 0:i.clientReferenceManifestsPerPage;globalThis[nZ]={clientReferenceManifestsPerPage:{...a,[td(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:f,serverActionsManifest:m,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,a;let s,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=z.workAsyncStorage.getStore();if(!(s=l?o[tj(a=l.page,"app")?a:"app"+a]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=s;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:m})});let y=await nD(t,e,r),v=n$(y),_=n$(s),b=n$(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=y;return{App:b,Document:_,Component:v,buildManifest:c,subresourceIntegrityManifest:g,reactLoadableManifest:h||{},dynamicCssManifest:p,pageConfig:y.config||{},ComponentMod:y,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:f,serverActionsManifest:m,isAppPath:r,page:t,routeModule:C}}let nH=(0,ez.getTracer)().wrap(tQ.loadComponents,nF);function nV(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rl(r,n,i.has,i.missing))continue;return!0}return!1}}var nW=r("../next-env/dist/index.js");let nX=require("stream");var nB=r.n(nX);class nG{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new nG(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(r,Promise.resolve);let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:a,reject:s}=new tY;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let e=await t(r,a);a(e)}catch(e){s(e)}finally{this.pending.delete(r)}}),i}}let nK=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var nY=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}({}),nJ=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 nQ(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===nY.PAGES?{kind:nY.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)===nY.APP_PAGE?{kind:nY.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 n0(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===nY.PAGES?{kind:nY.PAGES,html:t8.fromStatic(e.value.html,eS),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===nY.APP_PAGE?{kind:nY.APP_PAGE,html:t8.fromStatic(e.value.html,eS),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class n1{constructor(e){this.batcher=nG.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:nK}),this.minimal_mode=e}async get(e,t,r){if(!e)return t({hasResolved:!1,previousCacheEntry:null});let{incrementalCache:n,isOnDemandRevalidate:i=!1,isFallback:a=!1,isRoutePPREnabled:s=!1,waitUntil:o}=r,l=await this.batcher.batch({key:e,isOnDemandRevalidate:i},(l,d)=>{let u=(async()=>{var o;if(this.minimal_mode&&(null==(o=this.previousCacheItem)?void 0:o.key)===l&&this.previousCacheItem.expiresAt>Date.now())return this.previousCacheItem.entry;let u=function(e){switch(e){case rB.PAGES:return nJ.PAGES;case rB.APP_PAGE:return nJ.APP_PAGE;case rB.IMAGE:return nJ.IMAGE;case rB.APP_ROUTE:return nJ.APP_ROUTE;case rB.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),c=!1,h=null;try{if((h=this.minimal_mode?null:await n.get(e,{kind:u,isRoutePPREnabled:r.isRoutePPREnabled,isFallback:a}))&&!i&&(d(h),c=!0,!h.isStale||r.isPrefetch))return null;let o=await t({hasResolved:c,previousCacheEntry:h,isRevalidating:!0});if(!o)return this.minimal_mode&&(this.previousCacheItem=void 0),null;let p=await nQ({...o,isMiss:!h});if(!p)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return i||c||(d(p),c=!0),p.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:l,entry:p,expiresAt:Date.now()+1e3}:await n.set(e,p.value,{cacheControl:p.cacheControl,isRoutePPREnabled:s,isFallback:a})),p}catch(t){if(null==h?void 0:h.cacheControl){let t=Math.min(Math.max(h.cacheControl.revalidate||3,3),30),r=void 0===h.cacheControl.expire?void 0:Math.max(t+3,h.cacheControl.expire);await n.set(e,h.value,{cacheControl:{revalidate:t,expire:r},isRoutePPREnabled:s,isFallback:a})}if(c)return console.error(t),null;throw t}})();return o&&o(u),u});return n0(l)}}let n4=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class n2{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(r$().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 n9=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class n3{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?n3.memoryCache?n3.debug&&console.log("memory store already initialized"):(n3.debug&&console.log("using memory store for fetch cache"),n3.memoryCache=(0,n9.getMemoryCache)(e.maxMemoryCacheSize)):n3.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,n3.debug&&console.log("revalidateTag",t),0!==t.length)for(let e of t)n4.tagsManifest.has(e)||n4.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,a,s,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=n3.memoryCache)?void 0:t.get(u);if(n3.debug&&(h===nJ.FETCH?console.log("get",u,c.tags,h,!!p):console.log("get",u,h,!!p)),!p)try{if(h===nJ.APP_ROUTE){let e=this.getFilePath(`${u}.body`,nJ.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$/,eZ),"utf8"));p={lastModified:r.getTime(),value:{kind:nY.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===nJ.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===nJ.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let a=r.getTime(),l=JSON.parse(t);if(p={lastModified:a,value:l},(null==(s=p.value)?void 0:s.kind)===nY.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)))||(n3.debug&&console.log("tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===nJ.APP_PAGE){let n,i,a;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,eZ),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+eN;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+eD,nJ.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(a=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?ej:e$}`,nJ.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:nY.APP_PAGE,html:t,rscData:a,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===nJ.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${eM}`,nJ.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:nY.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=n3.memoryCache)||l.set(u,p))}catch{return null}if((null==p||null==(r=p.value)?void 0:r.kind)===nY.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===nY.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===nY.PAGES){let e,t=null==(d=p.value.headers)?void 0:d["x-next-cache-tags"];if("string"==typeof t&&(e=t.split(",")),(null==e?void 0:e.length)&&(0,n4.isStale)(e,(null==p?void 0:p.lastModified)||Date.now()))return null}else(null==p||null==(a=p.value)?void 0:a.kind)===nY.FETCH&&(c.kind===nJ.FETCH?[...c.tags||[],...c.softTags||[]]:[]).some(e=>!!this.revalidatedTags.includes(e)||(0,n4.isStale)([e],(null==p?void 0:p.lastModified)||Date.now()))&&(p=void 0);return p??null}async set(e,t,r){var n;if(null==(n=n3.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),n3.debug&&console.log("set",e),!this.flushToDisk||!t)return;let i=new n2(this.fs);if(t.kind===nY.APP_ROUTE){let r=this.getFilePath(`${e}.body`,nJ.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$/,eZ),JSON.stringify(n,null,2))}else if(t.kind===nY.PAGES||t.kind===nY.APP_PAGE){let n=t.kind===nY.APP_PAGE,a=this.getFilePath(`${e}.html`,n?nJ.APP_PAGE:nJ.PAGES);if(i.append(a,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?ej:e$:eM}`,n?nJ.APP_PAGE:nJ.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===nY.APP_PAGE){let e;if(t.segmentData){e=[];let r=a.replace(/\.html$/,eN);for(let[n,a]of t.segmentData){e.push(n);let t=r+n+eD;i.append(t,a)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(a.replace(/\.html$/,eZ),JSON.stringify(r))}}else if(t.kind===nY.FETCH){let n=this.getFilePath(e,nJ.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case nJ.FETCH:return r$().join(this.serverDistDir,"..","cache","fetch-cache",e);case nJ.PAGES:return r$().join(this.serverDistDir,"pages",e);case nJ.IMAGE:case nJ.APP_PAGE:case nJ.APP_ROUTE:return r$().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 n8=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class n5{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:a,maxMemoryCacheSize:s,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)n5.debug&&console.log("using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&i&&(n5.debug&&console.log("using filesystem cache handler"),d=n3)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(s=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=a,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new n8.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];a["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=rR(a,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:s,_requestHeaders:a,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nu(e)),a=i?i.revalidate:!n&&1;return"number"==typeof a?1e3*a+t:a}_getPathname(e,t){return t?e:rZ(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(n5.debug&&console.log("lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new tY;return n5.debug&&console.log("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,a=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(a.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(a.decode(e,{stream:!0})))}})),n.push(a.decode());let s=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(s),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 s="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in s&&delete s.traceparent,"tracestate"in s&&delete s.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,s,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,a;let s,o;if(t.kind===nJ.FETCH){let t=w.workUnitAsyncStorage.getStore(),r=t?(0,w.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===nY.FETCH)return{isStale:!1,value:t}}}if(this.disableForTestmode||this.dev&&(t.kind!==nJ.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===nJ.FETCH);let l=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===nJ.FETCH){if(!l)return null;if((null==(i=l.value)?void 0:i.kind)!==nY.FETCH)throw Object.defineProperty(new F(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(a=l.value)?void 0:a.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=z.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 null;let n=t.revalidate||l.value.revalidate,s=(performance.timeOrigin+performance.now()-(l.lastModified||0))/1e3,o=l.value.data;return{isStale:s>n,value:{kind:nY.FETCH,data:o,revalidate:n}}}if((null==l||null==(n=l.value)?void 0:n.kind)===nY.FETCH)throw Object.defineProperty(new F(`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 d=null,u=this.cacheControls.get(nu(e));return(null==l?void 0:l.lastModified)===-1?(s=-1,o=-31536e3):s=!!(!1!==(o=this.calculateRevalidate(e,(null==l?void 0:l.lastModified)||performance.timeOrigin+performance.now(),this.dev??!1,t.isFallback))&&o<performance.timeOrigin+performance.now())||void 0,l&&(d={isStale:s,cacheControl:u,revalidateAfter:o,value:l.value}),!l&&this.prerenderManifest.notFoundRoutes.includes(e)&&(d={isStale:s,value:null,cacheControl:u,revalidateAfter:o},this.set(e,d.value,{...t,cacheControl:u})),d}async set(e,t,r){if((null==t?void 0:t.kind)===nY.FETCH){let r=w.workUnitAsyncStorage.getStore(),n=r?(0,w.getPrerenderResumeDataCache)(r):null;n&&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(nu(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 n6=require("http"),n7=require("https"),ie={existsSync:ea().existsSync,readFile:ea().promises.readFile,readFileSync:ea().readFileSync,writeFile:(e,t)=>ea().promises.writeFile(e,t),mkdir:e=>ea().promises.mkdir(e,{recursive:!0}),stat:e=>ea().promises.stat(e)};class it extends nB().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 ir extends nB().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 tR(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 ii=(e,t)=>{let r=d().isAbsolute(t)?t:d().join(e,t);return(0,u.pathToFileURL)(r).toString()};class ia{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 io(e){return"object"==typeof e&&null!==e&&e.$$typeof===is}class il{async load(e){return await require(e)}}let id=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),iu=Symbol.for("@next/router-server-methods"),ic=globalThis,ih=e=>import(e).then(e=>e.default||e),ip=new WeakMap;class im extends nk{constructor(e){var t,r,n;super(e),this.cleanupListeners=new ia,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||ef(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});em(e,"bubbleNoFallback",void 0),ic[iu]||(ic[iu]={});let a=(0,l.relative)(process.cwd(),this.dir);ic[iu][a]||(ic[iu][a]={render404:this.render404.bind(this)}),ic[iu][a].nextConfig=this.nextConfig;try{var s;n=tS(n);let a={i18n:null==(s=this.i18nProvider)?void 0:s.fromRequest(e,n)},o=await this.matchers.match(n,a);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(em(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[rw];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===rB.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 nR.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=ef(e,"middlewareInvoke");if(!i)return!1;let a=()=>(em(e,"middlewareInvoke",!0),t.body("").send(),!0),s=await this.getMiddleware();if(!s)return a();let o=e0(ef(e,"initURL")),l=tZ(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tS(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(s.match(d,e,o.query)||s.match(u,e,o.query)))return a();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 ez.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tR(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 t3(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rT(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ee)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rO(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=ra(e.page);return{match:eh(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 n6.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new n7.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,l.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),a="NEXT_RUNTIME"===n;if(r||a)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=>{io(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{io(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 nH({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await nH({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled});e.patchFetch();let r=e.__next_app__.require;if(null==r?void 0:r.m)for(let e of Object.keys(r.m))await r(e)}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,id.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,id.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,nW.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:s,t)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nE[nb])return null==nv||nv("cache handlers already initialized"),!1;if(null==nv||nv("initializing cache handlers"),nE[nb]=new Map,nE[n_]){let e;nE[n_].DefaultCache?(null==nv||nv('setting "default" cache handler from symbol'),e=nE[n_].DefaultCache):(null==nv||nv('setting "default" cache handler from default'),e=ny()),nE[nb].set("default",e),nE[n_].RemoteCache?(null==nv||nv('setting "remote" cache handler from symbol'),nE[nb].set("remote",nE[n_].RemoteCache)):(null==nv||nv('setting "remote" cache handler from default'),nE[nb].set("remote",e))}else null==nv||nv('setting "default" cache handler from default'),nE[nb].set("default",ny()),null==nv||nv('setting "remote" cache handler from default'),nE[nb].set("remote",ny());return nE[nx]=new Set(nE[nb].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n$(await ih(ii(this.distDir,n)));if(!nE[nb]||!nE[nx])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nv||nv('setting cache handler for "%s"',r),nE[nb].set(r,t),nE[nx].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n$(await ih(ii(this.distDir,r)))),await this.loadCustomCacheHandlers(),new n5({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 n1(!0)}getPublicDir(){return(0,l.join)(this.dir,"public")}getHasStaticDir(){return ea().existsSync((0,l.join)(this.dir,"static"))}getPagesManifest(){return(0,nI.loadManifest)((0,l.join)(this.serverDistDir,eb))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,nI.loadManifest)((0,l.join)(this.serverDistDir,ex))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rC).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!nj(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,l.join)(this.distDir,"BUILD_ID");try{return ea().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:!!eP(t,"app"),pages:!!eP(t,"pages")}}sendRenderResult(e,t,r){return eY({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=e0(ef(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let a=new il,s=await a.load(n.definition.filename);return em(e.originalRequest,"relativeProjectDir",(0,l.relative)(process.cwd(),this.dir)),em(e.originalRequest,"distDir",this.distDir),await s.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,ez.getTracer)().trace(t0.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 nN(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 a of(n&&(i=t[0]),r))if(a===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:a}){return(0,ez.getTracer)().trace(t0.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?td(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:a}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:a}){let s=[t];for(let a of(r.amp&&s.unshift((i?td(t):rZ(t))+".amp"),e&&s.unshift(...s.map(t=>`/${e}${"/"===t?"":t}`)),s))try{let t=await nH({distDir:this.distDir,page:a,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled});if(e&&"string"==typeof t.Component&&!a.startsWith(`/${e}/`)&&a!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof er))throw e}return null}getNextFontManifest(){return(0,nI.loadManifest)((0,l.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 ie}normalizeReq(e){return e instanceof eX?e:new eX(e)}normalizeRes(e){return e instanceof eB?e:new eB(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:a=null}){return{req:new it({url:e,headers:t,method:r,socket:a,readable:n}),res:new ir({socket:a,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new eX(n.req),new eB(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,a=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,a)}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(ev)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:ev,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,a){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,a)}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:nV((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=ip.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=nV(e.matchers);return ip.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=t6(rZ(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new er(t);return null}return{name:n.name,paths:n.files.map(e=>(0,l.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,l.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,l.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,nI.loadManifest)((0,l.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,ez.getTracer)().trace(t0.getRoutesManifest,()=>(0,nI.loadManifest)((0,l.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",a=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;em(e,"initURL",a),em(e,"initQuery",{...t.query}),em(e,"initProtocol",i),r||em(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 nX.PassThrough,i=new nX.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,l.join)(this.distDir,eE);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 F("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:a=".",quiet:s=!1,conf:o,dev:l=!1,minimalMode:d=!1,hostname:c,port:h,experimentalTestProxy:p}=e;this.experimentalTestProxy=p,this.serverOptions=e,this.dir=r("path").resolve(a),this.quiet=s,this.loadEnvConfig({dev:l}),this.nextConfig=o,this.hostname=c,this.hostname&&(this.fetchHostname=function(e){return to.test(e)?`[${e}]`:e}(this.hostname)),this.port=h,this.distDir=r("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!d&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nr(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rS(this.i18nProvider):void 0;let{serverRuntimeConfig:f={},publicRuntimeConfig:m,assetPrefix:g,generateEtags:y}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=d||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(l),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 ns:void 0,prefetchRSC:this.isAppPPREnabled&&1?new no:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nP:void 0,data:this.enabledDirectories.pages?new nd(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:y,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(n=this.nextConfig.experimental.amp)?void 0:n.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==(i=this.nextConfig.i18n)?void 0:i.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(m).length>0?m: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,devtoolSegmentExplorer:this.nextConfig.experimental.devtoolSegmentExplorer},(0,tg.setConfig)({serverRuntimeConfig:f,publicRuntimeConfig:m}),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(g),this.responseCache=this.getResponseCache({dev:l})}getRouteMatchers(){let e=new nt(e=>{switch(e){case eb:return this.getPagesManifest()??null;case ex:return this.getAppPathsManifest()??null;default:return null}}),t=new rj;return t.push(new ne(this.distDir,e,this.i18nProvider)),t.push(new r5(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new rJ(this.distDir,e)),t.push(new r0(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 nw?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||e8(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,ez.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(tJ.handleRequest,{spanName:`${n} ${e.url}`,kind:ez.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async a=>this.handleRequestImpl(e,t,r).finally(()=>{if(!a)return;let r=ef(e,"isRSCRequest")??!1;a.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(a.setStatus({code:ez.SpanStatusCode.ERROR}),a.setAttribute("error.type",t.statusCode.toString()));let s=i.getRootSpanAttributes();if(!s)return;if(s.get("next.span_type")!==tJ.handleRequest)return void console.warn(`Unexpected root span type '${s.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=s.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;a.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),a.updateName(e)}else a.updateName(r?`RSC ${n} ${e.url}`:`${n} ${e.url}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,a,s,o,l,d,c,h,p=t.originalResponse;let f=p.setHeader.bind(p);p.setHeader=(t,r)=>{if("headersSent"in p&&p.headersSent)return p;if("set-cookie"===t.toLowerCase()){let t=ef(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return f(t,r)};let m=(e.url||"").split("?",1)[0];if(null==m?void 0:m.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,u.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:g=null}=e,y=null==g?void 0:g.headers["x-forwarded-proto"],v=y?"https"===y:!!(null==g||null==(n=g.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():v?"443":"80",e.headers["x-forwarded-proto"]??=v?"https":"http",e.headers["x-forwarded-for"]??=null==g||null==(i=g.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let _=await this.handleRSCRequest(e,t,r);if(_)return;let b=null==(a=this.i18nProvider)?void 0:a.detectDomainLocale(tN(r,e.headers)),x=(null==b?void 0:b.defaultLocale)||(null==(s=this.nextConfig.i18n)?void 0:s.defaultLocale);em(e,"defaultLocale",x);let E=e0(e.url.replace(/^\/+/,"/")),w=tZ(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=tM(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[eA];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[eA]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))em(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");em(e,"postponed",r)}n=this.normalize(n);let a=this.stripNextDataPath(i);n=t6(n);let s=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});s&&(em(e,"locale",s.detectedLocale),s.inferredFromDefault?em(e,"localeInferredFromDefault",!0):eg(e,"localeInferredFromDefault"));let u=n,h=tm(u),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(u,{i18n:s});e&&(u=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}s&&(n=s.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:a,caseSensitive:s}){let o,l,d;return i&&(d=(l=eh(o=function(e,t){var r,n,i;let a=function(e,t,r,n,i){let a,s=(a=0,()=>{let e="",t=++a;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let a of tS(e).slice(1).split("/")){let e=tc.some(e=>a.startsWith(e)),d=a.match(rn);if(e&&d&&d[2])l.push(rs({getSafeRouteKey:s,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?eI:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rr(d[1]));let e=rs({getSafeRouteKey:s,segment:d[2],routeKeys:o,keyPrefix:t?ek:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rr(a));r&&d&&d[3]&&l.push(rr(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),s=a.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(s+="(?:/)?"),{...ra(e,t),namedRegex:"^"+s+"$",routeKeys:a.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=t7(n.source+(a?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!s});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rl(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rC(n)){let e=o.headers[rv];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),a=i?t[1]:t;!a||a.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,rh.assert)(t,rg),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:a,destQuery:s}=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(":"+rr(n),"g"),"__ESC_COLON_"+n)}let n=e0(t),i=n.pathname;i&&(i=ro(i));let a=n.href;a&&(a=ro(a));let s=n.hostname;s&&(s=ro(s));let o=n.hash;o&&(o=ro(o));let l=n.search;l&&(l=ro(l));let d=n.origin;return d&&(d=ro(d)),{...n,pathname:i,hostname:s,href:a,hash:o,search:l,origin:d}}(e),{hostname:i,query:a,search:s}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(eu(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(eu(i,e),e))l.push(t.name)}let u=ec(o,{validate:!1});for(let[r,n]of(i&&(t=ec(i,{validate:!1})),Object.entries(a)))Array.isArray(n)?a[r]=n.map(t=>rd(ro(t),e.params)):"string"==typeof n&&(a[r]=rd(ro(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 a||(a[t]=e.params[t]);if(th(o))for(let t of o.split("/")){let r=tc.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,a]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(a?"#":"")+(a||""),n.search=s?rd(s,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:a,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(a.protocol)return!0;if(Object.assign(u,s,p),Object.assign(d.query,a.query),delete a.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,a),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t$(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=tS(c||"");return t===tS(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=tO(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>ru(e)):ru(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eh({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tO(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let a=r[e];if(!a)continue;let s=t[a],o=n[e];if(!s.optional&&!o)return null;i[s.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 a of Object.keys(r.groups)){let s=e[a];"string"==typeof s?s=tu(s):Array.isArray(s)&&(s=s.map(tu));let o=n[a],l=r.groups[a].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(s)?s.some(t=>t.includes(e)):null==s?void 0:s.includes(e)):null==s?void 0:s.includes(o))||void 0===s&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!s||Array.isArray(s)&&1===s.length&&("index"===s[0]||s[0]===`[[...${a}]]`))&&(s=void 0,delete e[a]),s&&"string"==typeof s&&r.groups[a].repeat&&(s=s.split("/")),s&&(i[a]=s)}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,rP(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",a=e.hash||"",s=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)),s&&"object"==typeof s&&(s=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,eQ(e));else t.set(r,eQ(n));return t}(s)));let l=e.search||s&&"?"+s||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rc.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),a&&"#"!==a[0]&&(a="#"+a),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+a}(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:a,repeat:s}=r.groups[n],o=`[${s?"...":""}${n}]`;a&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||a)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rP(e,t)}}({pageIsDynamic:h,page:u,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&&em(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tO(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(v[n]=Array.isArray(t)?t.map(e=>ru(e)):ru(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(v,!1)),!p.hasValidParams&&!tm(a)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,a);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&&a===u&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&em(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(u,t),e.url=f.interpolateDynamicPath(e.url,t);let r=ef(e,"segmentPrefetchRSCRequest");r&&tm(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rb]=r,em(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(c=f.defaultRouteRegex)?void 0:c.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 ee||r instanceof et)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(em(e,"isLocaleDomain",!!b),w.locale&&(e.url=(0,u.format)(E),em(e,"didStripLocale",!0)),!ef(e,"locale")&&(w.locale?em(e,"locale",w.locale):x&&(em(e,"locale",x),em(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!ef(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),em(e,"incrementalCache",t),globalThis.__incrementalCache=t}let P=function(){if(nE[nx])return nE[nx].values()}();P&&await Promise.all([...P].map(async t=>{if("refreshTags"in t);else{let r=rR(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),ef(e,"serverComponentsHmrCache")||em(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let R=ef(e,"invokePath");if(!C&&R){let n=ef(e,"invokeStatus");if(n){let i=ef(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let a=ef(e,"invokeError")||null;return this.renderError(a,e,t,"/_error",r.query)}let i=new URL(R||"/","http://n"),a=tZ(i.pathname,{nextConfig:this.nextConfig,parseData:!1});a.locale&&em(e,"locale",a.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,em(e,"rewroteURL",a.pathname));let s=t$(tM(r.pathname,this.nextConfig.basePath||""),null==(h=this.nextConfig.i18n)?void 0:h.locales);for(let t of(s.detectedLocale&&em(e,"locale",s.detectedLocale),r.pathname=s.pathname,Object.keys(r.query)))delete r.query[t];let o=ef(e,"invokeQuery");if(o&&Object.assign(r.query,o),_=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(ef(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=tM(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nR.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ee||r instanceof et)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[ep]=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=td(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,ez.getTracer)().trace(tJ.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,ez.getTracer)().trace(tJ.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||t_,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:a,res:s}=n,o=s.statusCode,{body:l}=i,{cacheControl:d}=i;if(!s.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(s.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(a,s,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),s.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,a=!1){return(0,ez.getTracer)().trace(tJ.render,async()=>this.renderImpl(e,t,r,n,i,a))}getWaitUntil(){let e=function(){let e=globalThis[nc];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,a=!1){var s;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 tv.test(e)?"dom":ty.test(e)?"html":void 0}(o),(s=r,ew.includes(s))?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,ez.getTracer)().trace(tJ.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return th(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rv}, ${r_}, ${rb}`,a=ef(e,"isRSCRequest")??!1,s=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rx}`),s=!0):(r||a)&&t.appendHeader("vary",i),s||delete e.headers[rx]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:a}){var s,o,l,d,c,h;let p,f;r===ey&&(r="/404");let m="/_error"===r,g="/404"===r||m&&404===t.statusCode,y="/500"===r||m&&500===t.statusCode,v=!0===i.isAppPath,_=!!i.getServerSideProps,b=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(ry)??null,r=e.headers.get("content-type")):(t=e.headers[ry]??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"))),a=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:a,isPossibleServerAction:!!(a||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=ef(e,"isRSCRequest")??!1,w=(0,u.parse)(e.url||"").pathname||"/",C=ef(e,"rewroteURL")||w;this.setVaryHeader(e,t,v,C);let P=this.getPrerenderManifest();(null==p?void 0:p.includes(C))||e.headers["x-now-route-matches"]?x=!0:x||=!!P.routes[nu(r)];let R=!!(ef(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||_);if(!x&&e.headers["x-middleware-prefetch"]&&!(g||"/_error"===r))return t.setHeader(eA,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[eA]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=ef(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(f=i.routeModule);let O=this.isAppPPREnabled&&void 0!==f&&f.definition.kind===rB.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==a.__nextppronly&&O,k=O&&((null==(s=P.routes[r]??P.dynamicRoutes[r])?void 0:s.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?ef(e,"postponed"):void 0;if(!g||R||E||(t.statusCode=404),eC.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!b&&!k&&!g&&!y&&"/_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:t8.fromStatic(i.Component,eS)};if("amp"in a&&!a.amp&&delete a.amp,!0===n.supportsDynamicResponse){let t=(c=d=e.headers["user-agent"]||"",tv.test(c)||ty.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!a.amp&&r}if(!R&&v&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[eA]&&(C=w),w=tS(w),C=tS(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),R&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==f?void 0:f.isDev)&&tm(r)&&(i.getStaticPaths||v)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.page,isAppPath:v});if(v&&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&&em(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}%%`,nO[i]]);return r}(r))}}if("OPTIONS"===e.method&&!g&&(!f||f.definition.kind!==rB.APP_ROUTE))return await nn(e,t,new Response(null,{status:400})),null;let I=e.originalRequest,A=t.originalResponse,j=(0,u.parse)(ef(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));m||(I.url=`${N}${j.search||""}`),h=ef(e),I[ep]=h,em(I,"distDir",this.distDir),em(I,"query",a),em(I,"params",n.params),em(I,"ampValidator",this.renderOpts.ampValidator),em(I,"minimalMode",!0),n.err&&em(I,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(I,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=t6(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,a=this.getOriginalAppPaths(i),s=Array.isArray(a),o=i;s&&(o=a[a.length-1]);let l=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:s,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:a,shouldEnsure:!1});if(l){(0,ez.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nR.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,ez.getTracer)().trace(tJ.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:a}=e,s=ef(e.req,"bubbleNoFallback")??!1;delete i[rw];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,a)};try{for await(let t of this.matchers.matchAll(a,o)){ef(e.req,"invokeOutput");let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},s);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,s);if(!1!==t)return t}}catch(i){let t=rO(i);if(i instanceof en)throw console.error("Invariant: failed to load static page",JSON.stringify({page:a,url:e.req.url,matchedPath:e.req.headers[eA],initUrl:ef(e.req,"initURL"),didRewrite:!!ef(e.req,"rewroteURL"),rewroteUrl:ef(e.req,"rewroteURL")},null,2)),t;if(t instanceof nR.NoFallbackError&&s)throw t;if(t instanceof ee||t instanceof et)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(em(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eg(e.req,"customErrorRender"));let r=t instanceof nS;if(!r)throw rT(t)&&(t.page=a),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=ef(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${a}`),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,ez.getTracer)().trace(tJ.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={},a=!0){return(0,ez.getTracer)().trace(tJ.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,a))}async renderErrorImpl(e,t,r,n,i={},a=!0){return a&&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,ez.getTracer)().trace(tJ.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,a=404===r.statusCode,s=this.enabledDirectories.app;a&&(s&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:ev,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!ef(e.req,"customErrorRender")&&!i&&eC.includes(o)&&(!i&&s&&(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:ef(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:ef(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nS(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?em(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eg(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nR.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(s){let t=rO(s),i=t instanceof nS;i||this.logError(t),r.statusCode=500;let a=await this.getFallbackErrorComponents(e.req.url);if(a)return em(e.req,"match",{definition:a.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:a});return{body:t8.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:a}=r||(0,u.parse)(e.url,!0);return this.nextConfig.i18n&&(ef(e,"locale")||em(e,"locale",this.nextConfig.i18n.defaultLocale),em(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,a,n)}}let nI=require("next/dist/server/load-manifest.external.js"),nA=new f(1e3);function nj(e,t,r,n){let i,a=`${e}:${t}:${r}:${n}`,s=null==nA?void 0:nA.get(a);if(s)return s;let o=d().join(t,eE);n&&(i=(0,nI.loadManifest)(d().join(o,ex),!0));let l=(0,nI.loadManifest)(d().join(o,eb),!0);try{e=t6(rZ(e))}catch(t){throw console.error(t),new er(e)}let u=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t$(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(s=u(i)),s||(s=u(l)),s)?(d().isAbsolute(s)||(s=d().join(o,s)),null==nA||nA.set(a,s),s):(null==nA||nA.set(a,null),null)}function nN(e,t,r,n){let i=nj(e,t,r,n);if(!i)throw new er(e);return i}async function nD(e,t,r){let n=nN(e,t,void 0,r);return n.endsWith(".html")?ei.promises.readFile(n,"utf8").catch(t=>{throw new en(e,t.message)}):require(n)}function n$(e){return e.default||e}async function nM(e){return new Promise(t=>setTimeout(t,e))}let nZ=Symbol.for("next.server.action-manifests");async function nL(e,t=3){for(;;)try{return(0,nI.loadManifest)(e)}catch(e){if(--t<=0)throw e;await nM(100)}}async function nq(e,t=3){try{return await nL(e,t)}catch(e){return}}async function nz(e,t=3){for(;;)try{return(0,nI.evalManifest)(e)}catch(e){if(--t<=0)throw e;await nM(100)}}async function nU(e,t,r){try{return(await nz(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function nF({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i}){let a,s={},o={};r||([s,o]=await Promise.all([nD("/_document",e,!1),nD("/_app",e,!1)]));let d=n?3:1;a=(0,l.join)(e,"react-loadable-manifest.json");let u=!function(e){let t=e.replace(/\/route$/,"");return rU(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,a=[RegExp(`^[\\\\/]robots${rH(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${rH(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${rH(["xml"],t)}${n}`),RegExp(`[\\\\/]${rF.icon.filename}${i}${rH(rF.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.apple.filename}${i}${rH(rF.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.openGraph.filename}${i}${rH(rF.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${rF.twitter.filename}${i}${rH(rF.twitter.extensions,t)}${n}`)],s=t5(e);return a.some(e=>e.test(s))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[c,h,p,f,m,g]=await Promise.all([nL((0,l.join)(e,"build-manifest.json"),d),nq(a,d),r||0?void 0:nL((0,l.join)(e,"dynamic-css-manifest.json"),d).catch(()=>void 0),r&&u?nU((0,l.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),d):void 0,r?nL((0,l.join)(e,"server","server-reference-manifest.json"),d).catch(()=>null):null,i?nL((0,l.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);m&&f&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let a=null==(i=globalThis[nZ])?void 0:i.clientReferenceManifestsPerPage;globalThis[nZ]={clientReferenceManifestsPerPage:{...a,[td(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:f,serverActionsManifest:m,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,a;let s,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=z.workAsyncStorage.getStore();if(!(s=l?o[tj(a=l.page,"app")?a:"app"+a]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=s;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:m})});let y=await nD(t,e,r),v=n$(y),_=n$(s),b=n$(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=y;return{App:b,Document:_,Component:v,buildManifest:c,subresourceIntegrityManifest:g,reactLoadableManifest:h||{},dynamicCssManifest:p,pageConfig:y.config||{},ComponentMod:y,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:f,serverActionsManifest:m,isAppPath:r,page:t,routeModule:C}}let nH=(0,ez.getTracer)().wrap(tQ.loadComponents,nF);function nV(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rl(r,n,i.has,i.missing))continue;return!0}return!1}}var nW=r("../next-env/dist/index.js");let nX=require("stream");var nB=r.n(nX);class nG{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new nG(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(r,Promise.resolve);let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:a,reject:s}=new tY;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let e=await t(r,a);a(e)}catch(e){s(e)}finally{this.pending.delete(r)}}),i}}let nK=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var nY=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}({}),nJ=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 nQ(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===nY.PAGES?{kind:nY.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)===nY.APP_PAGE?{kind:nY.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 n0(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===nY.PAGES?{kind:nY.PAGES,html:t8.fromStatic(e.value.html,eS),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===nY.APP_PAGE?{kind:nY.APP_PAGE,html:t8.fromStatic(e.value.html,eS),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class n1{constructor(e){this.batcher=nG.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:nK}),this.minimal_mode=e}async get(e,t,r){if(!e)return t({hasResolved:!1,previousCacheEntry:null});let{incrementalCache:n,isOnDemandRevalidate:i=!1,isFallback:a=!1,isRoutePPREnabled:s=!1,waitUntil:o}=r,l=await this.batcher.batch({key:e,isOnDemandRevalidate:i},(l,d)=>{let u=(async()=>{var o;if(this.minimal_mode&&(null==(o=this.previousCacheItem)?void 0:o.key)===l&&this.previousCacheItem.expiresAt>Date.now())return this.previousCacheItem.entry;let u=function(e){switch(e){case rB.PAGES:return nJ.PAGES;case rB.APP_PAGE:return nJ.APP_PAGE;case rB.IMAGE:return nJ.IMAGE;case rB.APP_ROUTE:return nJ.APP_ROUTE;case rB.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),c=!1,h=null;try{if((h=this.minimal_mode?null:await n.get(e,{kind:u,isRoutePPREnabled:r.isRoutePPREnabled,isFallback:a}))&&!i&&(d(h),c=!0,!h.isStale||r.isPrefetch))return null;let o=await t({hasResolved:c,previousCacheEntry:h,isRevalidating:!0});if(!o)return this.minimal_mode&&(this.previousCacheItem=void 0),null;let p=await nQ({...o,isMiss:!h});if(!p)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return i||c||(d(p),c=!0),p.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:l,entry:p,expiresAt:Date.now()+1e3}:await n.set(e,p.value,{cacheControl:p.cacheControl,isRoutePPREnabled:s,isFallback:a})),p}catch(t){if(null==h?void 0:h.cacheControl){let t=Math.min(Math.max(h.cacheControl.revalidate||3,3),30),r=void 0===h.cacheControl.expire?void 0:Math.max(t+3,h.cacheControl.expire);await n.set(e,h.value,{cacheControl:{revalidate:t,expire:r},isRoutePPREnabled:s,isFallback:a})}if(c)return console.error(t),null;throw t}})();return o&&o(u),u});return n0(l)}}let n4=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class n2{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(r$().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 n9=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class n3{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?n3.memoryCache?n3.debug&&console.log("memory store already initialized"):(n3.debug&&console.log("using memory store for fetch cache"),n3.memoryCache=(0,n9.getMemoryCache)(e.maxMemoryCacheSize)):n3.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,n3.debug&&console.log("revalidateTag",t),0!==t.length)for(let e of t)n4.tagsManifest.has(e)||n4.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,a,s,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=n3.memoryCache)?void 0:t.get(u);if(n3.debug&&(h===nJ.FETCH?console.log("get",u,c.tags,h,!!p):console.log("get",u,h,!!p)),!p)try{if(h===nJ.APP_ROUTE){let e=this.getFilePath(`${u}.body`,nJ.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$/,eZ),"utf8"));p={lastModified:r.getTime(),value:{kind:nY.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===nJ.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===nJ.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let a=r.getTime(),l=JSON.parse(t);if(p={lastModified:a,value:l},(null==(s=p.value)?void 0:s.kind)===nY.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)))||(n3.debug&&console.log("tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===nJ.APP_PAGE){let n,i,a;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,eZ),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+eN;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+eD,nJ.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(a=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?ej:e$}`,nJ.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:nY.APP_PAGE,html:t,rscData:a,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===nJ.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${eM}`,nJ.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:nY.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=n3.memoryCache)||l.set(u,p))}catch{return null}if((null==p||null==(r=p.value)?void 0:r.kind)===nY.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===nY.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===nY.PAGES){let e,t=null==(d=p.value.headers)?void 0:d["x-next-cache-tags"];if("string"==typeof t&&(e=t.split(",")),(null==e?void 0:e.length)&&(0,n4.isStale)(e,(null==p?void 0:p.lastModified)||Date.now()))return null}else(null==p||null==(a=p.value)?void 0:a.kind)===nY.FETCH&&(c.kind===nJ.FETCH?[...c.tags||[],...c.softTags||[]]:[]).some(e=>!!this.revalidatedTags.includes(e)||(0,n4.isStale)([e],(null==p?void 0:p.lastModified)||Date.now()))&&(p=void 0);return p??null}async set(e,t,r){var n;if(null==(n=n3.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),n3.debug&&console.log("set",e),!this.flushToDisk||!t)return;let i=new n2(this.fs);if(t.kind===nY.APP_ROUTE){let r=this.getFilePath(`${e}.body`,nJ.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$/,eZ),JSON.stringify(n,null,2))}else if(t.kind===nY.PAGES||t.kind===nY.APP_PAGE){let n=t.kind===nY.APP_PAGE,a=this.getFilePath(`${e}.html`,n?nJ.APP_PAGE:nJ.PAGES);if(i.append(a,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?ej:e$:eM}`,n?nJ.APP_PAGE:nJ.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===nY.APP_PAGE){let e;if(t.segmentData){e=[];let r=a.replace(/\.html$/,eN);for(let[n,a]of t.segmentData){e.push(n);let t=r+n+eD;i.append(t,a)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(a.replace(/\.html$/,eZ),JSON.stringify(r))}}else if(t.kind===nY.FETCH){let n=this.getFilePath(e,nJ.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case nJ.FETCH:return r$().join(this.serverDistDir,"..","cache","fetch-cache",e);case nJ.PAGES:return r$().join(this.serverDistDir,"pages",e);case nJ.IMAGE:case nJ.APP_PAGE:case nJ.APP_ROUTE:return r$().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 n8=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class n5{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:a,maxMemoryCacheSize:s,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)n5.debug&&console.log("using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&i&&(n5.debug&&console.log("using filesystem cache handler"),d=n3)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(s=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=a,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new n8.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];a["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=rR(a,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:s,_requestHeaders:a,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nu(e)),a=i?i.revalidate:!n&&1;return"number"==typeof a?1e3*a+t:a}_getPathname(e,t){return t?e:rZ(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(n5.debug&&console.log("lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new tY;return n5.debug&&console.log("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,a=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(a.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(a.decode(e,{stream:!0})))}})),n.push(a.decode());let s=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(s),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 s="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in s&&delete s.traceparent,"tracestate"in s&&delete s.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,s,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,a;let s,o;if(t.kind===nJ.FETCH){let t=w.workUnitAsyncStorage.getStore(),r=t?(0,w.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===nY.FETCH)return{isStale:!1,value:t}}}if(this.disableForTestmode||this.dev&&(t.kind!==nJ.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===nJ.FETCH);let l=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===nJ.FETCH){if(!l)return null;if((null==(i=l.value)?void 0:i.kind)!==nY.FETCH)throw Object.defineProperty(new F(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(a=l.value)?void 0:a.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=z.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 null;let n=t.revalidate||l.value.revalidate,s=(performance.timeOrigin+performance.now()-(l.lastModified||0))/1e3,o=l.value.data;return{isStale:s>n,value:{kind:nY.FETCH,data:o,revalidate:n}}}if((null==l||null==(n=l.value)?void 0:n.kind)===nY.FETCH)throw Object.defineProperty(new F(`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 d=null,u=this.cacheControls.get(nu(e));return(null==l?void 0:l.lastModified)===-1?(s=-1,o=-31536e3):s=!!(!1!==(o=this.calculateRevalidate(e,(null==l?void 0:l.lastModified)||performance.timeOrigin+performance.now(),this.dev??!1,t.isFallback))&&o<performance.timeOrigin+performance.now())||void 0,l&&(d={isStale:s,cacheControl:u,revalidateAfter:o,value:l.value}),!l&&this.prerenderManifest.notFoundRoutes.includes(e)&&(d={isStale:s,value:null,cacheControl:u,revalidateAfter:o},this.set(e,d.value,{...t,cacheControl:u})),d}async set(e,t,r){if((null==t?void 0:t.kind)===nY.FETCH){let r=w.workUnitAsyncStorage.getStore(),n=r?(0,w.getPrerenderResumeDataCache)(r):null;n&&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(nu(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 n6=require("http"),n7=require("https"),ie={existsSync:ea().existsSync,readFile:ea().promises.readFile,readFileSync:ea().readFileSync,writeFile:(e,t)=>ea().promises.writeFile(e,t),mkdir:e=>ea().promises.mkdir(e,{recursive:!0}),stat:e=>ea().promises.stat(e)};class it extends nB().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 ir extends nB().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 tR(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 ii=(e,t)=>{let r=d().isAbsolute(t)?t:d().join(e,t);return(0,u.pathToFileURL)(r).toString()};class ia{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 io(e){return"object"==typeof e&&null!==e&&e.$$typeof===is}class il{async load(e){return await require(e)}}let id=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),iu=Symbol.for("@next/router-server-methods"),ic=globalThis,ih=e=>import(e).then(e=>e.default||e),ip=new WeakMap;class im extends nk{constructor(e){var t,r,n;super(e),this.cleanupListeners=new ia,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||ef(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});em(e,"bubbleNoFallback",void 0),ic[iu]||(ic[iu]={});let a=(0,l.relative)(process.cwd(),this.dir);ic[iu][a]||(ic[iu][a]={render404:this.render404.bind(this)}),ic[iu][a].nextConfig=this.nextConfig;try{var s;n=tS(n);let a={i18n:null==(s=this.i18nProvider)?void 0:s.fromRequest(e,n)},o=await this.matchers.match(n,a);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(em(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[rw];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===rB.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 nR.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=ef(e,"middlewareInvoke");if(!i)return!1;let a=()=>(em(e,"middlewareInvoke",!0),t.body("").send(),!0),s=await this.getMiddleware();if(!s)return a();let o=e0(ef(e,"initURL")),l=tZ(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tS(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(s.match(d,e,o.query)||s.match(u,e,o.query)))return a();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 ez.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tR(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 t3(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rT(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ee)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rO(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=ra(e.page);return{match:eh(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 n6.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new n7.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,l.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),a="NEXT_RUNTIME"===n;if(r||a)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=>{io(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{io(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 nH({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await nH({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled});e.patchFetch()}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,id.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,id.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,nW.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:s,t)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nE[nb])return null==nv||nv("cache handlers already initialized"),!1;if(null==nv||nv("initializing cache handlers"),nE[nb]=new Map,nE[n_]){let e;nE[n_].DefaultCache?(null==nv||nv('setting "default" cache handler from symbol'),e=nE[n_].DefaultCache):(null==nv||nv('setting "default" cache handler from default'),e=ny()),nE[nb].set("default",e),nE[n_].RemoteCache?(null==nv||nv('setting "remote" cache handler from symbol'),nE[nb].set("remote",nE[n_].RemoteCache)):(null==nv||nv('setting "remote" cache handler from default'),nE[nb].set("remote",e))}else null==nv||nv('setting "default" cache handler from default'),nE[nb].set("default",ny()),null==nv||nv('setting "remote" cache handler from default'),nE[nb].set("remote",ny());return nE[nx]=new Set(nE[nb].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n$(await ih(ii(this.distDir,n)));if(!nE[nb]||!nE[nx])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nv||nv('setting cache handler for "%s"',r),nE[nb].set(r,t),nE[nx].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n$(await ih(ii(this.distDir,r)))),await this.loadCustomCacheHandlers(),new n5({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 n1(!0)}getPublicDir(){return(0,l.join)(this.dir,"public")}getHasStaticDir(){return ea().existsSync((0,l.join)(this.dir,"static"))}getPagesManifest(){return(0,nI.loadManifest)((0,l.join)(this.serverDistDir,eb))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,nI.loadManifest)((0,l.join)(this.serverDistDir,ex))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rC).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!nj(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,l.join)(this.distDir,"BUILD_ID");try{return ea().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:!!eP(t,"app"),pages:!!eP(t,"pages")}}sendRenderResult(e,t,r){return eY({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=e0(ef(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let a=new il,s=await a.load(n.definition.filename);return em(e.originalRequest,"relativeProjectDir",(0,l.relative)(process.cwd(),this.dir)),em(e.originalRequest,"distDir",this.distDir),await s.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,ez.getTracer)().trace(t0.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 nN(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 a of(n&&(i=t[0]),r))if(a===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:a}){return(0,ez.getTracer)().trace(t0.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?td(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:a}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:a}){let s=[t];for(let a of(r.amp&&s.unshift((i?td(t):rZ(t))+".amp"),e&&s.unshift(...s.map(t=>`/${e}${"/"===t?"":t}`)),s))try{let t=await nH({distDir:this.distDir,page:a,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled});if(e&&"string"==typeof t.Component&&!a.startsWith(`/${e}/`)&&a!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof er))throw e}return null}getNextFontManifest(){return(0,nI.loadManifest)((0,l.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 ie}normalizeReq(e){return e instanceof eX?e:new eX(e)}normalizeRes(e){return e instanceof eB?e:new eB(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:a=null}){return{req:new it({url:e,headers:t,method:r,socket:a,readable:n}),res:new ir({socket:a,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new eX(n.req),new eB(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,a=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,a)}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(ev)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:ev,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,a){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,a)}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:nV((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=ip.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=nV(e.matchers);return ip.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=t6(rZ(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new er(t);return null}return{name:n.name,paths:n.files.map(e=>(0,l.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,l.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,l.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,nI.loadManifest)((0,l.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,ez.getTracer)().trace(t0.getRoutesManifest,()=>(0,nI.loadManifest)((0,l.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",a=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;em(e,"initURL",a),em(e,"initQuery",{...t.query}),em(e,"initProtocol",i),r||em(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 nX.PassThrough,i=new nX.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,l.join)(this.distDir,eE);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 F("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