next 16.0.1-canary.1 → 16.0.1-canary.2

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 (34) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +3 -3
  3. package/dist/build/static-paths/app.d.ts +13 -12
  4. package/dist/build/static-paths/app.js +121 -57
  5. package/dist/build/static-paths/app.js.map +1 -1
  6. package/dist/build/swc/index.js +1 -1
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/client/app-bootstrap.js +1 -1
  9. package/dist/client/index.js +1 -1
  10. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  11. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  12. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  13. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  14. package/dist/esm/build/index.js +3 -3
  15. package/dist/esm/build/static-paths/app.js +131 -64
  16. package/dist/esm/build/static-paths/app.js.map +1 -1
  17. package/dist/esm/build/swc/index.js +1 -1
  18. package/dist/esm/build/webpack-config.js +2 -2
  19. package/dist/esm/client/app-bootstrap.js +1 -1
  20. package/dist/esm/client/index.js +1 -1
  21. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  22. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  23. package/dist/esm/server/lib/app-info-log.js +1 -1
  24. package/dist/esm/server/lib/start-server.js +1 -1
  25. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  26. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  27. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  28. package/dist/server/lib/app-info-log.js +1 -1
  29. package/dist/server/lib/start-server.js +1 -1
  30. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  31. package/dist/telemetry/anonymous-meta.js +1 -1
  32. package/dist/telemetry/events/session-stopped.js +2 -2
  33. package/dist/telemetry/events/version.js +2 -2
  34. package/package.json +15 -15
