Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ASL bundling for dynamic css #64451

Merged
merged 4 commits into from
Apr 17, 2024
Merged

Fix ASL bundling for dynamic css #64451

merged 4 commits into from
Apr 17, 2024

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Apr 13, 2024

Why

For app page rendering on edge, the AsyncLocalStorage (ALS) should be bundled as same instance across layers. We're accessing the ALS in next/dynamic modules during SSR for preloading CSS chunks. There's a bug that we can't get the ALS store during SSR in edge, I digged into it and found the root cause is:

We have both import paths:
module (rsc layer) -> request ALS (shared layer)
module (ssr layer) -> request ALS (shared layer)

We expect the ALS to be the same module since we're using the same layer but found that they're treated as different modules due to applying another loader transform on ssr layer. They're resulted in the same shared layer, but with different resource queries. This PR excluded that transform so now they're identical across layers.

What

For webpack, we aligned the loaders applying to the async local storage, so that they're resolved as the same module now.

For turbopack, we leverage module transition, sort of creating a new app-shared layer for these modules, and apply the transition to all async local storage instances therefore the instances of them are only bundled once.
To make the turbopack chanegs work, we change how the async local storage modules defined, separate the instance into a single file and mark it as "next-shared" layer with import:

any module -> async local storage --- use transition, specify "next-shared" layer ---> async local storage instance

Closes NEXT-3085

@ijjk
Copy link
Member

ijjk commented Apr 13, 2024

Tests Passed

@ijjk
Copy link
Member

ijjk commented Apr 13, 2024

Stats from current PR

Default Build
General Overall increase ⚠️
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
buildDuration 13.9s 14s ⚠️ +121ms
buildDurationCached 8.5s 6.5s N/A
nodeModulesSize 199 MB 199 MB ⚠️ +6.92 kB
nextStartRea..uration (ms) 399ms 404ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
2453-HASH.js gzip 31.4 kB 31.4 kB N/A
3304.HASH.js gzip 181 B 181 B
3f784ff6-HASH.js gzip 53.7 kB 53.7 kB
8299-HASH.js gzip 5.1 kB 5.1 kB N/A
framework-HASH.js gzip 45.2 kB 45.2 kB
main-app-HASH.js gzip 241 B 241 B
main-HASH.js gzip 29.6 kB 29.7 kB N/A
webpack-HASH.js gzip 1.68 kB 1.68 kB N/A
Overall change 99.3 kB 99.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
_app-HASH.js gzip 196 B 197 B N/A
_error-HASH.js gzip 184 B 184 B
amp-HASH.js gzip 505 B 505 B
css-HASH.js gzip 324 B 325 B N/A
dynamic-HASH.js gzip 2.5 kB 2.5 kB N/A
edge-ssr-HASH.js gzip 258 B 258 B
head-HASH.js gzip 352 B 352 B
hooks-HASH.js gzip 370 B 371 B N/A
image-HASH.js gzip 4.27 kB 4.27 kB
index-HASH.js gzip 259 B 259 B
link-HASH.js gzip 2.67 kB 2.67 kB N/A
routerDirect..HASH.js gzip 314 B 312 B N/A
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 309 B 309 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 6.63 kB 6.63 kB
Client Build Manifests
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
_buildManifest.js gzip 483 B 485 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
index.html gzip 529 B 529 B
link.html gzip 542 B 542 B
withRouter.html gzip 525 B 523 B N/A
Overall change 1.07 kB 1.07 kB
Edge SSR bundle Size
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
edge-ssr.js gzip 94.4 kB 94.4 kB N/A
page.js gzip 3.05 kB 3.05 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
middleware-b..fest.js gzip 624 B 626 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 25.5 kB 25.5 kB N/A
edge-runtime..pack.js gzip 839 B 839 B
Overall change 839 B 839 B
Next Runtimes
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
app-page-exp...dev.js gzip 171 kB 171 kB N/A
app-page-exp..prod.js gzip 97.5 kB 97.5 kB
app-page-tur..prod.js gzip 99.2 kB 99.2 kB N/A
app-page-tur..prod.js gzip 93.5 kB 93.5 kB N/A
app-page.run...dev.js gzip 145 kB 145 kB
app-page.run..prod.js gzip 92 kB 92 kB
app-route-ex...dev.js gzip 21.5 kB 21.5 kB
app-route-ex..prod.js gzip 15.2 kB 15.2 kB N/A
app-route-tu..prod.js gzip 15.2 kB 15.2 kB
app-route-tu..prod.js gzip 14.9 kB 14.9 kB N/A
app-route.ru...dev.js gzip 21.1 kB 21.1 kB N/A
app-route.ru..prod.js gzip 14.9 kB 14.9 kB N/A
pages-api-tu..prod.js gzip 9.55 kB 9.55 kB
pages-api.ru...dev.js gzip 9.82 kB 9.82 kB
pages-api.ru..prod.js gzip 9.55 kB 9.55 kB N/A
pages-turbo...prod.js gzip 21.4 kB 21.4 kB
pages.runtim...dev.js gzip 22.1 kB 22.1 kB N/A
pages.runtim..prod.js gzip 21.4 kB 21.4 kB N/A
server.runti..prod.js gzip 51.5 kB 51.5 kB N/A
Overall change 411 kB 411 kB
build cache
vercel/next.js canary vercel/next.js fix/dynamic-css-edge Change
0.pack gzip 1.59 MB 1.59 MB N/A
index.pack gzip 107 kB 107 kB N/A
Overall change 0 B 0 B
Diff details
Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for 2453-HASH.js