@@ -16,5 +16,5 @@ ${v}`,i=Math.min(c.length,p),a=0;for(;a<i-1;a++){let t=e(String(a),c[a],m,g,v);r
16
16
  ${t}`,m.pop(),`[${r}]`}let i=Object.keys(c),y=i.length;if(0===y)return"{}";if(f<m.length+1)return'"[Object]"';v+=g;let b=`,
17
17
  ${v}`,E="",x="",w=Math.min(y,p);l(c)&&(E+=u(c,b,p),i=i.slice(c.length),w-=c.length,x=b),o&&(i=s(i,h)),m.push(c);for(let t=0;t<w;t++){let r=i[t],n=e(r,c[r],m,g,v);void 0!==n&&(E+=`${x}${a(r)}: ${n}`,x=b)}return y>p&&(E+=`${x}"...": "${d(y-p)} not stringified"`,x=b),""!==x&&(E=`
18
18
  ${v}${E}
19
- ${t}`),m.pop(),`{${E}}`}case"number":return isFinite(c)?String(c):t?t(c):"null";case"boolean":return!0===c?"true":"false";case"undefined":return;case"bigint":if(i)return String(c);default:return t?t(c):void 0}}("",e,[],m,"")}return function e(r,c,m){switch(typeof c){case"string":return a(c);case"object":{if(null===c)return"null";if("function"==typeof c.toJSON){if("object"!=typeof(c=c.toJSON(r)))return e(r,c,m);if(null===c)return"null"}if(-1!==m.indexOf(c))return n;let t="",i=void 0!==c.length;if(i&&Array.isArray(c)){if(0===c.length)return"[]";if(f<m.length+1)return'"[Array]"';m.push(c);let r=Math.min(c.length,p),n=0;for(;n<r-1;n++){let r=e(String(n),c[n],m);t+=void 0!==r?r:"null",t+=","}let i=e(String(n),c[n],m);if(t+=void 0!==i?i:"null",c.length-1>p){let e=c.length-p-1;t+=`,"... ${d(e)} not stringified"`}return m.pop(),`[${t}]`}let g=Object.keys(c),v=g.length;if(0===v)return"{}";if(f<m.length+1)return'"[Object]"';let y="",b=Math.min(v,p);i&&l(c)&&(t+=u(c,",",p),g=g.slice(c.length),b-=c.length,y=","),o&&(g=s(g,h)),m.push(c);for(let r=0;r<b;r++){let n=g[r],i=e(n,c[n],m);void 0!==i&&(t+=`${y}${a(n)}:${i}`,y=",")}return v>p&&(t+=`${y}"...":"${d(v-p)} not stringified"`),m.pop(),`{${t}}`}case"number":return isFinite(c)?String(c):t?t(c):"null";case"boolean":return!0===c?"true":"false";case"undefined":return;case"bigint":if(i)return String(c);default:return t?t(c):void 0}}("",e,[])}}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}},s=!0;try{t[e](a,a.exports,n),s=!1}finally{s&&delete r[e]}return a.exports}n.ab=__dirname+"/",e.exports=n(879)}()},"./dist/esm/lib/constants.js":function(e,t,r){"use strict";r.d(t,{AA:()=>a,EP:()=>p,RM:()=>h,U2:()=>i,VC:()=>m,c1:()=>v,h:()=>s,j9:()=>n,kz:()=>o,mH:()=>c,pu:()=>u,qF:()=>y,r4:()=>l,tz:()=>d,vS:()=>g,x3:()=>f});let n="text/html; charset=utf-8",i="application/json; charset=utf-8",a="nxtP",s="nxtI",o="x-prerender-revalidate",l="x-prerender-revalidate-if-generated",u=".prefetch.rsc",c=".segments",d=".segment.rsc",h=".rsc",f=".json",p=".meta",m="x-next-cache-tags",g="x-next-revalidated-tags",v="x-next-revalidate-tag-token",y=31536e3,b={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"};({...b,GROUP:{builtinReact:[b.reactServerComponents,b.actionBrowser],serverOnly:[b.reactServerComponents,b.actionBrowser,b.instrument,b.middleware],neutralTarget:[b.apiNode,b.apiEdge],clientOnly:[b.serverSideRendering,b.appPagesBrowser],bundled:[b.reactServerComponents,b.actionBrowser,b.serverSideRendering,b.appPagesBrowser,b.shared,b.instrument,b.middleware],appPages:[b.reactServerComponents,b.serverSideRendering,b.appPagesBrowser,b.actionBrowser]}})},"./dist/esm/lib/format-dynamic-import-path.js":function(e,t,r){"use strict";r.r(t),r.d(t,{formatDynamicImportPath:()=>s});var n=r("path"),i=r.n(n);let a=require("url"),s=(e,t)=>{let r=i().isAbsolute(t)?t:i().join(e,t);return(0,a.pathToFileURL)(r).toString()}},"./dist/esm/server/api-utils/index.js":function(e,t,r){"use strict";r.d(t,{C4:()=>b,Gx:()=>c,Ic:()=>d,PW:()=>p,Uc:()=>h,V2:()=>u,cD:()=>l,hD:()=>v,l0:()=>o,n4:()=>y,wE:()=>g,wX:()=>f});var n=r("./dist/esm/server/web/spec-extension/adapters/headers.js"),i=r("./dist/esm/lib/constants.js"),a=r("./lib/trace/tracer"),s=r("./dist/esm/server/lib/trace/constants.js");function o(e,t){return(...r)=>((0,a.getTracer)().setRootSpanAttribute("next.route",e),(0,a.getTracer)().trace(s.fP.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r)))}function l(e,t){return e.statusCode=t,e}function u(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw Object.defineProperty(Error("Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination')."),"__NEXT_ERROR_CODE",{value:"E389",enumerable:!1,configurable:!0});return e.writeHead(t,{Location:r}),e.write(r),e.end(),e}function c(e,t){let r=n.o.from(e.headers);return{isOnDemandRevalidate:r.get(i.kz)===t.previewModeId,revalidateOnlyGenerated:r.has(i.r4)}}let d="__prerender_bypass",h="__next_preview_data",f=4194304,p=Symbol(h),m=Symbol(d);function g(e,t={}){if(m in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],n(d,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(h,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,m,{value:!0,enumerable:!1}),e}class v extends Error{constructor(e,t){super(t),this.statusCode=e}}function y(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function b({req:e},t,r){let n={configurable:!0,enumerable:!0},i={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...i,value:n}),n},set:r=>{Object.defineProperty(e,t,{...i,value:r})}})}},"./dist/esm/server/api-utils/node/try-get-preview-data.js":function(e,t,r){"use strict";r.r(t),r.d(t,{tryGetPreviewData:()=>s});var n=r("./dist/esm/server/api-utils/index.js"),i=r("./dist/esm/server/web/spec-extension/cookies.js"),a=r("./dist/esm/server/web/spec-extension/adapters/headers.js");function s(e,t,s,o){var l,u;let c;if(s&&(0,n.Gx)(e,s).isOnDemandRevalidate)return!1;if(n.PW in e)return e[n.PW];let d=a.o.from(e.headers),h=new i.tm(d),f=null==(l=h.get(n.Ic))?void 0:l.value,p=null==(u=h.get(n.Uc))?void 0:u.value;if(f&&!p&&f===s.previewModeId){let t={};return Object.defineProperty(e,n.PW,{value:t,enumerable:!1}),t}if(!f&&!p)return!1;if(!f||!p||f!==s.previewModeId)return o||(0,n.wE)(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(p,s.previewModeSigningKey)}catch{return(0,n.wE)(t),!1}let{decryptWithSecret:m}=r("./dist/esm/server/crypto-utils.js"),g=m(Buffer.from(s.previewModeEncryptionKey),c.data);try{let t=JSON.parse(g);return Object.defineProperty(e,n.PW,{value:t,enumerable:!1}),t}catch{return!1}}},"./dist/esm/server/crypto-utils.js":function(e,t,r){"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>o,encryptWithSecret:()=>s});var n=r("crypto"),i=r.n(n);let a="aes-256-gcm";function s(e,t){let r=i().randomBytes(16),n=i().randomBytes(64),s=i().pbkdf2Sync(e,n,1e5,32,"sha512"),o=i().createCipheriv(a,s,r),l=Buffer.concat([o.update(t,"utf8"),o.final()]),u=o.getAuthTag();return Buffer.concat([n,r,u,l]).toString("hex")}function o(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),s=r.slice(64,80),o=r.slice(80,96),l=r.slice(96),u=i().pbkdf2Sync(e,n,1e5,32,"sha512"),c=i().createDecipheriv(a,u,s);return c.setAuthTag(o),c.update(l)+c.final("utf8")}},"./dist/esm/server/lib/node-fs-methods.js":function(e,t,r){"use strict";r.d(t,{e:()=>a});let n=require("fs");var i=r.n(n);let a={existsSync:i().existsSync,readFile:i().promises.readFile,readFileSync:i().readFileSync,writeFile:(e,t)=>i().promises.writeFile(e,t),mkdir:e=>i().promises.mkdir(e,{recursive:!0}),stat:e=>i().promises.stat(e)}},"./dist/esm/server/lib/trace/constants.js":function(e,t,r){"use strict";r.d(t,{Fx:()=>a,fP:()=>s});var n,i,a=((n=a||{}).compression="NextNodeServer.compression",n.getBuildId="NextNodeServer.getBuildId",n.createComponentTree="NextNodeServer.createComponentTree",n.clientComponentLoading="NextNodeServer.clientComponentLoading",n.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",n.generateStaticRoutes="NextNodeServer.generateStaticRoutes",n.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",n.generatePublicRoutes="NextNodeServer.generatePublicRoutes",n.generateImageRoutes="NextNodeServer.generateImageRoutes.route",n.sendRenderResult="NextNodeServer.sendRenderResult",n.proxyRequest="NextNodeServer.proxyRequest",n.runApi="NextNodeServer.runApi",n.render="NextNodeServer.render",n.renderHTML="NextNodeServer.renderHTML",n.imageOptimizer="NextNodeServer.imageOptimizer",n.getPagePath="NextNodeServer.getPagePath",n.getRoutesManifest="NextNodeServer.getRoutesManifest",n.findPageComponents="NextNodeServer.findPageComponents",n.getFontManifest="NextNodeServer.getFontManifest",n.getServerComponentManifest="NextNodeServer.getServerComponentManifest",n.getRequestHandler="NextNodeServer.getRequestHandler",n.renderToHTML="NextNodeServer.renderToHTML",n.renderError="NextNodeServer.renderError",n.renderErrorToHTML="NextNodeServer.renderErrorToHTML",n.render404="NextNodeServer.render404",n.startResponse="NextNodeServer.startResponse",n.route="route",n.onProxyReq="onProxyReq",n.apiResolver="apiResolver",n.internalFetch="internalFetch",n),s=((i=s||{}).runHandler="Node.runHandler",i)},"./dist/esm/server/web/spec-extension/adapters/headers.js":function(e,t,r){"use strict";r.d(t,{o:()=>a});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class a extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.get(t,r,i);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);if(void 0!==s)return n.get(t,s,i)},set(t,r,i,a){if("symbol"==typeof r)return n.set(t,r,i,a);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return n.set(t,o??r,i,a)},has(t,r){if("symbol"==typeof r)return n.has(t,r);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==a&&n.has(t,a)},deleteProperty(t,r){if("symbol"==typeof r)return n.deleteProperty(t,r);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===a||n.deleteProperty(t,a)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new a(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},"./dist/esm/server/web/spec-extension/cookies.js":function(e,t,r){"use strict";r.d(t,{tm:()=>n.RequestCookies});var n=r("./dist/compiled/@edge-runtime/cookies/index.js")},"./dist/esm/shared/lib/isomorphic/path.js":function(e,t,r){e.exports=r("path")},"./dist/esm/shared/lib/modern-browserslist-target.js":function(e){e.exports=["chrome 111","edge 111","firefox 111","safari 16.4"]},"../lib/router-utils/instrumentation-globals.external.js":function(e){"use strict";e.exports=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js")},"./lib/trace/tracer":function(e){"use strict";e.exports=require("next/dist/server/lib/trace/tracer")},"../load-manifest.external":function(e){"use strict";e.exports=require("next/dist/server/load-manifest.external.js")},"next/dist/compiled/jsonwebtoken":function(e){"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/raw-body":function(e){"use strict";e.exports=require("next/dist/compiled/raw-body")},crypto:function(e){"use strict";e.exports=require("crypto")},"node:path":function(e){"use strict";e.exports=require("node:path")},path:function(e){"use strict";e.exports=require("path")},querystring:function(e){"use strict";e.exports=require("querystring")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,i){if(1&i&&(n=this(n)),8&i||"object"==typeof n&&n&&(4&i&&n.__esModule||16&i&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>{s[e]=()=>n[e]});return s.default=()=>n,r.d(a,s),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{PagesAPIRouteModule:()=>td,default:()=>th});var e=r("./dist/esm/server/api-utils/index.js");r("./dist/esm/shared/lib/modern-browserslist-target.js");let t={client:"client",server:"server",edgeServer:"edge-server"};t.client,t.server,t.edgeServer;let i="build-manifest.json";function a(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:""}}[...process?.features?.typescript?["next.config.mts"]:[]],Symbol("polyfills");let s=new WeakMap;function o(e,t){let r;if(!t)return{pathname:e};let n=s.get(t);n||(n=t.map(e=>e.toLowerCase()),s.set(t,n));let i=e.split("/",2);if(!i[1])return{pathname:e};let a=i[1].toLowerCase(),o=n.indexOf(a);return o<0?{pathname:e}:(r=t[o],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}function l(e){return e.startsWith("/")?e:`/${e}`}function u(e){return l(e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:`${e}/${t}`:e,""))}function c(e){return e.replace(/\.rsc($|\?)/,"$1")}let d=["(..)(..)","(.)","(..)","(...)"];function h(e){return void 0!==e.split("/").find(e=>d.find(t=>e.startsWith(t)))}let f=/\/[^/]*\[[^/]+\][^/]*(?=\/|$)/,p=/\/\[[^/]+\](?=\/|$)/;function m(e,t=!0){return(h(e)&&(e=function(e){let t,r,n;for(let i of e.split("/"))if(r=d.find(e=>i.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=u(t),r){case"(.)":n="/"===t?`/${n}`:t+"/"+n;break;case"(..)":if("/"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});n=t.split("/").slice(0,-1).concat(n).join("/");break;case"(...)":n="/"+n;break;case"(..)(..)":let i=t.split("/");if(i.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});n=i.slice(0,-2).concat(n).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}(e).interceptedRoute),t)?p.test(e):f.test(e)}function g(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function v(e,t){if("string"!=typeof e)return!1;let{pathname:r}=g(e);return r===t||r.startsWith(t+"/")}function y(e,t){if(!v(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}var b=r("./dist/compiled/path-to-regexp/index.js"),E=r("./dist/esm/lib/constants.js");let x=/[|\\{}()[\]^$+*?.-]/,w=/[|\\{}()[\]^$+*?.-]/g;function P(e){return x.test(e)?e.replace(w,"\\$&"):e}function _(e){return e.replace(/\/$/,"")||"/"}class R extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}let C=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function S(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 A({interceptionMarker:e,getSafeRouteKey:t,segment:r,routeKeys:n,keyPrefix:i,backreferenceDuplicateKeys:a}){let s,{key:o,optional:l,repeat:u}=S(r),c=o.replace(/\W/g,"");i&&(c=`${i}${c}`);let d=!1;(0===c.length||c.length>30)&&(d=!0),isNaN(parseInt(c.slice(0,1)))||(d=!0),d&&(c=t());let h=c in n;i?n[c]=`${i}${o}`:n[c]=o;let f=e?P(e):"";return s=h&&a?`\\k<${c}>`:u?`(?<${c}>.+?)`:`(?<${c}>[^/]+?)`,{key:o,pattern:l?`(?:/${f}${s})?`:`/${f}${s}`,cleanedKey:c,optional:l,repeat:u}}"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class O extends Error{}class $ extends Error{}let T="_NEXTSEP_";function j(e){return"string"==typeof e&&!!(/\/\(\.{1,3}\):[^/\s]+/.test(e)||/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(e))}function D(e){let t=e;return(t=t.replace(/(\([^)]*\)):([^/\s]+)/g,`$1${T}:$2`)).replace(/:([^:/\s)]+)(?=:)/g,`:$1${T}`)}function k(e){return e.replace(RegExp(`\\)${T}`,"g"),")")}function N(e,t,r){if("string"!=typeof e)return(0,b.pathToRegexp)(e,t,r);let n=j(e),i=n?D(e):e;try{return(0,b.pathToRegexp)(i,t,r)}catch(i){if(!n)try{let n=D(e);return(0,b.pathToRegexp)(n,t,r)}catch(e){}throw i}}function M(e,t){let r=j(e),n=r?D(e):e;try{let e=(0,b.compile)(n,t);if(r)return t=>k(e(t));return e}catch(n){if(!r)try{let r=D(e),n=(0,b.compile)(r,t);return e=>k(n(e))}catch(e){}throw n}}function I({re:e,groups:t}){var r;return r=r=>{let n=e.exec(r);if(!n)return!1;let i=e=>{try{return decodeURIComponent(e)}catch{throw Object.defineProperty(new O("failed to decode param"),"__NEXT_ERROR_CODE",{value:"E528",enumerable:!1,configurable:!0})}},a={};for(let[e,r]of Object.entries(t)){let t=n[r.pos];void 0!==t&&(r.repeat?a[e]=t.split("/").map(e=>i(e)):a[e]=i(t))}return a},e=>{let t=r(e);if(!t)return!1;let n={};for(let[e,r]of Object.entries(t))"string"==typeof r?n[e]=r.replace(RegExp(`^${T}`),""):Array.isArray(r)?n[e]=r.map(e=>"string"==typeof e?e.replace(RegExp(`^${T}`),""):e):n[e]=r;return n}}function F(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function H(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function L(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:n}=r("./dist/compiled/cookie/index.js");return n(Array.isArray(t)?t.join("; "):t)}}function U(e){return e.replace(/__ESC_COLON_/gi,":")}function q(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(`:${r}`)&&(e=e.replace(RegExp(`:${r}\\*`,"g"),`:${r}--ESCAPED_PARAM_ASTERISKS`).replace(RegExp(`:${r}\\?`,"g"),`:${r}--ESCAPED_PARAM_QUESTION`).replace(RegExp(`:${r}\\+`,"g"),`:${r}--ESCAPED_PARAM_PLUS`).replace(RegExp(`:${r}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${r}`));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),M(`/${e}`,{validate:!1})(t).slice(1)}function G(e){for(let t of[E.AA,E.h])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}function z(e){try{return decodeURIComponent(e)}catch{return e}}let B=/https?|ftp|gopher|file/;function X(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==E.AA&&r.startsWith(E.AA),i=r!==E.h&&r.startsWith(E.h);(n||i||t.includes(r))&&delete e[r]}}function W(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}function K(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}function J(e){return v(e||"/","/_next/data")&&"/index"===(e=e.replace(/\/_next\/data\/[^/]{1,}/,"").replace(/\.json$/,""))?"/":e}let V=Symbol.for("NextInternalRequestMeta");function Z(e,t){let r=e[V]||{};return"string"==typeof t?r[t]:r}function Q(e){let t=/^\/index(\/|$)/.test(e)&&!m(e)?`/index${e}`:"/"===e?"/index":l(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new $(`Requested and resolved page mismatch: ${t} ${n}`)}return t}let Y={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"]}},ee=(e,t)=>t&&0!==t.length?`(?:\\.(${e.join("|")})|(\\.(${t.join("|")})))`:`(\\.(?:${e.join("|")}))`,et=/^[\\/]favicon\.ico$/,er=/^[\\/]robots\.txt$/,en=/^[\\/]manifest\.json$/,ei=/^[\\/]manifest\.webmanifest$/,ea=/[\\/]sitemap\.xml$/,es=new Map;class eo{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}class el{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new el(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:a,reject:s}=new eo;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:a,key:e});a(r)}catch(e){s(e)}finally{this.pending.delete(r)}}),i}}let eu=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var ec=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}({}),ed=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({}),eh=r("./lib/trace/tracer");function ef(){}new Uint8Array([60,104,116,109,108]),new Uint8Array([60,98,111,100,121]),new Uint8Array([60,47,104,101,97,100,62]),new Uint8Array([60,47,98,111,100,121,62]),new Uint8Array([60,47,104,116,109,108,62]),new Uint8Array([60,47,98,111,100,121,62,60,47,104,116,109,108,62]),new Uint8Array([60,109,101,116,97,32,110,97,109,101,61,34,194,171,110,120,116,45,105,99,111,110,194,187,34]);let ep=new TextEncoder;function em(e){return new ReadableStream({start(t){t.enqueue(ep.encode(e)),t.close()}})}function eg(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function ev(e,t){let r=new TextDecoder("utf-8",{fatal:!0}),n="";for await(let i of e){if(null==t?void 0:t.aborted)return n;n+=r.decode(i,{stream:!0})}return n+r.decode()}function ey(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:i}=g(e);return`${t}${r}${n}${i}`}function eb(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:i}=g(e);return`${r}${t}${n}${i}`}let eE=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function ex(e,t){return new URL(String(e).replace(eE,"localhost"),t&&String(t).replace(eE,"localhost"))}let ew=Symbol("NextURLInternal");class eP{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[ew]={url:ex(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,n,i;let a=function(e,t){let{basePath:r,i18n:n,trailingSlash:i}=t.nextConfig??{},a={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):i};r&&v(a.pathname,r)&&(a.pathname=y(a.pathname,r),a.basePath=r);let s=a.pathname;if(a.pathname.startsWith("/_next/data/")&&a.pathname.endsWith(".json")){let e=a.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");a.buildId=e[0],s="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(a.pathname=s)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(a.pathname):o(a.pathname,n.locales);a.locale=e.detectedLocale,a.pathname=e.pathname??a.pathname,!e.detectedLocale&&a.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(s):o(s,n.locales)).detectedLocale&&(a.locale=e.detectedLocale)}return a}(this[ew].url.pathname,{nextConfig:this[ew].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[ew].options.i18nProvider}),s=K(this[ew].url,this[ew].options.headers);this[ew].domainLocale=this[ew].options.i18nProvider?this[ew].options.i18nProvider.detectDomainLocale(s):W(null==(t=this[ew].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,s);let l=(null==(r=this[ew].domainLocale)?void 0:r.defaultLocale)||(null==(i=this[ew].options.nextConfig)||null==(n=i.i18n)?void 0:n.defaultLocale);this[ew].url.pathname=a.pathname,this[ew].defaultLocale=l,this[ew].basePath=a.basePath??"",this[ew].buildId=a.buildId,this[ew].locale=a.locale??l,this[ew].trailingSlash=a.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,n){if(!t||t===r)return e;let i=e.toLowerCase();return!n&&(v(i,"/api")||v(i,`/${t.toLowerCase()}`))?e:ey(e,`/${t}`)}((e={basePath:this[ew].basePath,buildId:this[ew].buildId,defaultLocale:this[ew].options.forceLocale?void 0:this[ew].defaultLocale,locale:this[ew].locale,pathname:this[ew].url.pathname,trailingSlash:this[ew].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=_(t)),e.buildId&&(t=eb(ey(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=ey(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:eb(t,"/"):_(t)}formatSearch(){return this[ew].url.search}get buildId(){return this[ew].buildId}set buildId(e){this[ew].buildId=e}get locale(){return this[ew].locale??""}set locale(e){var t,r;if(!this[ew].locale||!(null==(r=this[ew].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[ew].locale=e}get defaultLocale(){return this[ew].defaultLocale}get domainLocale(){return this[ew].domainLocale}get searchParams(){return this[ew].url.searchParams}get host(){return this[ew].url.host}set host(e){this[ew].url.host=e}get hostname(){return this[ew].url.hostname}set hostname(e){this[ew].url.hostname=e}get port(){return this[ew].url.port}set port(e){this[ew].url.port=e}get protocol(){return this[ew].url.protocol}set protocol(e){this[ew].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[ew].url=ex(e),this.analyze()}get origin(){return this[ew].url.origin}get pathname(){return this[ew].url.pathname}set pathname(e){this[ew].url.pathname=e}get hash(){return this[ew].url.hash}set hash(e){this[ew].url.hash=e}get search(){return this[ew].url.search}set search(e){this[ew].url.search=e}get password(){return this[ew].url.password}set password(e){this[ew].url.password=e}get username(){return this[ew].url.username}set username(e){this[ew].url.username=e}get basePath(){return this[ew].basePath}set basePath(e){this[ew].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new eP(String(this),this[ew].options)}}r("./dist/esm/server/web/spec-extension/cookies.js"),Symbol("internal request"),Request,Symbol.for("edge-runtime.inspect.custom");let e_="ResponseAborted";class eR extends Error{constructor(...e){super(...e),this.name=e_}}var eC=r("./dist/esm/server/lib/trace/constants.js");let eS=0,eA=0,eO=0;function e$(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===e_}async function eT(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 eR)}),t}(t),s=function(e,t){let r=!1,n=new eo;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let a=new eo;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===eS?void 0:{clientComponentLoadStart:eS,clientComponentLoadTimes:eA,clientComponentLoadCount:eO};return e.reset&&(eS=0,eA=0,eO=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,eh.getTracer)().trace(eC.Fx.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 eo)}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(e$(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class ej{static #e=this.EMPTY=new ej(null,{metadata:{},contentType:null});static fromStatic(e,t){return new ej(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 R("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return ev(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?em(this.response):Buffer.isBuffer(this.response)?eg(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(ef),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[em(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[eg(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(e$(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await eT(this.readable,e,this.waitUntil)}}var eD=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}({});async function ek(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===ec.PAGES?{kind:ec.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)===ec.APP_PAGE?{kind:ec.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 eN(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===ec.PAGES?{kind:ec.PAGES,html:ej.fromStatic(e.value.html,E.j9),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ec.APP_PAGE?{kind:ec.APP_PAGE,html:ej.fromStatic(e.value.html,E.j9),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class eM{constructor(e){this.getBatcher=el.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:eu}),this.revalidateBatcher=el.create({schedulerFn:eu}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return eN(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:a=!1,isFallback:s=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:u,routeKind:c}=r;return eN(await this.getBatcher.batch({key:e,isOnDemandRevalidate:a},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:a,isFallback:s,isRoutePPREnabled:o,isPrefetch:l,routeKind:c},r);return u&&u(n),n}))}async handleGet(e,t,r,n){let i=null,a=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case eD.PAGES:return ed.PAGES;case eD.APP_PAGE:return ed.APP_PAGE;case eD.IMAGE:return ed.IMAGE;case eD.APP_ROUTE:return ed.APP_ROUTE;case eD.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(i),a=!0,!i.isStale||r.isPrefetch))return i;let s=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!s)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,s}catch(e){if(a)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,a,s,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,a,s);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,a,s){try{let o=await i({hasResolved:s,previousCacheEntry:a,isRevalidating:!0});if(!o)return null;let l=await ek({...o,isMiss:!a});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(i){if(null==a?void 0:a.cacheControl){let i=Math.min(Math.max(a.cacheControl.revalidate||3,3),30),s=void 0===a.cacheControl.expire?void 0:Math.max(i+3,a.cacheControl.expire);await t.set(e,a.value,{cacheControl:{revalidate:i,expire:s},isRoutePPREnabled:r,isFallback:n})}throw i}}}var eI=r("./dist/esm/shared/lib/isomorphic/path.js"),eF=r.n(eI);let eH=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class eL{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(eF().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 eU=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class eq{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?eq.memoryCache?eq.debug&&console.log("FileSystemCache: memory store already initialized"):(eq.debug&&console.log("FileSystemCache: using memory store for fetch cache"),eq.memoryCache=(0,eU.getMemoryCache)(e.maxMemoryCacheSize)):eq.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,eq.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=eH.tagsManifest.get(n)||{};if(t){let i={...e};i.stale=r,void 0!==t.expire&&(i.expired=r+1e3*t.expire),eH.tagsManifest.set(n,i)}else eH.tagsManifest.set(n,{...e,expired:r})}}async get(...e){var t,r,n,i,a,s,o,l,u;let[c,d]=e,{kind:h}=d,f=null==(t=eq.memoryCache)?void 0:t.get(c);if(eq.debug&&(h===ed.FETCH?console.log("FileSystemCache: get",c,d.tags,h,!!f):console.log("FileSystemCache: get",c,h,!!f)),!f)try{if(h===ed.APP_ROUTE){let e=this.getFilePath(`${c}.body`,ed.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$/,E.EP),"utf8"));f={lastModified:r.getTime(),value:{kind:ec.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ed.FETCH?c:`${c}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ed.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=d;if(!this.flushToDisk)return null;let a=r.getTime(),l=JSON.parse(t);if(f={lastModified:a,value:l},(null==(s=f.value)?void 0:s.kind)===ec.FETCH){let t=null==(o=f.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(eq.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(c,f.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ed.APP_PAGE){let n,i,a;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,E.EP),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=c+E.mH;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+E.tz,ed.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}d.isFallback||(a=await this.fs.readFile(this.getFilePath(`${c}${d.isRoutePPREnabled?E.pu:E.RM}`,ed.APP_PAGE))),f={lastModified:r.getTime(),value:{kind:ec.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===ed.PAGES){let e,n={};d.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${c}${E.x3}`,ed.PAGES),"utf8"))),f={lastModified:r.getTime(),value:{kind:ec.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})}f&&(null==(l=eq.memoryCache)||l.set(c,f))}catch{return null}if((null==f||null==(r=f.value)?void 0:r.kind)===ec.APP_PAGE||(null==f||null==(n=f.value)?void 0:n.kind)===ec.APP_ROUTE||(null==f||null==(i=f.value)?void 0:i.kind)===ec.PAGES){let e=null==(u=f.value.headers)?void 0:u[E.VC];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,eH.areTagsExpired)(t,f.lastModified))return eq.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==f||null==(a=f.value)?void 0:a.kind)===ec.FETCH){let e=d.kind===ed.FETCH?[...d.tags||[],...d.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return eq.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,eH.areTagsExpired)(e,f.lastModified))return eq.debug&&console.log("FileSystemCache: expired tags",e),null}return f??null}async set(e,t,r){var n;if(null==(n=eq.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),eq.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new eL(this.fs);if(t.kind===ec.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ed.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$/,E.EP),JSON.stringify(n,null,2))}else if(t.kind===ec.PAGES||t.kind===ec.APP_PAGE){let n=t.kind===ec.APP_PAGE,a=this.getFilePath(`${e}.html`,n?ed.APP_PAGE:ed.PAGES);if(i.append(a,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?E.pu:E.RM:E.x3}`,n?ed.APP_PAGE:ed.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===ec.APP_PAGE){let e;if(t.segmentData){e=[];let r=a.replace(/\.html$/,E.mH);for(let[n,a]of t.segmentData){e.push(n);let t=r+n+E.tz;i.append(t,a)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(a.replace(/\.html$/,E.EP),JSON.stringify(r))}}else if(t.kind===ec.FETCH){let n=this.getFilePath(e,ed.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ed.FETCH:return eF().join(this.serverDistDir,"..","cache","fetch-cache",e);case ed.PAGES:return eF().join(this.serverDistDir,"pages",e);case ed.IMAGE:case ed.APP_PAGE:case ed.APP_ROUTE:return eF().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}function eG(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}let ez=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js"),eB=require("next/dist/server/app-render/work-unit-async-storage.external.js"),eX=require("next/dist/server/app-render/work-async-storage.external.js");class eW{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:u,allowedRevalidateHeaderKeys:c}){var d,h,f,p;this.locks=new Map,this.hasCustomCacheHandler=!!u;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(u)eW.debug&&console.log("IncrementalCache: using custom cache handler",u.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?(u=t.FetchCache,eW.debug&&console.log("IncrementalCache: using global FetchCache cache handler")):e&&i&&(eW.debug&&console.log("IncrementalCache: using filesystem cache handler"),u=eq)}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=c,this.prerenderManifest=o(),this.cacheControls=new ez.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let v=[];a[E.kz]===(null==(h=this.prerenderManifest)||null==(d=h.preview)?void 0:d.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(v=this.revalidatedTags=function(e,t){return"string"==typeof e[E.vS]&&e[E.c1]===t?e[E.vS].split(","):[]}(a,null==(p=this.prerenderManifest)||null==(f=p.preview)?void 0:f.previewModeId)),u&&(this.cacheHandler=new u({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:v,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(eG(e)),a=i?i.revalidate:!n&&1;return"number"==typeof a?1e3*a+t:a}_getPathname(e,t){return t?e:Q(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(eW.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new eo;return eW.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let n=[],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,s,o,l;let u,c;if(t.kind===ed.FETCH){let t=eB.workUnitAsyncStorage.getStore(),r=t?(0,eB.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===ec.FETCH)return eW.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};eW.debug&&console.log("IncrementalCache: rdc:miss",e)}else eW.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ed.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ed.FETCH);let d=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ed.FETCH){if(!d)return null;if((null==(i=d.value)?void 0:i.kind)!==ec.FETCH)throw Object.defineProperty(new R(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(a=d.value)?void 0:a.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eX.workAsyncStorage.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return eW.debug&&console.log("IncrementalCache: expired tag",e),null;let s=eB.workUnitAsyncStorage.getStore();if(s){let t=(0,eB.getPrerenderResumeDataCache)(s);t&&(eW.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,d.value))}let o=t.revalidate||d.value.revalidate,l=(performance.timeOrigin+performance.now()-(d.lastModified||0))/1e3>o,u=d.value.data;return(0,eH.areTagsExpired)(n,d.lastModified)?null:((0,eH.areTagsStale)(n,d.lastModified)&&(l=!0),{isStale:l,value:{kind:ec.FETCH,data:u,revalidate:o}})}if((null==d||null==(n=d.value)?void 0:n.kind)===ec.FETCH)throw Object.defineProperty(new R(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,f=this.cacheControls.get(eG(e));if((null==d?void 0:d.lastModified)===-1)u=-1,c=-1*E.qF;else{let r=performance.timeOrigin+performance.now(),n=(null==d?void 0:d.lastModified)||r;if(void 0===(u=!1!==(c=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&c<r||void 0)&&((null==d||null==(s=d.value)?void 0:s.kind)===ec.APP_PAGE||(null==d||null==(o=d.value)?void 0:o.kind)===ec.APP_ROUTE)){let e=null==(l=d.value.headers)?void 0:l[E.VC];if("string"==typeof e){let t=e.split(",");t.length>0&&((0,eH.areTagsExpired)(t,n)?u=-1:(0,eH.areTagsStale)(t,n)&&(u=!0))}}}return d&&(h={isStale:u,cacheControl:f,revalidateAfter:c,value:d.value}),!d&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:u,value:null,cacheControl:f,revalidateAfter:c},this.set(e,h.value,{...t,cacheControl:f})),h}async set(e,t,r){if((null==t?void 0:t.kind)===ec.FETCH){let r=eB.workUnitAsyncStorage.getStore(),n=r?(0,eB.getPrerenderResumeDataCache)(r):null;n&&(eW.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(eG(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)}}}class eK{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class eJ{constructor(){this.prev=null,this.next=null}}class eV{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new eJ,this.tail=new eJ,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let n=this.cache.get(e);if(n)n.data=t,this.totalSize=this.totalSize-n.size+r,n.size=r,this.moveToHead(n);else{let n=new eK(e,t,r);this.cache.set(e,n),this.addToHead(n),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}function eZ(e){if(0===e)return{get:()=>Promise.resolve(void 0),set:()=>Promise.resolve(),refreshTags:()=>Promise.resolve(),getExpiration:()=>Promise.resolve(0),updateTags:()=>Promise.resolve()};let t=new eV(e,e=>e.size),r=new Map,n=process.env.NEXT_PRIVATE_DEBUG_CACHE?console.debug.bind(console,"DefaultCacheHandler:"):void 0;return{async get(e){let i=r.get(e);i&&(null==n||n("get",e,"pending"),await i);let a=t.get(e);if(!a){null==n||n("get",e,"not found");return}let s=a.entry;if(performance.timeOrigin+performance.now()>s.timestamp+1e3*s.revalidate){null==n||n("get",e,"expired");return}let o=s.revalidate;if((0,eH.areTagsExpired)(s.tags,s.timestamp)){null==n||n("get",e,"had expired tag");return}(0,eH.areTagsStale)(s.tags,s.timestamp)&&(null==n||n("get",e,"had stale tag"),o=-1);let[l,u]=s.value.tee();return s.value=u,null==n||n("get",e,"found",{tags:s.tags,timestamp:s.timestamp,expire:s.expire,revalidate:o}),{...s,revalidate:o,value:l}},async set(e,i){null==n||n("set",e,"start");let a=()=>{},s=new Promise(e=>{a=e});r.set(e,s);let o=await i,l=0;try{let[r,i]=o.value.tee();o.value=r;let a=i.getReader();for(let e;!(e=await a.read()).done;)l+=Buffer.from(e.value).byteLength;t.set(e,{entry:o,isErrored:!1,errorRetryCount:0,size:l}),null==n||n("set",e,"done")}catch(t){null==n||n("set",e,"failed",t)}finally{a(),r.delete(e)}},async refreshTags(){},async getExpiration(e){let t=Math.max(...e.map(e=>{let t=eH.tagsManifest.get(e);return t&&t.expired||0}),0);return null==n||n("getExpiration",{tags:e,expiration:t}),t},async updateTags(e,t){let r=Math.round(performance.timeOrigin+performance.now());for(let i of(null==n||n("updateTags",{tags:e,timestamp:r}),e)){let e=eH.tagsManifest.get(i)||{};if(t){let n={...e};n.stale=r,void 0!==t.expire&&(n.expired=r+1e3*t.expire),eH.tagsManifest.set(i,n)}else eH.tagsManifest.set(i,{...e,expired:r})}}}}let eQ=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,eY=Symbol.for("@next/cache-handlers"),e0=Symbol.for("@next/cache-handlers-map"),e1=Symbol.for("@next/cache-handlers-set"),e2=globalThis;function e4(e){return e.default||e}let e3=Symbol.for("@next/router-server-methods"),e6=globalThis;function e9(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)==="next-url"}let e5=e=>import(e).then(e=>e.default||e);class e8{constructor({userland:e,definition:t,distDir:r,relativeProjectDir:n}){this.userland=e,this.definition=t,this.isDev=!1,this.distDir=r,this.relativeProjectDir=n}async instrumentationOnRequestError(e,...t){{let{join:n}=r("node:path"),i=n(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir),{instrumentationOnRequestError:a}=await Promise.resolve().then(r.t.bind(r,"../lib/router-utils/instrumentation-globals.external.js",23));return a(i,this.distDir,...t)}}loadManifests(e,t){{var n;if(!t)throw Object.defineProperty(Error("Invariant: projectDir is required for node runtime"),"__NEXT_ERROR_CODE",{value:"E718",enumerable:!1,configurable:!0});let{loadManifestFromRelativePath:a}=r("../load-manifest.external"),s=Q(e),o=this.definition.kind===eD.PAGES||this.definition.kind===eD.PAGES_API?"pages":"app",[l,u,c,d,h,f,p,m,g,v,y,b]=[a({projectDir:t,distDir:this.distDir,manifest:"routes-manifest.json",shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:"prerender-manifest.json",shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:i,shouldCache:!this.isDev}),"/_error"===e?a({projectDir:t,distDir:this.distDir,manifest:`fallback-${i}`,shouldCache:!this.isDev,handleMissing:!0}):{},a({projectDir:t,distDir:this.distDir,manifest:`server/${"app"===o?"app":"pages"}${s}/react-loadable-manifest.json`,handleMissing:!0,shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:"server/next-font-manifest.json",shouldCache:!this.isDev}),"app"!==o||function(e){let t=e.replace(/\/route$/,"");return e.endsWith("/route")&&function(e,t,r){if(!e||e.length<2)return!1;let n=e.replace(/\\/g,"/"),i=!!(et.test(n)||er.test(n)||en.test(n)||ei.test(n)||ea.test(n))||(!!n.includes("robots")||!!n.includes("manifest")||!!n.includes("sitemap")||!!n.includes("icon")||!!n.includes("apple-icon")||!!n.includes("opengraph-image")||!!n.includes("twitter-image")||!!n.includes("favicon"))&&null;if(null!==i)return i;let a=function(e,t){let r=`${e.join(",")}|${t}`,n=es.get(r);if(n)return n;let i=t?"$":"?$",a="\\d?"+(t?"":"(-\\w{6})?"),s=e.length>0?[...e,"txt"]:["txt"],o=e.length>0?[...e,"webmanifest","json"]:["webmanifest","json"],l=[RegExp(`^[\\\\/]robots${ee(s,null)}${i}`),RegExp(`^[\\\\/]manifest${ee(o,null)}${i}`),RegExp(`[\\\\/]sitemap${ee(["xml"],e)}${i}`),RegExp(`[\\\\/]icon${a}${ee(Y.icon.extensions,e)}${i}`),RegExp(`[\\\\/]apple-icon${a}${ee(Y.apple.extensions,e)}${i}`),RegExp(`[\\\\/]opengraph-image${a}${ee(Y.openGraph.extensions,e)}${i}`),RegExp(`[\\\\/]twitter-image${a}${ee(Y.twitter.extensions,e)}${i}`)];return es.set(r,l),l}(t,r);for(let e=0;e<a.length;e++)if(a[e].test(n))return!0;return!1}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(e)?void 0:a({distDir:this.distDir,projectDir:t,useEval:!0,handleMissing:!0,manifest:`server/app${e.replace(/%5F/g,"_")+"_client-reference-manifest"}.js`,shouldCache:!this.isDev}),"app"===o?a({distDir:this.distDir,projectDir:t,manifest:"server/server-reference-manifest.json",handleMissing:!0,shouldCache:!this.isDev}):{},a({projectDir:t,distDir:this.distDir,manifest:"server/subresource-integrity-manifest.json",handleMissing:!0,shouldCache:!this.isDev}),this.isDev?{}:a({projectDir:t,distDir:this.distDir,manifest:"required-server-files.json"}),this.isDev?"development":a({projectDir:t,distDir:this.distDir,manifest:"BUILD_ID",skipParse:!0}),a({projectDir:t,distDir:this.distDir,manifest:"dynamic-css-manifest",handleMissing:!0})];return{buildId:y,buildManifest:c,fallbackBuildManifest:d,routesManifest:l,nextFontManifest:f,prerenderManifest:u,serverFilesManifest:v,reactLoadableManifest:h,clientReferenceManifest:null==p||null==(n=p.__RSC_MANIFEST)?void 0:n[e.replace(/%5F/g,"_")],serverActionsManifest:m,subresourceIntegrityManifest:g,dynamicCssManifest:b,interceptionRoutePatterns:l.rewrites.beforeFiles.filter(e9).map(e=>new RegExp(e.regex))}}}async loadCustomCacheHandlers(e,t){{let{cacheMaxMemorySize:i,cacheHandlers:a}=t;if(!a||!function(e){if(e2[e0])return null==eQ||eQ("cache handlers already initialized"),!1;if(null==eQ||eQ("initializing cache handlers"),e2[e0]=new Map,e2[eY]){let t;e2[eY].DefaultCache?(null==eQ||eQ('setting "default" cache handler from symbol'),t=e2[eY].DefaultCache):(null==eQ||eQ('setting "default" cache handler from default'),t=eZ(e)),e2[e0].set("default",t),e2[eY].RemoteCache?(null==eQ||eQ('setting "remote" cache handler from symbol'),e2[e0].set("remote",e2[eY].RemoteCache)):(null==eQ||eQ('setting "remote" cache handler from default'),e2[e0].set("remote",t))}else{let t=eZ(e);null==eQ||eQ('setting "default" cache handler from default'),e2[e0].set("default",t),null==eQ||eQ('setting "remote" cache handler from default'),e2[e0].set("remote",t)}return e2[e1]=new Set(e2[e0].values()),!0}(i))return;for(let[t,i]of Object.entries(a)){if(!i)continue;let{formatDynamicImportPath:a}=r("./dist/esm/lib/format-dynamic-import-path.js"),{join:s}=r("node:path"),o=s(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir);var n=e4(await e5(a(`${o}/${this.distDir}`,i)));if(!e2[e0]||!e2[e1])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==eQ||eQ('setting cache handler for "%s"',t),e2[e0].set(t,n),e2[e1].add(n)}}}async getIncrementalCache(e,t,n,i){{let a,{cacheHandler:s}=t;if(s){let{formatDynamicImportPath:e}=r("./dist/esm/lib/format-dynamic-import-path.js");a=e4(await e5(e(this.distDir,s)))}let{join:o}=r("node:path"),l=o(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir);await this.loadCustomCacheHandlers(e,t);let u=new eW({fs:r("./dist/esm/server/lib/node-fs-methods.js").e,dev:this.isDev,requestHeaders:e.headers,allowedRevalidateHeaderKeys:t.experimental.allowedRevalidateHeaderKeys,minimalMode:i,serverDistDir:`${l}/${this.distDir}/server`,fetchCacheKeyPrefix:t.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:t.cacheMaxMemorySize,flushToDisk:!i&&t.experimental.isrFlushToDisk,getPrerenderManifest:()=>n,CurCacheHandler:a});return globalThis.__incrementalCache=u,u}}async onRequestError(e,t,r,n){(null==n?void 0:n.logErrorWithOriginalStack)?n.logErrorWithOriginalStack(t,"app-dir"):console.error(t),await this.instrumentationOnRequestError(e,t,{path:e.url||"/",headers:e.headers,method:e.method||"GET"},r)}async prepare(t,n,{srcPage:i,multiZoneDraftMode:s}){var l;let f,p,g,x;{let{join:e,relative:n}=r("node:path");f=e(process.cwd(),Z(t,"relativeProjectDir")||this.relativeProjectDir);let i=Z(t,"distDir");i&&(this.distDir=n(f,i));let{ensureInstrumentationRegistered:a}=await Promise.resolve().then(r.t.bind(r,"../lib/router-utils/instrumentation-globals.external.js",23));a(f,this.distDir)}let w=await this.loadManifests(i,f),{routesManifest:R,prerenderManifest:$,serverFilesManifest:T}=w,{basePath:j,i18n:D,rewrites:k}=R;j&&(t.url=y(t.url||"/",j));let Q=a(t.url||"/");if(!Q)return;let Y=!1;v(Q.pathname||"/","/_next/data")&&(Y=!0,Q.pathname=J(Q.pathname||"/"));let ee=Q.pathname||"/",et={...Q.query},er=m(i);D&&(p=o(Q.pathname||"/",D.locales)).detectedLocale&&(t.url=`${p.pathname}${Q.search}`,ee=p.pathname,g||(g=p.detectedLocale));let en=u(i),ei=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:l}){let u,f,p;return i&&(p=(f=I(u=function(e,t){let r=function(e,t,r,n,i,a={names:{},intercepted:{}}){let s,o=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={},u=[],c=[];for(let s of(a=structuredClone(a),_(e).slice(1).split("/"))){let e,h=d.some(e=>s.startsWith(e)),f=s.match(C),p=h?f?.[1]:void 0;if(p&&f?.[2]?(e=t?E.h:void 0,a.intercepted[f[2]]=p):e=f?.[2]&&a.intercepted[f[2]]?t?E.h:void 0:t?E.AA:void 0,p&&f&&f[2]){let{key:t,pattern:r,cleanedKey:n,repeat:s,optional:d}=A({getSafeRouteKey:o,interceptionMarker:p,segment:f[2],routeKeys:l,keyPrefix:e,backreferenceDuplicateKeys:i});u.push(r),c.push(`/${f[1]}:${a.names[t]??n}${s?d?"*":"+":""}`),a.names[t]??=n}else if(f&&f[2]){n&&f[1]&&(u.push(`/${P(f[1])}`),c.push(`/${f[1]}`));let{key:t,pattern:r,cleanedKey:s,repeat:d,optional:h}=A({getSafeRouteKey:o,segment:f[2],routeKeys:l,keyPrefix:e,backreferenceDuplicateKeys:i}),p=r;n&&f[1]&&(p=p.substring(1)),u.push(p),c.push(`/:${a.names[t]??s}${d?h?"*":"+":""}`),a.names[t]??=s}else u.push(`/${P(s)}`),c.push(`/${s}`);r&&f&&f[3]&&(u.push(P(f[3])),c.push(f[3]))}return{namedParameterizedRoute:u.join(""),routeKeys:l,pathToRegexpPattern:c.join(""),reference:a}}(e,t.prefixRouteKeys,t.includeSuffix??!1,t.includePrefix??!1,t.backreferenceDuplicateKeys??!1,t.reference),n=r.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(n+="(?:/)?"),{...function(e,{includeSuffix:t=!1,includePrefix:r=!1,excludeOptionalTrailingSlash:n=!1}={}){let{parameterizedRoute:i,groups:a}=function(e,t,r){let n={},i=1,a=[];for(let s of _(e).slice(1).split("/")){let e=d.find(e=>s.startsWith(e)),o=s.match(C);if(e&&o&&o[2]){let{key:t,optional:r,repeat:s}=S(o[2]);n[t]={pos:i++,repeat:s,optional:r},a.push(`/${P(e)}([^/]+?)`)}else if(o&&o[2]){let{key:e,repeat:t,optional:s}=S(o[2]);n[e]={pos:i++,repeat:t,optional:s},r&&o[1]&&a.push(`/${P(o[1])}`);let l=t?s?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),a.push(l)}else a.push(`/${P(s)}`);t&&o&&o[3]&&a.push(P(o[3]))}return{parameterizedRoute:a.join(""),groups:n}}(e,t,r),s=i;return n||(s+="(?:/)?"),{re:RegExp(`^${s}$`),groups:a}}(e,t),namedRegex:`^${n}$`,routeKeys:r.routeKeys,pathToRegexpPattern:r.pathToRegexpPattern,reference:r.reference}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(a,u){let c=structuredClone(u),p={},m=c.pathname,g=n=>{let u=function(e,t){let r=[],n=(0,b.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof t?.sensitive&&t.sensitive,strict:t?.strict}),i=(0,b.regexpToFunction)(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(t?.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete a.params[e.name];return{...n,...a.params}}}(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!l});if(!c.pathname)return!1;let g=u(c.pathname);if((n.has||n.missing)&&g){let e=function(e,t,r=[],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]:L(e.headers)()[r.key];break;case"query":n=t[a];break;case"host":{let{host:t}=e?.headers||{};n=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}(a,c.query,n.has,n.missing);e?Object.assign(g,e):g=!1}if(g){let{parsedDestination:a,destQuery:s}=function(e){let t,r,n=function(e){let t=e.destination;for(let r of Object.keys({...e.params,...e.query}))r&&(t=t.replace(RegExp(`:${P(r)}`,"g"),`__ESC_COLON_${r}`));let r=function(e){if(e.startsWith("/"))return function(e,t,r=!0){let n=new URL("http://n"),i=e.startsWith(".")?new URL("http://n"):n,{pathname:a,searchParams:s,search:o,hash:l,href:u,origin:c}=new URL(e,i);if(c!==n.origin)throw Object.defineProperty(Error(`invariant: invalid relative URL, router received ${e}`),"__NEXT_ERROR_CODE",{value:"E159",enumerable:!1,configurable:!0});return{pathname:a,query:r?F(s):void 0,search:o,hash:l,href:u.slice(c.length),slashes:void 0}}(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:F(t.searchParams),search:t.search,origin:t.origin,slashes:"//"===t.href.slice(t.protocol.length,t.protocol.length+2)}}(t),n=r.pathname;n&&(n=U(n));let i=r.href;i&&(i=U(i));let a=r.hostname;a&&(a=U(a));let s=r.hash;s&&(s=U(s));let o=r.search;o&&(o=U(o));let l=r.origin;return l&&(l=U(l)),{...r,pathname:n,hostname:a,href:i,hash:s,search:o,origin:l}}(e),{hostname:i,query:a,search:s}=n,o=n.pathname;n.hash&&(o=`${o}${n.hash}`);let l=[],u=[];for(let e of(N(o,u),u))l.push(e.name);if(i){let e=[];for(let t of(N(i,e),e))l.push(t.name)}let c=M(o,{validate:!1});for(let[r,n]of(i&&(t=M(i,{validate:!1})),Object.entries(a)))Array.isArray(n)?a[r]=n.map(t=>q(U(t),e.params)):"string"==typeof n&&(a[r]=q(U(n),e.params));let f=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!f.some(e=>l.includes(e)))for(let t of f)t in a||(a[t]=e.params[t]);if(h(o))for(let t of o.split("/")){let r=d.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,a]=(r=c(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=`${a?"#":""}${a||""}`,n.search=s?q(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:g,query:c.query});if(a.protocol)return!0;if(Object.assign(p,s,g),Object.assign(c.query,a.query),delete a.query,Object.assign(c,a),!(m=c.pathname))return!1;if(r&&(m=m.replace(RegExp(`^${r}`),"")||"/"),t){let e=o(m,t.locales);m=e.pathname,c.query.nextInternalLocale=e.detectedLocale||g.nextInternalLocale}if(m===e)return!0;if(i&&f){let e=f(m);if(e)return c.query={...c.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])g(e);if(m!==e){let t=!1;for(let e of n.afterFiles||[])if(t=g(e))break;if(!t&&!(()=>{let t=_(m||"");return t===_(e)||(null==f?void 0:f(t))})()){for(let e of n.fallback||[])if(t=g(e))break}}return{rewriteParams:p,rewrittenParsedUrl:c}},defaultRouteRegex:u,dynamicRouteMatcher:f,defaultRouteMatches:p,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=G(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>z(e)):z(n)))}},getParamsFromRouteMatches:function(e){if(!u)return null;let{groups:t,routeKeys:r}=u,n=I({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=G(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(!u||!p)return{params:{},hasValidParams:!1};var r=u,n=p;let i={};for(let a of Object.keys(r.groups)){let s=e[a];"string"==typeof s?s=c(s):Array.isArray(s)&&(s=s.map(c));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}]]`)||"index"===s||s===`[[...${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=a(e.url);if(!r)return e.url;delete r.search,X(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,H(e));else t.set(r,H(n));return t}(s)));let l=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||B.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),l=l.replace("#","%23"),`${n}${o}${i}${l}${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,u),filterInternalQuery:(e,t)=>X(e,t)}}({page:en,i18n:D,basePath:j,rewrites:k,pageIsDynamic:er,trailingSlash:process.env.__NEXT_TRAILING_SLASH,caseSensitive:!!R.caseSensitive}),ea=W(null==D?void 0:D.domains,K(Q,t.headers),g);!function(e,t,r){let n=Z(e);n[t]=r,e[V]=n}(t,"isLocaleDomain",!!ea);let es=(null==ea?void 0:ea.defaultLocale)||(null==D?void 0:D.defaultLocale);es&&!g&&(Q.pathname=`/${es}${"/"===Q.pathname?"":Q.pathname}`);let eo=Z(t,"locale")||g||es,{rewriteParams:el,rewrittenParsedUrl:eu}=ei.handleRewrites(t,Q),ec=Object.keys(el);Object.assign(Q.query,eu.query),D&&(Q.pathname=o(Q.pathname||"/",D.locales).pathname,eu.pathname=o(eu.pathname||"/",D.locales).pathname);let ed=Z(t,"params");if(!ed&&ei.dynamicRouteMatcher){let e=ei.dynamicRouteMatcher(J((null==eu?void 0:eu.pathname)||Q.pathname||"/")),t=ei.normalizeDynamicRouteParams(e||{},!0);t.hasValidParams&&(ed=t.params)}let eh=Z(t,"query")||{...Q.query},ef=new Set,ep=[];if(this.definition.kind===eD.PAGES||this.definition.kind===eD.PAGES_API)for(let e of[...ec,...Object.keys(ei.defaultRouteMatches||{})]){let t=Array.isArray(et[e])?et[e].join(""):et[e],r=Array.isArray(eh[e])?eh[e].join(""):eh[e];e in et&&t!==r||ep.push(e)}if(ei.normalizeCdnUrl(t,ep),ei.normalizeQueryParams(eh,ef),ei.filterInternalQuery(et,ep),er){let e,r=ei.normalizeDynamicRouteParams(eh,!0),n=ei.normalizeDynamicRouteParams(ed||{},!0);if(eh&&ed&&n.hasValidParams&&r.hasValidParams&&Object.keys(n.params).length<Object.keys(r.params).length?(e=r.params,ed=Object.assign(r.params)):e=n.hasValidParams&&ed?ed:r.hasValidParams?eh:{},t.url=ei.interpolateDynamicPath(t.url||"/",e),Q.pathname=ei.interpolateDynamicPath(Q.pathname||"/",e),ee=ei.interpolateDynamicPath(ee,e),!ed)if(r.hasValidParams)for(let e in ed=Object.assign({},r.params),ei.defaultRouteMatches)delete eh[e];else{let e=null==ei.dynamicRouteMatcher?void 0:ei.dynamicRouteMatcher.call(ei,J((null==p?void 0:p.pathname)||Q.pathname||"/"));e&&(ed=Object.assign({},e))}}for(let e of ef)e in et||delete eh[e];let{isOnDemandRevalidate:em,revalidateOnlyGenerated:eg}=(0,e.Gx)(t,$.preview),ev=!1;if(n){let{tryGetPreviewData:e}=r("./dist/esm/server/api-utils/node/try-get-preview-data.js");ev=!1!==(x=e(t,n,$.preview,!!s))}let ey=Z(t,"relativeProjectDir")||this.relativeProjectDir,eb=null==(l=e6[e3])?void 0:l[ey],eE=(null==eb?void 0:eb.nextConfig)||T.config,ex=en;m(ex)&&ed&&(ex=ei.interpolateDynamicPath(ex,ed)),"/index"===ex&&(ex="/");let ew=ex;try{ex=ex.split("/").map(e=>{try{var t;t=decodeURIComponent(e),e=t.replace(RegExp("([/#?]|%(2f|23|3f|5c))","gi"),e=>encodeURIComponent(e))}catch(e){throw Object.defineProperty(new O("Failed to decode path param(s)."),"__NEXT_ERROR_CODE",{value:"E539",enumerable:!1,configurable:!0})}return e}).join("/")}catch(e){}return ex=_(ex),{query:eh,originalQuery:et,originalPathname:ee,params:ed,parsedUrl:Q,locale:eo,isNextDataRequest:Y,locales:null==D?void 0:D.locales,defaultLocale:es,isDraftMode:ev,previewData:x,pageIsDynamic:er,resolvedPathname:ex,encodedResolvedPathname:ew,isOnDemandRevalidate:em,revalidateOnlyGenerated:eg,...w,serverActionsManifest:w.serverActionsManifest,clientReferenceManifest:w.clientReferenceManifest,nextConfig:eE,routerServerContext:eb}}getResponseCache(e){if(!this.responseCache){let t=(!!process.env.MINIMAL_MODE||Z(e,"minimalMode"))??!1;this.responseCache=new eM(t)}return this.responseCache}async handleResponse({req:e,nextConfig:t,cacheKey:r,routeKind:n,isFallback:i,prerenderManifest:a,isRoutePPREnabled:s,isOnDemandRevalidate:o,revalidateOnlyGenerated:l,responseGenerator:u,waitUntil:c,isMinimalMode:d}){let h=this.getResponseCache(e),f=await h.get(r,u,{routeKind:n,isFallback:i,isRoutePPREnabled:s,isOnDemandRevalidate:o,isPrefetch:"prefetch"===e.headers.purpose,incrementalCache:await this.getIncrementalCache(e,t,a,d),waitUntil:c});if(!f&&r&&!(o&&l))throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return f}}var e7=r("./dist/compiled/bytes/index.js"),te=r.n(e7),tt=r("./dist/compiled/fresh/index.js"),tr=r.n(tt);let tn=require("stream");function ti(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}r("./dist/compiled/safe-stable-stringify/index.js");var ta=r("./dist/esm/server/api-utils/node/try-get-preview-data.js"),ts=r("./dist/compiled/content-type/index.js");async function to(t,n){let i,a;try{i=(0,ts.parse)(t.headers["content-type"]||"text/plain")}catch{i=(0,ts.parse)("text/plain")}let{type:s,parameters:o}=i,l=o.charset||"utf-8";try{let e=r("next/dist/compiled/raw-body");a=await e(t,{encoding:l,limit:n})}catch(t){if(ti(t)&&"entity.too.large"===t.type)throw Object.defineProperty(new e.hD(413,`Body exceeded ${n} limit`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw Object.defineProperty(new e.hD(400,"Invalid body"),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}let u=a.toString();if("application/json"===s||"application/ld+json"===s){if(0===u.length)return{};try{return JSON.parse(u)}catch(t){throw Object.defineProperty(new e.hD(400,"Invalid JSON"),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}return"application/x-www-form-urlencoded"===s?r("querystring").decode(u):u}function tl(e){return"string"==typeof e&&e.length>=16}async function tu(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Object.defineProperty(Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`),"__NEXT_ERROR_CODE",{value:"E153",enumerable:!1,configurable:!0});let i={[E.kz]:n.previewModeId,...t.unstable_onlyGenerated?{[E.r4]:"1"}:{}},a=[...n.allowedRevalidateHeaderKeys||[]];for(let e of((n.trustHostHeader||n.dev)&&a.push("cookie"),n.trustHostHeader&&a.push("x-vercel-protection-bypass"),Object.keys(r.headers)))a.includes(e)&&(i[e]=r.headers[e]);let s=n.internalRevalidate;try{if(s)return await s({urlPath:e,revalidateHeaders:i,opts:t});if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:i}),a=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==a?void 0:a.toUpperCase())!=="REVALIDATED"&&200!==n.status&&!(404===n.status&&t.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.status}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}else throw Object.defineProperty(Error("Invariant: missing internal router-server-methods this is an internal bug"),"__NEXT_ERROR_CODE",{value:"E676",enumerable:!1,configurable:!0})}catch(t){throw Object.defineProperty(Error(`Failed to revalidate ${e}: ${ti(t)?t.message:t}`),"__NEXT_ERROR_CODE",{value:"E240",enumerable:!1,configurable:!0})}}async function tc(t,n,i,a,s,o,l,u,c){try{var d,h,f;if(!a){n.statusCode=404,n.end("Not Found");return}let o=a.config||{},l=(null==(d=o.api)?void 0:d.bodyParser)!==!1,u=(null==(h=o.api)?void 0:h.responseLimit)??!0;null==(f=o.api)||f.externalResolver,(0,e.C4)({req:t},"cookies",L(t.headers)),t.query=i,(0,e.C4)({req:t},"previewData",()=>(0,ta.tryGetPreviewData)(t,n,s,!!s.multiZoneDraftMode)),(0,e.C4)({req:t},"preview",()=>!1!==t.previewData||void 0),(0,e.C4)({req:t},"draftMode",()=>t.preview),l&&!t.body&&(t.body=await to(t,o.api&&o.api.bodyParser&&o.api.bodyParser.sizeLimit?o.api.bodyParser.sizeLimit:"1mb"));let c=0,p=u&&"boolean"!=typeof u?te().parse(u):e.wX,m=n.write,g=n.end;n.write=(...e)=>(c+=Buffer.byteLength(e[0]||""),m.apply(n,e)),n.end=(...e)=>(e.length&&"function"!=typeof e[0]&&(c+=Buffer.byteLength(e[0]||"")),u&&c>=p&&console.warn(`API response for ${t.url} exceeds ${te().format(p)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),g.apply(n,e)),n.status=t=>(0,e.cD)(n,t),n.send=e=>(function(e,t,r){if(null==r)return void t.end();if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let n=t.getHeader("Content-Type");if(r instanceof tn.Stream){n||t.setHeader("Content-Type","application/octet-stream"),r.pipe(t);return}let i=["object","number","boolean"].includes(typeof r),a=i?JSON.stringify(r):r,s=((e,t=!1)=>(t?'W/"':'"')+(e=>{let t=e.length,r=0,n=0,i=8997,a=0,s=33826,o=0,l=40164,u=0,c=52210;for(;r<t;)i^=e.charCodeAt(r++),n=435*i,a=435*s,o=435*l,u=435*c,o+=i<<8,u+=s<<8,a+=n>>>16,i=65535&n,o+=a>>>16,s=65535&a,c=u+(o>>>16)&65535,l=65535&o;return(15&c)*0x1000000000000+0x100000000*l+65536*s+(i^c>>4)})(e).toString(36)+e.length.toString(36)+'"')(a);if(s&&t.setHeader("ETag",s),!tr()(e.headers,{etag:s})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){n||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type",E.U2),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(t,n,e),n.json=e=>{n.setHeader("Content-Type",E.U2),n.send(JSON.stringify(e))},n.redirect=(t,r)=>(0,e.V2)(n,t,r),n.setDraftMode=(t={enable:!0})=>(function(t,n){if(!tl(n.previewModeId))throw Object.defineProperty(Error("invariant: invalid previewModeId"),"__NEXT_ERROR_CODE",{value:"E169",enumerable:!1,configurable:!0});let i=n.enable?void 0:new Date(0),{serialize:a}=r("./dist/compiled/cookie/index.js"),s=t.getHeader("Set-Cookie");return t.setHeader("Set-Cookie",[..."string"==typeof s?[s]:Array.isArray(s)?s:[],a(e.Ic,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:i})]),t})(n,Object.assign({},s,t)),n.setPreviewData=(t,i={})=>(function(t,n,i){if(!tl(i.previewModeId))throw Object.defineProperty(Error("invariant: invalid previewModeId"),"__NEXT_ERROR_CODE",{value:"E169",enumerable:!1,configurable:!0});if(!tl(i.previewModeEncryptionKey))throw Object.defineProperty(Error("invariant: invalid previewModeEncryptionKey"),"__NEXT_ERROR_CODE",{value:"E334",enumerable:!1,configurable:!0});if(!tl(i.previewModeSigningKey))throw Object.defineProperty(Error("invariant: invalid previewModeSigningKey"),"__NEXT_ERROR_CODE",{value:"E436",enumerable:!1,configurable:!0});let a=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:s}=r("./dist/esm/server/crypto-utils.js"),o=a.sign({data:s(Buffer.from(i.previewModeEncryptionKey),JSON.stringify(n))},i.previewModeSigningKey,{algorithm:"HS256",...void 0!==i.maxAge?{expiresIn:i.maxAge}:void 0});if(o.length>2048)throw Object.defineProperty(Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue"),"__NEXT_ERROR_CODE",{value:"E465",enumerable:!1,configurable:!0});let{serialize:l}=r("./dist/compiled/cookie/index.js"),u=t.getHeader("Set-Cookie");return t.setHeader("Set-Cookie",[..."string"==typeof u?[u]:Array.isArray(u)?u:[],l(e.Ic,i.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==i.maxAge?{maxAge:i.maxAge}:void 0,...void 0!==i.path?{path:i.path}:void 0}),l(e.Uc,o,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==i.maxAge?{maxAge:i.maxAge}:void 0,...void 0!==i.path?{path:i.path}:void 0})]),t})(n,t,Object.assign({},s,i)),n.clearPreviewData=(t={})=>(0,e.wE)(n,t),n.revalidate=(e,r)=>tu(e,r||{},t,s);let v=a.default||a;await v(t,n)}catch(r){if(await (null==c?void 0:c(r,{method:t.method||"GET",headers:t.headers,path:t.url||"/"},{routerKind:"Pages Router",routePath:u||"",routeType:"route",revalidateReason:void 0})),r instanceof e.hD)(0,e.n4)(n,r.statusCode,r.message);else{if(l)throw ti(r)&&(r.page=u),r;if(console.error(r),o)throw r;(0,e.n4)(n,500,"Internal Server Error")}}}class td extends e8{constructor(t){if(super(t),"function"!=typeof t.userland.default)throw Object.defineProperty(Error(`Page ${t.definition.page} does not export a default function.`),"__NEXT_ERROR_CODE",{value:"E379",enumerable:!1,configurable:!0});this.apiResolverWrapped=(0,e.l0)(t.definition.page,tc)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname,multiZoneDraftMode:r.multiZoneDraftMode,dev:r.dev,internalRevalidate:r.internalRevalidate},r.propagateError,r.dev,r.page,r.onError)}}let th=td})(),module.exports=n})();
19
+ ${t}`),m.pop(),`{${E}}`}case"number":return isFinite(c)?String(c):t?t(c):"null";case"boolean":return!0===c?"true":"false";case"undefined":return;case"bigint":if(i)return String(c);default:return t?t(c):void 0}}("",e,[],m,"")}return function e(r,c,m){switch(typeof c){case"string":return a(c);case"object":{if(null===c)return"null";if("function"==typeof c.toJSON){if("object"!=typeof(c=c.toJSON(r)))return e(r,c,m);if(null===c)return"null"}if(-1!==m.indexOf(c))return n;let t="",i=void 0!==c.length;if(i&&Array.isArray(c)){if(0===c.length)return"[]";if(f<m.length+1)return'"[Array]"';m.push(c);let r=Math.min(c.length,p),n=0;for(;n<r-1;n++){let r=e(String(n),c[n],m);t+=void 0!==r?r:"null",t+=","}let i=e(String(n),c[n],m);if(t+=void 0!==i?i:"null",c.length-1>p){let e=c.length-p-1;t+=`,"... ${d(e)} not stringified"`}return m.pop(),`[${t}]`}let g=Object.keys(c),v=g.length;if(0===v)return"{}";if(f<m.length+1)return'"[Object]"';let y="",b=Math.min(v,p);i&&l(c)&&(t+=u(c,",",p),g=g.slice(c.length),b-=c.length,y=","),o&&(g=s(g,h)),m.push(c);for(let r=0;r<b;r++){let n=g[r],i=e(n,c[n],m);void 0!==i&&(t+=`${y}${a(n)}:${i}`,y=",")}return v>p&&(t+=`${y}"...":"${d(v-p)} not stringified"`),m.pop(),`{${t}}`}case"number":return isFinite(c)?String(c):t?t(c):"null";case"boolean":return!0===c?"true":"false";case"undefined":return;case"bigint":if(i)return String(c);default:return t?t(c):void 0}}("",e,[])}}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}},s=!0;try{t[e](a,a.exports,n),s=!1}finally{s&&delete r[e]}return a.exports}n.ab=__dirname+"/",e.exports=n(879)}()},"./dist/esm/lib/constants.js":function(e,t,r){"use strict";r.d(t,{AA:()=>a,EP:()=>p,RM:()=>h,U2:()=>i,VC:()=>m,c1:()=>v,h:()=>s,j9:()=>n,kz:()=>o,mH:()=>c,pu:()=>u,qF:()=>y,r4:()=>l,tz:()=>d,vS:()=>g,x3:()=>f});let n="text/html; charset=utf-8",i="application/json; charset=utf-8",a="nxtP",s="nxtI",o="x-prerender-revalidate",l="x-prerender-revalidate-if-generated",u=".prefetch.rsc",c=".segments",d=".segment.rsc",h=".rsc",f=".json",p=".meta",m="x-next-cache-tags",g="x-next-revalidated-tags",v="x-next-revalidate-tag-token",y=31536e3,b={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"};({...b,GROUP:{builtinReact:[b.reactServerComponents,b.actionBrowser],serverOnly:[b.reactServerComponents,b.actionBrowser,b.instrument,b.middleware],neutralTarget:[b.apiNode,b.apiEdge],clientOnly:[b.serverSideRendering,b.appPagesBrowser],bundled:[b.reactServerComponents,b.actionBrowser,b.serverSideRendering,b.appPagesBrowser,b.shared,b.instrument,b.middleware],appPages:[b.reactServerComponents,b.serverSideRendering,b.appPagesBrowser,b.actionBrowser]}})},"./dist/esm/lib/format-dynamic-import-path.js":function(e,t,r){"use strict";r.r(t),r.d(t,{formatDynamicImportPath:()=>s});var n=r("path"),i=r.n(n);let a=require("url"),s=(e,t)=>{let r=i().isAbsolute(t)?t:i().join(e,t);return(0,a.pathToFileURL)(r).toString()}},"./dist/esm/server/api-utils/index.js":function(e,t,r){"use strict";r.d(t,{C4:()=>b,Gx:()=>c,Ic:()=>d,PW:()=>p,Uc:()=>h,V2:()=>u,cD:()=>l,hD:()=>v,l0:()=>o,n4:()=>y,wE:()=>g,wX:()=>f});var n=r("./dist/esm/server/web/spec-extension/adapters/headers.js"),i=r("./dist/esm/lib/constants.js"),a=r("../lib/trace/tracer"),s=r("./dist/esm/server/lib/trace/constants.js");function o(e,t){return(...r)=>((0,a.getTracer)().setRootSpanAttribute("next.route",e),(0,a.getTracer)().trace(s.fP.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r)))}function l(e,t){return e.statusCode=t,e}function u(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw Object.defineProperty(Error("Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination')."),"__NEXT_ERROR_CODE",{value:"E389",enumerable:!1,configurable:!0});return e.writeHead(t,{Location:r}),e.write(r),e.end(),e}function c(e,t){let r=n.o.from(e.headers);return{isOnDemandRevalidate:r.get(i.kz)===t.previewModeId,revalidateOnlyGenerated:r.has(i.r4)}}let d="__prerender_bypass",h="__next_preview_data",f=4194304,p=Symbol(h),m=Symbol(d);function g(e,t={}){if(m in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],n(d,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(h,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,m,{value:!0,enumerable:!1}),e}class v extends Error{constructor(e,t){super(t),this.statusCode=e}}function y(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function b({req:e},t,r){let n={configurable:!0,enumerable:!0},i={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...i,value:n}),n},set:r=>{Object.defineProperty(e,t,{...i,value:r})}})}},"./dist/esm/server/api-utils/node/try-get-preview-data.js":function(e,t,r){"use strict";r.r(t),r.d(t,{tryGetPreviewData:()=>s});var n=r("./dist/esm/server/api-utils/index.js"),i=r("./dist/esm/server/web/spec-extension/cookies.js"),a=r("./dist/esm/server/web/spec-extension/adapters/headers.js");function s(e,t,s,o){var l,u;let c;if(s&&(0,n.Gx)(e,s).isOnDemandRevalidate)return!1;if(n.PW in e)return e[n.PW];let d=a.o.from(e.headers),h=new i.tm(d),f=null==(l=h.get(n.Ic))?void 0:l.value,p=null==(u=h.get(n.Uc))?void 0:u.value;if(f&&!p&&f===s.previewModeId){let t={};return Object.defineProperty(e,n.PW,{value:t,enumerable:!1}),t}if(!f&&!p)return!1;if(!f||!p||f!==s.previewModeId)return o||(0,n.wE)(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(p,s.previewModeSigningKey)}catch{return(0,n.wE)(t),!1}let{decryptWithSecret:m}=r("./dist/esm/server/crypto-utils.js"),g=m(Buffer.from(s.previewModeEncryptionKey),c.data);try{let t=JSON.parse(g);return Object.defineProperty(e,n.PW,{value:t,enumerable:!1}),t}catch{return!1}}},"./dist/esm/server/crypto-utils.js":function(e,t,r){"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>o,encryptWithSecret:()=>s});var n=r("crypto"),i=r.n(n);let a="aes-256-gcm";function s(e,t){let r=i().randomBytes(16),n=i().randomBytes(64),s=i().pbkdf2Sync(e,n,1e5,32,"sha512"),o=i().createCipheriv(a,s,r),l=Buffer.concat([o.update(t,"utf8"),o.final()]),u=o.getAuthTag();return Buffer.concat([n,r,u,l]).toString("hex")}function o(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),s=r.slice(64,80),o=r.slice(80,96),l=r.slice(96),u=i().pbkdf2Sync(e,n,1e5,32,"sha512"),c=i().createDecipheriv(a,u,s);return c.setAuthTag(o),c.update(l)+c.final("utf8")}},"./dist/esm/server/lib/node-fs-methods.js":function(e,t,r){"use strict";r.d(t,{e:()=>a});let n=require("fs");var i=r.n(n);let a={existsSync:i().existsSync,readFile:i().promises.readFile,readFileSync:i().readFileSync,writeFile:(e,t)=>i().promises.writeFile(e,t),mkdir:e=>i().promises.mkdir(e,{recursive:!0}),stat:e=>i().promises.stat(e)}},"./dist/esm/server/lib/trace/constants.js":function(e,t,r){"use strict";r.d(t,{Fx:()=>a,fP:()=>s});var n,i,a=((n=a||{}).compression="NextNodeServer.compression",n.getBuildId="NextNodeServer.getBuildId",n.createComponentTree="NextNodeServer.createComponentTree",n.clientComponentLoading="NextNodeServer.clientComponentLoading",n.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",n.generateStaticRoutes="NextNodeServer.generateStaticRoutes",n.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",n.generatePublicRoutes="NextNodeServer.generatePublicRoutes",n.generateImageRoutes="NextNodeServer.generateImageRoutes.route",n.sendRenderResult="NextNodeServer.sendRenderResult",n.proxyRequest="NextNodeServer.proxyRequest",n.runApi="NextNodeServer.runApi",n.render="NextNodeServer.render",n.renderHTML="NextNodeServer.renderHTML",n.imageOptimizer="NextNodeServer.imageOptimizer",n.getPagePath="NextNodeServer.getPagePath",n.getRoutesManifest="NextNodeServer.getRoutesManifest",n.findPageComponents="NextNodeServer.findPageComponents",n.getFontManifest="NextNodeServer.getFontManifest",n.getServerComponentManifest="NextNodeServer.getServerComponentManifest",n.getRequestHandler="NextNodeServer.getRequestHandler",n.renderToHTML="NextNodeServer.renderToHTML",n.renderError="NextNodeServer.renderError",n.renderErrorToHTML="NextNodeServer.renderErrorToHTML",n.render404="NextNodeServer.render404",n.startResponse="NextNodeServer.startResponse",n.route="route",n.onProxyReq="onProxyReq",n.apiResolver="apiResolver",n.internalFetch="internalFetch",n),s=((i=s||{}).runHandler="Node.runHandler",i)},"./dist/esm/server/web/spec-extension/adapters/headers.js":function(e,t,r){"use strict";r.d(t,{o:()=>a});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class a extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.get(t,r,i);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);if(void 0!==s)return n.get(t,s,i)},set(t,r,i,a){if("symbol"==typeof r)return n.set(t,r,i,a);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return n.set(t,o??r,i,a)},has(t,r){if("symbol"==typeof r)return n.has(t,r);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==a&&n.has(t,a)},deleteProperty(t,r){if("symbol"==typeof r)return n.deleteProperty(t,r);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===a||n.deleteProperty(t,a)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new a(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},"./dist/esm/server/web/spec-extension/cookies.js":function(e,t,r){"use strict";r.d(t,{tm:()=>n.RequestCookies});var n=r("./dist/compiled/@edge-runtime/cookies/index.js")},"./dist/esm/shared/lib/isomorphic/path.js":function(e,t,r){e.exports=r("path")},"./dist/esm/shared/lib/modern-browserslist-target.js":function(e){e.exports=["chrome 111","edge 111","firefox 111","safari 16.4"]},"../lib/router-utils/instrumentation-globals.external.js":function(e){"use strict";e.exports=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js")},"../lib/trace/tracer":function(e){"use strict";e.exports=require("next/dist/server/lib/trace/tracer")},"../load-manifest.external":function(e){"use strict";e.exports=require("next/dist/server/load-manifest.external.js")},"next/dist/compiled/jsonwebtoken":function(e){"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/raw-body":function(e){"use strict";e.exports=require("next/dist/compiled/raw-body")},crypto:function(e){"use strict";e.exports=require("crypto")},"node:path":function(e){"use strict";e.exports=require("node:path")},path:function(e){"use strict";e.exports=require("path")},querystring:function(e){"use strict";e.exports=require("querystring")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,i){if(1&i&&(n=this(n)),8&i||"object"==typeof n&&n&&(4&i&&n.__esModule||16&i&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>{s[e]=()=>n[e]});return s.default=()=>n,r.d(a,s),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{PagesAPIRouteModule:()=>td,default:()=>th});var e=r("./dist/esm/server/api-utils/index.js");r("./dist/esm/shared/lib/modern-browserslist-target.js");let t={client:"client",server:"server",edgeServer:"edge-server"};t.client,t.server,t.edgeServer;let i="build-manifest.json";function a(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:""}}[...process?.features?.typescript?["next.config.mts"]:[]],Symbol("polyfills");let s=new WeakMap;function o(e,t){let r;if(!t)return{pathname:e};let n=s.get(t);n||(n=t.map(e=>e.toLowerCase()),s.set(t,n));let i=e.split("/",2);if(!i[1])return{pathname:e};let a=i[1].toLowerCase(),o=n.indexOf(a);return o<0?{pathname:e}:(r=t[o],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}function l(e){return e.startsWith("/")?e:`/${e}`}function u(e){return l(e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:`${e}/${t}`:e,""))}function c(e){return e.replace(/\.rsc($|\?)/,"$1")}let d=["(..)(..)","(.)","(..)","(...)"];function h(e){return void 0!==e.split("/").find(e=>d.find(t=>e.startsWith(t)))}let f=/\/[^/]*\[[^/]+\][^/]*(?=\/|$)/,p=/\/\[[^/]+\](?=\/|$)/;function m(e,t=!0){return(h(e)&&(e=function(e){let t,r,n;for(let i of e.split("/"))if(r=d.find(e=>i.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=u(t),r){case"(.)":n="/"===t?`/${n}`:t+"/"+n;break;case"(..)":if("/"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});n=t.split("/").slice(0,-1).concat(n).join("/");break;case"(...)":n="/"+n;break;case"(..)(..)":let i=t.split("/");if(i.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});n=i.slice(0,-2).concat(n).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}(e).interceptedRoute),t)?p.test(e):f.test(e)}function g(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function v(e,t){if("string"!=typeof e)return!1;let{pathname:r}=g(e);return r===t||r.startsWith(t+"/")}function y(e,t){if(!v(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}var b=r("./dist/compiled/path-to-regexp/index.js"),E=r("./dist/esm/lib/constants.js");let x=/[|\\{}()[\]^$+*?.-]/,w=/[|\\{}()[\]^$+*?.-]/g;function P(e){return x.test(e)?e.replace(w,"\\$&"):e}function _(e){return e.replace(/\/$/,"")||"/"}class R extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}let C=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function S(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 A({interceptionMarker:e,getSafeRouteKey:t,segment:r,routeKeys:n,keyPrefix:i,backreferenceDuplicateKeys:a}){let s,{key:o,optional:l,repeat:u}=S(r),c=o.replace(/\W/g,"");i&&(c=`${i}${c}`);let d=!1;(0===c.length||c.length>30)&&(d=!0),isNaN(parseInt(c.slice(0,1)))||(d=!0),d&&(c=t());let h=c in n;i?n[c]=`${i}${o}`:n[c]=o;let f=e?P(e):"";return s=h&&a?`\\k<${c}>`:u?`(?<${c}>.+?)`:`(?<${c}>[^/]+?)`,{key:o,pattern:l?`(?:/${f}${s})?`:`/${f}${s}`,cleanedKey:c,optional:l,repeat:u}}"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class O extends Error{}class $ extends Error{}let T="_NEXTSEP_";function j(e){return"string"==typeof e&&!!(/\/\(\.{1,3}\):[^/\s]+/.test(e)||/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(e))}function D(e){let t=e;return(t=t.replace(/(\([^)]*\)):([^/\s]+)/g,`$1${T}:$2`)).replace(/:([^:/\s)]+)(?=:)/g,`:$1${T}`)}function k(e){return e.replace(RegExp(`\\)${T}`,"g"),")")}function N(e,t,r){if("string"!=typeof e)return(0,b.pathToRegexp)(e,t,r);let n=j(e),i=n?D(e):e;try{return(0,b.pathToRegexp)(i,t,r)}catch(i){if(!n)try{let n=D(e);return(0,b.pathToRegexp)(n,t,r)}catch(e){}throw i}}function M(e,t){let r=j(e),n=r?D(e):e;try{let e=(0,b.compile)(n,t);if(r)return t=>k(e(t));return e}catch(n){if(!r)try{let r=D(e),n=(0,b.compile)(r,t);return e=>k(n(e))}catch(e){}throw n}}function I({re:e,groups:t}){var r;return r=r=>{let n=e.exec(r);if(!n)return!1;let i=e=>{try{return decodeURIComponent(e)}catch{throw Object.defineProperty(new O("failed to decode param"),"__NEXT_ERROR_CODE",{value:"E528",enumerable:!1,configurable:!0})}},a={};for(let[e,r]of Object.entries(t)){let t=n[r.pos];void 0!==t&&(r.repeat?a[e]=t.split("/").map(e=>i(e)):a[e]=i(t))}return a},e=>{let t=r(e);if(!t)return!1;let n={};for(let[e,r]of Object.entries(t))"string"==typeof r?n[e]=r.replace(RegExp(`^${T}`),""):Array.isArray(r)?n[e]=r.map(e=>"string"==typeof e?e.replace(RegExp(`^${T}`),""):e):n[e]=r;return n}}function F(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function H(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function L(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:n}=r("./dist/compiled/cookie/index.js");return n(Array.isArray(t)?t.join("; "):t)}}function U(e){return e.replace(/__ESC_COLON_/gi,":")}function q(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(`:${r}`)&&(e=e.replace(RegExp(`:${r}\\*`,"g"),`:${r}--ESCAPED_PARAM_ASTERISKS`).replace(RegExp(`:${r}\\?`,"g"),`:${r}--ESCAPED_PARAM_QUESTION`).replace(RegExp(`:${r}\\+`,"g"),`:${r}--ESCAPED_PARAM_PLUS`).replace(RegExp(`:${r}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${r}`));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),M(`/${e}`,{validate:!1})(t).slice(1)}function G(e){for(let t of[E.AA,E.h])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}function z(e){try{return decodeURIComponent(e)}catch{return e}}let B=/https?|ftp|gopher|file/;function X(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==E.AA&&r.startsWith(E.AA),i=r!==E.h&&r.startsWith(E.h);(n||i||t.includes(r))&&delete e[r]}}function W(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}function K(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}function J(e){return v(e||"/","/_next/data")&&"/index"===(e=e.replace(/\/_next\/data\/[^/]{1,}/,"").replace(/\.json$/,""))?"/":e}let V=Symbol.for("NextInternalRequestMeta");function Z(e,t){let r=e[V]||{};return"string"==typeof t?r[t]:r}function Q(e){let t=/^\/index(\/|$)/.test(e)&&!m(e)?`/index${e}`:"/"===e?"/index":l(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new $(`Requested and resolved page mismatch: ${t} ${n}`)}return t}let Y={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"]}},ee=(e,t)=>t&&0!==t.length?`(?:\\.(${e.join("|")})|(\\.(${t.join("|")})))`:`(\\.(?:${e.join("|")}))`,et=/^[\\/]favicon\.ico$/,er=/^[\\/]robots\.txt$/,en=/^[\\/]manifest\.json$/,ei=/^[\\/]manifest\.webmanifest$/,ea=/[\\/]sitemap\.xml$/,es=new Map;class eo{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}class el{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new el(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:a,reject:s}=new eo;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:a,key:e});a(r)}catch(e){s(e)}finally{this.pending.delete(r)}}),i}}let eu=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var ec=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}({}),ed=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({}),eh=r("../lib/trace/tracer");function ef(){}new Uint8Array([60,104,116,109,108]),new Uint8Array([60,98,111,100,121]),new Uint8Array([60,47,104,101,97,100,62]),new Uint8Array([60,47,98,111,100,121,62]),new Uint8Array([60,47,104,116,109,108,62]),new Uint8Array([60,47,98,111,100,121,62,60,47,104,116,109,108,62]),new Uint8Array([60,109,101,116,97,32,110,97,109,101,61,34,194,171,110,120,116,45,105,99,111,110,194,187,34]);let ep=new TextEncoder;function em(e){return new ReadableStream({start(t){t.enqueue(ep.encode(e)),t.close()}})}function eg(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function ev(e,t){let r=new TextDecoder("utf-8",{fatal:!0}),n="";for await(let i of e){if(null==t?void 0:t.aborted)return n;n+=r.decode(i,{stream:!0})}return n+r.decode()}function ey(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:i}=g(e);return`${t}${r}${n}${i}`}function eb(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:i}=g(e);return`${r}${t}${n}${i}`}let eE=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function ex(e,t){return new URL(String(e).replace(eE,"localhost"),t&&String(t).replace(eE,"localhost"))}let ew=Symbol("NextURLInternal");class eP{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[ew]={url:ex(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,n,i;let a=function(e,t){let{basePath:r,i18n:n,trailingSlash:i}=t.nextConfig??{},a={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):i};r&&v(a.pathname,r)&&(a.pathname=y(a.pathname,r),a.basePath=r);let s=a.pathname;if(a.pathname.startsWith("/_next/data/")&&a.pathname.endsWith(".json")){let e=a.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");a.buildId=e[0],s="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(a.pathname=s)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(a.pathname):o(a.pathname,n.locales);a.locale=e.detectedLocale,a.pathname=e.pathname??a.pathname,!e.detectedLocale&&a.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(s):o(s,n.locales)).detectedLocale&&(a.locale=e.detectedLocale)}return a}(this[ew].url.pathname,{nextConfig:this[ew].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[ew].options.i18nProvider}),s=K(this[ew].url,this[ew].options.headers);this[ew].domainLocale=this[ew].options.i18nProvider?this[ew].options.i18nProvider.detectDomainLocale(s):W(null==(t=this[ew].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,s);let l=(null==(r=this[ew].domainLocale)?void 0:r.defaultLocale)||(null==(i=this[ew].options.nextConfig)||null==(n=i.i18n)?void 0:n.defaultLocale);this[ew].url.pathname=a.pathname,this[ew].defaultLocale=l,this[ew].basePath=a.basePath??"",this[ew].buildId=a.buildId,this[ew].locale=a.locale??l,this[ew].trailingSlash=a.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,n){if(!t||t===r)return e;let i=e.toLowerCase();return!n&&(v(i,"/api")||v(i,`/${t.toLowerCase()}`))?e:ey(e,`/${t}`)}((e={basePath:this[ew].basePath,buildId:this[ew].buildId,defaultLocale:this[ew].options.forceLocale?void 0:this[ew].defaultLocale,locale:this[ew].locale,pathname:this[ew].url.pathname,trailingSlash:this[ew].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=_(t)),e.buildId&&(t=eb(ey(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=ey(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:eb(t,"/"):_(t)}formatSearch(){return this[ew].url.search}get buildId(){return this[ew].buildId}set buildId(e){this[ew].buildId=e}get locale(){return this[ew].locale??""}set locale(e){var t,r;if(!this[ew].locale||!(null==(r=this[ew].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[ew].locale=e}get defaultLocale(){return this[ew].defaultLocale}get domainLocale(){return this[ew].domainLocale}get searchParams(){return this[ew].url.searchParams}get host(){return this[ew].url.host}set host(e){this[ew].url.host=e}get hostname(){return this[ew].url.hostname}set hostname(e){this[ew].url.hostname=e}get port(){return this[ew].url.port}set port(e){this[ew].url.port=e}get protocol(){return this[ew].url.protocol}set protocol(e){this[ew].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[ew].url=ex(e),this.analyze()}get origin(){return this[ew].url.origin}get pathname(){return this[ew].url.pathname}set pathname(e){this[ew].url.pathname=e}get hash(){return this[ew].url.hash}set hash(e){this[ew].url.hash=e}get search(){return this[ew].url.search}set search(e){this[ew].url.search=e}get password(){return this[ew].url.password}set password(e){this[ew].url.password=e}get username(){return this[ew].url.username}set username(e){this[ew].url.username=e}get basePath(){return this[ew].basePath}set basePath(e){this[ew].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new eP(String(this),this[ew].options)}}r("./dist/esm/server/web/spec-extension/cookies.js"),Symbol("internal request"),Request,Symbol.for("edge-runtime.inspect.custom");let e_="ResponseAborted";class eR extends Error{constructor(...e){super(...e),this.name=e_}}var eC=r("./dist/esm/server/lib/trace/constants.js");let eS=0,eA=0,eO=0;function e$(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===e_}async function eT(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 eR)}),t}(t),s=function(e,t){let r=!1,n=new eo;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let a=new eo;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===eS?void 0:{clientComponentLoadStart:eS,clientComponentLoadTimes:eA,clientComponentLoadCount:eO};return e.reset&&(eS=0,eA=0,eO=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,eh.getTracer)().trace(eC.Fx.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 eo)}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(e$(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class ej{static #e=this.EMPTY=new ej(null,{metadata:{},contentType:null});static fromStatic(e,t){return new ej(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 R("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return ev(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?em(this.response):Buffer.isBuffer(this.response)?eg(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(ef),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[em(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[eg(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(e$(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await eT(this.readable,e,this.waitUntil)}}var eD=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}({});async function ek(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===ec.PAGES?{kind:ec.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)===ec.APP_PAGE?{kind:ec.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 eN(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===ec.PAGES?{kind:ec.PAGES,html:ej.fromStatic(e.value.html,E.j9),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ec.APP_PAGE?{kind:ec.APP_PAGE,html:ej.fromStatic(e.value.html,E.j9),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class eM{constructor(e){this.getBatcher=el.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:eu}),this.revalidateBatcher=el.create({schedulerFn:eu}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return eN(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:a=!1,isFallback:s=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:u,routeKind:c}=r;return eN(await this.getBatcher.batch({key:e,isOnDemandRevalidate:a},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:a,isFallback:s,isRoutePPREnabled:o,isPrefetch:l,routeKind:c},r);return u&&u(n),n}))}async handleGet(e,t,r,n){let i=null,a=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case eD.PAGES:return ed.PAGES;case eD.APP_PAGE:return ed.APP_PAGE;case eD.IMAGE:return ed.IMAGE;case eD.APP_ROUTE:return ed.APP_ROUTE;case eD.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(i),a=!0,!i.isStale||r.isPrefetch))return i;let s=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!s)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,s}catch(e){if(a)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,a,s,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,a,s);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,a,s){try{let o=await i({hasResolved:s,previousCacheEntry:a,isRevalidating:!0});if(!o)return null;let l=await ek({...o,isMiss:!a});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(i){if(null==a?void 0:a.cacheControl){let i=Math.min(Math.max(a.cacheControl.revalidate||3,3),30),s=void 0===a.cacheControl.expire?void 0:Math.max(i+3,a.cacheControl.expire);await t.set(e,a.value,{cacheControl:{revalidate:i,expire:s},isRoutePPREnabled:r,isFallback:n})}throw i}}}var eI=r("./dist/esm/shared/lib/isomorphic/path.js"),eF=r.n(eI);let eH=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class eL{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(eF().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 eU=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class eq{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?eq.memoryCache?eq.debug&&console.log("FileSystemCache: memory store already initialized"):(eq.debug&&console.log("FileSystemCache: using memory store for fetch cache"),eq.memoryCache=(0,eU.getMemoryCache)(e.maxMemoryCacheSize)):eq.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,eq.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=eH.tagsManifest.get(n)||{};if(t){let i={...e};i.stale=r,void 0!==t.expire&&(i.expired=r+1e3*t.expire),eH.tagsManifest.set(n,i)}else eH.tagsManifest.set(n,{...e,expired:r})}}async get(...e){var t,r,n,i,a,s,o,l,u;let[c,d]=e,{kind:h}=d,f=null==(t=eq.memoryCache)?void 0:t.get(c);if(eq.debug&&(h===ed.FETCH?console.log("FileSystemCache: get",c,d.tags,h,!!f):console.log("FileSystemCache: get",c,h,!!f)),!f)try{if(h===ed.APP_ROUTE){let e=this.getFilePath(`${c}.body`,ed.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$/,E.EP),"utf8"));f={lastModified:r.getTime(),value:{kind:ec.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ed.FETCH?c:`${c}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ed.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=d;if(!this.flushToDisk)return null;let a=r.getTime(),l=JSON.parse(t);if(f={lastModified:a,value:l},(null==(s=f.value)?void 0:s.kind)===ec.FETCH){let t=null==(o=f.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(eq.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(c,f.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ed.APP_PAGE){let n,i,a;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,E.EP),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=c+E.mH;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+E.tz,ed.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}d.isFallback||(a=await this.fs.readFile(this.getFilePath(`${c}${d.isRoutePPREnabled?E.pu:E.RM}`,ed.APP_PAGE))),f={lastModified:r.getTime(),value:{kind:ec.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===ed.PAGES){let e,n={};d.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${c}${E.x3}`,ed.PAGES),"utf8"))),f={lastModified:r.getTime(),value:{kind:ec.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})}f&&(null==(l=eq.memoryCache)||l.set(c,f))}catch{return null}if((null==f||null==(r=f.value)?void 0:r.kind)===ec.APP_PAGE||(null==f||null==(n=f.value)?void 0:n.kind)===ec.APP_ROUTE||(null==f||null==(i=f.value)?void 0:i.kind)===ec.PAGES){let e=null==(u=f.value.headers)?void 0:u[E.VC];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,eH.areTagsExpired)(t,f.lastModified))return eq.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==f||null==(a=f.value)?void 0:a.kind)===ec.FETCH){let e=d.kind===ed.FETCH?[...d.tags||[],...d.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return eq.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,eH.areTagsExpired)(e,f.lastModified))return eq.debug&&console.log("FileSystemCache: expired tags",e),null}return f??null}async set(e,t,r){var n;if(null==(n=eq.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),eq.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new eL(this.fs);if(t.kind===ec.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ed.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$/,E.EP),JSON.stringify(n,null,2))}else if(t.kind===ec.PAGES||t.kind===ec.APP_PAGE){let n=t.kind===ec.APP_PAGE,a=this.getFilePath(`${e}.html`,n?ed.APP_PAGE:ed.PAGES);if(i.append(a,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?E.pu:E.RM:E.x3}`,n?ed.APP_PAGE:ed.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===ec.APP_PAGE){let e;if(t.segmentData){e=[];let r=a.replace(/\.html$/,E.mH);for(let[n,a]of t.segmentData){e.push(n);let t=r+n+E.tz;i.append(t,a)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(a.replace(/\.html$/,E.EP),JSON.stringify(r))}}else if(t.kind===ec.FETCH){let n=this.getFilePath(e,ed.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ed.FETCH:return eF().join(this.serverDistDir,"..","cache","fetch-cache",e);case ed.PAGES:return eF().join(this.serverDistDir,"pages",e);case ed.IMAGE:case ed.APP_PAGE:case ed.APP_ROUTE:return eF().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}function eG(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}let ez=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js"),eB=require("next/dist/server/app-render/work-unit-async-storage.external.js"),eX=require("next/dist/server/app-render/work-async-storage.external.js");class eW{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:u,allowedRevalidateHeaderKeys:c}){var d,h,f,p;this.locks=new Map,this.hasCustomCacheHandler=!!u;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(u)eW.debug&&console.log("IncrementalCache: using custom cache handler",u.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?(u=t.FetchCache,eW.debug&&console.log("IncrementalCache: using global FetchCache cache handler")):e&&i&&(eW.debug&&console.log("IncrementalCache: using filesystem cache handler"),u=eq)}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=c,this.prerenderManifest=o(),this.cacheControls=new ez.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let v=[];a[E.kz]===(null==(h=this.prerenderManifest)||null==(d=h.preview)?void 0:d.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(v=this.revalidatedTags=function(e,t){return"string"==typeof e[E.vS]&&e[E.c1]===t?e[E.vS].split(","):[]}(a,null==(p=this.prerenderManifest)||null==(f=p.preview)?void 0:f.previewModeId)),u&&(this.cacheHandler=new u({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:v,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(eG(e)),a=i?i.revalidate:!n&&1;return"number"==typeof a?1e3*a+t:a}_getPathname(e,t){return t?e:Q(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(eW.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new eo;return eW.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let n=[],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,s,o,l;let u,c;if(t.kind===ed.FETCH){let t=eB.workUnitAsyncStorage.getStore(),r=t?(0,eB.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===ec.FETCH)return eW.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};eW.debug&&console.log("IncrementalCache: rdc:miss",e)}else eW.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ed.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ed.FETCH);let d=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ed.FETCH){if(!d)return null;if((null==(i=d.value)?void 0:i.kind)!==ec.FETCH)throw Object.defineProperty(new R(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(a=d.value)?void 0:a.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eX.workAsyncStorage.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return eW.debug&&console.log("IncrementalCache: expired tag",e),null;let s=eB.workUnitAsyncStorage.getStore();if(s){let t=(0,eB.getPrerenderResumeDataCache)(s);t&&(eW.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,d.value))}let o=t.revalidate||d.value.revalidate,l=(performance.timeOrigin+performance.now()-(d.lastModified||0))/1e3>o,u=d.value.data;return(0,eH.areTagsExpired)(n,d.lastModified)?null:((0,eH.areTagsStale)(n,d.lastModified)&&(l=!0),{isStale:l,value:{kind:ec.FETCH,data:u,revalidate:o}})}if((null==d||null==(n=d.value)?void 0:n.kind)===ec.FETCH)throw Object.defineProperty(new R(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,f=this.cacheControls.get(eG(e));if((null==d?void 0:d.lastModified)===-1)u=-1,c=-1*E.qF;else{let r=performance.timeOrigin+performance.now(),n=(null==d?void 0:d.lastModified)||r;if(void 0===(u=!1!==(c=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&c<r||void 0)&&((null==d||null==(s=d.value)?void 0:s.kind)===ec.APP_PAGE||(null==d||null==(o=d.value)?void 0:o.kind)===ec.APP_ROUTE)){let e=null==(l=d.value.headers)?void 0:l[E.VC];if("string"==typeof e){let t=e.split(",");t.length>0&&((0,eH.areTagsExpired)(t,n)?u=-1:(0,eH.areTagsStale)(t,n)&&(u=!0))}}}return d&&(h={isStale:u,cacheControl:f,revalidateAfter:c,value:d.value}),!d&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:u,value:null,cacheControl:f,revalidateAfter:c},this.set(e,h.value,{...t,cacheControl:f})),h}async set(e,t,r){if((null==t?void 0:t.kind)===ec.FETCH){let r=eB.workUnitAsyncStorage.getStore(),n=r?(0,eB.getPrerenderResumeDataCache)(r):null;n&&(eW.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(eG(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)}}}class eK{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class eJ{constructor(){this.prev=null,this.next=null}}class eV{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new eJ,this.tail=new eJ,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let n=this.cache.get(e);if(n)n.data=t,this.totalSize=this.totalSize-n.size+r,n.size=r,this.moveToHead(n);else{let n=new eK(e,t,r);this.cache.set(e,n),this.addToHead(n),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}function eZ(e){if(0===e)return{get:()=>Promise.resolve(void 0),set:()=>Promise.resolve(),refreshTags:()=>Promise.resolve(),getExpiration:()=>Promise.resolve(0),updateTags:()=>Promise.resolve()};let t=new eV(e,e=>e.size),r=new Map,n=process.env.NEXT_PRIVATE_DEBUG_CACHE?console.debug.bind(console,"DefaultCacheHandler:"):void 0;return{async get(e){let i=r.get(e);i&&(null==n||n("get",e,"pending"),await i);let a=t.get(e);if(!a){null==n||n("get",e,"not found");return}let s=a.entry;if(performance.timeOrigin+performance.now()>s.timestamp+1e3*s.revalidate){null==n||n("get",e,"expired");return}let o=s.revalidate;if((0,eH.areTagsExpired)(s.tags,s.timestamp)){null==n||n("get",e,"had expired tag");return}(0,eH.areTagsStale)(s.tags,s.timestamp)&&(null==n||n("get",e,"had stale tag"),o=-1);let[l,u]=s.value.tee();return s.value=u,null==n||n("get",e,"found",{tags:s.tags,timestamp:s.timestamp,expire:s.expire,revalidate:o}),{...s,revalidate:o,value:l}},async set(e,i){null==n||n("set",e,"start");let a=()=>{},s=new Promise(e=>{a=e});r.set(e,s);let o=await i,l=0;try{let[r,i]=o.value.tee();o.value=r;let a=i.getReader();for(let e;!(e=await a.read()).done;)l+=Buffer.from(e.value).byteLength;t.set(e,{entry:o,isErrored:!1,errorRetryCount:0,size:l}),null==n||n("set",e,"done")}catch(t){null==n||n("set",e,"failed",t)}finally{a(),r.delete(e)}},async refreshTags(){},async getExpiration(e){let t=Math.max(...e.map(e=>{let t=eH.tagsManifest.get(e);return t&&t.expired||0}),0);return null==n||n("getExpiration",{tags:e,expiration:t}),t},async updateTags(e,t){let r=Math.round(performance.timeOrigin+performance.now());for(let i of(null==n||n("updateTags",{tags:e,timestamp:r}),e)){let e=eH.tagsManifest.get(i)||{};if(t){let n={...e};n.stale=r,void 0!==t.expire&&(n.expired=r+1e3*t.expire),eH.tagsManifest.set(i,n)}else eH.tagsManifest.set(i,{...e,expired:r})}}}}let eQ=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,eY=Symbol.for("@next/cache-handlers"),e0=Symbol.for("@next/cache-handlers-map"),e1=Symbol.for("@next/cache-handlers-set"),e2=globalThis;function e4(e){return e.default||e}let e3=Symbol.for("@next/router-server-methods"),e6=globalThis;function e9(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)==="next-url"}let e5=e=>import(e).then(e=>e.default||e);class e8{constructor({userland:e,definition:t,distDir:r,relativeProjectDir:n}){this.userland=e,this.definition=t,this.isDev=!1,this.distDir=r,this.relativeProjectDir=n}async instrumentationOnRequestError(e,...t){{let{join:n}=r("node:path"),i=n(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir),{instrumentationOnRequestError:a}=await Promise.resolve().then(r.t.bind(r,"../lib/router-utils/instrumentation-globals.external.js",23));return a(i,this.distDir,...t)}}loadManifests(e,t){{var n;if(!t)throw Object.defineProperty(Error("Invariant: projectDir is required for node runtime"),"__NEXT_ERROR_CODE",{value:"E718",enumerable:!1,configurable:!0});let{loadManifestFromRelativePath:a}=r("../load-manifest.external"),s=Q(e),o=this.definition.kind===eD.PAGES||this.definition.kind===eD.PAGES_API?"pages":"app",[l,u,c,d,h,f,p,m,g,v,y,b]=[a({projectDir:t,distDir:this.distDir,manifest:"routes-manifest.json",shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:"prerender-manifest.json",shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:i,shouldCache:!this.isDev}),"/_error"===e?a({projectDir:t,distDir:this.distDir,manifest:`fallback-${i}`,shouldCache:!this.isDev,handleMissing:!0}):{},a({projectDir:t,distDir:this.distDir,manifest:`server/${"app"===o?"app":"pages"}${s}/react-loadable-manifest.json`,handleMissing:!0,shouldCache:!this.isDev}),a({projectDir:t,distDir:this.distDir,manifest:"server/next-font-manifest.json",shouldCache:!this.isDev}),"app"!==o||function(e){let t=e.replace(/\/route$/,"");return e.endsWith("/route")&&function(e,t,r){if(!e||e.length<2)return!1;let n=e.replace(/\\/g,"/"),i=!!(et.test(n)||er.test(n)||en.test(n)||ei.test(n)||ea.test(n))||(!!n.includes("robots")||!!n.includes("manifest")||!!n.includes("sitemap")||!!n.includes("icon")||!!n.includes("apple-icon")||!!n.includes("opengraph-image")||!!n.includes("twitter-image")||!!n.includes("favicon"))&&null;if(null!==i)return i;let a=function(e,t){let r=`${e.join(",")}|${t}`,n=es.get(r);if(n)return n;let i=t?"$":"?$",a="\\d?"+(t?"":"(-\\w{6})?"),s=e.length>0?[...e,"txt"]:["txt"],o=e.length>0?[...e,"webmanifest","json"]:["webmanifest","json"],l=[RegExp(`^[\\\\/]robots${ee(s,null)}${i}`),RegExp(`^[\\\\/]manifest${ee(o,null)}${i}`),RegExp(`[\\\\/]sitemap${ee(["xml"],e)}${i}`),RegExp(`[\\\\/]icon${a}${ee(Y.icon.extensions,e)}${i}`),RegExp(`[\\\\/]apple-icon${a}${ee(Y.apple.extensions,e)}${i}`),RegExp(`[\\\\/]opengraph-image${a}${ee(Y.openGraph.extensions,e)}${i}`),RegExp(`[\\\\/]twitter-image${a}${ee(Y.twitter.extensions,e)}${i}`)];return es.set(r,l),l}(t,r);for(let e=0;e<a.length;e++)if(a[e].test(n))return!0;return!1}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(e)?void 0:a({distDir:this.distDir,projectDir:t,useEval:!0,handleMissing:!0,manifest:`server/app${e.replace(/%5F/g,"_")+"_client-reference-manifest"}.js`,shouldCache:!this.isDev}),"app"===o?a({distDir:this.distDir,projectDir:t,manifest:"server/server-reference-manifest.json",handleMissing:!0,shouldCache:!this.isDev}):{},a({projectDir:t,distDir:this.distDir,manifest:"server/subresource-integrity-manifest.json",handleMissing:!0,shouldCache:!this.isDev}),this.isDev?{}:a({projectDir:t,distDir:this.distDir,manifest:"required-server-files.json"}),this.isDev?"development":a({projectDir:t,distDir:this.distDir,manifest:"BUILD_ID",skipParse:!0}),a({projectDir:t,distDir:this.distDir,manifest:"dynamic-css-manifest",handleMissing:!0})];return{buildId:y,buildManifest:c,fallbackBuildManifest:d,routesManifest:l,nextFontManifest:f,prerenderManifest:u,serverFilesManifest:v,reactLoadableManifest:h,clientReferenceManifest:null==p||null==(n=p.__RSC_MANIFEST)?void 0:n[e.replace(/%5F/g,"_")],serverActionsManifest:m,subresourceIntegrityManifest:g,dynamicCssManifest:b,interceptionRoutePatterns:l.rewrites.beforeFiles.filter(e9).map(e=>new RegExp(e.regex))}}}async loadCustomCacheHandlers(e,t){{let{cacheMaxMemorySize:i,cacheHandlers:a}=t;if(!a||!function(e){if(e2[e0])return null==eQ||eQ("cache handlers already initialized"),!1;if(null==eQ||eQ("initializing cache handlers"),e2[e0]=new Map,e2[eY]){let t;e2[eY].DefaultCache?(null==eQ||eQ('setting "default" cache handler from symbol'),t=e2[eY].DefaultCache):(null==eQ||eQ('setting "default" cache handler from default'),t=eZ(e)),e2[e0].set("default",t),e2[eY].RemoteCache?(null==eQ||eQ('setting "remote" cache handler from symbol'),e2[e0].set("remote",e2[eY].RemoteCache)):(null==eQ||eQ('setting "remote" cache handler from default'),e2[e0].set("remote",t))}else{let t=eZ(e);null==eQ||eQ('setting "default" cache handler from default'),e2[e0].set("default",t),null==eQ||eQ('setting "remote" cache handler from default'),e2[e0].set("remote",t)}return e2[e1]=new Set(e2[e0].values()),!0}(i))return;for(let[t,i]of Object.entries(a)){if(!i)continue;let{formatDynamicImportPath:a}=r("./dist/esm/lib/format-dynamic-import-path.js"),{join:s}=r("node:path"),o=s(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir);var n=e4(await e5(a(`${o}/${this.distDir}`,i)));if(!e2[e0]||!e2[e1])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==eQ||eQ('setting cache handler for "%s"',t),e2[e0].set(t,n),e2[e1].add(n)}}}async getIncrementalCache(e,t,n,i){{let a,{cacheHandler:s}=t;if(s){let{formatDynamicImportPath:e}=r("./dist/esm/lib/format-dynamic-import-path.js");a=e4(await e5(e(this.distDir,s)))}let{join:o}=r("node:path"),l=o(process.cwd(),Z(e,"relativeProjectDir")||this.relativeProjectDir);await this.loadCustomCacheHandlers(e,t);let u=new eW({fs:r("./dist/esm/server/lib/node-fs-methods.js").e,dev:this.isDev,requestHeaders:e.headers,allowedRevalidateHeaderKeys:t.experimental.allowedRevalidateHeaderKeys,minimalMode:i,serverDistDir:`${l}/${this.distDir}/server`,fetchCacheKeyPrefix:t.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:t.cacheMaxMemorySize,flushToDisk:!i&&t.experimental.isrFlushToDisk,getPrerenderManifest:()=>n,CurCacheHandler:a});return globalThis.__incrementalCache=u,u}}async onRequestError(e,t,r,n){(null==n?void 0:n.logErrorWithOriginalStack)?n.logErrorWithOriginalStack(t,"app-dir"):console.error(t),await this.instrumentationOnRequestError(e,t,{path:e.url||"/",headers:e.headers,method:e.method||"GET"},r)}async prepare(t,n,{srcPage:i,multiZoneDraftMode:s}){var l;let f,p,g,x;{let{join:e,relative:n}=r("node:path");f=e(process.cwd(),Z(t,"relativeProjectDir")||this.relativeProjectDir);let i=Z(t,"distDir");i&&(this.distDir=n(f,i));let{ensureInstrumentationRegistered:a}=await Promise.resolve().then(r.t.bind(r,"../lib/router-utils/instrumentation-globals.external.js",23));a(f,this.distDir)}let w=await this.loadManifests(i,f),{routesManifest:R,prerenderManifest:$,serverFilesManifest:T}=w,{basePath:j,i18n:D,rewrites:k}=R;j&&(t.url=y(t.url||"/",j));let Q=a(t.url||"/");if(!Q)return;let Y=!1;v(Q.pathname||"/","/_next/data")&&(Y=!0,Q.pathname=J(Q.pathname||"/"));let ee=Q.pathname||"/",et={...Q.query},er=m(i);D&&(p=o(Q.pathname||"/",D.locales)).detectedLocale&&(t.url=`${p.pathname}${Q.search}`,ee=p.pathname,g||(g=p.detectedLocale));let en=u(i),ei=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:l}){let u,f,p;return i&&(p=(f=I(u=function(e,t){let r=function(e,t,r,n,i,a={names:{},intercepted:{}}){let s,o=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={},u=[],c=[];for(let s of(a=structuredClone(a),_(e).slice(1).split("/"))){let e,h=d.some(e=>s.startsWith(e)),f=s.match(C),p=h?f?.[1]:void 0;if(p&&f?.[2]?(e=t?E.h:void 0,a.intercepted[f[2]]=p):e=f?.[2]&&a.intercepted[f[2]]?t?E.h:void 0:t?E.AA:void 0,p&&f&&f[2]){let{key:t,pattern:r,cleanedKey:n,repeat:s,optional:d}=A({getSafeRouteKey:o,interceptionMarker:p,segment:f[2],routeKeys:l,keyPrefix:e,backreferenceDuplicateKeys:i});u.push(r),c.push(`/${f[1]}:${a.names[t]??n}${s?d?"*":"+":""}`),a.names[t]??=n}else if(f&&f[2]){n&&f[1]&&(u.push(`/${P(f[1])}`),c.push(`/${f[1]}`));let{key:t,pattern:r,cleanedKey:s,repeat:d,optional:h}=A({getSafeRouteKey:o,segment:f[2],routeKeys:l,keyPrefix:e,backreferenceDuplicateKeys:i}),p=r;n&&f[1]&&(p=p.substring(1)),u.push(p),c.push(`/:${a.names[t]??s}${d?h?"*":"+":""}`),a.names[t]??=s}else u.push(`/${P(s)}`),c.push(`/${s}`);r&&f&&f[3]&&(u.push(P(f[3])),c.push(f[3]))}return{namedParameterizedRoute:u.join(""),routeKeys:l,pathToRegexpPattern:c.join(""),reference:a}}(e,t.prefixRouteKeys,t.includeSuffix??!1,t.includePrefix??!1,t.backreferenceDuplicateKeys??!1,t.reference),n=r.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(n+="(?:/)?"),{...function(e,{includeSuffix:t=!1,includePrefix:r=!1,excludeOptionalTrailingSlash:n=!1}={}){let{parameterizedRoute:i,groups:a}=function(e,t,r){let n={},i=1,a=[];for(let s of _(e).slice(1).split("/")){let e=d.find(e=>s.startsWith(e)),o=s.match(C);if(e&&o&&o[2]){let{key:t,optional:r,repeat:s}=S(o[2]);n[t]={pos:i++,repeat:s,optional:r},a.push(`/${P(e)}([^/]+?)`)}else if(o&&o[2]){let{key:e,repeat:t,optional:s}=S(o[2]);n[e]={pos:i++,repeat:t,optional:s},r&&o[1]&&a.push(`/${P(o[1])}`);let l=t?s?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),a.push(l)}else a.push(`/${P(s)}`);t&&o&&o[3]&&a.push(P(o[3]))}return{parameterizedRoute:a.join(""),groups:n}}(e,t,r),s=i;return n||(s+="(?:/)?"),{re:RegExp(`^${s}$`),groups:a}}(e,t),namedRegex:`^${n}$`,routeKeys:r.routeKeys,pathToRegexpPattern:r.pathToRegexpPattern,reference:r.reference}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(a,u){let c=structuredClone(u),p={},m=c.pathname,g=n=>{let u=function(e,t){let r=[],n=(0,b.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof t?.sensitive&&t.sensitive,strict:t?.strict}),i=(0,b.regexpToFunction)(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(t?.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete a.params[e.name];return{...n,...a.params}}}(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!l});if(!c.pathname)return!1;let g=u(c.pathname);if((n.has||n.missing)&&g){let e=function(e,t,r=[],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]:L(e.headers)()[r.key];break;case"query":n=t[a];break;case"host":{let{host:t}=e?.headers||{};n=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}(a,c.query,n.has,n.missing);e?Object.assign(g,e):g=!1}if(g){let{parsedDestination:a,destQuery:s}=function(e){let t,r,n=function(e){let t=e.destination;for(let r of Object.keys({...e.params,...e.query}))r&&(t=t.replace(RegExp(`:${P(r)}`,"g"),`__ESC_COLON_${r}`));let r=function(e){if(e.startsWith("/"))return function(e,t,r=!0){let n=new URL("http://n"),i=e.startsWith(".")?new URL("http://n"):n,{pathname:a,searchParams:s,search:o,hash:l,href:u,origin:c}=new URL(e,i);if(c!==n.origin)throw Object.defineProperty(Error(`invariant: invalid relative URL, router received ${e}`),"__NEXT_ERROR_CODE",{value:"E159",enumerable:!1,configurable:!0});return{pathname:a,query:r?F(s):void 0,search:o,hash:l,href:u.slice(c.length),slashes:void 0}}(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:F(t.searchParams),search:t.search,origin:t.origin,slashes:"//"===t.href.slice(t.protocol.length,t.protocol.length+2)}}(t),n=r.pathname;n&&(n=U(n));let i=r.href;i&&(i=U(i));let a=r.hostname;a&&(a=U(a));let s=r.hash;s&&(s=U(s));let o=r.search;o&&(o=U(o));let l=r.origin;return l&&(l=U(l)),{...r,pathname:n,hostname:a,href:i,hash:s,search:o,origin:l}}(e),{hostname:i,query:a,search:s}=n,o=n.pathname;n.hash&&(o=`${o}${n.hash}`);let l=[],u=[];for(let e of(N(o,u),u))l.push(e.name);if(i){let e=[];for(let t of(N(i,e),e))l.push(t.name)}let c=M(o,{validate:!1});for(let[r,n]of(i&&(t=M(i,{validate:!1})),Object.entries(a)))Array.isArray(n)?a[r]=n.map(t=>q(U(t),e.params)):"string"==typeof n&&(a[r]=q(U(n),e.params));let f=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!f.some(e=>l.includes(e)))for(let t of f)t in a||(a[t]=e.params[t]);if(h(o))for(let t of o.split("/")){let r=d.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,a]=(r=c(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=`${a?"#":""}${a||""}`,n.search=s?q(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:g,query:c.query});if(a.protocol)return!0;if(Object.assign(p,s,g),Object.assign(c.query,a.query),delete a.query,Object.assign(c,a),!(m=c.pathname))return!1;if(r&&(m=m.replace(RegExp(`^${r}`),"")||"/"),t){let e=o(m,t.locales);m=e.pathname,c.query.nextInternalLocale=e.detectedLocale||g.nextInternalLocale}if(m===e)return!0;if(i&&f){let e=f(m);if(e)return c.query={...c.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])g(e);if(m!==e){let t=!1;for(let e of n.afterFiles||[])if(t=g(e))break;if(!t&&!(()=>{let t=_(m||"");return t===_(e)||(null==f?void 0:f(t))})()){for(let e of n.fallback||[])if(t=g(e))break}}return{rewriteParams:p,rewrittenParsedUrl:c}},defaultRouteRegex:u,dynamicRouteMatcher:f,defaultRouteMatches:p,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=G(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>z(e)):z(n)))}},getParamsFromRouteMatches:function(e){if(!u)return null;let{groups:t,routeKeys:r}=u,n=I({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=G(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(!u||!p)return{params:{},hasValidParams:!1};var r=u,n=p;let i={};for(let a of Object.keys(r.groups)){let s=e[a];"string"==typeof s?s=c(s):Array.isArray(s)&&(s=s.map(c));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}]]`)||"index"===s||s===`[[...${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=a(e.url);if(!r)return e.url;delete r.search,X(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,H(e));else t.set(r,H(n));return t}(s)));let l=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||B.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),l=l.replace("#","%23"),`${n}${o}${i}${l}${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,u),filterInternalQuery:(e,t)=>X(e,t)}}({page:en,i18n:D,basePath:j,rewrites:k,pageIsDynamic:er,trailingSlash:process.env.__NEXT_TRAILING_SLASH,caseSensitive:!!R.caseSensitive}),ea=W(null==D?void 0:D.domains,K(Q,t.headers),g);!function(e,t,r){let n=Z(e);n[t]=r,e[V]=n}(t,"isLocaleDomain",!!ea);let es=(null==ea?void 0:ea.defaultLocale)||(null==D?void 0:D.defaultLocale);es&&!g&&(Q.pathname=`/${es}${"/"===Q.pathname?"":Q.pathname}`);let eo=Z(t,"locale")||g||es,{rewriteParams:el,rewrittenParsedUrl:eu}=ei.handleRewrites(t,Q),ec=Object.keys(el);Object.assign(Q.query,eu.query),D&&(Q.pathname=o(Q.pathname||"/",D.locales).pathname,eu.pathname=o(eu.pathname||"/",D.locales).pathname);let ed=Z(t,"params");if(!ed&&ei.dynamicRouteMatcher){let e=ei.dynamicRouteMatcher(J((null==eu?void 0:eu.pathname)||Q.pathname||"/")),t=ei.normalizeDynamicRouteParams(e||{},!0);t.hasValidParams&&(ed=t.params)}let eh=Z(t,"query")||{...Q.query},ef=new Set,ep=[];if(this.definition.kind===eD.PAGES||this.definition.kind===eD.PAGES_API)for(let e of[...ec,...Object.keys(ei.defaultRouteMatches||{})]){let t=Array.isArray(et[e])?et[e].join(""):et[e],r=Array.isArray(eh[e])?eh[e].join(""):eh[e];e in et&&t!==r||ep.push(e)}if(ei.normalizeCdnUrl(t,ep),ei.normalizeQueryParams(eh,ef),ei.filterInternalQuery(et,ep),er){let e,r=ei.normalizeDynamicRouteParams(eh,!0),n=ei.normalizeDynamicRouteParams(ed||{},!0);if(eh&&ed&&n.hasValidParams&&r.hasValidParams&&Object.keys(n.params).length<Object.keys(r.params).length?(e=r.params,ed=Object.assign(r.params)):e=n.hasValidParams&&ed?ed:r.hasValidParams?eh:{},t.url=ei.interpolateDynamicPath(t.url||"/",e),Q.pathname=ei.interpolateDynamicPath(Q.pathname||"/",e),ee=ei.interpolateDynamicPath(ee,e),!ed)if(r.hasValidParams)for(let e in ed=Object.assign({},r.params),ei.defaultRouteMatches)delete eh[e];else{let e=null==ei.dynamicRouteMatcher?void 0:ei.dynamicRouteMatcher.call(ei,J((null==p?void 0:p.pathname)||Q.pathname||"/"));e&&(ed=Object.assign({},e))}}for(let e of ef)e in et||delete eh[e];let{isOnDemandRevalidate:em,revalidateOnlyGenerated:eg}=(0,e.Gx)(t,$.preview),ev=!1;if(n){let{tryGetPreviewData:e}=r("./dist/esm/server/api-utils/node/try-get-preview-data.js");ev=!1!==(x=e(t,n,$.preview,!!s))}let ey=Z(t,"relativeProjectDir")||this.relativeProjectDir,eb=null==(l=e6[e3])?void 0:l[ey],eE=(null==eb?void 0:eb.nextConfig)||T.config,ex=en;m(ex)&&ed&&(ex=ei.interpolateDynamicPath(ex,ed)),"/index"===ex&&(ex="/");let ew=ex;try{ex=ex.split("/").map(e=>{try{var t;t=decodeURIComponent(e),e=t.replace(RegExp("([/#?]|%(2f|23|3f|5c))","gi"),e=>encodeURIComponent(e))}catch(e){throw Object.defineProperty(new O("Failed to decode path param(s)."),"__NEXT_ERROR_CODE",{value:"E539",enumerable:!1,configurable:!0})}return e}).join("/")}catch(e){}return ex=_(ex),{query:eh,originalQuery:et,originalPathname:ee,params:ed,parsedUrl:Q,locale:eo,isNextDataRequest:Y,locales:null==D?void 0:D.locales,defaultLocale:es,isDraftMode:ev,previewData:x,pageIsDynamic:er,resolvedPathname:ex,encodedResolvedPathname:ew,isOnDemandRevalidate:em,revalidateOnlyGenerated:eg,...w,serverActionsManifest:w.serverActionsManifest,clientReferenceManifest:w.clientReferenceManifest,nextConfig:eE,routerServerContext:eb}}getResponseCache(e){if(!this.responseCache){let t=(!!process.env.MINIMAL_MODE||Z(e,"minimalMode"))??!1;this.responseCache=new eM(t)}return this.responseCache}async handleResponse({req:e,nextConfig:t,cacheKey:r,routeKind:n,isFallback:i,prerenderManifest:a,isRoutePPREnabled:s,isOnDemandRevalidate:o,revalidateOnlyGenerated:l,responseGenerator:u,waitUntil:c,isMinimalMode:d}){let h=this.getResponseCache(e),f=await h.get(r,u,{routeKind:n,isFallback:i,isRoutePPREnabled:s,isOnDemandRevalidate:o,isPrefetch:"prefetch"===e.headers.purpose,incrementalCache:await this.getIncrementalCache(e,t,a,d),waitUntil:c});if(!f&&r&&!(o&&l))throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return f}}var e7=r("./dist/compiled/bytes/index.js"),te=r.n(e7),tt=r("./dist/compiled/fresh/index.js"),tr=r.n(tt);let tn=require("stream");function ti(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}r("./dist/compiled/safe-stable-stringify/index.js");var ta=r("./dist/esm/server/api-utils/node/try-get-preview-data.js"),ts=r("./dist/compiled/content-type/index.js");async function to(t,n){let i,a;try{i=(0,ts.parse)(t.headers["content-type"]||"text/plain")}catch{i=(0,ts.parse)("text/plain")}let{type:s,parameters:o}=i,l=o.charset||"utf-8";try{let e=r("next/dist/compiled/raw-body");a=await e(t,{encoding:l,limit:n})}catch(t){if(ti(t)&&"entity.too.large"===t.type)throw Object.defineProperty(new e.hD(413,`Body exceeded ${n} limit`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw Object.defineProperty(new e.hD(400,"Invalid body"),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}let u=a.toString();if("application/json"===s||"application/ld+json"===s){if(0===u.length)return{};try{return JSON.parse(u)}catch(t){throw Object.defineProperty(new e.hD(400,"Invalid JSON"),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}return"application/x-www-form-urlencoded"===s?r("querystring").decode(u):u}function tl(e){return"string"==typeof e&&e.length>=16}async function tu(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Object.defineProperty(Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`),"__NEXT_ERROR_CODE",{value:"E153",enumerable:!1,configurable:!0});let i={[E.kz]:n.previewModeId,...t.unstable_onlyGenerated?{[E.r4]:"1"}:{}},a=[...n.allowedRevalidateHeaderKeys||[]];for(let e of((n.trustHostHeader||n.dev)&&a.push("cookie"),n.trustHostHeader&&a.push("x-vercel-protection-bypass"),Object.keys(r.headers)))a.includes(e)&&(i[e]=r.headers[e]);let s=n.internalRevalidate;try{if(s)return await s({urlPath:e,revalidateHeaders:i,opts:t});if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:i}),a=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==a?void 0:a.toUpperCase())!=="REVALIDATED"&&200!==n.status&&!(404===n.status&&t.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.status}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}else throw Object.defineProperty(Error("Invariant: missing internal router-server-methods this is an internal bug"),"__NEXT_ERROR_CODE",{value:"E676",enumerable:!1,configurable:!0})}catch(t){throw Object.defineProperty(Error(`Failed to revalidate ${e}: ${ti(t)?t.message:t}`),"__NEXT_ERROR_CODE",{value:"E240",enumerable:!1,configurable:!0})}}async function tc(t,n,i,a,s,o,l,u,c){try{var d,h,f;if(!a){n.statusCode=404,n.end("Not Found");return}let o=a.config||{},l=(null==(d=o.api)?void 0:d.bodyParser)!==!1,u=(null==(h=o.api)?void 0:h.responseLimit)??!0;null==(f=o.api)||f.externalResolver,(0,e.C4)({req:t},"cookies",L(t.headers)),t.query=i,(0,e.C4)({req:t},"previewData",()=>(0,ta.tryGetPreviewData)(t,n,s,!!s.multiZoneDraftMode)),(0,e.C4)({req:t},"preview",()=>!1!==t.previewData||void 0),(0,e.C4)({req:t},"draftMode",()=>t.preview),l&&!t.body&&(t.body=await to(t,o.api&&o.api.bodyParser&&o.api.bodyParser.sizeLimit?o.api.bodyParser.sizeLimit:"1mb"));let c=0,p=u&&"boolean"!=typeof u?te().parse(u):e.wX,m=n.write,g=n.end;n.write=(...e)=>(c+=Buffer.byteLength(e[0]||""),m.apply(n,e)),n.end=(...e)=>(e.length&&"function"!=typeof e[0]&&(c+=Buffer.byteLength(e[0]||"")),u&&c>=p&&console.warn(`API response for ${t.url} exceeds ${te().format(p)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),g.apply(n,e)),n.status=t=>(0,e.cD)(n,t),n.send=e=>(function(e,t,r){if(null==r)return void t.end();if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let n=t.getHeader("Content-Type");if(r instanceof tn.Stream){n||t.setHeader("Content-Type","application/octet-stream"),r.pipe(t);return}let i=["object","number","boolean"].includes(typeof r),a=i?JSON.stringify(r):r,s=((e,t=!1)=>(t?'W/"':'"')+(e=>{let t=e.length,r=0,n=0,i=8997,a=0,s=33826,o=0,l=40164,u=0,c=52210;for(;r<t;)i^=e.charCodeAt(r++),n=435*i,a=435*s,o=435*l,u=435*c,o+=i<<8,u+=s<<8,a+=n>>>16,i=65535&n,o+=a>>>16,s=65535&a,c=u+(o>>>16)&65535,l=65535&o;return(15&c)*0x1000000000000+0x100000000*l+65536*s+(i^c>>4)})(e).toString(36)+e.length.toString(36)+'"')(a);if(s&&t.setHeader("ETag",s),!tr()(e.headers,{etag:s})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){n||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type",E.U2),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(t,n,e),n.json=e=>{n.setHeader("Content-Type",E.U2),n.send(JSON.stringify(e))},n.redirect=(t,r)=>(0,e.V2)(n,t,r),n.setDraftMode=(t={enable:!0})=>(function(t,n){if(!tl(n.previewModeId))throw Object.defineProperty(Error("invariant: invalid previewModeId"),"__NEXT_ERROR_CODE",{value:"E169",enumerable:!1,configurable:!0});let i=n.enable?void 0:new Date(0),{serialize:a}=r("./dist/compiled/cookie/index.js"),s=t.getHeader("Set-Cookie");return t.setHeader("Set-Cookie",[..."string"==typeof s?[s]:Array.isArray(s)?s:[],a(e.Ic,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:i})]),t})(n,Object.assign({},s,t)),n.setPreviewData=(t,i={})=>(function(t,n,i){if(!tl(i.previewModeId))throw Object.defineProperty(Error("invariant: invalid previewModeId"),"__NEXT_ERROR_CODE",{value:"E169",enumerable:!1,configurable:!0});if(!tl(i.previewModeEncryptionKey))throw Object.defineProperty(Error("invariant: invalid previewModeEncryptionKey"),"__NEXT_ERROR_CODE",{value:"E334",enumerable:!1,configurable:!0});if(!tl(i.previewModeSigningKey))throw Object.defineProperty(Error("invariant: invalid previewModeSigningKey"),"__NEXT_ERROR_CODE",{value:"E436",enumerable:!1,configurable:!0});let a=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:s}=r("./dist/esm/server/crypto-utils.js"),o=a.sign({data:s(Buffer.from(i.previewModeEncryptionKey),JSON.stringify(n))},i.previewModeSigningKey,{algorithm:"HS256",...void 0!==i.maxAge?{expiresIn:i.maxAge}:void 0});if(o.length>2048)throw Object.defineProperty(Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue"),"__NEXT_ERROR_CODE",{value:"E465",enumerable:!1,configurable:!0});let{serialize:l}=r("./dist/compiled/cookie/index.js"),u=t.getHeader("Set-Cookie");return t.setHeader("Set-Cookie",[..."string"==typeof u?[u]:Array.isArray(u)?u:[],l(e.Ic,i.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==i.maxAge?{maxAge:i.maxAge}:void 0,...void 0!==i.path?{path:i.path}:void 0}),l(e.Uc,o,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==i.maxAge?{maxAge:i.maxAge}:void 0,...void 0!==i.path?{path:i.path}:void 0})]),t})(n,t,Object.assign({},s,i)),n.clearPreviewData=(t={})=>(0,e.wE)(n,t),n.revalidate=(e,r)=>tu(e,r||{},t,s);let v=a.default||a;await v(t,n)}catch(r){if(await (null==c?void 0:c(r,{method:t.method||"GET",headers:t.headers,path:t.url||"/"},{routerKind:"Pages Router",routePath:u||"",routeType:"route",revalidateReason:void 0})),r instanceof e.hD)(0,e.n4)(n,r.statusCode,r.message);else{if(l)throw ti(r)&&(r.page=u),r;if(console.error(r),o)throw r;(0,e.n4)(n,500,"Internal Server Error")}}}class td extends e8{constructor(t){if(super(t),"function"!=typeof t.userland.default)throw Object.defineProperty(Error(`Page ${t.definition.page} does not export a default function.`),"__NEXT_ERROR_CODE",{value:"E379",enumerable:!1,configurable:!0});this.apiResolverWrapped=(0,e.l0)(t.definition.page,tc)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname,multiZoneDraftMode:r.multiZoneDraftMode,dev:r.dev,internalRevalidate:r.internalRevalidate},r.propagateError,r.dev,r.page,r.onError)}}let th=td})(),module.exports=n})();
20
20
  //# sourceMappingURL=pages-api-turbo.runtime.prod.js.map