Diff too large to display

Diff for app-page-exp..ntime.dev.js

Diff too large to display

Diff for app-page-exp..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page.runtime.dev.js

Diff too large to display

Diff for app-page.runtime.prod.js

Diff too large to display

Diff for app-route-ex..ntime.dev.js

Diff too large to display

Diff for app-route-ex..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route.runtime.dev.js

Diff too large to display

Diff for app-route.ru..time.prod.js

Diff too large to display

Diff for pages-api-tu..time.prod.js
@@ -17,5 +17,5 @@
  * Copyright(c) 2012 TJ Holowaychuk
  * Copyright(c) 2016-2017 Douglas Christopher Wilson
  * MIT Licensed
- */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser,s.shared],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(N||(N={})).executeRoute="Router.executeRoute",(j||(j={})).runHandler="Node.runHandler",(T||(T={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(_||(_={})),(A||(A={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,N,j,T,_,A,H=r("./dist/compiled/bytes/index.js"),O=r.n(H);let M=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},P=(e,t=!1)=>(t?'W/"':'"')+M(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var q=r("./dist/compiled/@edge-runtime/cookies/index.js"),$=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,$.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,$.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0;null==(w=c.api)||w.externalResolver,v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new q.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let g=0,y=m&&"boolean"!=typeof m?O().parse(m):4194304,R=t.write,C=t.end;t.write=(...e)=>(g+=Buffer.byteLength(e[0]||""),R.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(g+=Buffer.byteLength(r[0]||"")),m&&g>=y&&console.warn(`API response for ${e.url} exceeds ${O().format(y)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),C.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let o=t.getHeader("Content-Type");if(r instanceof L.Stream){o||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;if((n=P(a))&&t.setHeader("ETag",n),!E()(e.headers,{etag:n})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){o||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type","application/json; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(e,t,r),t.json=e=>{t.setHeader("Content-Type","application/json; charset=utf-8"),t.send(JSON.stringify(e))},t.redirect=(e,r)=>(function(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw 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').");return e.writeHead(t,{Location:r}),e.write(r),e.end(),e})(t,e,r),t.setDraftMode=(e={enable:!0})=>(function(e,t){if(!D(t.previewModeId))throw Error("invariant: invalid previewModeId");let n=t.enable?void 0:new Date(0),{serialize:o}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],o(p,t.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:n})]),e})(t,Object.assign({},d,e)),t.setPreviewData=(e,n={})=>(function(e,t,n){if(!D(n.previewModeId))throw Error("invariant: invalid previewModeId");if(!D(n.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!D(n.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let o=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:i}=r("./dist/esm/server/crypto-utils.js"),a=o.sign({data:i(Buffer.from(n.previewModeEncryptionKey),JSON.stringify(t))},n.previewModeSigningKey,{algorithm:"HS256",...void 0!==n.maxAge?{expiresIn:n.maxAge}:void 0});if(a.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:s}=r("./dist/compiled/cookie/index.js"),d=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof d?[d]:Array.isArray(d)?d:[],s(p,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0}),s(u,a,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0})]),e})(t,e,Object.assign({},d,n)),t.clearPreviewData=(e={})=>f(t,e),t.revalidate=(t,r)=>z(t,r||{},e,d);let N=s.default||s;await N(e,t)}catch(e){if(e instanceof h)m(t,e.statusCode,e.message);else{if(g)throw B(e)&&(e.page=y),e;if(console.error(e),c)throw e;m(t,500,"Internal Server Error")}}}class U extends g{constructor(e){if(super(e),"function"!=typeof e.userland.default)throw Error(`Page ${e.definition.page} does not export a default function.`);this.apiResolverWrapped=function(e,t){return(...r)=>{var n;return null==(n=(0,d.getTracer)().getRootSpanAttributes())||n.set("next.route",e),(0,d.getTracer)().trace(j.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r))}}(e.definition.page,K)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,revalidate:r.revalidate,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname},r.minimalMode,r.dev,r.page)}}let F=U})(),module.exports=n})();
+ */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(N||(N={})).executeRoute="Router.executeRoute",(j||(j={})).runHandler="Node.runHandler",(T||(T={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(_||(_={})),(A||(A={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,N,j,T,_,A,H=r("./dist/compiled/bytes/index.js"),O=r.n(H);let M=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},P=(e,t=!1)=>(t?'W/"':'"')+M(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var q=r("./dist/compiled/@edge-runtime/cookies/index.js"),$=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,$.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,$.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0;null==(w=c.api)||w.externalResolver,v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new q.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let g=0,y=m&&"boolean"!=typeof m?O().parse(m):4194304,R=t.write,C=t.end;t.write=(...e)=>(g+=Buffer.byteLength(e[0]||""),R.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(g+=Buffer.byteLength(r[0]||"")),m&&g>=y&&console.warn(`API response for ${e.url} exceeds ${O().format(y)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),C.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let o=t.getHeader("Content-Type");if(r instanceof L.Stream){o||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;if((n=P(a))&&t.setHeader("ETag",n),!E()(e.headers,{etag:n})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){o||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type","application/json; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(e,t,r),t.json=e=>{t.setHeader("Content-Type","application/json; charset=utf-8"),t.send(JSON.stringify(e))},t.redirect=(e,r)=>(function(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw 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').");return e.writeHead(t,{Location:r}),e.write(r),e.end(),e})(t,e,r),t.setDraftMode=(e={enable:!0})=>(function(e,t){if(!D(t.previewModeId))throw Error("invariant: invalid previewModeId");let n=t.enable?void 0:new Date(0),{serialize:o}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],o(p,t.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:n})]),e})(t,Object.assign({},d,e)),t.setPreviewData=(e,n={})=>(function(e,t,n){if(!D(n.previewModeId))throw Error("invariant: invalid previewModeId");if(!D(n.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!D(n.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let o=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:i}=r("./dist/esm/server/crypto-utils.js"),a=o.sign({data:i(Buffer.from(n.previewModeEncryptionKey),JSON.stringify(t))},n.previewModeSigningKey,{algorithm:"HS256",...void 0!==n.maxAge?{expiresIn:n.maxAge}:void 0});if(a.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:s}=r("./dist/compiled/cookie/index.js"),d=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof d?[d]:Array.isArray(d)?d:[],s(p,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0}),s(u,a,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0})]),e})(t,e,Object.assign({},d,n)),t.clearPreviewData=(e={})=>f(t,e),t.revalidate=(t,r)=>z(t,r||{},e,d);let N=s.default||s;await N(e,t)}catch(e){if(e instanceof h)m(t,e.statusCode,e.message);else{if(g)throw B(e)&&(e.page=y),e;if(console.error(e),c)throw e;m(t,500,"Internal Server Error")}}}class U extends g{constructor(e){if(super(e),"function"!=typeof e.userland.default)throw Error(`Page ${e.definition.page} does not export a default function.`);this.apiResolverWrapped=function(e,t){return(...r)=>{var n;return null==(n=(0,d.getTracer)().getRootSpanAttributes())||n.set("next.route",e),(0,d.getTracer)().trace(j.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r))}}(e.definition.page,K)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,revalidate:r.revalidate,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname},r.minimalMode,r.dev,r.page)}}let F=U})(),module.exports=n})();
 //# sourceMappingURL=pages-api-turbo.runtime.prod.js.map
\ No newline at end of file
Diff for pages-api.runtime.dev.js
@@ -17,6 +17,6 @@
  * Copyright(c) 2012 TJ Holowaychuk
  * Copyright(c) 2016-2017 Douglas Christopher Wilson
  * MIT Licensed
- */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser,s.shared],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(j||(j={})).executeRoute="Router.executeRoute",(N||(N={})).runHandler="Node.runHandler",(A||(A={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(T||(T={})),(_||(_={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,j,N,A,T,_,P=r("./dist/compiled/bytes/index.js"),H=r.n(P);let O=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},M=(e,t=!1)=>(t?'W/"':'"')+O(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var $=r("./dist/compiled/@edge-runtime/cookies/index.js"),q=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,q.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,q.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0,g=(null==(w=c.api)?void 0:w.externalResolver)||!1;v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new $.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let y=0,R=m&&"boolean"!=typeof m?H().parse(m):4194304,C=t.write,j=t.end;t.write=(...e)=>(y+=Buffer.byteLength(e[0]||""),C.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(y+=Buffer.byteLength(r[0]||"")),m&&y>=R&&console.warn(`API response for ${e.url} exceeds ${H().format(R)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),j.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),r&&console.warn(`A body was attempted to be set with a 204 statusCode for ${e.url}, this is invalid and the body was ignored.
+ */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(j||(j={})).executeRoute="Router.executeRoute",(N||(N={})).runHandler="Node.runHandler",(A||(A={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(T||(T={})),(_||(_={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,j,N,A,T,_,P=r("./dist/compiled/bytes/index.js"),H=r.n(P);let O=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},M=(e,t=!1)=>(t?'W/"':'"')+O(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var $=r("./dist/compiled/@edge-runtime/cookies/index.js"),q=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,q.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,q.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0,g=(null==(w=c.api)?void 0:w.externalResolver)||!1;v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new $.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let y=0,R=m&&"boolean"!=typeof m?H().parse(m):4194304,C=t.write,j=t.end;t.write=(...e)=>(y+=Buffer.byteLength(e[0]||""),C.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(y+=Buffer.byteLength(r[0]||"")),m&&y>=R&&console.warn(`API response for ${e.url} exceeds ${H().format(R)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),j.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),r&&console.warn(`A body was attempted to be set with a 204 statusCode for ${e.url}, this is invalid and the body was ignored.
 See more info here https://nextjs.org/docs/messages/invalid-api-status-body`),t.end();return}let o=t.getHeader("Content-Type");if(r instanceof L.Stream){o||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;if((n=M(a))&&t.setHeader("ETag",n),!E()(e.headers,{etag:n})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){o||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type","application/json; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(e,t,r),t.json=e=>{t.setHeader("Content-Type","application/json; charset=utf-8"),t.send(JSON.stringify(e))},t.redirect=(e,r)=>(function(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw 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').");return e.writeHead(t,{Location:r}),e.write(r),e.end(),e})(t,e,r),t.setDraftMode=(e={enable:!0})=>(function(e,t){if(!D(t.previewModeId))throw Error("invariant: invalid previewModeId");let n=t.enable?void 0:new Date(0),{serialize:o}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],o(p,t.previewModeId,{httpOnly:!0,sameSite:"lax",secure:!1,path:"/",expires:n})]),e})(t,Object.assign({},d,e)),t.setPreviewData=(e,n={})=>(function(e,t,n){if(!D(n.previewModeId))throw Error("invariant: invalid previewModeId");if(!D(n.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!D(n.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let o=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:i}=r("./dist/esm/server/crypto-utils.js"),a=o.sign({data:i(Buffer.from(n.previewModeEncryptionKey),JSON.stringify(t))},n.previewModeSigningKey,{algorithm:"HS256",...void 0!==n.maxAge?{expiresIn:n.maxAge}:void 0});if(a.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:s}=r("./dist/compiled/cookie/index.js"),d=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof d?[d]:Array.isArray(d)?d:[],s(p,n.previewModeId,{httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0}),s(u,a,{httpOnly:!0,sameSite:"lax",secure:!1,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0})]),e})(t,e,Object.assign({},d,n)),t.clearPreviewData=(e={})=>f(t,e),t.revalidate=(t,r)=>z(t,r||{},e,d);let N=s.default||s,A=!1;t.once("pipe",()=>A=!0);let T=await N(e,t);if(void 0!==T){if(T instanceof Response)throw Error('API route returned a Response object in the Node.js runtime, this is not supported. Please use `runtime: "edge"` instead: https://nextjs.org/docs/api-routes/edge-api-routes');console.warn(`API handler should not return a value, received ${typeof T}.`)}g||t.finished||t.headersSent||A||console.warn(`API resolved without sending a response for ${e.url}, this may result in stalled requests.`)}catch(e){if(e instanceof h)m(t,e.statusCode,e.message);else{if(g)throw B(e)&&(e.page=y),e;if(console.error(e),c)throw e;m(t,500,"Internal Server Error")}}}class U extends g{constructor(e){if(super(e),"function"!=typeof e.userland.default)throw Error(`Page ${e.definition.page} does not export a default function.`);this.apiResolverWrapped=function(e,t){return(...r)=>{var n;return null==(n=(0,d.getTracer)().getRootSpanAttributes())||n.set("next.route",e),(0,d.getTracer)().trace(N.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r))}}(e.definition.page,K)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,revalidate:r.revalidate,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname},r.minimalMode,r.dev,r.page)}}let F=U})(),module.exports=n})();
 //# sourceMappingURL=pages-api.runtime.dev.js.map
\ No newline at end of file
Diff for pages-api.ru..time.prod.js
@@ -17,5 +17,5 @@
  * Copyright(c) 2012 TJ Holowaychuk
  * Copyright(c) 2016-2017 Douglas Christopher Wilson
  * MIT Licensed
- */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser,s.shared],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(N||(N={})).executeRoute="Router.executeRoute",(j||(j={})).runHandler="Node.runHandler",(T||(T={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(_||(_={})),(A||(A={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,N,j,T,_,A,H=r("./dist/compiled/bytes/index.js"),O=r.n(H);let M=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},P=(e,t=!1)=>(t?'W/"':'"')+M(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var q=r("./dist/compiled/@edge-runtime/cookies/index.js"),$=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,$.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,$.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0;null==(w=c.api)||w.externalResolver,v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new q.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let g=0,y=m&&"boolean"!=typeof m?O().parse(m):4194304,R=t.write,C=t.end;t.write=(...e)=>(g+=Buffer.byteLength(e[0]||""),R.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(g+=Buffer.byteLength(r[0]||"")),m&&g>=y&&console.warn(`API response for ${e.url} exceeds ${O().format(y)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),C.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let o=t.getHeader("Content-Type");if(r instanceof L.Stream){o||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;if((n=P(a))&&t.setHeader("ETag",n),!E()(e.headers,{etag:n})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){o||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type","application/json; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(e,t,r),t.json=e=>{t.setHeader("Content-Type","application/json; charset=utf-8"),t.send(JSON.stringify(e))},t.redirect=(e,r)=>(function(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw 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').");return e.writeHead(t,{Location:r}),e.write(r),e.end(),e})(t,e,r),t.setDraftMode=(e={enable:!0})=>(function(e,t){if(!D(t.previewModeId))throw Error("invariant: invalid previewModeId");let n=t.enable?void 0:new Date(0),{serialize:o}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],o(p,t.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:n})]),e})(t,Object.assign({},d,e)),t.setPreviewData=(e,n={})=>(function(e,t,n){if(!D(n.previewModeId))throw Error("invariant: invalid previewModeId");if(!D(n.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!D(n.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let o=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:i}=r("./dist/esm/server/crypto-utils.js"),a=o.sign({data:i(Buffer.from(n.previewModeEncryptionKey),JSON.stringify(t))},n.previewModeSigningKey,{algorithm:"HS256",...void 0!==n.maxAge?{expiresIn:n.maxAge}:void 0});if(a.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:s}=r("./dist/compiled/cookie/index.js"),d=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof d?[d]:Array.isArray(d)?d:[],s(p,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0}),s(u,a,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0})]),e})(t,e,Object.assign({},d,n)),t.clearPreviewData=(e={})=>f(t,e),t.revalidate=(t,r)=>z(t,r||{},e,d);let N=s.default||s;await N(e,t)}catch(e){if(e instanceof h)m(t,e.statusCode,e.message);else{if(g)throw B(e)&&(e.page=y),e;if(console.error(e),c)throw e;m(t,500,"Internal Server Error")}}}class U extends g{constructor(e){if(super(e),"function"!=typeof e.userland.default)throw Error(`Page ${e.definition.page} does not export a default function.`);this.apiResolverWrapped=function(e,t){return(...r)=>{var n;return null==(n=(0,d.getTracer)().getRootSpanAttributes())||n.set("next.route",e),(0,d.getTracer)().trace(j.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r))}}(e.definition.page,K)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,revalidate:r.revalidate,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname},r.minimalMode,r.dev,r.page)}}let F=U})(),module.exports=n})();
+ */var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,n){var o=e["if-modified-since"],i=e["if-none-match"];if(!o&&!i)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(i&&"*"!==i){var s=n.etag;if(!s)return!1;for(var d=!0,p=function(e){for(var t=0,r=[],n=0,o=0,i=e.length;o<i;o++)switch(e.charCodeAt(o)){case 32:n===t&&(n=t=o+1);break;case 44:r.push(e.substring(n,t)),n=t=o+1;break;default:t=o+1}return r.push(e.substring(n,t)),r}(i),u=0;u<p.length;u++){var l=p[u];if(l===s||l==="W/"+s||"W/"+l===s){d=!1;break}}if(d)return!1}if(o){var c=n["last-modified"];if(!c||!(r(c)<=r(o)))return!1}return!0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},a=!0;try{t[e](i,i.exports,n),a=!1}finally{a&&delete r[e]}return i.exports}n.ab=__dirname+"/";var o=n(695);e.exports=o})()},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>s,encryptWithSecret:()=>a});let n=require("crypto");var o=r.n(n);let i="aes-256-gcm";function a(e,t){let r=o().randomBytes(16),n=o().randomBytes(64),a=o().pbkdf2Sync(e,n,1e5,32,"sha512"),s=o().createCipheriv(i,a,r),d=Buffer.concat([s.update(t,"utf8"),s.final()]),p=s.getAuthTag();return Buffer.concat([n,r,p,d]).toString("hex")}function s(e,t){let r=Buffer.from(t,"hex"),n=r.slice(0,64),a=r.slice(64,80),s=r.slice(80,96),d=r.slice(96),p=o().pbkdf2Sync(e,n,1e5,32,"sha512"),u=o().createDecipheriv(i,p,a);return u.setAuthTag(s),u.update(d)+u.final("utf8")}},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/raw-body":e=>{"use strict";e.exports=require("next/dist/compiled/raw-body")},querystring:e=>{"use strict";e.exports=require("querystring")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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:()=>U,default:()=>F});class e{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 t extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new t}}class o extends Headers{constructor(t){super(),this.headers=new Proxy(t,{get(r,n,o){if("symbol"==typeof n)return e.get(r,n,o);let i=n.toLowerCase(),a=Object.keys(t).find(e=>e.toLowerCase()===i);if(void 0!==a)return e.get(r,a,o)},set(r,n,o,i){if("symbol"==typeof n)return e.set(r,n,o,i);let a=n.toLowerCase(),s=Object.keys(t).find(e=>e.toLowerCase()===a);return e.set(r,s??n,o,i)},has(r,n){if("symbol"==typeof n)return e.has(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0!==i&&e.has(r,i)},deleteProperty(r,n){if("symbol"==typeof n)return e.deleteProperty(r,n);let o=n.toLowerCase(),i=Object.keys(t).find(e=>e.toLowerCase()===o);return void 0===i||e.deleteProperty(r,i)}})}static seal(r){return new Proxy(r,{get(r,n,o){switch(n){case"append":case"delete":case"set":return t.callable;default:return e.get(r,n,o)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(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()}}let i="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...s,GROUP:{serverOnly:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.instrument],clientOnly:[s.serverSideRendering,s.appPagesBrowser],nonClientServerTarget:[s.middleware,s.api],app:[s.reactServerComponents,s.actionBrowser,s.appMetadataRoute,s.appRouteHandler,s.serverSideRendering,s.appPagesBrowser,s.shared,s.instrument]}});let d=require("next/dist/server/lib/trace/tracer");(function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"})(y||(y={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(x||(x={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(b||(b={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(w||(w={})),(S||(S={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(R||(R={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(C||(C={})),(N||(N={})).executeRoute="Router.executeRoute",(j||(j={})).runHandler="Node.runHandler",(T||(T={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(_||(_={})),(A||(A={})).execute="Middleware.execute";let p="__prerender_bypass",u="__next_preview_data",l=Symbol(u),c=Symbol(p);function f(e,t={}){if(c in e)return e;let{serialize:n}=r("./dist/compiled/cookie/index.js"),o=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof o?[o]:Array.isArray(o)?o:[],n(p,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),n(u,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,c,{value:!0,enumerable:!1}),e}class h extends Error{constructor(e,t){super(t),this.statusCode=e}}function m(e,t,r){e.statusCode=t,e.statusMessage=r,e.end(r)}function v({req:e},t,r){let n={configurable:!0,enumerable:!0},o={...n,writable:!0};Object.defineProperty(e,t,{...n,get:()=>{let n=r();return Object.defineProperty(e,t,{...o,value:n}),n},set:r=>{Object.defineProperty(e,t,{...o,value:r})}})}class g{constructor({userland:e,definition:t}){this.userland=e,this.definition=t}}var y,x,b,w,S,R,C,N,j,T,_,A,H=r("./dist/compiled/bytes/index.js"),O=r.n(H);let M=e=>{let t=e.length,r=0,n=0,o=8997,i=0,a=33826,s=0,d=40164,p=0,u=52210;for(;r<t;)o^=e.charCodeAt(r++),n=435*o,i=435*a,s=435*d,p=435*u,s+=o<<8,p+=a<<8,i+=n>>>16,o=65535&n,s+=i>>>16,a=65535&i,u=p+(s>>>16)&65535,d=65535&s;return(15&u)*281474976710656+4294967296*d+65536*a+(o^u>>4)},P=(e,t=!1)=>(t?'W/"':'"')+M(e).toString(36)+e.length.toString(36)+'"';"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);var k=r("./dist/compiled/fresh/index.js"),E=r.n(k);let L=require("stream");function B(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}var q=r("./dist/compiled/@edge-runtime/cookies/index.js"),$=r("./dist/compiled/content-type/index.js");async function I(e,t){let n,o;try{n=(0,$.parse)(e.headers["content-type"]||"text/plain")}catch{n=(0,$.parse)("text/plain")}let{type:i,parameters:a}=n,s=a.charset||"utf-8";try{let n=r("next/dist/compiled/raw-body");o=await n(e,{encoding:s,limit:t})}catch(e){if(B(e)&&"entity.too.large"===e.type)throw new h(413,`Body exceeded ${t} limit`);throw new h(400,"Invalid body")}let d=o.toString();return"application/json"===i||"application/ld+json"===i?function(e){if(0===e.length)return{};try{return JSON.parse(e)}catch(e){throw new h(400,"Invalid JSON")}}(d):"application/x-www-form-urlencoded"===i?r("querystring").decode(d):d}function D(e){return"string"==typeof e&&e.length>=16}async function z(e,t,r,n){if("string"!=typeof e||!e.startsWith("/"))throw Error(`Invalid urlPath provided to revalidate(), must be a path e.g. /blog/post-1, received ${e}`);let o={[i]:n.previewModeId,...t.unstable_onlyGenerated?{[a]:"1"}:{}},s=[...n.allowedRevalidateHeaderKeys||[],...n.trustHostHeader?["cookie","x-vercel-protection-bypass"]:[]];for(let e of Object.keys(r.headers))s.includes(e)&&(o[e]=r.headers[e]);try{if(n.trustHostHeader){let n=await fetch(`https://${r.headers.host}${e}`,{method:"HEAD",headers:o}),i=n.headers.get("x-vercel-cache")||n.headers.get("x-nextjs-cache");if((null==i?void 0:i.toUpperCase())!=="REVALIDATED"&&!(404===n.status&&t.unstable_onlyGenerated))throw Error(`Invalid response ${n.status}`)}else if(n.revalidate)await n.revalidate({urlPath:e,revalidateHeaders:o,opts:t});else throw Error("Invariant: required internal revalidate method not passed to api-utils")}catch(t){throw Error(`Failed to revalidate ${e}: ${B(t)?t.message:t}`)}}async function K(e,t,n,s,d,c,g,y){try{var x,b,w,S;if(!s){t.statusCode=404,t.end("Not Found");return}let c=s.config||{},h=(null==(x=c.api)?void 0:x.bodyParser)!==!1,m=(null==(b=c.api)?void 0:b.responseLimit)??!0;null==(w=c.api)||w.externalResolver,v({req:e},"cookies",(S=e.headers,function(){let{cookie:e}=S;if(!e)return{};let{parse:t}=r("./dist/compiled/cookie/index.js");return t(Array.isArray(e)?e.join("; "):e)})),e.query=n,v({req:e},"previewData",()=>(function(e,t,n){var s,d;let c;if(n&&function(e,t){let r=o.from(e.headers);return{isOnDemandRevalidate:r.get(i)===t.previewModeId,revalidateOnlyGenerated:r.has(a)}}(e,n).isOnDemandRevalidate)return!1;if(l in e)return e[l];let h=o.from(e.headers),m=new q.RequestCookies(h),v=null==(s=m.get(p))?void 0:s.value,g=null==(d=m.get(u))?void 0:d.value;if(v&&!g&&v===n.previewModeId){let t={};return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}if(!v&&!g)return!1;if(!v||!g||v!==n.previewModeId)return f(t),!1;try{c=r("next/dist/compiled/jsonwebtoken").verify(g,n.previewModeSigningKey)}catch{return f(t),!1}let{decryptWithSecret:y}=r("./dist/esm/server/crypto-utils.js"),x=y(Buffer.from(n.previewModeEncryptionKey),c.data);try{let t=JSON.parse(x);return Object.defineProperty(e,l,{value:t,enumerable:!1}),t}catch{return!1}})(e,t,d)),v({req:e},"preview",()=>!1!==e.previewData||void 0),v({req:e},"draftMode",()=>e.preview),h&&!e.body&&(e.body=await I(e,c.api&&c.api.bodyParser&&c.api.bodyParser.sizeLimit?c.api.bodyParser.sizeLimit:"1mb"));let g=0,y=m&&"boolean"!=typeof m?O().parse(m):4194304,R=t.write,C=t.end;t.write=(...e)=>(g+=Buffer.byteLength(e[0]||""),R.apply(t,e)),t.end=(...r)=>(r.length&&"function"!=typeof r[0]&&(g+=Buffer.byteLength(r[0]||"")),m&&g>=y&&console.warn(`API response for ${e.url} exceeds ${O().format(y)}. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit`),C.apply(t,r)),t.status=e=>(t.statusCode=e,t),t.send=r=>(function(e,t,r){var n;if(null==r){t.end();return}if(204===t.statusCode||304===t.statusCode){t.removeHeader("Content-Type"),t.removeHeader("Content-Length"),t.removeHeader("Transfer-Encoding"),t.end();return}let o=t.getHeader("Content-Type");if(r instanceof L.Stream){o||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;if((n=P(a))&&t.setHeader("ETag",n),!E()(e.headers,{etag:n})||(t.statusCode=304,t.end(),0)){if(Buffer.isBuffer(r)){o||t.setHeader("Content-Type","application/octet-stream"),t.setHeader("Content-Length",r.length),t.end(r);return}i&&t.setHeader("Content-Type","application/json; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(a)),t.end(a)}})(e,t,r),t.json=e=>{t.setHeader("Content-Type","application/json; charset=utf-8"),t.send(JSON.stringify(e))},t.redirect=(e,r)=>(function(e,t,r){if("string"==typeof t&&(r=t,t=307),"number"!=typeof t||"string"!=typeof r)throw 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').");return e.writeHead(t,{Location:r}),e.write(r),e.end(),e})(t,e,r),t.setDraftMode=(e={enable:!0})=>(function(e,t){if(!D(t.previewModeId))throw Error("invariant: invalid previewModeId");let n=t.enable?void 0:new Date(0),{serialize:o}=r("./dist/compiled/cookie/index.js"),i=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof i?[i]:Array.isArray(i)?i:[],o(p,t.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:n})]),e})(t,Object.assign({},d,e)),t.setPreviewData=(e,n={})=>(function(e,t,n){if(!D(n.previewModeId))throw Error("invariant: invalid previewModeId");if(!D(n.previewModeEncryptionKey))throw Error("invariant: invalid previewModeEncryptionKey");if(!D(n.previewModeSigningKey))throw Error("invariant: invalid previewModeSigningKey");let o=r("next/dist/compiled/jsonwebtoken"),{encryptWithSecret:i}=r("./dist/esm/server/crypto-utils.js"),a=o.sign({data:i(Buffer.from(n.previewModeEncryptionKey),JSON.stringify(t))},n.previewModeSigningKey,{algorithm:"HS256",...void 0!==n.maxAge?{expiresIn:n.maxAge}:void 0});if(a.length>2048)throw Error("Preview data is limited to 2KB currently, reduce how much data you are storing as preview data to continue");let{serialize:s}=r("./dist/compiled/cookie/index.js"),d=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof d?[d]:Array.isArray(d)?d:[],s(p,n.previewModeId,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0}),s(u,a,{httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==n.maxAge?{maxAge:n.maxAge}:void 0,...void 0!==n.path?{path:n.path}:void 0})]),e})(t,e,Object.assign({},d,n)),t.clearPreviewData=(e={})=>f(t,e),t.revalidate=(t,r)=>z(t,r||{},e,d);let N=s.default||s;await N(e,t)}catch(e){if(e instanceof h)m(t,e.statusCode,e.message);else{if(g)throw B(e)&&(e.page=y),e;if(console.error(e),c)throw e;m(t,500,"Internal Server Error")}}}class U extends g{constructor(e){if(super(e),"function"!=typeof e.userland.default)throw Error(`Page ${e.definition.page} does not export a default function.`);this.apiResolverWrapped=function(e,t){return(...r)=>{var n;return null==(n=(0,d.getTracer)().getRootSpanAttributes())||n.set("next.route",e),(0,d.getTracer)().trace(j.runHandler,{spanName:`executing api route (pages) ${e}`},()=>t(...r))}}(e.definition.page,K)}async render(e,t,r){let{apiResolverWrapped:n}=this;await n(e,t,r.query,this.userland,{...r.previewProps,revalidate:r.revalidate,trustHostHeader:r.trustHostHeader,allowedRevalidateHeaderKeys:r.allowedRevalidateHeaderKeys,hostname:r.hostname},r.minimalMode,r.dev,r.page)}}let F=U})(),module.exports=n})();
 //# sourceMappingURL=pages-api.runtime.prod.js.map
\ No newline at end of file
Diff for pages-turbo...time.prod.js

Diff too large to display

Diff for pages.runtime.dev.js

Diff too large to display

Diff for pages.runtime.prod.js

Diff too large to display

Diff for server.runtime.prod.js

Diff too large to display

Commit: 0d9546a

@ijjk ijjk added the Turbopack Related to Turbopack with Next.js. label Apr 16, 2024
Copy link
Contributor

github-actions bot commented Apr 16, 2024

Hi there 👋

It looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:

Broken link Type File
#updating-or-extending-the-session hash /docs/02-app/01-building-your-application/09-authentication/index.mdx

Thank you 🙏

@huozhi huozhi marked this pull request as ready for review April 16, 2024 20:02
@huozhi huozhi merged commit 8b82225 into canary Apr 17, 2024
81 of 82 checks passed
@huozhi huozhi deleted the fix/dynamic-css-edge branch April 17, 2024 08:18
ztanner pushed a commit that referenced this pull request Apr 17, 2024
For app page rendering on edge, the `AsyncLocalStorage` (ALS) should be
bundled as same instance across layers. We're accessing the ALS in
`next/dynamic` modules during SSR for preloading CSS chunks. There's a
bug that we can't get the ALS store during SSR in edge, I digged into it
and found the root cause is:

We have both import paths:
`module (rsc layer) -> request ALS (shared layer)`
`module (ssr layer) -> request ALS (shared layer)`

We expect the ALS to be the same module since we're using the same layer
but found that they're treated as different modules due to applying
another loader transform on ssr layer. They're resulted in the same
`shared` layer, but with different resource queries. This PR excluded
that transform so now they're identical across layers.

For webpack, we aligned the loaders applying to the async local storage,
so that they're resolved as the same module now.

For turbopack, we leverage module transition, sort of creating a new
`app-shared` layer for these modules, and apply the transition to all
async local storage instances therefore the instances of them are only
bundled once.
To make the turbopack chanegs work, we change how the async local
storage modules defined, separate the instance into a single file and
mark it as "next-shared" layer with import:

```
any module -> async local storage --- use transition, specify "next-shared" layer ---> async local storage instance
```

Closes NEXT-3085
@github-actions github-actions bot added the locked label May 1, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Next.js team PRs by the Next.js team. locked Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants