mrsandip commited on
Commit
893dc94
·
verified ·
1 Parent(s): c485fc9

Update (part 22)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/auto-implement-methods.js +71 -0
  2. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/auto-implement-methods.js.map +1 -0
  3. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/clean-url.js +14 -0
  4. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/clean-url.js.map +1 -0
  5. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +19 -0
  6. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js.map +1 -0
  7. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/is-static-gen-enabled.js +12 -0
  8. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/is-static-gen-enabled.js.map +1 -0
  9. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +15 -0
  10. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/parsed-url-query-to-params.js.map +1 -0
  11. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.d.ts +1 -0
  12. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js +35 -0
  13. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js.map +1 -0
  14. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.js +854 -0
  15. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.js.map +1 -0
  16. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/shared-modules.js +5 -0
  17. e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/shared-modules.js.map +1 -0
  18. e-commerce/node_modules/next/dist/esm/server/route-modules/checks.js +15 -0
  19. e-commerce/node_modules/next/dist/esm/server/route-modules/checks.js.map +1 -0
  20. e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.d.ts +1 -0
  21. e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.js +19 -0
  22. e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.js.map +1 -0
  23. e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.js +32 -0
  24. e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.js.map +1 -0
  25. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/builtin/_error.js +32 -0
  26. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/builtin/_error.js.map +1 -0
  27. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.d.ts +1 -0
  28. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.js +19 -0
  29. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.js.map +1 -0
  30. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.js +23 -0
  31. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.js.map +1 -0
  32. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.render.js +10 -0
  33. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.render.js.map +1 -0
  34. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/pages-handler.js +561 -0
  35. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/pages-handler.js.map +1 -0
  36. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/app-router-context.js +3 -0
  37. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/app-router-context.js.map +1 -0
  38. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/entrypoints.js +11 -0
  39. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/entrypoints.js.map +1 -0
  40. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/head-manager-context.js +3 -0
  41. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/head-manager-context.js.map +1 -0
  42. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/hooks-client-context.js +3 -0
  43. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/hooks-client-context.js.map +1 -0
  44. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/html-context.js +3 -0
  45. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/html-context.js.map +1 -0
  46. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/image-config-context.js +3 -0
  47. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/image-config-context.js.map +1 -0
  48. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable-context.js +3 -0
  49. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable-context.js.map +1 -0
  50. e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable.js +3 -0
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/auto-implement-methods.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { HTTP_METHODS } from '../../../web/http';
2
+ const AUTOMATIC_ROUTE_METHODS = [
3
+ 'HEAD',
4
+ 'OPTIONS'
5
+ ];
6
+ function handleMethodNotAllowedResponse() {
7
+ return new Response(null, {
8
+ status: 405
9
+ });
10
+ }
11
+ export function autoImplementMethods(handlers) {
12
+ // Loop through all the HTTP methods to create the initial methods object.
13
+ // Each of the methods will be set to the 405 response handler.
14
+ const methods = HTTP_METHODS.reduce((acc, method)=>({
15
+ ...acc,
16
+ // If the userland module implements the method, then use it. Otherwise,
17
+ // use the 405 response handler.
18
+ [method]: handlers[method] ?? handleMethodNotAllowedResponse
19
+ }), {});
20
+ // Get all the methods that could be automatically implemented that were not
21
+ // implemented by the userland module.
22
+ const implemented = new Set(HTTP_METHODS.filter((method)=>handlers[method]));
23
+ const missing = AUTOMATIC_ROUTE_METHODS.filter((method)=>!implemented.has(method));
24
+ // Loop over the missing methods to automatically implement them if we can.
25
+ for (const method of missing){
26
+ // If the userland module doesn't implement the HEAD method, then
27
+ // we'll automatically implement it by calling the GET method (if it
28
+ // exists).
29
+ if (method === 'HEAD') {
30
+ if (handlers.GET) {
31
+ // Implement the HEAD method by calling the GET method.
32
+ methods.HEAD = handlers.GET;
33
+ // Mark it as implemented.
34
+ implemented.add('HEAD');
35
+ }
36
+ continue;
37
+ }
38
+ // If OPTIONS is not provided then implement it.
39
+ if (method === 'OPTIONS') {
40
+ // TODO: check if HEAD is implemented, if so, use it to add more headers
41
+ // Get all the methods that were implemented by the userland module.
42
+ const allow = [
43
+ 'OPTIONS',
44
+ ...implemented
45
+ ];
46
+ // If the list of methods doesn't include HEAD, but it includes GET, then
47
+ // add HEAD as it's automatically implemented.
48
+ if (!implemented.has('HEAD') && implemented.has('GET')) {
49
+ allow.push('HEAD');
50
+ }
51
+ // Sort and join the list with commas to create the `Allow` header. See:
52
+ // https://httpwg.org/specs/rfc9110.html#field.allow
53
+ const headers = {
54
+ Allow: allow.sort().join(', ')
55
+ };
56
+ // Implement the OPTIONS method by returning a 204 response with the
57
+ // `Allow` header.
58
+ methods.OPTIONS = ()=>new Response(null, {
59
+ status: 204,
60
+ headers
61
+ });
62
+ // Mark this method as implemented.
63
+ implemented.add('OPTIONS');
64
+ continue;
65
+ }
66
+ throw new Error(`Invariant: should handle all automatic implementable methods, got method: ${method}`);
67
+ }
68
+ return methods;
69
+ }
70
+
71
+ //# sourceMappingURL=auto-implement-methods.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/auto-implement-methods.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/app-route/helpers/auto-implement-methods.ts"],"sourcesContent":["import type { AppRouteHandlerFn, AppRouteHandlers } from '../module'\n\nimport { HTTP_METHODS, type HTTP_METHOD } from '../../../web/http'\n\nconst AUTOMATIC_ROUTE_METHODS = ['HEAD', 'OPTIONS'] as const\n\nfunction handleMethodNotAllowedResponse(): Response {\n return new Response(null, { status: 405 })\n}\n\nexport function autoImplementMethods(\n handlers: AppRouteHandlers\n): Record<HTTP_METHOD, AppRouteHandlerFn> {\n // Loop through all the HTTP methods to create the initial methods object.\n // Each of the methods will be set to the 405 response handler.\n const methods: Record<HTTP_METHOD, AppRouteHandlerFn> = HTTP_METHODS.reduce(\n (acc, method) => ({\n ...acc,\n // If the userland module implements the method, then use it. Otherwise,\n // use the 405 response handler.\n [method]: handlers[method] ?? handleMethodNotAllowedResponse,\n }),\n {} as Record<HTTP_METHOD, AppRouteHandlerFn>\n )\n\n // Get all the methods that could be automatically implemented that were not\n // implemented by the userland module.\n const implemented = new Set(HTTP_METHODS.filter((method) => handlers[method]))\n const missing = AUTOMATIC_ROUTE_METHODS.filter(\n (method) => !implemented.has(method)\n )\n\n // Loop over the missing methods to automatically implement them if we can.\n for (const method of missing) {\n // If the userland module doesn't implement the HEAD method, then\n // we'll automatically implement it by calling the GET method (if it\n // exists).\n if (method === 'HEAD') {\n if (handlers.GET) {\n // Implement the HEAD method by calling the GET method.\n methods.HEAD = handlers.GET\n\n // Mark it as implemented.\n implemented.add('HEAD')\n }\n continue\n }\n\n // If OPTIONS is not provided then implement it.\n if (method === 'OPTIONS') {\n // TODO: check if HEAD is implemented, if so, use it to add more headers\n\n // Get all the methods that were implemented by the userland module.\n const allow: HTTP_METHOD[] = ['OPTIONS', ...implemented]\n\n // If the list of methods doesn't include HEAD, but it includes GET, then\n // add HEAD as it's automatically implemented.\n if (!implemented.has('HEAD') && implemented.has('GET')) {\n allow.push('HEAD')\n }\n\n // Sort and join the list with commas to create the `Allow` header. See:\n // https://httpwg.org/specs/rfc9110.html#field.allow\n const headers = { Allow: allow.sort().join(', ') }\n\n // Implement the OPTIONS method by returning a 204 response with the\n // `Allow` header.\n methods.OPTIONS = () => new Response(null, { status: 204, headers })\n\n // Mark this method as implemented.\n implemented.add('OPTIONS')\n\n continue\n }\n\n throw new Error(\n `Invariant: should handle all automatic implementable methods, got method: ${method}`\n )\n }\n\n return methods\n}\n"],"names":["HTTP_METHODS","AUTOMATIC_ROUTE_METHODS","handleMethodNotAllowedResponse","Response","status","autoImplementMethods","handlers","methods","reduce","acc","method","implemented","Set","filter","missing","has","GET","HEAD","add","allow","push","headers","Allow","sort","join","OPTIONS","Error"],"mappings":"AAEA,SAASA,YAAY,QAA0B,oBAAmB;AAElE,MAAMC,0BAA0B;IAAC;IAAQ;CAAU;AAEnD,SAASC;IACP,OAAO,IAAIC,SAAS,MAAM;QAAEC,QAAQ;IAAI;AAC1C;AAEA,OAAO,SAASC,qBACdC,QAA0B;IAE1B,0EAA0E;IAC1E,+DAA+D;IAC/D,MAAMC,UAAkDP,aAAaQ,MAAM,CACzE,CAACC,KAAKC,SAAY,CAAA;YAChB,GAAGD,GAAG;YACN,wEAAwE;YACxE,gCAAgC;YAChC,CAACC,OAAO,EAAEJ,QAAQ,CAACI,OAAO,IAAIR;QAChC,CAAA,GACA,CAAC;IAGH,4EAA4E;IAC5E,sCAAsC;IACtC,MAAMS,cAAc,IAAIC,IAAIZ,aAAaa,MAAM,CAAC,CAACH,SAAWJ,QAAQ,CAACI,OAAO;IAC5E,MAAMI,UAAUb,wBAAwBY,MAAM,CAC5C,CAACH,SAAW,CAACC,YAAYI,GAAG,CAACL;IAG/B,2EAA2E;IAC3E,KAAK,MAAMA,UAAUI,QAAS;QAC5B,iEAAiE;QACjE,oEAAoE;QACpE,WAAW;QACX,IAAIJ,WAAW,QAAQ;YACrB,IAAIJ,SAASU,GAAG,EAAE;gBAChB,uDAAuD;gBACvDT,QAAQU,IAAI,GAAGX,SAASU,GAAG;gBAE3B,0BAA0B;gBAC1BL,YAAYO,GAAG,CAAC;YAClB;YACA;QACF;QAEA,gDAAgD;QAChD,IAAIR,WAAW,WAAW;YACxB,wEAAwE;YAExE,oEAAoE;YACpE,MAAMS,QAAuB;gBAAC;mBAAcR;aAAY;YAExD,yEAAyE;YACzE,8CAA8C;YAC9C,IAAI,CAACA,YAAYI,GAAG,CAAC,WAAWJ,YAAYI,GAAG,CAAC,QAAQ;gBACtDI,MAAMC,IAAI,CAAC;YACb;YAEA,wEAAwE;YACxE,oDAAoD;YACpD,MAAMC,UAAU;gBAAEC,OAAOH,MAAMI,IAAI,GAAGC,IAAI,CAAC;YAAM;YAEjD,oEAAoE;YACpE,kBAAkB;YAClBjB,QAAQkB,OAAO,GAAG,IAAM,IAAItB,SAAS,MAAM;oBAAEC,QAAQ;oBAAKiB;gBAAQ;YAElE,mCAAmC;YACnCV,YAAYO,GAAG,CAAC;YAEhB;QACF;QAEA,MAAM,IAAIQ,MACR,CAAC,0EAA0E,EAAEhB,QAAQ;IAEzF;IAEA,OAAOH;AACT","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/clean-url.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Cleans a URL by stripping the protocol, host, and search params.
3
+ *
4
+ * @param urlString the url to clean
5
+ * @returns the cleaned url
6
+ */ export function cleanURL(url) {
7
+ const u = new URL(url);
8
+ u.host = 'localhost:3000';
9
+ u.search = '';
10
+ u.protocol = 'http';
11
+ return u;
12
+ }
13
+
14
+ //# sourceMappingURL=clean-url.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/clean-url.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/app-route/helpers/clean-url.ts"],"sourcesContent":["/**\n * Cleans a URL by stripping the protocol, host, and search params.\n *\n * @param urlString the url to clean\n * @returns the cleaned url\n */\n\nexport function cleanURL(url: string | URL): URL {\n const u = new URL(url)\n u.host = 'localhost:3000'\n u.search = ''\n u.protocol = 'http'\n return u\n}\n"],"names":["cleanURL","url","u","URL","host","search","protocol"],"mappings":"AAAA;;;;;CAKC,GAED,OAAO,SAASA,SAASC,GAAiB;IACxC,MAAMC,IAAI,IAAIC,IAAIF;IAClBC,EAAEE,IAAI,GAAG;IACTF,EAAEG,MAAM,GAAG;IACXH,EAAEI,QAAQ,GAAG;IACb,OAAOJ;AACT","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Get pathname from absolute path.
3
+ *
4
+ * @param absolutePath the absolute path
5
+ * @returns the pathname
6
+ */ export function getPathnameFromAbsolutePath(absolutePath) {
7
+ // Remove prefix including app dir
8
+ let appDir = '/app/';
9
+ if (!absolutePath.includes(appDir)) {
10
+ appDir = '\\app\\';
11
+ }
12
+ const [, ...parts] = absolutePath.split(appDir);
13
+ const relativePath = appDir[0] + parts.join(appDir);
14
+ // remove extension
15
+ const pathname = relativePath.split('.').slice(0, -1).join('.');
16
+ return pathname;
17
+ }
18
+
19
+ //# sourceMappingURL=get-pathname-from-absolute-path.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.ts"],"sourcesContent":["/**\n * Get pathname from absolute path.\n *\n * @param absolutePath the absolute path\n * @returns the pathname\n */\nexport function getPathnameFromAbsolutePath(absolutePath: string) {\n // Remove prefix including app dir\n let appDir = '/app/'\n if (!absolutePath.includes(appDir)) {\n appDir = '\\\\app\\\\'\n }\n const [, ...parts] = absolutePath.split(appDir)\n const relativePath = appDir[0] + parts.join(appDir)\n\n // remove extension\n const pathname = relativePath.split('.').slice(0, -1).join('.')\n return pathname\n}\n"],"names":["getPathnameFromAbsolutePath","absolutePath","appDir","includes","parts","split","relativePath","join","pathname","slice"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,4BAA4BC,YAAoB;IAC9D,kCAAkC;IAClC,IAAIC,SAAS;IACb,IAAI,CAACD,aAAaE,QAAQ,CAACD,SAAS;QAClCA,SAAS;IACX;IACA,MAAM,GAAG,GAAGE,MAAM,GAAGH,aAAaI,KAAK,CAACH;IACxC,MAAMI,eAAeJ,MAAM,CAAC,EAAE,GAAGE,MAAMG,IAAI,CAACL;IAE5C,mBAAmB;IACnB,MAAMM,WAAWF,aAAaD,KAAK,CAAC,KAAKI,KAAK,CAAC,GAAG,CAAC,GAAGF,IAAI,CAAC;IAC3D,OAAOC;AACT","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/is-static-gen-enabled.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // route handlers are only statically optimized if they define
2
+ // one of these top-level configs manually
3
+ // - dynamic = 'force-static'
4
+ // - dynamic = 'error'
5
+ // - revalidate > 0
6
+ // - revalidate = false
7
+ // - generateStaticParams
8
+ export function isStaticGenEnabled(mod) {
9
+ return mod.dynamic === 'force-static' || mod.dynamic === 'error' || mod.revalidate === false || mod.revalidate !== undefined && mod.revalidate > 0 || typeof mod.generateStaticParams == 'function';
10
+ }
11
+
12
+ //# sourceMappingURL=is-static-gen-enabled.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/is-static-gen-enabled.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/app-route/helpers/is-static-gen-enabled.ts"],"sourcesContent":["import type { AppRouteModule } from '../module.compiled'\n\n// route handlers are only statically optimized if they define\n// one of these top-level configs manually\n// - dynamic = 'force-static'\n// - dynamic = 'error'\n// - revalidate > 0\n// - revalidate = false\n// - generateStaticParams\nexport function isStaticGenEnabled(\n mod: AppRouteModule['routeModule']['userland']\n) {\n return (\n mod.dynamic === 'force-static' ||\n mod.dynamic === 'error' ||\n mod.revalidate === false ||\n (mod.revalidate !== undefined && mod.revalidate > 0) ||\n typeof mod.generateStaticParams == 'function'\n )\n}\n"],"names":["isStaticGenEnabled","mod","dynamic","revalidate","undefined","generateStaticParams"],"mappings":"AAEA,8DAA8D;AAC9D,0CAA0C;AAC1C,+BAA+B;AAC/B,wBAAwB;AACxB,qBAAqB;AACrB,yBAAyB;AACzB,2BAA2B;AAC3B,OAAO,SAASA,mBACdC,GAA8C;IAE9C,OACEA,IAAIC,OAAO,KAAK,kBAChBD,IAAIC,OAAO,KAAK,WAChBD,IAAIE,UAAU,KAAK,SAClBF,IAAIE,UAAU,KAAKC,aAAaH,IAAIE,UAAU,GAAG,KAClD,OAAOF,IAAII,oBAAoB,IAAI;AAEvC","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/parsed-url-query-to-params.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Converts the query into params.
3
+ *
4
+ * @param query the query to convert to params
5
+ * @returns the params
6
+ */ export function parsedUrlQueryToParams(query) {
7
+ const params = {};
8
+ for (const [key, value] of Object.entries(query)){
9
+ if (typeof value === 'undefined') continue;
10
+ params[key] = value;
11
+ }
12
+ return params;
13
+ }
14
+
15
+ //# sourceMappingURL=parsed-url-query-to-params.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/helpers/parsed-url-query-to-params.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/app-route/helpers/parsed-url-query-to-params.ts"],"sourcesContent":["import type { ParsedUrlQuery } from 'querystring'\n\n/**\n * Converts the query into params.\n *\n * @param query the query to convert to params\n * @returns the params\n */\nexport function parsedUrlQueryToParams(\n query: ParsedUrlQuery\n): Record<string, string | string[]> {\n const params: Record<string, string | string[]> = {}\n\n for (const [key, value] of Object.entries(query)) {\n if (typeof value === 'undefined') continue\n params[key] = value\n }\n\n return params\n}\n"],"names":["parsedUrlQueryToParams","query","params","key","value","Object","entries"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,SAASA,uBACdC,KAAqB;IAErB,MAAMC,SAA4C,CAAC;IAEnD,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACL,OAAQ;QAChD,IAAI,OAAOG,UAAU,aAAa;QAClCF,MAAM,CAACC,IAAI,GAAGC;IAChB;IAEA,OAAOF;AACT","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.d.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ export * from './module'
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (process.env.NEXT_RUNTIME === 'edge') {
2
+ module.exports = require('next/dist/server/route-modules/app-route/module.js');
3
+ } else {
4
+ if (process.env.__NEXT_EXPERIMENTAL_REACT) {
5
+ if (process.env.NODE_ENV === 'development') {
6
+ if (process.env.TURBOPACK) {
7
+ module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js');
8
+ } else {
9
+ module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js');
10
+ }
11
+ } else {
12
+ if (process.env.TURBOPACK) {
13
+ module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js');
14
+ } else {
15
+ module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js');
16
+ }
17
+ }
18
+ } else {
19
+ if (process.env.NODE_ENV === 'development') {
20
+ if (process.env.TURBOPACK) {
21
+ module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js');
22
+ } else {
23
+ module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js');
24
+ }
25
+ } else {
26
+ if (process.env.TURBOPACK) {
27
+ module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js');
28
+ } else {
29
+ module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js');
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ //# sourceMappingURL=module.compiled.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/app-route/module.compiled.js"],"sourcesContent":["if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/app-route/module.js')\n} else {\n if (process.env.__NEXT_EXPERIMENTAL_REACT) {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js')\n }\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js')\n }\n }\n }\n}\n"],"names":["process","env","NEXT_RUNTIME","module","exports","require","__NEXT_EXPERIMENTAL_REACT","NODE_ENV","TURBOPACK"],"mappings":"AAAA,IAAIA,QAAQC,GAAG,CAACC,YAAY,KAA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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { RouteModule } from '../route-module';
2
+ import { createRequestStoreForAPI } from '../../async-storage/request-store';
3
+ import { createPrerenderWorkStore, createWorkStore } from '../../async-storage/work-store';
4
+ import { HTTP_METHODS, isHTTPMethod } from '../../web/http';
5
+ import { getImplicitTags } from '../../lib/implicit-tags';
6
+ import { patchFetch } from '../../lib/patch-fetch';
7
+ import { getTracer } from '../../lib/trace/tracer';
8
+ import { AppRouteRouteHandlersSpan, AppRouteRouteModuleSpan } from '../../lib/trace/constants';
9
+ import * as Log from '../../../build/output/log';
10
+ import { autoImplementMethods } from './helpers/auto-implement-methods';
11
+ import { appendMutableCookies } from '../../web/spec-extension/adapters/request-cookies';
12
+ import { HeadersAdapter } from '../../web/spec-extension/adapters/headers';
13
+ import { RequestCookiesAdapter } from '../../web/spec-extension/adapters/request-cookies';
14
+ import { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params';
15
+ import { Phase, printDebugThrownValueForProspectiveRender } from '../../app-render/prospective-render-utils';
16
+ import * as serverHooks from '../../../client/components/hooks-server-context';
17
+ import { DynamicServerError } from '../../../client/components/hooks-server-context';
18
+ import { workAsyncStorage } from '../../app-render/work-async-storage.external';
19
+ import { workUnitAsyncStorage } from '../../app-render/work-unit-async-storage.external';
20
+ import { actionAsyncStorage } from '../../app-render/action-async-storage.external';
21
+ import * as sharedModules from './shared-modules';
22
+ import { getIsPossibleServerAction } from '../../lib/server-action-request-meta';
23
+ import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies';
24
+ import { cleanURL } from './helpers/clean-url';
25
+ import { StaticGenBailoutError } from '../../../client/components/static-generation-bailout';
26
+ import { isStaticGenEnabled } from './helpers/is-static-gen-enabled';
27
+ import { abortAndThrowOnSynchronousRequestDataAccess, createDynamicTrackingState, getFirstDynamicReason } from '../../app-render/dynamic-rendering';
28
+ import { ReflectAdapter } from '../../web/spec-extension/adapters/reflect';
29
+ import { CacheSignal } from '../../app-render/cache-signal';
30
+ import { scheduleImmediate } from '../../../lib/scheduler';
31
+ import { createServerParamsForRoute } from '../../request/params';
32
+ import { getRedirectStatusCodeFromError, getURLFromRedirectError } from '../../../client/components/redirect';
33
+ import { isRedirectError } from '../../../client/components/redirect-error';
34
+ import { getAccessFallbackHTTPStatus, isHTTPAccessFallbackError } from '../../../client/components/http-access-fallback/http-access-fallback';
35
+ import { RedirectStatusCode } from '../../../client/components/redirect-status-code';
36
+ import { INFINITE_CACHE } from '../../../lib/constants';
37
+ import { executeRevalidates } from '../../revalidation-utils';
38
+ import { trackPendingModules } from '../../app-render/module-loading/track-module-loading.external';
39
+ import { InvariantError } from '../../../shared/lib/invariant-error';
40
+ import { LazyModule } from '../../lib/lazy-module';
41
+ import { createPrerenderResumeDataCache } from '../../resume-data-cache/resume-data-cache';
42
+ import { createRouteHandlerRequestInUseCacheError, createRouteHandlerRequestInUnstableCacheError } from '../../use-cache/use-cache-messages';
43
+ export class WrappedNextRouterError {
44
+ constructor(error, headers){
45
+ this.error = error;
46
+ this.headers = headers;
47
+ }
48
+ }
49
+ /**
50
+ * AppRouteRouteHandler is the handler for app routes.
51
+ */ export class AppRouteRouteModule extends RouteModule {
52
+ static #_ = this.sharedModules = sharedModules;
53
+ get userland() {
54
+ return this._lazyUserland.assertLoaded();
55
+ }
56
+ /**
57
+ * Ensures the userland module is fully loaded before it's accessed via
58
+ * `userland`. Required for route files that use top-level await, where
59
+ * require() returns a promise instead of the module directly. Must be called
60
+ * before accessing `userland` in contexts where the module may not yet be
61
+ * resolved (e.g. the export/static-generation worker).
62
+ */ async ensureUserland() {
63
+ await this._lazyUserland.waitUntilLoaded();
64
+ }
65
+ constructor({ userland, getUserland, definition, distDir, relativeProjectDir, resolvedPagePath, nextConfigOutput }){
66
+ super({
67
+ userland: undefined,
68
+ definition,
69
+ distDir,
70
+ relativeProjectDir
71
+ }), /**
72
+ * A reference to the request async storage.
73
+ */ this.workUnitAsyncStorage = workUnitAsyncStorage, /**
74
+ * A reference to the static generation async storage.
75
+ */ this.workAsyncStorage = workAsyncStorage, /**
76
+ * An interface to call server hooks which interact with the underlying
77
+ * storage.
78
+ */ this.serverHooks = serverHooks, /**
79
+ * A reference to the mutation related async storage, such as mutations of
80
+ * cookies.
81
+ */ this.actionAsyncStorage = actionAsyncStorage;
82
+ this.resolvedPagePath = resolvedPagePath;
83
+ this.nextConfigOutput = nextConfigOutput;
84
+ this._getUserland = getUserland;
85
+ this._lazyUserland = new LazyModule(()=>getTracer().trace(AppRouteRouteModuleSpan.loadUserland, {
86
+ spanName: 'load app route module',
87
+ attributes: {
88
+ 'next.route': this.definition.pathname
89
+ }
90
+ }, userland), (module)=>this._onUserlandLoaded(module));
91
+ // output:export routes load eagerly, so that errors surface at module
92
+ // load time (as a Redbox in dev) rather than at request time.
93
+ if (nextConfigOutput === 'export') {
94
+ this._lazyUserland.loadIfNeeded();
95
+ }
96
+ }
97
+ _onUserlandLoaded(userland) {
98
+ // Automatically implement some methods if they aren't implemented by the
99
+ // userland module.
100
+ this._methods = autoImplementMethods(userland);
101
+ // Get the non-static methods for this route.
102
+ this._hasNonStaticMethods = hasNonStaticMethods(userland);
103
+ // Get the dynamic property from the userland module.
104
+ this._dynamic = userland.dynamic;
105
+ if (this.nextConfigOutput === 'export') {
106
+ if (this._dynamic === 'force-dynamic') {
107
+ throw new Error(`export const dynamic = "force-dynamic" on page "${this.definition.pathname}" cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`);
108
+ } else if (!isStaticGenEnabled(userland) && userland['GET']) {
109
+ throw new Error(`export const dynamic = "force-static"/export const revalidate not configured on route "${this.definition.pathname}" with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`);
110
+ } else {
111
+ this._dynamic = 'error';
112
+ }
113
+ }
114
+ // We only warn in development after here, so return if we're not in
115
+ // development.
116
+ if (process.env.NODE_ENV === 'development') {
117
+ // Print error in development if the exported handlers are in lowercase, only
118
+ // uppercase handlers are supported.
119
+ const lowercased = HTTP_METHODS.map((method)=>method.toLowerCase());
120
+ for (const method of lowercased){
121
+ if (method in userland) {
122
+ Log.error(`Detected lowercase method '${method}' in '${this.resolvedPagePath}'. Export the uppercase '${method.toUpperCase()}' method name to fix this error.`);
123
+ }
124
+ }
125
+ // Print error if the module exports a default handler, they must use named
126
+ // exports for each HTTP method.
127
+ if ('default' in userland) {
128
+ Log.error(`Detected default export in '${this.resolvedPagePath}'. Export a named export for each HTTP method instead.`);
129
+ }
130
+ // If there is no methods exported by this module, then return a not found
131
+ // response.
132
+ if (!HTTP_METHODS.some((method)=>method in userland)) {
133
+ Log.error(`No HTTP methods exported in '${this.resolvedPagePath}'. Export a named export for each HTTP method.`);
134
+ }
135
+ }
136
+ }
137
+ /**
138
+ * Returns the handler function for the given HTTP method.
139
+ * Must be called after ensureUserland() has resolved so that _methods is
140
+ * populated.
141
+ */ resolveHandler(method) {
142
+ // Prevent RCE: only allow recognized HTTP methods.
143
+ if (!isHTTPMethod(method)) return ()=>new Response(null, {
144
+ status: 400
145
+ });
146
+ return this._methods[method];
147
+ }
148
+ /**
149
+ * Returns the handler for the given method using a live userland snapshot.
150
+ * Used in Turbopack dev mode to pick up server HMR updates. The userland
151
+ * is fetched synchronously via require() so no async overhead is added.
152
+ */ resolveHandlerFromUserland(method, userland) {
153
+ if (!isHTTPMethod(method)) return ()=>new Response(null, {
154
+ status: 400
155
+ });
156
+ return autoImplementMethods(userland)[method];
157
+ }
158
+ resolvePendingRevalidations(workStore, requestStore, context) {
159
+ const maybeRevalidatesPromise = executeRevalidates(workStore);
160
+ if (maybeRevalidatesPromise !== false) {
161
+ context.renderOpts.pendingWaitUntil = maybeRevalidatesPromise.finally(()=>{
162
+ if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {
163
+ console.log('pending revalidates promise finished for:', requestStore.url.pathname + requestStore.url.search);
164
+ }
165
+ });
166
+ }
167
+ }
168
+ handleHandlerError(err, actionStore, workStore, requestStore, context) {
169
+ if (isRedirectError(err)) {
170
+ const url = getURLFromRedirectError(err);
171
+ if (!url) {
172
+ throw new Error('Invariant: Unexpected redirect url format');
173
+ }
174
+ // We need to capture any headers that should be sent on the response.
175
+ const headers = new Headers({
176
+ Location: url
177
+ });
178
+ // Let's append any cookies that were added by the cookie API.
179
+ // TODO leaving the gate here b/c it indicates that we might not actually
180
+ // want to do this on every handler invocation. During prerender there
181
+ // should be no mutableCookies because then they'd be dynamic.
182
+ appendMutableCookies(headers, requestStore.mutableCookies);
183
+ this.resolvePendingRevalidations(workStore, requestStore, context);
184
+ return new Response(null, {
185
+ // If we're in an action, we want to use a 303 redirect as we don't
186
+ // want the POST request to follow the redirect, as it could result in
187
+ // erroneous re-submissions.
188
+ status: actionStore.isAction ? RedirectStatusCode.SeeOther : getRedirectStatusCodeFromError(err),
189
+ headers
190
+ });
191
+ }
192
+ if (isHTTPAccessFallbackError(err)) {
193
+ const httpStatus = getAccessFallbackHTTPStatus(err);
194
+ return new Response(null, {
195
+ status: httpStatus
196
+ });
197
+ }
198
+ throw err;
199
+ }
200
+ finalizeResponse(res, request, workStore, requestStore, prerenderStore, context) {
201
+ if (!(res instanceof Response)) {
202
+ var _res_constructor;
203
+ const invalidType = res === null ? 'null' : res === undefined ? 'undefined' : typeof res === 'object' ? ((_res_constructor = res.constructor) == null ? void 0 : _res_constructor.name) || 'object' : typeof res;
204
+ throw new Error(`No response is returned from route handler '${this.resolvedPagePath}'. ` + `Expected a Response object but received '${invalidType}' (method: ${request.method}, url: ${requestStore.url.pathname}). ` + `Ensure you return a \`Response\` or a \`NextResponse\` in all branches of your handler.`);
205
+ }
206
+ context.renderOpts.fetchMetrics = workStore.fetchMetrics;
207
+ this.resolvePendingRevalidations(workStore, requestStore, context);
208
+ if (prerenderStore) {
209
+ var _prerenderStore_tags;
210
+ context.renderOpts.collectedTags = (_prerenderStore_tags = prerenderStore.tags) == null ? void 0 : _prerenderStore_tags.join(',');
211
+ context.renderOpts.collectedRevalidate = prerenderStore.revalidate;
212
+ context.renderOpts.collectedExpire = prerenderStore.expire;
213
+ context.renderOpts.collectedStale = prerenderStore.stale;
214
+ }
215
+ // It's possible cookies were set in the handler, so we need to merge the
216
+ // modified cookies and the returned response here.
217
+ const headers = new Headers(res.headers);
218
+ if (appendMutableCookies(headers, requestStore.mutableCookies)) {
219
+ return new Response(res.body, {
220
+ status: res.status,
221
+ statusText: res.statusText,
222
+ headers
223
+ });
224
+ }
225
+ return res;
226
+ }
227
+ async prerenderToResponse(handler, actionStore, workStore, requestStore, implicitTags, request, context) {
228
+ const cacheComponentsEnabled = !!context.renderOpts.cacheComponents;
229
+ // Patch the global fetch.
230
+ patchFetch({
231
+ workAsyncStorage: this.workAsyncStorage,
232
+ workUnitAsyncStorage: this.workUnitAsyncStorage
233
+ });
234
+ const handlerContext = {
235
+ params: context.params ? createServerParamsForRoute(parsedUrlQueryToParams(context.params)) : undefined
236
+ };
237
+ let prerenderStore;
238
+ let res;
239
+ try {
240
+ const userlandRevalidate = this.userland.revalidate;
241
+ const defaultRevalidate = // If the static generation store does not have a revalidate value
242
+ // set, then we should set it the revalidate value from the userland
243
+ // module or default to false.
244
+ userlandRevalidate === false || userlandRevalidate === undefined ? INFINITE_CACHE : userlandRevalidate;
245
+ if (cacheComponentsEnabled) {
246
+ /**
247
+ * When we are attempting to statically prerender the GET handler of a route.ts module
248
+ * and cacheComponents is on we follow a similar pattern to rendering.
249
+ *
250
+ * We first run the handler letting caches fill. If something synchronously dynamic occurs
251
+ * during this prospective render then we can infer it will happen on every render and we
252
+ * just bail out of prerendering.
253
+ *
254
+ * Next we run the handler again and we check if we get a result back in a microtask.
255
+ * Next.js expects the return value to be a Response or a Thenable that resolves to a Response.
256
+ * Unfortunately Response's do not allow for accessing the response body synchronously or in
257
+ * a microtask so we need to allow one more task to unwrap the response body. This is a slightly
258
+ * different semantic than what we have when we render and it means that certain tasks can still
259
+ * execute before a prerender completes such as a carefully timed setImmediate.
260
+ *
261
+ * Functionally though IO should still take longer than the time it takes to unwrap the response body
262
+ * so our heuristic of excluding any IO should be preserved.
263
+ */ const prospectiveController = new AbortController();
264
+ let prospectiveRenderIsDynamic = false;
265
+ const cacheSignal = new CacheSignal(null);
266
+ let dynamicTracking = createDynamicTrackingState(undefined);
267
+ // TODO: Route handlers are never resumed, so it's counter-intuitive
268
+ // to use an RDC here. However, we need the data cache to store cached
269
+ // results in memory during the prospective prerender, so that they
270
+ // can be retrieved during the final prerender within microtasks. This
271
+ // is crucial when doing revalidations of a deployed route handler,
272
+ // where the default cache handler does not do any in-memory caching.
273
+ const prerenderResumeDataCache = createPrerenderResumeDataCache();
274
+ const prospectiveRoutePrerenderStore = prerenderStore = {
275
+ type: 'prerender',
276
+ phase: 'action',
277
+ // This replicates prior behavior where rootParams is empty in routes
278
+ // TODO we need to make this have the proper rootParams for this route
279
+ rootParams: {},
280
+ fallbackRouteParams: null,
281
+ implicitTags,
282
+ renderSignal: prospectiveController.signal,
283
+ controller: prospectiveController,
284
+ stagedRendering: null,
285
+ cacheSignal,
286
+ // During prospective render we don't use a controller
287
+ // because we need to let all caches fill.
288
+ dynamicTracking,
289
+ revalidate: defaultRevalidate,
290
+ expire: INFINITE_CACHE,
291
+ stale: INFINITE_CACHE,
292
+ tags: [
293
+ ...implicitTags.tags
294
+ ],
295
+ resumeDataCache: prerenderResumeDataCache,
296
+ hmrRefreshHash: undefined,
297
+ varyParamsAccumulator: null,
298
+ ensureStaticLevel: null,
299
+ prerenderDataTracking: null,
300
+ isFallbackUpgradeable: false
301
+ };
302
+ let prospectiveResult;
303
+ try {
304
+ prospectiveResult = this.workUnitAsyncStorage.run(prospectiveRoutePrerenderStore, handler, request, handlerContext);
305
+ } catch (err) {
306
+ if (prospectiveController.signal.aborted) {
307
+ // the route handler called an API which is always dynamic
308
+ // there is no need to try again
309
+ prospectiveRenderIsDynamic = true;
310
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
311
+ printDebugThrownValueForProspectiveRender(err, workStore.route, Phase.ProspectiveRender);
312
+ }
313
+ }
314
+ if (typeof prospectiveResult === 'object' && prospectiveResult !== null && typeof prospectiveResult.then === 'function') {
315
+ // The handler returned a Thenable. We'll listen for rejections to determine
316
+ // if the route is erroring for dynamic reasons.
317
+ ;
318
+ prospectiveResult.then(()=>{}, (err)=>{
319
+ if (prospectiveController.signal.aborted) {
320
+ // the route handler called an API which is always dynamic
321
+ // there is no need to try again
322
+ prospectiveRenderIsDynamic = true;
323
+ } else if (process.env.NEXT_DEBUG_BUILD) {
324
+ printDebugThrownValueForProspectiveRender(err, workStore.route, Phase.ProspectiveRender);
325
+ }
326
+ });
327
+ }
328
+ trackPendingModules(cacheSignal);
329
+ await cacheSignal.cacheReady();
330
+ if (prospectiveRenderIsDynamic) {
331
+ // the route handler called an API which is always dynamic
332
+ // there is no need to try again
333
+ const dynamicReason = getFirstDynamicReason(dynamicTracking);
334
+ if (dynamicReason) {
335
+ throw new DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${dynamicReason}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
336
+ } else {
337
+ console.error('Expected Next.js to keep track of reason for opting out of static rendering but one was not found. This is a bug in Next.js');
338
+ throw new DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used a dynamic API. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
339
+ }
340
+ }
341
+ // TODO start passing this controller to the route handler. We should expose
342
+ // it so the handler to abort inflight requests and other operations if we abort
343
+ // the prerender.
344
+ const finalController = new AbortController();
345
+ dynamicTracking = createDynamicTrackingState(undefined);
346
+ const finalRoutePrerenderStore = prerenderStore = {
347
+ type: 'prerender',
348
+ phase: 'action',
349
+ rootParams: {},
350
+ fallbackRouteParams: null,
351
+ implicitTags,
352
+ renderSignal: finalController.signal,
353
+ controller: finalController,
354
+ stagedRendering: null,
355
+ cacheSignal: null,
356
+ dynamicTracking,
357
+ revalidate: defaultRevalidate,
358
+ expire: INFINITE_CACHE,
359
+ stale: INFINITE_CACHE,
360
+ tags: [
361
+ ...implicitTags.tags
362
+ ],
363
+ resumeDataCache: prerenderResumeDataCache,
364
+ hmrRefreshHash: undefined,
365
+ varyParamsAccumulator: null,
366
+ ensureStaticLevel: null,
367
+ prerenderDataTracking: null,
368
+ isFallbackUpgradeable: false
369
+ };
370
+ let responseHandled = false;
371
+ res = await new Promise((resolve, reject)=>{
372
+ scheduleImmediate(async ()=>{
373
+ try {
374
+ const result = await this.workUnitAsyncStorage.run(finalRoutePrerenderStore, handler, request, handlerContext);
375
+ if (responseHandled) {
376
+ // we already rejected in the followup task
377
+ return;
378
+ } else if (!(result instanceof Response)) {
379
+ // This is going to error but we let that happen below
380
+ resolve(result);
381
+ return;
382
+ }
383
+ responseHandled = true;
384
+ let bodyHandled = false;
385
+ result.arrayBuffer().then((body)=>{
386
+ if (!bodyHandled) {
387
+ bodyHandled = true;
388
+ resolve(new Response(body, {
389
+ headers: result.headers,
390
+ status: result.status,
391
+ statusText: result.statusText
392
+ }));
393
+ }
394
+ }, reject);
395
+ scheduleImmediate(()=>{
396
+ if (!bodyHandled) {
397
+ bodyHandled = true;
398
+ finalController.abort();
399
+ reject(createCacheComponentsError(workStore.route));
400
+ }
401
+ });
402
+ } catch (err) {
403
+ reject(err);
404
+ }
405
+ });
406
+ scheduleImmediate(()=>{
407
+ if (!responseHandled) {
408
+ responseHandled = true;
409
+ finalController.abort();
410
+ reject(createCacheComponentsError(workStore.route));
411
+ }
412
+ });
413
+ });
414
+ if (finalController.signal.aborted) {
415
+ // We aborted from within the execution
416
+ throw createCacheComponentsError(workStore.route);
417
+ } else {
418
+ // We didn't abort during the execution. We can abort now as a matter of semantics
419
+ // though at the moment nothing actually consumes this signal so it won't halt any
420
+ // inflight work.
421
+ finalController.abort();
422
+ }
423
+ } else {
424
+ prerenderStore = {
425
+ type: 'prerender-legacy',
426
+ phase: 'action',
427
+ rootParams: {},
428
+ implicitTags,
429
+ revalidate: defaultRevalidate,
430
+ expire: INFINITE_CACHE,
431
+ stale: INFINITE_CACHE,
432
+ tags: [
433
+ ...implicitTags.tags
434
+ ]
435
+ };
436
+ res = await workUnitAsyncStorage.run(prerenderStore, handler, request, handlerContext);
437
+ }
438
+ } catch (err) {
439
+ return this.handleHandlerError(err, actionStore, workStore, requestStore, context);
440
+ }
441
+ return this.finalizeResponse(res, request, workStore, requestStore, prerenderStore, context);
442
+ }
443
+ async renderToResponse(handler, actionStore, workStore, requestStore, request, context) {
444
+ // Patch the global fetch.
445
+ patchFetch({
446
+ workAsyncStorage: this.workAsyncStorage,
447
+ workUnitAsyncStorage: this.workUnitAsyncStorage
448
+ });
449
+ const handlerContext = {
450
+ params: context.params ? createServerParamsForRoute(parsedUrlQueryToParams(context.params)) : undefined
451
+ };
452
+ let res;
453
+ try {
454
+ res = await workUnitAsyncStorage.run(requestStore, handler, request, handlerContext);
455
+ } catch (err) {
456
+ return this.handleHandlerError(err, actionStore, workStore, requestStore, context);
457
+ }
458
+ return this.finalizeResponse(res, request, workStore, requestStore, null, context);
459
+ }
460
+ async prepareExecution(req, context) {
461
+ // Ensure userland is fully loaded (handles async modules with top-level
462
+ // await, where require() returns a Promise instead of the module).
463
+ await this.ensureUserland();
464
+ // In Turbopack dev mode, fetch the live userland module on every request
465
+ // via the synchronous require() getter so server HMR updates are reflected
466
+ // immediately. This is cheap — it is just a devModuleCache lookup.
467
+ // For routes with top-level await, require() may still return a Promise
468
+ // (async module); in that case fall back to the already-resolved
469
+ // userland module resolved by ensureUserland() above.
470
+ const rawLiveUserland = this._getUserland == null ? void 0 : this._getUserland.call(this);
471
+ const liveUserland = rawLiveUserland instanceof Promise ? undefined : rawLiveUserland;
472
+ const handler = liveUserland ? this.resolveHandlerFromUserland(req.method, liveUserland) : this.resolveHandler(req.method);
473
+ // Use the live userland (if available) for per-request values so HMR
474
+ // changes to fetchCache, dynamic, etc. are also picked up.
475
+ const userland = liveUserland ?? this.userland;
476
+ // Add the fetchCache option to the renderOpts.
477
+ context.renderOpts.fetchCache = userland.fetchCache;
478
+ const actionStore = {
479
+ isAppRoute: true,
480
+ isAction: getIsPossibleServerAction(req)
481
+ };
482
+ const implicitTags = await getImplicitTags(this.definition.page, req.nextUrl.pathname, // App Routes don't support unknown route params.
483
+ null);
484
+ const requestStore = createRequestStoreForAPI(req, req.nextUrl, implicitTags, undefined, context.previewProps, context.renderOpts.hmrRefreshHash);
485
+ return {
486
+ handler,
487
+ dynamic: (liveUserland == null ? void 0 : liveUserland.dynamic) ?? this._dynamic,
488
+ hasNonStaticMethods: liveUserland ? hasNonStaticMethods(liveUserland) : this._hasNonStaticMethods,
489
+ actionStore,
490
+ implicitTags,
491
+ requestStore
492
+ };
493
+ }
494
+ validateExecutionResponse(response) {
495
+ // If the handler didn't return a valid response, then return the internal
496
+ // error response.
497
+ if (!(response instanceof Response)) {
498
+ // TODO: validate the correct handling behavior, maybe log something?
499
+ return new Response(null, {
500
+ status: 500
501
+ });
502
+ }
503
+ if (response.headers.has('x-middleware-rewrite')) {
504
+ throw new Error('NextResponse.rewrite() was used in a app route handler, this is not currently supported. Please remove the invocation to continue.');
505
+ }
506
+ if (response.headers.get('x-middleware-next') === '1') {
507
+ // TODO: move this error into the `NextResponse.next()` function.
508
+ throw new Error('NextResponse.next() was used in a app route handler, this is not supported. See here for more info: https://nextjs.org/docs/messages/next-response-next-in-app-route-handler');
509
+ }
510
+ return response;
511
+ }
512
+ async executeRequest(req, context, prepared, workStore) {
513
+ const { actionStore, handler, requestStore } = prepared;
514
+ const response = await this.actionAsyncStorage.run(actionStore, ()=>this.workUnitAsyncStorage.run(requestStore, ()=>this.workAsyncStorage.run(workStore, ()=>{
515
+ let request = req;
516
+ switch(prepared.dynamic){
517
+ case 'force-dynamic':
518
+ workStore.forceDynamic = true;
519
+ break;
520
+ case 'force-static':
521
+ workStore.forceStatic = true;
522
+ request = new Proxy(req, forceStaticRequestHandlers);
523
+ break;
524
+ case 'error':
525
+ workStore.dynamicShouldError = true;
526
+ break;
527
+ case undefined:
528
+ case 'auto':
529
+ request = proxyNextRequest(req, workStore);
530
+ break;
531
+ default:
532
+ prepared.dynamic;
533
+ }
534
+ const tracer = getTracer();
535
+ const { pathname } = this.definition;
536
+ tracer.setRootSpanAttribute('next.route', pathname);
537
+ return tracer.trace(AppRouteRouteHandlersSpan.runHandler, {
538
+ spanName: `executing api route (app) ${pathname}`,
539
+ attributes: {
540
+ 'next.route': pathname
541
+ }
542
+ }, ()=>this.renderToResponse(handler, actionStore, workStore, requestStore, request, context));
543
+ })));
544
+ return this.validateExecutionResponse(response);
545
+ }
546
+ async executePrerender(req, context, prepared, workStore) {
547
+ const { actionStore, handler, implicitTags, requestStore } = prepared;
548
+ // Run the handler with the request AsyncLocalStorage to inject the helper
549
+ // support. We set this to `unknown` because the type is not known until
550
+ // runtime when we do a instanceof check below.
551
+ const response = await this.actionAsyncStorage.run(actionStore, ()=>this.workUnitAsyncStorage.run(requestStore, ()=>this.workAsyncStorage.run(workStore, ()=>{
552
+ if (prepared.hasNonStaticMethods) {
553
+ const err = new DynamicServerError('Route is configured with methods that cannot be statically generated.');
554
+ workStore.dynamicUsageDescription = err.message;
555
+ workStore.dynamicUsageStack = err.stack;
556
+ throw err;
557
+ }
558
+ let request = req;
559
+ switch(prepared.dynamic){
560
+ case 'force-dynamic':
561
+ {
562
+ workStore.forceDynamic = true;
563
+ const err = new DynamicServerError('Route is configured with dynamic = error which cannot be statically generated.');
564
+ workStore.dynamicUsageDescription = err.message;
565
+ workStore.dynamicUsageStack = err.stack;
566
+ throw err;
567
+ }
568
+ case 'force-static':
569
+ workStore.forceStatic = true;
570
+ request = new Proxy(req, forceStaticRequestHandlers);
571
+ break;
572
+ case 'error':
573
+ workStore.dynamicShouldError = true;
574
+ request = new Proxy(req, ensureStaticRequestHandlers);
575
+ break;
576
+ case undefined:
577
+ case 'auto':
578
+ request = proxyNextRequest(req, workStore);
579
+ break;
580
+ default:
581
+ prepared.dynamic;
582
+ }
583
+ const tracer = getTracer();
584
+ const { pathname } = this.definition;
585
+ tracer.setRootSpanAttribute('next.route', pathname);
586
+ return tracer.trace(AppRouteRouteHandlersSpan.runHandler, {
587
+ spanName: `executing api route (app) ${pathname}`,
588
+ attributes: {
589
+ 'next.route': pathname
590
+ }
591
+ }, ()=>this.prerenderToResponse(handler, actionStore, workStore, requestStore, implicitTags, request, context));
592
+ })));
593
+ return this.validateExecutionResponse(response);
594
+ }
595
+ async handle(req, context) {
596
+ const prepared = await this.prepareExecution(req, context);
597
+ const workStore = createWorkStore({
598
+ page: this.definition.page,
599
+ renderOpts: context.renderOpts,
600
+ buildId: context.sharedContext.buildId,
601
+ deploymentId: context.sharedContext.deploymentId,
602
+ previouslyRevalidatedTags: []
603
+ });
604
+ return this.executeRequest(req, context, prepared, workStore);
605
+ }
606
+ async prerender(req, context) {
607
+ const prepared = await this.prepareExecution(req, context);
608
+ const workStore = createPrerenderWorkStore({
609
+ page: this.definition.page,
610
+ renderOpts: context.renderOpts,
611
+ buildId: context.sharedContext.buildId,
612
+ deploymentId: context.sharedContext.deploymentId,
613
+ previouslyRevalidatedTags: []
614
+ });
615
+ return this.executePrerender(req, context, prepared, workStore);
616
+ }
617
+ }
618
+ export default AppRouteRouteModule;
619
+ /**
620
+ * Gets all the method names for handlers that are not considered static.
621
+ *
622
+ * @param handlers the handlers from the userland module
623
+ * @returns the method names that are not considered static or false if all
624
+ * methods are static
625
+ */ export function hasNonStaticMethods(handlers) {
626
+ if (// Order these by how common they are to be used
627
+ handlers.POST || handlers.PUT || handlers.DELETE || handlers.PATCH || handlers.OPTIONS) {
628
+ return true;
629
+ }
630
+ return false;
631
+ }
632
+ // These symbols will be used to stash cached values on Proxied requests without requiring
633
+ // additional closures or storage such as WeakMaps.
634
+ const nextURLSymbol = Symbol('nextUrl');
635
+ const requestCloneSymbol = Symbol('clone');
636
+ const urlCloneSymbol = Symbol('clone');
637
+ const searchParamsSymbol = Symbol('searchParams');
638
+ const hrefSymbol = Symbol('href');
639
+ const toStringSymbol = Symbol('toString');
640
+ const headersSymbol = Symbol('headers');
641
+ const cookiesSymbol = Symbol('cookies');
642
+ /**
643
+ * The general technique with these proxy handlers is to prioritize keeping them static
644
+ * by stashing computed values on the Proxy itself. This is safe because the Proxy is
645
+ * inaccessible to the consumer since all operations are forwarded
646
+ */ const forceStaticRequestHandlers = {
647
+ get (target, prop, receiver) {
648
+ switch(prop){
649
+ case 'headers':
650
+ return target[headersSymbol] || (target[headersSymbol] = HeadersAdapter.seal(new Headers({})));
651
+ case 'cookies':
652
+ return target[cookiesSymbol] || (target[cookiesSymbol] = RequestCookiesAdapter.seal(new RequestCookies(new Headers({}))));
653
+ case 'nextUrl':
654
+ return target[nextURLSymbol] || (target[nextURLSymbol] = new Proxy(target.nextUrl, forceStaticNextUrlHandlers));
655
+ case 'url':
656
+ // we don't need to separately cache this we can just read the nextUrl
657
+ // and return the href since we know it will have been stripped of any
658
+ // dynamic parts. We access via the receiver to trigger the get trap
659
+ return receiver.nextUrl.href;
660
+ case 'geo':
661
+ case 'ip':
662
+ return undefined;
663
+ case 'clone':
664
+ return target[requestCloneSymbol] || (target[requestCloneSymbol] = ()=>new Proxy(// This is vaguely unsafe but it's required since NextRequest does not implement
665
+ // clone. The reason we might expect this to work in this context is the Proxy will
666
+ // respond with static-amenable values anyway somewhat restoring the interface.
667
+ // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly
668
+ // sophisticated to adequately represent themselves in all contexts. A better approach is
669
+ // to probably embed the static generation logic into the class itself removing the need
670
+ // for any kind of proxying
671
+ target.clone(), forceStaticRequestHandlers));
672
+ default:
673
+ return ReflectAdapter.get(target, prop, receiver);
674
+ }
675
+ }
676
+ };
677
+ const forceStaticNextUrlHandlers = {
678
+ get (target, prop, receiver) {
679
+ switch(prop){
680
+ // URL properties
681
+ case 'search':
682
+ return '';
683
+ case 'searchParams':
684
+ return target[searchParamsSymbol] || (target[searchParamsSymbol] = new URLSearchParams());
685
+ case 'href':
686
+ return target[hrefSymbol] || (target[hrefSymbol] = cleanURL(target.href).href);
687
+ case 'toJSON':
688
+ case 'toString':
689
+ return target[toStringSymbol] || (target[toStringSymbol] = ()=>receiver.href);
690
+ // NextUrl properties
691
+ case 'url':
692
+ // Currently nextURL does not expose url but our Docs indicate that it is an available property
693
+ // I am forcing this to undefined here to avoid accidentally exposing a dynamic value later if
694
+ // the underlying nextURL ends up adding this property
695
+ return undefined;
696
+ case 'clone':
697
+ return target[urlCloneSymbol] || (target[urlCloneSymbol] = ()=>new Proxy(target.clone(), forceStaticNextUrlHandlers));
698
+ default:
699
+ return ReflectAdapter.get(target, prop, receiver);
700
+ }
701
+ }
702
+ };
703
+ function proxyNextRequest(request, workStore) {
704
+ const nextUrlHandlers = {
705
+ get (target, prop, receiver) {
706
+ switch(prop){
707
+ case 'search':
708
+ case 'searchParams':
709
+ case 'url':
710
+ case 'href':
711
+ case 'toJSON':
712
+ case 'toString':
713
+ case 'origin':
714
+ {
715
+ const workUnitStore = workUnitAsyncStorage.getStore();
716
+ trackDynamic(workStore, workUnitStore, `nextUrl.${prop}`);
717
+ return ReflectAdapter.get(target, prop, receiver);
718
+ }
719
+ case 'clone':
720
+ return target[urlCloneSymbol] || (target[urlCloneSymbol] = ()=>new Proxy(target.clone(), nextUrlHandlers));
721
+ default:
722
+ return ReflectAdapter.get(target, prop, receiver);
723
+ }
724
+ }
725
+ };
726
+ const nextRequestHandlers = {
727
+ get (target, prop) {
728
+ switch(prop){
729
+ case 'nextUrl':
730
+ return target[nextURLSymbol] || (target[nextURLSymbol] = new Proxy(target.nextUrl, nextUrlHandlers));
731
+ case 'headers':
732
+ case 'cookies':
733
+ case 'url':
734
+ case 'body':
735
+ case 'blob':
736
+ case 'json':
737
+ case 'text':
738
+ case 'arrayBuffer':
739
+ case 'formData':
740
+ {
741
+ const workUnitStore = workUnitAsyncStorage.getStore();
742
+ trackDynamic(workStore, workUnitStore, `request.${prop}`);
743
+ // The receiver arg is intentionally the same as the target to fix an issue with
744
+ // edge runtime, where attempting to access internal slots with the wrong `this` context
745
+ // results in an error.
746
+ return ReflectAdapter.get(target, prop, target);
747
+ }
748
+ case 'clone':
749
+ return target[requestCloneSymbol] || (target[requestCloneSymbol] = ()=>new Proxy(// This is vaguely unsafe but it's required since NextRequest does not implement
750
+ // clone. The reason we might expect this to work in this context is the Proxy will
751
+ // respond with static-amenable values anyway somewhat restoring the interface.
752
+ // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly
753
+ // sophisticated to adequately represent themselves in all contexts. A better approach is
754
+ // to probably embed the static generation logic into the class itself removing the need
755
+ // for any kind of proxying
756
+ target.clone(), nextRequestHandlers));
757
+ default:
758
+ // The receiver arg is intentionally the same as the target to fix an issue with
759
+ // edge runtime, where attempting to access internal slots with the wrong `this` context
760
+ // results in an error.
761
+ return ReflectAdapter.get(target, prop, target);
762
+ }
763
+ }
764
+ };
765
+ return new Proxy(request, nextRequestHandlers);
766
+ }
767
+ const ensureStaticRequestHandlers = {
768
+ get (target, prop, receiver) {
769
+ switch(prop){
770
+ case 'nextUrl':
771
+ return target[nextURLSymbol] || (target[nextURLSymbol] = new Proxy(target.nextUrl, ensureStaticNextUrlHandlers));
772
+ case 'headers':
773
+ case 'cookies':
774
+ case 'url':
775
+ case 'body':
776
+ case 'blob':
777
+ case 'json':
778
+ case 'text':
779
+ case 'arrayBuffer':
780
+ case 'formData':
781
+ throw new StaticGenBailoutError(`Route ${target.nextUrl.pathname} with \`dynamic = "error"\` couldn't be rendered statically because it used \`request.${prop}\`.`);
782
+ case 'clone':
783
+ return target[requestCloneSymbol] || (target[requestCloneSymbol] = ()=>new Proxy(// This is vaguely unsafe but it's required since NextRequest does not implement
784
+ // clone. The reason we might expect this to work in this context is the Proxy will
785
+ // respond with static-amenable values anyway somewhat restoring the interface.
786
+ // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly
787
+ // sophisticated to adequately represent themselves in all contexts. A better approach is
788
+ // to probably embed the static generation logic into the class itself removing the need
789
+ // for any kind of proxying
790
+ target.clone(), ensureStaticRequestHandlers));
791
+ default:
792
+ return ReflectAdapter.get(target, prop, receiver);
793
+ }
794
+ }
795
+ };
796
+ const ensureStaticNextUrlHandlers = {
797
+ get (target, prop, receiver) {
798
+ switch(prop){
799
+ case 'search':
800
+ case 'searchParams':
801
+ case 'url':
802
+ case 'href':
803
+ case 'toJSON':
804
+ case 'toString':
805
+ case 'origin':
806
+ throw new StaticGenBailoutError(`Route ${target.pathname} with \`dynamic = "error"\` couldn't be rendered statically because it used \`nextUrl.${prop}\`.`);
807
+ case 'clone':
808
+ return target[urlCloneSymbol] || (target[urlCloneSymbol] = ()=>new Proxy(target.clone(), ensureStaticNextUrlHandlers));
809
+ default:
810
+ return ReflectAdapter.get(target, prop, receiver);
811
+ }
812
+ }
813
+ };
814
+ function createCacheComponentsError(route) {
815
+ return new DynamicServerError(`Route ${route} couldn't be rendered statically because it used IO that was not cached. See more info here: https://nextjs.org/docs/messages/cache-components`);
816
+ }
817
+ function trackDynamic(store, workUnitStore, expression) {
818
+ if (store.dynamicShouldError) {
819
+ throw new StaticGenBailoutError(`Route ${store.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
820
+ }
821
+ if (workUnitStore) {
822
+ switch(workUnitStore.type){
823
+ case 'cache':
824
+ case 'private-cache':
825
+ // TODO: Should we allow reading cookies and search params from the
826
+ // request for private caches in route handlers?
827
+ throw createRouteHandlerRequestInUseCacheError(store.route, expression);
828
+ case 'unstable-cache':
829
+ throw createRouteHandlerRequestInUnstableCacheError(store.route, expression);
830
+ case 'prerender':
831
+ const error = new Error(`Route ${store.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-request`);
832
+ return abortAndThrowOnSynchronousRequestDataAccess(store.route, expression, error, workUnitStore);
833
+ case 'prerender-client':
834
+ case 'validation-client':
835
+ throw new InvariantError('A client prerender store should not be used for a route handler.');
836
+ case 'prerender-runtime':
837
+ throw new InvariantError('A runtime prerender store should not be used for a route handler.');
838
+ case 'prerender-legacy':
839
+ workUnitStore.revalidate = 0;
840
+ const err = new DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
841
+ store.dynamicUsageDescription = expression;
842
+ store.dynamicUsageStack = err.stack;
843
+ throw err;
844
+ case 'request':
845
+ break;
846
+ case 'build-time-generator':
847
+ break;
848
+ default:
849
+ workUnitStore;
850
+ }
851
+ }
852
+ }
853
+
854
+ //# sourceMappingURL=module.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/module.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/app-route/module.ts"],"sourcesContent":["import type { NextConfig } from '../../config-shared'\nimport type { AppRouteRouteDefinition } from '../../route-definitions/app-route-route-definition'\nimport type { AppSegmentConfig } from '../../../build/segment-config/app/app-segment-config'\nimport type { NextRequest } from '../../web/spec-extension/request'\nimport type { NextURL } from '../../web/next-url'\nimport type { DeepReadonly } from '../../../shared/lib/deep-readonly'\nimport type { WorkUnitStore } from '../../app-render/work-unit-async-storage.external'\nimport type { __ApiPreviewProps } from '../../api-utils'\n\nimport {\n RouteModule,\n type RouteModuleHandleContext,\n type RouteModuleOptions,\n} from '../route-module'\nimport { createRequestStoreForAPI } from '../../async-storage/request-store'\nimport {\n createPrerenderWorkStore,\n createWorkStore,\n type WorkStoreContext,\n} from '../../async-storage/work-store'\nimport { type HTTP_METHOD, HTTP_METHODS, isHTTPMethod } from '../../web/http'\nimport { getImplicitTags, type ImplicitTags } from '../../lib/implicit-tags'\nimport { patchFetch } from '../../lib/patch-fetch'\nimport { getTracer } from '../../lib/trace/tracer'\nimport {\n AppRouteRouteHandlersSpan,\n AppRouteRouteModuleSpan,\n} from '../../lib/trace/constants'\nimport * as Log from '../../../build/output/log'\nimport { autoImplementMethods } from './helpers/auto-implement-methods'\nimport {\n appendMutableCookies,\n type ReadonlyRequestCookies,\n} from '../../web/spec-extension/adapters/request-cookies'\nimport { HeadersAdapter } from '../../web/spec-extension/adapters/headers'\nimport { RequestCookiesAdapter } from '../../web/spec-extension/adapters/request-cookies'\nimport { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params'\nimport {\n Phase,\n printDebugThrownValueForProspectiveRender,\n} from '../../app-render/prospective-render-utils'\n\nimport * as serverHooks from '../../../client/components/hooks-server-context'\nimport { DynamicServerError } from '../../../client/components/hooks-server-context'\n\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../../app-render/work-async-storage.external'\nimport {\n workUnitAsyncStorage,\n type RequestStore,\n type PrerenderStore,\n} from '../../app-render/work-unit-async-storage.external'\nimport {\n actionAsyncStorage,\n type ActionStore,\n} from '../../app-render/action-async-storage.external'\nimport * as sharedModules from './shared-modules'\nimport { getIsPossibleServerAction } from '../../lib/server-action-request-meta'\nimport { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies'\nimport { cleanURL } from './helpers/clean-url'\nimport { StaticGenBailoutError } from '../../../client/components/static-generation-bailout'\nimport { isStaticGenEnabled } from './helpers/is-static-gen-enabled'\nimport {\n abortAndThrowOnSynchronousRequestDataAccess,\n createDynamicTrackingState,\n getFirstDynamicReason,\n} from '../../app-render/dynamic-rendering'\nimport { ReflectAdapter } from '../../web/spec-extension/adapters/reflect'\nimport { CacheSignal } from '../../app-render/cache-signal'\nimport { scheduleImmediate } from '../../../lib/scheduler'\nimport { createServerParamsForRoute } from '../../request/params'\nimport type { AppSegment } from '../../../build/segment-config/app/app-segments'\nimport {\n getRedirectStatusCodeFromError,\n getURLFromRedirectError,\n} from '../../../client/components/redirect'\nimport {\n isRedirectError,\n type RedirectError,\n} from '../../../client/components/redirect-error'\nimport {\n getAccessFallbackHTTPStatus,\n isHTTPAccessFallbackError,\n} from '../../../client/components/http-access-fallback/http-access-fallback'\nimport { RedirectStatusCode } from '../../../client/components/redirect-status-code'\nimport { INFINITE_CACHE } from '../../../lib/constants'\nimport { executeRevalidates } from '../../revalidation-utils'\nimport { trackPendingModules } from '../../app-render/module-loading/track-module-loading.external'\nimport { InvariantError } from '../../../shared/lib/invariant-error'\nimport { LazyModule } from '../../lib/lazy-module'\nimport { createPrerenderResumeDataCache } from '../../resume-data-cache/resume-data-cache'\nimport {\n createRouteHandlerRequestInUseCacheError,\n createRouteHandlerRequestInUnstableCacheError,\n} from '../../use-cache/use-cache-messages'\n\nexport class WrappedNextRouterError {\n constructor(\n public readonly error: RedirectError,\n public readonly headers?: Headers\n ) {}\n}\n\n/**\n * The AppRouteModule is the type of the module exported by the bundled App\n * Route module.\n */\nexport type AppRouteModule = typeof import('../../../build/templates/app-route')\n\nexport type AppRouteSharedContext = {\n buildId: string\n deploymentId: string\n}\n\n/**\n * AppRouteRouteHandlerContext is the context that is passed to the route\n * handler for app routes.\n */\nexport interface AppRouteRouteHandlerContext extends RouteModuleHandleContext {\n renderOpts: WorkStoreContext['renderOpts'] & CollectedCacheInfo\n previewProps: DeepReadonly<__ApiPreviewProps>\n sharedContext: AppRouteSharedContext\n}\n\ntype CollectedCacheInfo = {\n collectedTags?: string\n collectedRevalidate?: number\n collectedExpire?: number\n collectedStale?: number\n}\n\n/**\n * AppRouteHandlerFnContext is the context that is passed to the handler as the\n * second argument.\n */\ntype AppRouteHandlerFnContext = {\n params?: Promise<Record<string, string | string[] | undefined>>\n}\n\ntype PreparedAppRouteExecution = {\n handler: AppRouteHandlerFn\n dynamic: AppSegmentConfig['dynamic']\n hasNonStaticMethods: boolean\n actionStore: ActionStore\n implicitTags: ImplicitTags\n requestStore: RequestStore\n}\n\n/**\n * Handler function for app routes. If a non-Response value is returned, an error\n * will be thrown.\n */\nexport type AppRouteHandlerFn = (\n /**\n * Incoming request object.\n */\n req: NextRequest,\n /**\n * Context properties on the request (including the parameters if this was a\n * dynamic route).\n */\n ctx: AppRouteHandlerFnContext\n) => unknown\n\n/**\n * AppRouteHandlers describes the handlers for app routes that is provided by\n * the userland module.\n */\nexport type AppRouteHandlers = {\n [method in HTTP_METHOD]?: AppRouteHandlerFn\n}\n\n/**\n * AppRouteUserlandModule is the userland module that is provided for app\n * routes. This contains all the user generated code.\n */\nexport type AppRouteUserlandModule = AppRouteHandlers &\n Pick<\n AppSegmentConfig,\n 'dynamic' | 'revalidate' | 'dynamicParams' | 'fetchCache'\n > &\n Pick<AppSegment, 'generateStaticParams'>\n\n/**\n * AppRouteRouteModuleOptions is the options that are passed to the app route\n * module from the bundled code.\n */\nexport interface AppRouteRouteModuleOptions\n extends Omit<\n RouteModuleOptions<AppRouteRouteDefinition, AppRouteUserlandModule>,\n 'userland'\n > {\n readonly userland: () =>\n | AppRouteUserlandModule\n | Promise<AppRouteUserlandModule>\n readonly resolvedPagePath: string\n readonly nextConfigOutput: NextConfig['output']\n /**\n * Optional synchronous getter that returns the live userland module. When\n * provided (Turbopack dev mode), it is called on every request so that\n * server HMR updates are picked up without re-executing the entry chunk.\n * Using require() instead of import() keeps this synchronous so the time\n * spent here is not incorrectly attributed to application-code in timing.\n */\n readonly getUserland?: () => AppRouteUserlandModule\n}\n\n/**\n * AppRouteRouteHandler is the handler for app routes.\n */\nexport class AppRouteRouteModule extends RouteModule<\n AppRouteRouteDefinition,\n AppRouteUserlandModule\n> {\n /**\n * A reference to the request async storage.\n */\n public readonly workUnitAsyncStorage = workUnitAsyncStorage\n\n /**\n * A reference to the static generation async storage.\n */\n public readonly workAsyncStorage = workAsyncStorage\n\n /**\n * An interface to call server hooks which interact with the underlying\n * storage.\n */\n public readonly serverHooks = serverHooks\n\n public static readonly sharedModules = sharedModules\n\n /**\n * A reference to the mutation related async storage, such as mutations of\n * cookies.\n */\n public readonly actionAsyncStorage = actionAsyncStorage\n\n public readonly resolvedPagePath: string\n public readonly nextConfigOutput: NextConfig['output'] | undefined\n\n // Loaded lazily since the route file may be an async module (top-level\n // await).\n private readonly _lazyUserland: LazyModule<AppRouteUserlandModule>\n // Synchronous per-request userland getter for Turbopack dev mode.\n // Called on every request to pick up server HMR updates.\n private readonly _getUserland?: () => AppRouteUserlandModule\n private _methods!: Record<HTTP_METHOD, AppRouteHandlerFn>\n private _hasNonStaticMethods!: boolean\n private _dynamic!: AppRouteUserlandModule['dynamic']\n\n override get userland(): AppRouteUserlandModule {\n return this._lazyUserland.assertLoaded()\n }\n\n /**\n * Ensures the userland module is fully loaded before it's accessed via\n * `userland`. Required for route files that use top-level await, where\n * require() returns a promise instead of the module directly. Must be called\n * before accessing `userland` in contexts where the module may not yet be\n * resolved (e.g. the export/static-generation worker).\n */\n async ensureUserland(): Promise<void> {\n await this._lazyUserland.waitUntilLoaded()\n }\n\n constructor({\n userland,\n getUserland,\n definition,\n distDir,\n relativeProjectDir,\n resolvedPagePath,\n nextConfigOutput,\n }: AppRouteRouteModuleOptions) {\n super({\n userland: undefined! as AppRouteUserlandModule,\n definition,\n distDir,\n relativeProjectDir,\n })\n\n this.resolvedPagePath = resolvedPagePath\n this.nextConfigOutput = nextConfigOutput\n this._getUserland = getUserland\n this._lazyUserland = new LazyModule(\n () =>\n getTracer().trace(\n AppRouteRouteModuleSpan.loadUserland,\n {\n spanName: 'load app route module',\n attributes: {\n 'next.route': this.definition.pathname,\n },\n },\n userland\n ),\n (module) => this._onUserlandLoaded(module)\n )\n\n // output:export routes load eagerly, so that errors surface at module\n // load time (as a Redbox in dev) rather than at request time.\n if (nextConfigOutput === 'export') {\n this._lazyUserland.loadIfNeeded()\n }\n }\n\n private _onUserlandLoaded(userland: AppRouteUserlandModule): void {\n // Automatically implement some methods if they aren't implemented by the\n // userland module.\n this._methods = autoImplementMethods(userland)\n\n // Get the non-static methods for this route.\n this._hasNonStaticMethods = hasNonStaticMethods(userland)\n\n // Get the dynamic property from the userland module.\n this._dynamic = userland.dynamic\n if (this.nextConfigOutput === 'export') {\n if (this._dynamic === 'force-dynamic') {\n throw new Error(\n `export const dynamic = \"force-dynamic\" on page \"${this.definition.pathname}\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`\n )\n } else if (!isStaticGenEnabled(userland) && userland['GET']) {\n throw new Error(\n `export const dynamic = \"force-static\"/export const revalidate not configured on route \"${this.definition.pathname}\" with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`\n )\n } else {\n this._dynamic = 'error'\n }\n }\n\n // We only warn in development after here, so return if we're not in\n // development.\n if (process.env.NODE_ENV === 'development') {\n // Print error in development if the exported handlers are in lowercase, only\n // uppercase handlers are supported.\n const lowercased = HTTP_METHODS.map((method) => method.toLowerCase())\n for (const method of lowercased) {\n if (method in userland) {\n Log.error(\n `Detected lowercase method '${method}' in '${\n this.resolvedPagePath\n }'. Export the uppercase '${method.toUpperCase()}' method name to fix this error.`\n )\n }\n }\n\n // Print error if the module exports a default handler, they must use named\n // exports for each HTTP method.\n if ('default' in userland) {\n Log.error(\n `Detected default export in '${this.resolvedPagePath}'. Export a named export for each HTTP method instead.`\n )\n }\n\n // If there is no methods exported by this module, then return a not found\n // response.\n if (!HTTP_METHODS.some((method) => method in userland)) {\n Log.error(\n `No HTTP methods exported in '${this.resolvedPagePath}'. Export a named export for each HTTP method.`\n )\n }\n }\n }\n\n /**\n * Returns the handler function for the given HTTP method.\n * Must be called after ensureUserland() has resolved so that _methods is\n * populated.\n */\n private resolveHandler(method: string): AppRouteHandlerFn {\n // Prevent RCE: only allow recognized HTTP methods.\n if (!isHTTPMethod(method)) return () => new Response(null, { status: 400 })\n\n return this._methods[method]\n }\n\n /**\n * Returns the handler for the given method using a live userland snapshot.\n * Used in Turbopack dev mode to pick up server HMR updates. The userland\n * is fetched synchronously via require() so no async overhead is added.\n */\n private resolveHandlerFromUserland(\n method: string,\n userland: AppRouteUserlandModule\n ): AppRouteHandlerFn {\n if (!isHTTPMethod(method)) return () => new Response(null, { status: 400 })\n return autoImplementMethods(userland)[method]\n }\n\n private resolvePendingRevalidations(\n workStore: WorkStore,\n requestStore: RequestStore,\n context: AppRouteRouteHandlerContext\n ): void {\n const maybeRevalidatesPromise = executeRevalidates(workStore)\n\n if (maybeRevalidatesPromise !== false) {\n context.renderOpts.pendingWaitUntil = maybeRevalidatesPromise.finally(\n () => {\n if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {\n console.log(\n 'pending revalidates promise finished for:',\n requestStore.url.pathname + requestStore.url.search\n )\n }\n }\n )\n }\n }\n\n private handleHandlerError(\n err: unknown,\n actionStore: ActionStore,\n workStore: WorkStore,\n requestStore: RequestStore,\n context: AppRouteRouteHandlerContext\n ): Response {\n if (isRedirectError(err)) {\n const url = getURLFromRedirectError(err)\n if (!url) {\n throw new Error('Invariant: Unexpected redirect url format')\n }\n\n // We need to capture any headers that should be sent on the response.\n const headers = new Headers({ Location: url })\n\n // Let's append any cookies that were added by the cookie API.\n // TODO leaving the gate here b/c it indicates that we might not actually\n // want to do this on every handler invocation. During prerender there\n // should be no mutableCookies because then they'd be dynamic.\n appendMutableCookies(headers, requestStore.mutableCookies)\n\n this.resolvePendingRevalidations(workStore, requestStore, context)\n\n return new Response(null, {\n // If we're in an action, we want to use a 303 redirect as we don't\n // want the POST request to follow the redirect, as it could result in\n // erroneous re-submissions.\n status: actionStore.isAction\n ? RedirectStatusCode.SeeOther\n : getRedirectStatusCodeFromError(err),\n headers,\n })\n }\n\n if (isHTTPAccessFallbackError(err)) {\n const httpStatus = getAccessFallbackHTTPStatus(err)\n return new Response(null, { status: httpStatus })\n }\n\n throw err\n }\n\n private finalizeResponse(\n res: unknown,\n request: NextRequest,\n workStore: WorkStore,\n requestStore: RequestStore,\n prerenderStore: PrerenderStore | null,\n context: AppRouteRouteHandlerContext\n ): Response {\n if (!(res instanceof Response)) {\n const invalidType =\n res === null\n ? 'null'\n : res === undefined\n ? 'undefined'\n : typeof res === 'object'\n ? res.constructor?.name || 'object'\n : typeof res\n\n throw new Error(\n `No response is returned from route handler '${this.resolvedPagePath}'. ` +\n `Expected a Response object but received '${invalidType}' (method: ${request.method}, url: ${requestStore.url.pathname}). ` +\n `Ensure you return a \\`Response\\` or a \\`NextResponse\\` in all branches of your handler.`\n )\n }\n\n context.renderOpts.fetchMetrics = workStore.fetchMetrics\n this.resolvePendingRevalidations(workStore, requestStore, context)\n\n if (prerenderStore) {\n context.renderOpts.collectedTags = prerenderStore.tags?.join(',')\n context.renderOpts.collectedRevalidate = prerenderStore.revalidate\n context.renderOpts.collectedExpire = prerenderStore.expire\n context.renderOpts.collectedStale = prerenderStore.stale\n }\n\n // It's possible cookies were set in the handler, so we need to merge the\n // modified cookies and the returned response here.\n const headers = new Headers(res.headers)\n if (appendMutableCookies(headers, requestStore.mutableCookies)) {\n return new Response(res.body, {\n status: res.status,\n statusText: res.statusText,\n headers,\n })\n }\n\n return res\n }\n\n private async prerenderToResponse(\n handler: AppRouteHandlerFn,\n actionStore: ActionStore,\n workStore: WorkStore,\n requestStore: RequestStore,\n implicitTags: ImplicitTags,\n request: NextRequest,\n context: AppRouteRouteHandlerContext\n ) {\n const cacheComponentsEnabled = !!context.renderOpts.cacheComponents\n\n // Patch the global fetch.\n patchFetch({\n workAsyncStorage: this.workAsyncStorage,\n workUnitAsyncStorage: this.workUnitAsyncStorage,\n })\n\n const handlerContext: AppRouteHandlerFnContext = {\n params: context.params\n ? createServerParamsForRoute(parsedUrlQueryToParams(context.params))\n : undefined,\n }\n\n let prerenderStore: PrerenderStore\n\n let res: unknown\n try {\n const userlandRevalidate = this.userland.revalidate\n const defaultRevalidate: number =\n // If the static generation store does not have a revalidate value\n // set, then we should set it the revalidate value from the userland\n // module or default to false.\n userlandRevalidate === false || userlandRevalidate === undefined\n ? INFINITE_CACHE\n : userlandRevalidate\n\n if (cacheComponentsEnabled) {\n /**\n * When we are attempting to statically prerender the GET handler of a route.ts module\n * and cacheComponents is on we follow a similar pattern to rendering.\n *\n * We first run the handler letting caches fill. If something synchronously dynamic occurs\n * during this prospective render then we can infer it will happen on every render and we\n * just bail out of prerendering.\n *\n * Next we run the handler again and we check if we get a result back in a microtask.\n * Next.js expects the return value to be a Response or a Thenable that resolves to a Response.\n * Unfortunately Response's do not allow for accessing the response body synchronously or in\n * a microtask so we need to allow one more task to unwrap the response body. This is a slightly\n * different semantic than what we have when we render and it means that certain tasks can still\n * execute before a prerender completes such as a carefully timed setImmediate.\n *\n * Functionally though IO should still take longer than the time it takes to unwrap the response body\n * so our heuristic of excluding any IO should be preserved.\n */\n const prospectiveController = new AbortController()\n let prospectiveRenderIsDynamic = false\n const cacheSignal = new CacheSignal(null)\n let dynamicTracking = createDynamicTrackingState(undefined)\n\n // TODO: Route handlers are never resumed, so it's counter-intuitive\n // to use an RDC here. However, we need the data cache to store cached\n // results in memory during the prospective prerender, so that they\n // can be retrieved during the final prerender within microtasks. This\n // is crucial when doing revalidations of a deployed route handler,\n // where the default cache handler does not do any in-memory caching.\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n\n const prospectiveRoutePrerenderStore: PrerenderStore = (prerenderStore =\n {\n type: 'prerender',\n phase: 'action',\n // This replicates prior behavior where rootParams is empty in routes\n // TODO we need to make this have the proper rootParams for this route\n rootParams: {},\n fallbackRouteParams: null,\n implicitTags,\n renderSignal: prospectiveController.signal,\n controller: prospectiveController,\n stagedRendering: null,\n cacheSignal,\n // During prospective render we don't use a controller\n // because we need to let all caches fill.\n dynamicTracking,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n resumeDataCache: prerenderResumeDataCache,\n hmrRefreshHash: undefined,\n varyParamsAccumulator: null,\n ensureStaticLevel: null,\n prerenderDataTracking: null,\n isFallbackUpgradeable: false,\n })\n\n let prospectiveResult\n try {\n prospectiveResult = this.workUnitAsyncStorage.run(\n prospectiveRoutePrerenderStore,\n handler,\n request,\n handlerContext\n )\n } catch (err) {\n if (prospectiveController.signal.aborted) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n prospectiveRenderIsDynamic = true\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n printDebugThrownValueForProspectiveRender(\n err,\n workStore.route,\n Phase.ProspectiveRender\n )\n }\n }\n if (\n typeof prospectiveResult === 'object' &&\n prospectiveResult !== null &&\n typeof (prospectiveResult as any).then === 'function'\n ) {\n // The handler returned a Thenable. We'll listen for rejections to determine\n // if the route is erroring for dynamic reasons.\n ;(prospectiveResult as any as Promise<unknown>).then(\n () => {},\n (err) => {\n if (prospectiveController.signal.aborted) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n prospectiveRenderIsDynamic = true\n } else if (process.env.NEXT_DEBUG_BUILD) {\n printDebugThrownValueForProspectiveRender(\n err,\n workStore.route,\n Phase.ProspectiveRender\n )\n }\n }\n )\n }\n\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n\n if (prospectiveRenderIsDynamic) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n const dynamicReason = getFirstDynamicReason(dynamicTracking)\n if (dynamicReason) {\n throw new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used \\`${dynamicReason}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n } else {\n console.error(\n 'Expected Next.js to keep track of reason for opting out of static rendering but one was not found. This is a bug in Next.js'\n )\n throw new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used a dynamic API. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n }\n }\n\n // TODO start passing this controller to the route handler. We should expose\n // it so the handler to abort inflight requests and other operations if we abort\n // the prerender.\n const finalController = new AbortController()\n dynamicTracking = createDynamicTrackingState(undefined)\n\n const finalRoutePrerenderStore: PrerenderStore = (prerenderStore = {\n type: 'prerender',\n phase: 'action',\n rootParams: {},\n fallbackRouteParams: null,\n implicitTags,\n renderSignal: finalController.signal,\n controller: finalController,\n stagedRendering: null,\n cacheSignal: null,\n dynamicTracking,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n resumeDataCache: prerenderResumeDataCache,\n hmrRefreshHash: undefined,\n varyParamsAccumulator: null,\n ensureStaticLevel: null,\n prerenderDataTracking: null,\n isFallbackUpgradeable: false,\n })\n\n let responseHandled = false\n res = await new Promise((resolve, reject) => {\n scheduleImmediate(async () => {\n try {\n const result = await (this.workUnitAsyncStorage.run(\n finalRoutePrerenderStore,\n handler,\n request,\n handlerContext\n ) as Promise<Response>)\n if (responseHandled) {\n // we already rejected in the followup task\n return\n } else if (!(result instanceof Response)) {\n // This is going to error but we let that happen below\n resolve(result)\n return\n }\n\n responseHandled = true\n\n let bodyHandled = false\n result.arrayBuffer().then((body) => {\n if (!bodyHandled) {\n bodyHandled = true\n\n resolve(\n new Response(body, {\n headers: result.headers,\n status: result.status,\n statusText: result.statusText,\n })\n )\n }\n }, reject)\n scheduleImmediate(() => {\n if (!bodyHandled) {\n bodyHandled = true\n finalController.abort()\n reject(createCacheComponentsError(workStore.route))\n }\n })\n } catch (err) {\n reject(err)\n }\n })\n scheduleImmediate(() => {\n if (!responseHandled) {\n responseHandled = true\n finalController.abort()\n reject(createCacheComponentsError(workStore.route))\n }\n })\n })\n if (finalController.signal.aborted) {\n // We aborted from within the execution\n throw createCacheComponentsError(workStore.route)\n } else {\n // We didn't abort during the execution. We can abort now as a matter of semantics\n // though at the moment nothing actually consumes this signal so it won't halt any\n // inflight work.\n finalController.abort()\n }\n } else {\n prerenderStore = {\n type: 'prerender-legacy',\n phase: 'action',\n rootParams: {},\n implicitTags,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n }\n\n res = await workUnitAsyncStorage.run(\n prerenderStore,\n handler,\n request,\n handlerContext\n )\n }\n } catch (err) {\n return this.handleHandlerError(\n err,\n actionStore,\n workStore,\n requestStore,\n context\n )\n }\n\n return this.finalizeResponse(\n res,\n request,\n workStore,\n requestStore,\n prerenderStore,\n context\n )\n }\n\n private async renderToResponse(\n handler: AppRouteHandlerFn,\n actionStore: ActionStore,\n workStore: WorkStore,\n requestStore: RequestStore,\n request: NextRequest,\n context: AppRouteRouteHandlerContext\n ): Promise<Response> {\n // Patch the global fetch.\n patchFetch({\n workAsyncStorage: this.workAsyncStorage,\n workUnitAsyncStorage: this.workUnitAsyncStorage,\n })\n\n const handlerContext: AppRouteHandlerFnContext = {\n params: context.params\n ? createServerParamsForRoute(parsedUrlQueryToParams(context.params))\n : undefined,\n }\n\n let res: unknown\n try {\n res = await workUnitAsyncStorage.run(\n requestStore,\n handler,\n request,\n handlerContext\n )\n } catch (err) {\n return this.handleHandlerError(\n err,\n actionStore,\n workStore,\n requestStore,\n context\n )\n }\n\n return this.finalizeResponse(\n res,\n request,\n workStore,\n requestStore,\n null,\n context\n )\n }\n\n private async prepareExecution(\n req: NextRequest,\n context: AppRouteRouteHandlerContext\n ): Promise<PreparedAppRouteExecution> {\n // Ensure userland is fully loaded (handles async modules with top-level\n // await, where require() returns a Promise instead of the module).\n await this.ensureUserland()\n\n // In Turbopack dev mode, fetch the live userland module on every request\n // via the synchronous require() getter so server HMR updates are reflected\n // immediately. This is cheap — it is just a devModuleCache lookup.\n // For routes with top-level await, require() may still return a Promise\n // (async module); in that case fall back to the already-resolved\n // userland module resolved by ensureUserland() above.\n const rawLiveUserland = this._getUserland?.()\n const liveUserland =\n rawLiveUserland instanceof Promise\n ? undefined\n : (rawLiveUserland as AppRouteUserlandModule | undefined)\n\n const handler = liveUserland\n ? this.resolveHandlerFromUserland(req.method, liveUserland)\n : this.resolveHandler(req.method)\n\n // Use the live userland (if available) for per-request values so HMR\n // changes to fetchCache, dynamic, etc. are also picked up.\n const userland = liveUserland ?? this.userland\n\n // Add the fetchCache option to the renderOpts.\n context.renderOpts.fetchCache = userland.fetchCache\n\n const actionStore: ActionStore = {\n isAppRoute: true,\n isAction: getIsPossibleServerAction(req),\n }\n\n const implicitTags = await getImplicitTags(\n this.definition.page,\n req.nextUrl.pathname,\n // App Routes don't support unknown route params.\n null\n )\n\n const requestStore = createRequestStoreForAPI(\n req,\n req.nextUrl,\n implicitTags,\n undefined,\n context.previewProps,\n context.renderOpts.hmrRefreshHash\n )\n\n return {\n handler,\n dynamic: liveUserland?.dynamic ?? this._dynamic,\n hasNonStaticMethods: liveUserland\n ? hasNonStaticMethods(liveUserland)\n : this._hasNonStaticMethods,\n actionStore,\n implicitTags,\n requestStore,\n }\n }\n\n private validateExecutionResponse(response: unknown): Response {\n // If the handler didn't return a valid response, then return the internal\n // error response.\n if (!(response instanceof Response)) {\n // TODO: validate the correct handling behavior, maybe log something?\n return new Response(null, { status: 500 })\n }\n\n if (response.headers.has('x-middleware-rewrite')) {\n throw new Error(\n 'NextResponse.rewrite() was used in a app route handler, this is not currently supported. Please remove the invocation to continue.'\n )\n }\n\n if (response.headers.get('x-middleware-next') === '1') {\n // TODO: move this error into the `NextResponse.next()` function.\n throw new Error(\n 'NextResponse.next() was used in a app route handler, this is not supported. See here for more info: https://nextjs.org/docs/messages/next-response-next-in-app-route-handler'\n )\n }\n\n return response\n }\n\n private async executeRequest(\n req: NextRequest,\n context: AppRouteRouteHandlerContext,\n prepared: PreparedAppRouteExecution,\n workStore: WorkStore\n ): Promise<Response> {\n const { actionStore, handler, requestStore } = prepared\n\n const response: unknown = await this.actionAsyncStorage.run(\n actionStore,\n () =>\n this.workUnitAsyncStorage.run(requestStore, () =>\n this.workAsyncStorage.run(workStore, () => {\n let request = req\n\n switch (prepared.dynamic) {\n case 'force-dynamic':\n workStore.forceDynamic = true\n break\n case 'force-static':\n workStore.forceStatic = true\n request = new Proxy(req, forceStaticRequestHandlers)\n break\n case 'error':\n workStore.dynamicShouldError = true\n break\n case undefined:\n case 'auto':\n request = proxyNextRequest(req, workStore)\n break\n default:\n prepared.dynamic satisfies never\n }\n\n const tracer = getTracer()\n const { pathname } = this.definition\n tracer.setRootSpanAttribute('next.route', pathname)\n\n return tracer.trace(\n AppRouteRouteHandlersSpan.runHandler,\n {\n spanName: `executing api route (app) ${pathname}`,\n attributes: {\n 'next.route': pathname,\n },\n },\n () =>\n this.renderToResponse(\n handler,\n actionStore,\n workStore,\n requestStore,\n request,\n context\n )\n )\n })\n )\n )\n\n return this.validateExecutionResponse(response)\n }\n\n private async executePrerender(\n req: NextRequest,\n context: AppRouteRouteHandlerContext,\n prepared: PreparedAppRouteExecution,\n workStore: WorkStore\n ): Promise<Response> {\n const { actionStore, handler, implicitTags, requestStore } = prepared\n\n // Run the handler with the request AsyncLocalStorage to inject the helper\n // support. We set this to `unknown` because the type is not known until\n // runtime when we do a instanceof check below.\n const response: unknown = await this.actionAsyncStorage.run(\n actionStore,\n () =>\n this.workUnitAsyncStorage.run(requestStore, () =>\n this.workAsyncStorage.run(workStore, () => {\n if (prepared.hasNonStaticMethods) {\n const err = new DynamicServerError(\n 'Route is configured with methods that cannot be statically generated.'\n )\n workStore.dynamicUsageDescription = err.message\n workStore.dynamicUsageStack = err.stack\n throw err\n }\n\n let request = req\n\n switch (prepared.dynamic) {\n case 'force-dynamic': {\n workStore.forceDynamic = true\n const err = new DynamicServerError(\n 'Route is configured with dynamic = error which cannot be statically generated.'\n )\n workStore.dynamicUsageDescription = err.message\n workStore.dynamicUsageStack = err.stack\n throw err\n }\n case 'force-static':\n workStore.forceStatic = true\n request = new Proxy(req, forceStaticRequestHandlers)\n break\n case 'error':\n workStore.dynamicShouldError = true\n request = new Proxy(req, ensureStaticRequestHandlers)\n break\n case undefined:\n case 'auto':\n request = proxyNextRequest(req, workStore)\n break\n default:\n prepared.dynamic satisfies never\n }\n\n const tracer = getTracer()\n const { pathname } = this.definition\n tracer.setRootSpanAttribute('next.route', pathname)\n\n return tracer.trace(\n AppRouteRouteHandlersSpan.runHandler,\n {\n spanName: `executing api route (app) ${pathname}`,\n attributes: {\n 'next.route': pathname,\n },\n },\n () =>\n this.prerenderToResponse(\n handler,\n actionStore,\n workStore,\n requestStore,\n implicitTags,\n request,\n context\n )\n )\n })\n )\n )\n\n return this.validateExecutionResponse(response)\n }\n\n public async handle(\n req: NextRequest,\n context: AppRouteRouteHandlerContext\n ): Promise<Response> {\n const prepared = await this.prepareExecution(req, context)\n const workStore = createWorkStore({\n page: this.definition.page,\n renderOpts: context.renderOpts,\n buildId: context.sharedContext.buildId,\n deploymentId: context.sharedContext.deploymentId,\n previouslyRevalidatedTags: [],\n })\n\n return this.executeRequest(req, context, prepared, workStore)\n }\n\n public async prerender(\n req: NextRequest,\n context: AppRouteRouteHandlerContext\n ): Promise<Response> {\n const prepared = await this.prepareExecution(req, context)\n const workStore = createPrerenderWorkStore({\n page: this.definition.page,\n renderOpts: context.renderOpts,\n buildId: context.sharedContext.buildId,\n deploymentId: context.sharedContext.deploymentId,\n previouslyRevalidatedTags: [],\n })\n\n return this.executePrerender(req, context, prepared, workStore)\n }\n}\n\nexport default AppRouteRouteModule\n\n/**\n * Gets all the method names for handlers that are not considered static.\n *\n * @param handlers the handlers from the userland module\n * @returns the method names that are not considered static or false if all\n * methods are static\n */\nexport function hasNonStaticMethods(handlers: AppRouteHandlers): boolean {\n if (\n // Order these by how common they are to be used\n handlers.POST ||\n handlers.PUT ||\n handlers.DELETE ||\n handlers.PATCH ||\n handlers.OPTIONS\n ) {\n return true\n }\n return false\n}\n\n// These symbols will be used to stash cached values on Proxied requests without requiring\n// additional closures or storage such as WeakMaps.\nconst nextURLSymbol = Symbol('nextUrl')\nconst requestCloneSymbol = Symbol('clone')\nconst urlCloneSymbol = Symbol('clone')\nconst searchParamsSymbol = Symbol('searchParams')\nconst hrefSymbol = Symbol('href')\nconst toStringSymbol = Symbol('toString')\nconst headersSymbol = Symbol('headers')\nconst cookiesSymbol = Symbol('cookies')\n\ntype RequestSymbolTarget = {\n [headersSymbol]?: Headers\n [cookiesSymbol]?: RequestCookies | ReadonlyRequestCookies\n [nextURLSymbol]?: NextURL\n [requestCloneSymbol]?: () => NextRequest\n}\n\ntype UrlSymbolTarget = {\n [searchParamsSymbol]?: URLSearchParams\n [hrefSymbol]?: string\n [toStringSymbol]?: () => string\n [urlCloneSymbol]?: () => NextURL\n}\n\n/**\n * The general technique with these proxy handlers is to prioritize keeping them static\n * by stashing computed values on the Proxy itself. This is safe because the Proxy is\n * inaccessible to the consumer since all operations are forwarded\n */\nconst forceStaticRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'headers':\n return (\n target[headersSymbol] ||\n (target[headersSymbol] = HeadersAdapter.seal(new Headers({})))\n )\n case 'cookies':\n return (\n target[cookiesSymbol] ||\n (target[cookiesSymbol] = RequestCookiesAdapter.seal(\n new RequestCookies(new Headers({}))\n ))\n )\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(\n target.nextUrl,\n forceStaticNextUrlHandlers\n ))\n )\n case 'url':\n // we don't need to separately cache this we can just read the nextUrl\n // and return the href since we know it will have been stripped of any\n // dynamic parts. We access via the receiver to trigger the get trap\n return receiver.nextUrl.href\n case 'geo':\n case 'ip':\n return undefined\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n forceStaticRequestHandlers\n ))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n}\n\nconst forceStaticNextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n // URL properties\n case 'search':\n return ''\n case 'searchParams':\n return (\n target[searchParamsSymbol] ||\n (target[searchParamsSymbol] = new URLSearchParams())\n )\n case 'href':\n return (\n target[hrefSymbol] ||\n (target[hrefSymbol] = cleanURL(target.href).href)\n )\n case 'toJSON':\n case 'toString':\n return (\n target[toStringSymbol] ||\n (target[toStringSymbol] = () => receiver.href)\n )\n\n // NextUrl properties\n case 'url':\n // Currently nextURL does not expose url but our Docs indicate that it is an available property\n // I am forcing this to undefined here to avoid accidentally exposing a dynamic value later if\n // the underlying nextURL ends up adding this property\n return undefined\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), forceStaticNextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n}\n\nfunction proxyNextRequest(request: NextRequest, workStore: WorkStore) {\n const nextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'search':\n case 'searchParams':\n case 'url':\n case 'href':\n case 'toJSON':\n case 'toString':\n case 'origin': {\n const workUnitStore = workUnitAsyncStorage.getStore()\n trackDynamic(workStore, workUnitStore, `nextUrl.${prop}`)\n return ReflectAdapter.get(target, prop, receiver)\n }\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), nextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n }\n\n const nextRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol\n ): unknown {\n switch (prop) {\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(target.nextUrl, nextUrlHandlers))\n )\n case 'headers':\n case 'cookies':\n case 'url':\n case 'body':\n case 'blob':\n case 'json':\n case 'text':\n case 'arrayBuffer':\n case 'formData': {\n const workUnitStore = workUnitAsyncStorage.getStore()\n trackDynamic(workStore, workUnitStore, `request.${prop}`)\n // The receiver arg is intentionally the same as the target to fix an issue with\n // edge runtime, where attempting to access internal slots with the wrong `this` context\n // results in an error.\n return ReflectAdapter.get(target, prop, target)\n }\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n nextRequestHandlers\n ))\n )\n default:\n // The receiver arg is intentionally the same as the target to fix an issue with\n // edge runtime, where attempting to access internal slots with the wrong `this` context\n // results in an error.\n return ReflectAdapter.get(target, prop, target)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n }\n\n return new Proxy(request, nextRequestHandlers)\n}\n\nconst ensureStaticRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(\n target.nextUrl,\n ensureStaticNextUrlHandlers\n ))\n )\n case 'headers':\n case 'cookies':\n case 'url':\n case 'body':\n case 'blob':\n case 'json':\n case 'text':\n case 'arrayBuffer':\n case 'formData':\n throw new StaticGenBailoutError(\n `Route ${target.nextUrl.pathname} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`request.${prop}\\`.`\n )\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n ensureStaticRequestHandlers\n ))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n}\n\nconst ensureStaticNextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'search':\n case 'searchParams':\n case 'url':\n case 'href':\n case 'toJSON':\n case 'toString':\n case 'origin':\n throw new StaticGenBailoutError(\n `Route ${target.pathname} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`nextUrl.${prop}\\`.`\n )\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), ensureStaticNextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n}\n\nfunction createCacheComponentsError(route: string) {\n return new DynamicServerError(\n `Route ${route} couldn't be rendered statically because it used IO that was not cached. See more info here: https://nextjs.org/docs/messages/cache-components`\n )\n}\n\nfunction trackDynamic(\n store: WorkStore,\n workUnitStore: undefined | WorkUnitStore,\n expression: string\n): void {\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'private-cache':\n // TODO: Should we allow reading cookies and search params from the\n // request for private caches in route handlers?\n throw createRouteHandlerRequestInUseCacheError(store.route, expression)\n case 'unstable-cache':\n throw createRouteHandlerRequestInUnstableCacheError(\n store.route,\n expression\n )\n case 'prerender':\n const error = new Error(\n `Route ${store.route} used ${expression} without first calling \\`await connection()\\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-request`\n )\n return abortAndThrowOnSynchronousRequestDataAccess(\n store.route,\n expression,\n error,\n workUnitStore\n )\n case 'prerender-client':\n case 'validation-client':\n throw new InvariantError(\n 'A client prerender store should not be used for a route handler.'\n )\n case 'prerender-runtime':\n throw new InvariantError(\n 'A runtime prerender store should not be used for a route handler.'\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n break\n case 'build-time-generator':\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n"],"names":["RouteModule","createRequestStoreForAPI","createPrerenderWorkStore","createWorkStore","HTTP_METHODS","isHTTPMethod","getImplicitTags","patchFetch","getTracer","AppRouteRouteHandlersSpan","AppRouteRouteModuleSpan","Log","autoImplementMethods","appendMutableCookies","HeadersAdapter","RequestCookiesAdapter","parsedUrlQueryToParams","Phase","printDebugThrownValueForProspectiveRender","serverHooks","DynamicServerError","workAsyncStorage","workUnitAsyncStorage","actionAsyncStorage","sharedModules","getIsPossibleServerAction","RequestCookies","cleanURL","StaticGenBailoutError","isStaticGenEnabled","abortAndThrowOnSynchronousRequestDataAccess","createDynamicTrackingState","getFirstDynamicReason","ReflectAdapter","CacheSignal","scheduleImmediate","createServerParamsForRoute","getRedirectStatusCodeFromError","getURLFromRedirectError","isRedirectError","getAccessFallbackHTTPStatus","isHTTPAccessFallbackError","RedirectStatusCode","INFINITE_CACHE","executeRevalidates","trackPendingModules","InvariantError","LazyModule","createPrerenderResumeDataCache","createRouteHandlerRequestInUseCacheError","createRouteHandlerRequestInUnstableCacheError","WrappedNextRouterError","constructor","error","headers","AppRouteRouteModule","userland","_lazyUserland","assertLoaded","ensureUserland","waitUntilLoaded","getUserland","definition","distDir","relativeProjectDir","resolvedPagePath","nextConfigOutput","undefined","_getUserland","trace","loadUserland","spanName","attributes","pathname","module","_onUserlandLoaded","loadIfNeeded","_methods","_hasNonStaticMethods","hasNonStaticMethods","_dynamic","dynamic","Error","process","env","NODE_ENV","lowercased","map","method","toLowerCase","toUpperCase","some","resolveHandler","Response","status","resolveHandlerFromUserland","resolvePendingRevalidations","workStore","requestStore","context","maybeRevalidatesPromise","renderOpts","pendingWaitUntil","finally","NEXT_PRIVATE_DEBUG_CACHE","console","log","url","search","handleHandlerError","err","actionStore","Headers","Location","mutableCookies","isAction","SeeOther","httpStatus","finalizeResponse","res","request","prerenderStore","invalidType","name","fetchMetrics","collectedTags","tags","join","collectedRevalidate","revalidate","collectedExpire","expire","collectedStale","stale","body","statusText","prerenderToResponse","handler","implicitTags","cacheComponentsEnabled","cacheComponents","handlerContext","params","userlandRevalidate","defaultRevalidate","prospectiveController","AbortController","prospectiveRenderIsDynamic","cacheSignal","dynamicTracking","prerenderResumeDataCache","prospectiveRoutePrerenderStore","type","phase","rootParams","fallbackRouteParams","renderSignal","signal","controller","stagedRendering","resumeDataCache","hmrRefreshHash","varyParamsAccumulator","ensureStaticLevel","prerenderDataTracking","isFallbackUpgradeable","prospectiveResult","run","aborted","NEXT_DEBUG_BUILD","__NEXT_VERBOSE_LOGGING","route","ProspectiveRender","then","cacheReady","dynamicReason","finalController","finalRoutePrerenderStore","responseHandled","Promise","resolve","reject","result","bodyHandled","arrayBuffer","abort","createCacheComponentsError","renderToResponse","prepareExecution","req","rawLiveUserland","liveUserland","fetchCache","isAppRoute","page","nextUrl","previewProps","validateExecutionResponse","response","has","get","executeRequest","prepared","forceDynamic","forceStatic","Proxy","forceStaticRequestHandlers","dynamicShouldError","proxyNextRequest","tracer","setRootSpanAttribute","runHandler","executePrerender","dynamicUsageDescription","message","dynamicUsageStack","stack","ensureStaticRequestHandlers","handle","buildId","sharedContext","deploymentId","previouslyRevalidatedTags","prerender","handlers","POST","PUT","DELETE","PATCH","OPTIONS","nextURLSymbol","Symbol","requestCloneSymbol","urlCloneSymbol","searchParamsSymbol","hrefSymbol","toStringSymbol","headersSymbol","cookiesSymbol","target","prop","receiver","seal","forceStaticNextUrlHandlers","href","clone","URLSearchParams","nextUrlHandlers","workUnitStore","getStore","trackDynamic","nextRequestHandlers","ensureStaticNextUrlHandlers","store","expression"],"mappings":"AASA,SACEA,WAAW,QAGN,kBAAiB;AACxB,SAASC,wBAAwB,QAAQ,oCAAmC;AAC5E,SACEC,wBAAwB,EACxBC,eAAe,QAEV,iCAAgC;AACvC,SAA2BC,YAAY,EAAEC,YAAY,QAAQ,iBAAgB;AAC7E,SAASC,eAAe,QAA2B,0BAAyB;AAC5E,SAASC,UAAU,QAAQ,wBAAuB;AAClD,SAASC,SAAS,QAAQ,yBAAwB;AAClD,SACEC,yBAAyB,EACzBC,uBAAuB,QAClB,4BAA2B;AAClC,YAAYC,SAAS,4BAA2B;AAChD,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SACEC,oBAAoB,QAEf,oDAAmD;AAC1D,SAASC,cAAc,QAAQ,4CAA2C;AAC1E,SAASC,qBAAqB,QAAQ,oDAAmD;AACzF,SAASC,sBAAsB,QAAQ,uCAAsC;AAC7E,SACEC,KAAK,EACLC,yCAAyC,QACpC,4CAA2C;AAElD,YAAYC,iBAAiB,kDAAiD;AAC9E,SAASC,kBAAkB,QAAQ,kDAAiD;AAEpF,SACEC,gBAAgB,QAEX,+CAA8C;AACrD,SACEC,oBAAoB,QAGf,oDAAmD;AAC1D,SACEC,kBAAkB,QAEb,iDAAgD;AACvD,YAAYC,mBAAmB,mBAAkB;AACjD,SAASC,yBAAyB,QAA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H,UAAU,GAAG;gBAE3B,MAAMnB,MAAM,IAAI1F,mBACd,CAAC,MAAM,EAAEyO,MAAMlF,KAAK,CAAC,mDAAmD,EAAEmF,WAAW,6EAA6E,CAAC;gBAErKD,MAAMxC,uBAAuB,GAAGyC;gBAChCD,MAAMtC,iBAAiB,GAAGzG,IAAI0G,KAAK;gBAEnC,MAAM1G;YACR,KAAK;gBACH;YACF,KAAK;gBACH;YACF;gBACE0I;QACJ;IACF;AACF","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/shared-modules.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ // the name of the export has to be the camelCase version of the file name (without the extension)
2
+ // TODO: remove this. We need it because using notFound from next/navigation imports this file :(
3
+ export * as appRouterContext from '../../../shared/lib/app-router-context.shared-runtime';
4
+
5
+ //# sourceMappingURL=shared-modules.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/app-route/shared-modules.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/app-route/shared-modules.ts"],"sourcesContent":["// the name of the export has to be the camelCase version of the file name (without the extension)\n// TODO: remove this. We need it because using notFound from next/navigation imports this file :(\nexport * as appRouterContext from '../../../shared/lib/app-router-context.shared-runtime'\n"],"names":["appRouterContext"],"mappings":"AAAA,kGAAkG;AAClG,iGAAiG;AACjG,OAAO,KAAKA,gBAAgB,MAAM,wDAAuD","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/checks.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { RouteKind } from '../route-kind';
2
+ export function isAppRouteRouteModule(routeModule) {
3
+ return routeModule.definition.kind === RouteKind.APP_ROUTE;
4
+ }
5
+ export function isAppPageRouteModule(routeModule) {
6
+ return routeModule.definition.kind === RouteKind.APP_PAGE;
7
+ }
8
+ export function isPagesRouteModule(routeModule) {
9
+ return routeModule.definition.kind === RouteKind.PAGES;
10
+ }
11
+ export function isPagesAPIRouteModule(routeModule) {
12
+ return routeModule.definition.kind === RouteKind.PAGES_API;
13
+ }
14
+
15
+ //# sourceMappingURL=checks.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/checks.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../src/server/route-modules/checks.ts"],"sourcesContent":["import type { AppRouteRouteModule } from './app-route/module'\nimport type { AppPageRouteModule } from './app-page/module'\nimport type { PagesRouteModule } from './pages/module'\nimport type { PagesAPIRouteModule } from './pages-api/module'\n\nimport type { RouteModule } from './route-module'\n\nimport { RouteKind } from '../route-kind'\n\nexport function isAppRouteRouteModule(\n routeModule: RouteModule\n): routeModule is AppRouteRouteModule {\n return routeModule.definition.kind === RouteKind.APP_ROUTE\n}\n\nexport function isAppPageRouteModule(\n routeModule: RouteModule\n): routeModule is AppPageRouteModule {\n return routeModule.definition.kind === RouteKind.APP_PAGE\n}\n\nexport function isPagesRouteModule(\n routeModule: RouteModule\n): routeModule is PagesRouteModule {\n return routeModule.definition.kind === RouteKind.PAGES\n}\n\nexport function isPagesAPIRouteModule(\n routeModule: RouteModule\n): routeModule is PagesAPIRouteModule {\n return routeModule.definition.kind === RouteKind.PAGES_API\n}\n"],"names":["RouteKind","isAppRouteRouteModule","routeModule","definition","kind","APP_ROUTE","isAppPageRouteModule","APP_PAGE","isPagesRouteModule","PAGES","isPagesAPIRouteModule","PAGES_API"],"mappings":"AAOA,SAASA,SAAS,QAAQ,gBAAe;AAEzC,OAAO,SAASC,sBACdC,WAAwB;IAExB,OAAOA,YAAYC,UAAU,CAACC,IAAI,KAAKJ,UAAUK,SAAS;AAC5D;AAEA,OAAO,SAASC,qBACdJ,WAAwB;IAExB,OAAOA,YAAYC,UAAU,CAACC,IAAI,KAAKJ,UAAUO,QAAQ;AAC3D;AAEA,OAAO,SAASC,mBACdN,WAAwB;IAExB,OAAOA,YAAYC,UAAU,CAACC,IAAI,KAAKJ,UAAUS,KAAK;AACxD;AAEA,OAAO,SAASC,sBACdR,WAAwB;IAExB,OAAOA,YAAYC,UAAU,CAACC,IAAI,KAAKJ,UAAUW,SAAS;AAC5D","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.d.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ export * from './module'
e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (process.env.NEXT_RUNTIME === 'edge') {
2
+ module.exports = require('next/dist/server/route-modules/pages-api/module.js');
3
+ } else {
4
+ if (process.env.NODE_ENV === 'development') {
5
+ if (process.env.TURBOPACK) {
6
+ module.exports = require('next/dist/compiled/next-server/pages-api-turbo.runtime.dev.js');
7
+ } else {
8
+ module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js');
9
+ }
10
+ } else {
11
+ if (process.env.TURBOPACK) {
12
+ module.exports = require('next/dist/compiled/next-server/pages-api-turbo.runtime.prod.js');
13
+ } else {
14
+ module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js');
15
+ }
16
+ }
17
+ }
18
+
19
+ //# sourceMappingURL=module.compiled.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.compiled.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages-api/module.compiled.js"],"sourcesContent":["if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/pages-api/module.js')\n} else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/pages-api-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/pages-api-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js')\n }\n }\n}\n"],"names":["process","env","NEXT_RUNTIME","module","exports","require","NODE_ENV","TURBOPACK"],"mappings":"AAAA,IAAIA,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;IACvCC,OAAOC,OAAO,GAAGC,QAAQ;AAC3B,OAAO;IACL,IAAIL,QAAQC,GAAG,CAACK,QAAQ,KAAK,eAAe;QAC1C,IAAIN,QAAQC,GAAG,CAACM,SAAS,EAAE;YACzBJ,OAAOC,OAAO,GAAGC,QAAQ;QAC3B,OAAO;YACLF,OAAOC,OAAO,GAAGC,QAAQ;QAC3B;IACF,OAAO;QACL,IAAIL,QAAQC,GAAG,CAACM,SAAS,EAAE;YACzBJ,OAAOC,OAAO,GAAGC,QAAQ;QAC3B,OAAO;YACLF,OAAOC,OAAO,GAAGC,QAAQ;QAC3B;IACF;AACF","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { wrapApiHandler } from '../../api-utils';
2
+ import { RouteModule } from '../route-module';
3
+ import { apiResolver } from '../../api-utils/node/api-resolver';
4
+ export class PagesAPIRouteModule extends RouteModule {
5
+ constructor(options){
6
+ super(options);
7
+ if (typeof options.userland.default !== 'function') {
8
+ throw new Error(`Page ${options.definition.page} does not export a default function.`);
9
+ }
10
+ this.apiResolverWrapped = wrapApiHandler(options.definition.page, apiResolver);
11
+ }
12
+ /**
13
+ *
14
+ * @param req the incoming server request
15
+ * @param res the outgoing server response
16
+ * @param context the context for the render
17
+ */ async render(req, res, context) {
18
+ const { apiResolverWrapped } = this;
19
+ await apiResolverWrapped(req, res, context.query, this.userland, {
20
+ ...context.previewProps,
21
+ trustHostHeader: context.trustHostHeader,
22
+ allowedRevalidateHeaderKeys: context.allowedRevalidateHeaderKeys,
23
+ hostname: context.hostname,
24
+ multiZoneDraftMode: context.multiZoneDraftMode,
25
+ dev: context.dev,
26
+ internalRevalidate: context.internalRevalidate
27
+ }, context.propagateError, context.dev, context.page, context.onError);
28
+ }
29
+ }
30
+ export default PagesAPIRouteModule;
31
+
32
+ //# sourceMappingURL=module.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages-api/module.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages-api/module.ts"],"sourcesContent":["import type { IncomingMessage, ServerResponse } from 'http'\nimport type { PagesAPIRouteDefinition } from '../../route-definitions/pages-api-route-definition'\nimport type { PageConfig } from '../../../types'\nimport type { ParsedUrlQuery } from 'querystring'\nimport { wrapApiHandler, type __ApiPreviewProps } from '../../api-utils'\nimport type { RouteModuleOptions } from '../route-module'\n\nimport { RouteModule, type RouteModuleHandleContext } from '../route-module'\nimport { apiResolver } from '../../api-utils/node/api-resolver'\nimport type { RevalidateFn } from '../../lib/router-utils/router-server-context'\n\ntype PagesAPIHandleFn = (\n req: IncomingMessage,\n res: ServerResponse\n) => Promise<void>\n\n/**\n * The PagesAPIModule is the type of the module exported by the bundled Pages\n * API module.\n */\nexport type PagesAPIModule = typeof import('../../../build/templates/pages-api')\n\ntype PagesAPIUserlandModule = {\n /**\n * The exported handler method.\n */\n readonly default: PagesAPIHandleFn\n\n /**\n * The exported page config.\n */\n readonly config?: PageConfig\n}\n\ntype PagesAPIRouteHandlerContext = RouteModuleHandleContext & {\n /**\n * The incoming server request in non-edge runtime.\n */\n req?: IncomingMessage\n\n /**\n * The outgoing server response in non-edge runtime.\n */\n res?: ServerResponse\n\n /**\n * The hostname for the request.\n */\n hostname?: string\n\n /**\n * Keys allowed in the revalidate call.\n */\n allowedRevalidateHeaderKeys?: string[]\n\n /**\n * Whether to trust the host header.\n */\n trustHostHeader?: boolean\n\n /**\n * The query for the request.\n */\n query: ParsedUrlQuery\n\n /**\n * The preview props used by the `preview` API.\n */\n previewProps: __ApiPreviewProps\n\n /**\n * True if the server is in development mode.\n */\n dev: boolean\n\n /**\n * Whether errors should be left uncaught to handle\n * higher up\n */\n propagateError: boolean\n\n /**\n * The page that's being rendered.\n */\n page: string\n\n /**\n * The error handler for the request.\n */\n onError?: Parameters<typeof apiResolver>[8]\n\n /**\n * whether multi-zone flag is enabled for draft mode\n */\n multiZoneDraftMode?: boolean\n\n /**\n * Internal revalidate function to avoid revalidating\n * over the network\n */\n internalRevalidate?: RevalidateFn\n}\n\nexport type PagesAPIRouteModuleOptions = RouteModuleOptions<\n PagesAPIRouteDefinition,\n PagesAPIUserlandModule\n>\n\nexport class PagesAPIRouteModule extends RouteModule<\n PagesAPIRouteDefinition,\n PagesAPIUserlandModule\n> {\n private apiResolverWrapped: typeof apiResolver\n\n constructor(options: PagesAPIRouteModuleOptions) {\n super(options)\n\n if (typeof options.userland.default !== 'function') {\n throw new Error(\n `Page ${options.definition.page} does not export a default function.`\n )\n }\n\n this.apiResolverWrapped = wrapApiHandler(\n options.definition.page,\n apiResolver\n )\n }\n\n /**\n *\n * @param req the incoming server request\n * @param res the outgoing server response\n * @param context the context for the render\n */\n public async render(\n req: IncomingMessage,\n res: ServerResponse,\n context: PagesAPIRouteHandlerContext\n ): Promise<void> {\n const { apiResolverWrapped } = this\n await apiResolverWrapped(\n req,\n res,\n context.query,\n this.userland,\n {\n ...context.previewProps,\n trustHostHeader: context.trustHostHeader,\n allowedRevalidateHeaderKeys: context.allowedRevalidateHeaderKeys,\n hostname: context.hostname,\n multiZoneDraftMode: context.multiZoneDraftMode,\n dev: context.dev,\n internalRevalidate: context.internalRevalidate,\n },\n context.propagateError,\n context.dev,\n context.page,\n context.onError\n )\n }\n}\n\nexport default PagesAPIRouteModule\n"],"names":["wrapApiHandler","RouteModule","apiResolver","PagesAPIRouteModule","constructor","options","userland","default","Error","definition","page","apiResolverWrapped","render","req","res","context","query","previewProps","trustHostHeader","allowedRevalidateHeaderKeys","hostname","multiZoneDraftMode","dev","internalRevalidate","propagateError","onError"],"mappings":"AAIA,SAASA,cAAc,QAAgC,kBAAiB;AAGxE,SAASC,WAAW,QAAuC,kBAAiB;AAC5E,SAASC,WAAW,QAAQ,oCAAmC;AAoG/D,OAAO,MAAMC,4BAA4BF;IAMvCG,YAAYC,OAAmC,CAAE;QAC/C,KAAK,CAACA;QAEN,IAAI,OAAOA,QAAQC,QAAQ,CAACC,OAAO,KAAK,YAAY;YAClD,MAAM,IAAIC,MACR,CAAC,KAAK,EAAEH,QAAQI,UAAU,CAACC,IAAI,CAAC,oCAAoC,CAAC;QAEzE;QAEA,IAAI,CAACC,kBAAkB,GAAGX,eACxBK,QAAQI,UAAU,CAACC,IAAI,EACvBR;IAEJ;IAEA;;;;;GAKC,GACD,MAAaU,OACXC,GAAoB,EACpBC,GAAmB,EACnBC,OAAoC,EACrB;QACf,MAAM,EAAEJ,kBAAkB,EAAE,GAAG,IAAI;QACnC,MAAMA,mBACJE,KACAC,KACAC,QAAQC,KAAK,EACb,IAAI,CAACV,QAAQ,EACb;YACE,GAAGS,QAAQE,YAAY;YACvBC,iBAAiBH,QAAQG,eAAe;YACxCC,6BAA6BJ,QAAQI,2BAA2B;YAChEC,UAAUL,QAAQK,QAAQ;YAC1BC,oBAAoBN,QAAQM,kBAAkB;YAC9CC,KAAKP,QAAQO,GAAG;YAChBC,oBAAoBR,QAAQQ,kBAAkB;QAChD,GACAR,QAAQS,cAAc,EACtBT,QAAQO,GAAG,EACXP,QAAQL,IAAI,EACZK,QAAQU,OAAO;IAEnB;AACF;AAEA,eAAetB,oBAAmB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/builtin/_error.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import App from '../../../../pages/_app';
2
+ import Document from '../../../../pages/_document';
3
+ import { RouteKind } from '../../../route-kind';
4
+ import * as moduleError from '../../../../pages/_error';
5
+ import PagesRouteModule from '../module';
6
+ import { getHandler } from '../pages-handler';
7
+ export const routeModule = new PagesRouteModule({
8
+ // TODO: add descriptor for internal error page
9
+ definition: {
10
+ kind: RouteKind.PAGES,
11
+ page: '/_error',
12
+ pathname: '/_error',
13
+ filename: '',
14
+ bundlePath: ''
15
+ },
16
+ distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
17
+ relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',
18
+ components: {
19
+ App,
20
+ Document
21
+ },
22
+ userland: moduleError
23
+ });
24
+ export const handler = getHandler({
25
+ srcPage: '/_error',
26
+ routeModule,
27
+ userland: moduleError,
28
+ config: {},
29
+ isFallbackError: true
30
+ });
31
+
32
+ //# sourceMappingURL=_error.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/builtin/_error.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../src/server/route-modules/pages/builtin/_error.tsx"],"sourcesContent":["import App from '../../../../pages/_app'\nimport Document from '../../../../pages/_document'\nimport { RouteKind } from '../../../route-kind'\n\nimport * as moduleError from '../../../../pages/_error'\n\nimport PagesRouteModule from '../module'\nimport { getHandler } from '../pages-handler'\n\nexport const routeModule = new PagesRouteModule({\n // TODO: add descriptor for internal error page\n definition: {\n kind: RouteKind.PAGES,\n page: '/_error',\n pathname: '/_error',\n filename: '',\n bundlePath: '',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n components: {\n App,\n Document,\n },\n userland: moduleError,\n})\n\nexport const handler = getHandler({\n srcPage: '/_error',\n routeModule,\n userland: moduleError,\n config: {},\n isFallbackError: true,\n})\n"],"names":["App","Document","RouteKind","moduleError","PagesRouteModule","getHandler","routeModule","definition","kind","PAGES","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","components","userland","handler","srcPage","config","isFallbackError"],"mappings":"AAAA,OAAOA,SAAS,yBAAwB;AACxC,OAAOC,cAAc,8BAA6B;AAClD,SAASC,SAAS,QAAQ,sBAAqB;AAE/C,YAAYC,iBAAiB,2BAA0B;AAEvD,OAAOC,sBAAsB,YAAW;AACxC,SAASC,UAAU,QAAQ,mBAAkB;AAE7C,OAAO,MAAMC,cAAc,IAAIF,iBAAiB;IAC9C,+CAA+C;IAC/CG,YAAY;QACVC,MAAMN,UAAUO,KAAK;QACrBC,MAAM;QACNC,UAAU;QACVC,UAAU;QACVC,YAAY;IACd;IACAC,SAASC,QAAQC,GAAG,CAACC,wBAAwB,IAAI;IACjDC,oBAAoBH,QAAQC,GAAG,CAACG,2BAA2B,IAAI;IAC/DC,YAAY;QACVpB;QACAC;IACF;IACAoB,UAAUlB;AACZ,GAAE;AAEF,OAAO,MAAMmB,UAAUjB,WAAW;IAChCkB,SAAS;IACTjB;IACAe,UAAUlB;IACVqB,QAAQ,CAAC;IACTC,iBAAiB;AACnB,GAAE","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.d.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ export * from './module'
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (process.env.NEXT_RUNTIME === 'edge') {
2
+ module.exports = require('next/dist/server/route-modules/pages/module.js');
3
+ } else {
4
+ if (process.env.NODE_ENV === 'development') {
5
+ if (process.env.TURBOPACK) {
6
+ module.exports = require('next/dist/compiled/next-server/pages-turbo.runtime.dev.js');
7
+ } else {
8
+ module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js');
9
+ }
10
+ } else {
11
+ if (process.env.TURBOPACK) {
12
+ module.exports = require('next/dist/compiled/next-server/pages-turbo.runtime.prod.js');
13
+ } else {
14
+ module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js');
15
+ }
16
+ }
17
+ }
18
+
19
+ //# sourceMappingURL=module.compiled.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.compiled.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages/module.compiled.js"],"sourcesContent":["if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/pages/module.js')\n} else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/pages-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/pages-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js')\n }\n }\n}\n"],"names":["process","env","NEXT_RUNTIME","module","exports","require","NODE_ENV","TURBOPACK"],"mappings":"AAAA,IAAIA,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;IACvCC,OAAOC,OAAO,GAAGC,QAAQ;AAC3B,OAAO;IACL,IAAIL,QAAQC,GAAG,CAACK,QAAQ,KAAK,eAAe;QAC1C,IAAIN,QAAQC,GAAG,CAACM,SAAS,EAAE;YACzBJ,OAAOC,OAAO,GAAGC,QAAQ;QAC3B,OAAO;YACLF,OAAOC,OAAO,GAAGC,QAAQ;QAC3B;IACF,OAAO;QACL,IAAIL,QAAQC,GAAG,CAACM,SAAS,EAAE;YACzBJ,OAAOC,OAAO,GAAGC,QAAQ;QAC3B,OAAO;YACLF,OAAOC,OAAO,GAAGC,QAAQ;QAC3B;IACF;AACF","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { RouteModule } from '../route-module';
2
+ import { renderToHTMLImpl, renderToHTML } from '../../render';
3
+ import * as vendoredContexts from './vendored/contexts/entrypoints';
4
+ export class PagesRouteModule extends RouteModule {
5
+ constructor(options){
6
+ super(options);
7
+ this.components = options.components;
8
+ }
9
+ render(req, res, context) {
10
+ return renderToHTMLImpl(req, res, context.page, context.query, context.renderOpts, {
11
+ App: this.components.App,
12
+ Document: this.components.Document
13
+ }, context.sharedContext, context.renderContext);
14
+ }
15
+ }
16
+ const vendored = {
17
+ contexts: vendoredContexts
18
+ };
19
+ // needed for the static build
20
+ export { renderToHTML, vendored };
21
+ export default PagesRouteModule;
22
+
23
+ //# sourceMappingURL=module.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages/module.ts"],"sourcesContent":["import type { IncomingMessage, ServerResponse } from 'http'\nimport type {\n GetServerSideProps,\n GetStaticPaths,\n GetStaticProps,\n NextComponentType,\n PageConfig,\n} from '../../../types'\nimport type { PagesRouteDefinition } from '../../route-definitions/pages-route-definition'\nimport type { NextParsedUrlQuery } from '../../request-meta'\nimport type {\n PagesRenderContext,\n PagesSharedContext,\n RenderOpts,\n} from '../../render'\nimport type RenderResult from '../../render-result'\nimport type { AppType, DocumentType } from '../../../shared/lib/utils'\n\nimport {\n RouteModule,\n type RouteModuleHandleContext,\n type RouteModuleOptions,\n} from '../route-module'\nimport { renderToHTMLImpl, renderToHTML } from '../../render'\nimport * as vendoredContexts from './vendored/contexts/entrypoints'\n\n/**\n * The PagesModule is the type of the module exported by the bundled pages\n * module.\n */\nexport type PagesModule = typeof import('../../../build/templates/pages')\n\n/**\n * The userland module for a page. This is the module that is exported from the\n * page file that contains the page component, page config, and any page data\n * fetching functions.\n */\nexport type PagesUserlandModule = {\n /**\n * The exported page component.\n */\n readonly default: NextComponentType\n\n /**\n * The exported page config.\n */\n readonly config?: PageConfig\n\n /**\n * The exported `getStaticProps` function.\n */\n readonly getStaticProps?: GetStaticProps\n\n /**\n * The exported `getStaticPaths` function.\n */\n readonly getStaticPaths?: GetStaticPaths\n\n /**\n * The exported `getServerSideProps` function.\n */\n readonly getServerSideProps?: GetServerSideProps\n}\n\n/**\n * The components that are used to render a page. These aren't tied to the\n * specific page being rendered, but rather are the components that are used to\n * render all pages.\n */\ntype PagesComponents = {\n /**\n * The `App` component. This could be exported by a user's custom `_app` page\n * file, or it could be the default `App` component.\n */\n readonly App: AppType\n\n /**\n * The `Document` component. This could be exported by a user's custom\n * `_document` page file, or it could be the default `Document` component.\n */\n readonly Document: DocumentType\n}\n\nexport interface PagesRouteModuleOptions\n extends RouteModuleOptions<PagesRouteDefinition, PagesUserlandModule> {\n readonly components: PagesComponents\n}\n\n/**\n * AppRouteRouteHandlerContext is the context that is passed to the route\n * handler for app routes.\n */\nexport interface PagesRouteHandlerContext extends RouteModuleHandleContext {\n /**\n * The page for the given route.\n */\n page: string\n\n /**\n * The parsed URL query for the given request.\n */\n query: NextParsedUrlQuery\n\n /**\n * The shared context used for all page renders.\n */\n sharedContext: PagesSharedContext\n\n /**\n * The context for the given request.\n */\n renderContext: PagesRenderContext\n\n /**\n * The arguments for the given request.\n /**\n * The RenderOpts for the given request which include the specific modules to\n * use for rendering.\n */\n // TODO: (wyattjoh) break this out into smaller parts, it currently includes the userland components\n renderOpts: Omit<RenderOpts, 'Document' | 'App'>\n}\n\nexport class PagesRouteModule extends RouteModule<\n PagesRouteDefinition,\n PagesUserlandModule\n> {\n private readonly components: PagesComponents\n\n constructor(options: PagesRouteModuleOptions) {\n super(options)\n\n this.components = options.components\n }\n\n public render(\n req: IncomingMessage,\n res: ServerResponse,\n context: PagesRouteHandlerContext\n ): Promise<RenderResult> {\n return renderToHTMLImpl(\n req,\n res,\n context.page,\n context.query,\n context.renderOpts,\n {\n App: this.components.App,\n Document: this.components.Document,\n },\n context.sharedContext,\n context.renderContext\n )\n }\n}\n\nconst vendored = {\n contexts: vendoredContexts,\n}\n\n// needed for the static build\nexport { renderToHTML, vendored }\n\nexport default PagesRouteModule\n"],"names":["RouteModule","renderToHTMLImpl","renderToHTML","vendoredContexts","PagesRouteModule","constructor","options","components","render","req","res","context","page","query","renderOpts","App","Document","sharedContext","renderContext","vendored","contexts"],"mappings":"AAkBA,SACEA,WAAW,QAGN,kBAAiB;AACxB,SAASC,gBAAgB,EAAEC,YAAY,QAAQ,eAAc;AAC7D,YAAYC,sBAAsB,kCAAiC;AAmGnE,OAAO,MAAMC,yBAAyBJ;IAMpCK,YAAYC,OAAgC,CAAE;QAC5C,KAAK,CAACA;QAEN,IAAI,CAACC,UAAU,GAAGD,QAAQC,UAAU;IACtC;IAEOC,OACLC,GAAoB,EACpBC,GAAmB,EACnBC,OAAiC,EACV;QACvB,OAAOV,iBACLQ,KACAC,KACAC,QAAQC,IAAI,EACZD,QAAQE,KAAK,EACbF,QAAQG,UAAU,EAClB;YACEC,KAAK,IAAI,CAACR,UAAU,CAACQ,GAAG;YACxBC,UAAU,IAAI,CAACT,UAAU,CAACS,QAAQ;QACpC,GACAL,QAAQM,aAAa,EACrBN,QAAQO,aAAa;IAEzB;AACF;AAEA,MAAMC,WAAW;IACfC,UAAUjB;AACZ;AAEA,8BAA8B;AAC9B,SAASD,YAAY,EAAEiB,QAAQ,GAAE;AAEjC,eAAef,iBAAgB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.render.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ export const lazyRenderPagesPage = (...args)=>{
2
+ if (process.env.NEXT_MINIMAL) {
3
+ throw new Error("Can't use lazyRenderPagesPage in minimal mode");
4
+ } else {
5
+ const render = require('./module.compiled').renderToHTML;
6
+ return render(...args);
7
+ }
8
+ };
9
+
10
+ //# sourceMappingURL=module.render.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/module.render.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages/module.render.ts"],"sourcesContent":["import type { PagesRender } from '../../render'\n\nexport const lazyRenderPagesPage: PagesRender = (...args) => {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"Can't use lazyRenderPagesPage in minimal mode\")\n } else {\n const render: PagesRender = (\n require('./module.compiled') as typeof import('./module.compiled')\n ).renderToHTML\n\n return render(...args)\n }\n}\n"],"names":["lazyRenderPagesPage","args","process","env","NEXT_MINIMAL","Error","render","require","renderToHTML"],"mappings":"AAEA,OAAO,MAAMA,sBAAmC,CAAC,GAAGC;IAClD,IAAIC,QAAQC,GAAG,CAACC,YAAY,EAAE;QAC5B,MAAM,IAAIC,MAAM;IAClB,OAAO;QACL,MAAMC,SAAsB,AAC1BC,QAAQ,qBACRC,YAAY;QAEd,OAAOF,UAAUL;IACnB;AACF,EAAC","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/pages-handler.js ADDED
@@ -0,0 +1,561 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { RouteKind } from '../../route-kind';
2
+ import { BaseServerSpan } from '../../lib/trace/constants';
3
+ import { getTracer, SpanKind } from '../../lib/trace/tracer';
4
+ import { formatUrl } from '../../../shared/lib/router/utils/format-url';
5
+ import { addRequestMeta, getRequestMeta, setRequestMeta } from '../../request-meta';
6
+ import { interopDefault } from '../../app-render/interop-default';
7
+ import { getRevalidateReason } from '../../instrumentation/utils';
8
+ import { normalizeDataPath } from '../../../shared/lib/page-path/normalize-data-path';
9
+ import { CachedRouteKind } from '../../response-cache';
10
+ import { getCacheControlHeader } from '../../lib/cache-control';
11
+ import { normalizeRepeatedSlashes } from '../../../shared/lib/utils';
12
+ import { getRedirectStatus } from '../../../lib/redirect-status';
13
+ import { CACHE_ONE_YEAR_SECONDS, HTML_CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE_HEADER, NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants';
14
+ import path from 'path';
15
+ import { sendRenderResult } from '../../send-payload';
16
+ import RenderResult from '../../render-result';
17
+ import { toResponseCacheEntry } from '../../response-cache/utils';
18
+ import { NoFallbackError } from '../../../shared/lib/no-fallback-error.external';
19
+ import { RedirectStatusCode } from '../../../client/components/redirect-status-code';
20
+ import { isBot } from '../../../shared/lib/router/utils/is-bot';
21
+ import { addPathPrefix } from '../../../shared/lib/router/utils/add-path-prefix';
22
+ import { removeTrailingSlash } from '../../../shared/lib/router/utils/remove-trailing-slash';
23
+ import { isRouteCacheOwner } from '../../lib/route-cache-key';
24
+ export const getHandler = ({ srcPage: originalSrcPage, config, userland, routeModule, isFallbackError, getStaticPaths, getStaticProps, getServerSideProps })=>{
25
+ return async function handler(req, res, ctx) {
26
+ var _serverFilesManifest_config_experimental, _serverFilesManifest_config, _parsedUrl_pathname;
27
+ if (ctx.requestMeta) {
28
+ setRequestMeta(req, ctx.requestMeta);
29
+ }
30
+ if (routeModule.isDev) {
31
+ addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
32
+ }
33
+ let srcPage = originalSrcPage;
34
+ // turbopack doesn't normalize `/index` in the page name
35
+ // so we need to to process dynamic routes properly
36
+ // TODO: fix turbopack providing differing value from webpack
37
+ if (process.env.TURBOPACK) {
38
+ srcPage = srcPage.replace(/\/index$/, '') || '/';
39
+ } else if (srcPage === '/index') {
40
+ // we always normalize /index specifically
41
+ srcPage = '/';
42
+ }
43
+ const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;
44
+ const prepareResult = await routeModule.prepare(req, res, {
45
+ srcPage,
46
+ multiZoneDraftMode
47
+ });
48
+ if (!prepareResult) {
49
+ res.statusCode = 400;
50
+ res.end('Bad Request');
51
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
52
+ return;
53
+ }
54
+ const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));
55
+ const render404 = async ()=>{
56
+ // TODO: should route-module itself handle rendering the 404
57
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
58
+ // When the Pages and App Routers coexist, a Pages Router 404 renders
59
+ // the App Router not-found page. A direct route-module invocation
60
+ // cannot provide the postponed state needed to resume that App Router
61
+ // output, so an empty postponed state signals that the renderer must
62
+ // perform a complete dynamic render instead.
63
+ //
64
+ // TODO: Re-enter routing with the App Router not-found output so its
65
+ // prerender and postponed state can be selected and resumed.
66
+ if (nextConfig.cacheComponents && !routerServerContext.isWrappedByNextServer && typeof getRequestMeta(req, 'postponed') !== 'string') {
67
+ addRequestMeta(req, 'postponed', '');
68
+ }
69
+ await routerServerContext.render404(req, res, parsedUrl, false);
70
+ } else {
71
+ res.end('This page could not be found');
72
+ }
73
+ };
74
+ const { buildId, query, params, parsedUrl, originalQuery, originalPathname, buildManifest, fallbackBuildManifest, nextFontManifest, serverFilesManifest, reactLoadableManifest, prerenderManifest, previewProps, isDraftMode, isOnDemandRevalidate, revalidateOnlyGenerated, locale, locales, defaultLocale, routerServerContext, nextConfig, resolvedPathname, encodedResolvedPathname, deploymentId, clientAssetToken } = prepareResult;
75
+ const isExperimentalCompile = serverFilesManifest == null ? void 0 : (_serverFilesManifest_config = serverFilesManifest.config) == null ? void 0 : (_serverFilesManifest_config_experimental = _serverFilesManifest_config.experimental) == null ? void 0 : _serverFilesManifest_config_experimental.isExperimentalCompile;
76
+ const hasServerProps = Boolean(getServerSideProps);
77
+ const hasStaticProps = Boolean(getStaticProps);
78
+ const hasStaticPaths = Boolean(getStaticPaths);
79
+ const hasGetInitialProps = Boolean((userland.default || userland).getInitialProps);
80
+ let cacheKey = null;
81
+ let isIsrFallback = false;
82
+ let isNextDataRequest = prepareResult.isNextDataRequest && (hasStaticProps || hasServerProps);
83
+ const is404Page = srcPage === '/404';
84
+ const is500Page = srcPage === '/500';
85
+ const isErrorPage = srcPage === '/_error';
86
+ if (!routeModule.isDev && !isDraftMode && hasStaticProps) {
87
+ cacheKey = `${locale ? `/${locale}` : ''}${(srcPage === '/' || resolvedPathname === '/') && locale ? '' : resolvedPathname}`;
88
+ if (is404Page || is500Page || isErrorPage) {
89
+ cacheKey = `${locale ? `/${locale}` : ''}${srcPage}`;
90
+ }
91
+ // ensure /index and / is normalized to one key
92
+ cacheKey = cacheKey === '/index' ? '/' : cacheKey;
93
+ }
94
+ if (hasStaticPaths && !isDraftMode) {
95
+ var _nextConfig_i18n;
96
+ const decodedPathname = removeTrailingSlash(locale ? addPathPrefix(resolvedPathname, `/${locale}`) : resolvedPathname);
97
+ const isPrerendered = (Boolean(prerenderManifest.routes[decodedPathname]) || prerenderManifest.notFoundRoutes.includes(decodedPathname)) && // A sibling's positive or negative prerender cannot admit parameters
98
+ // that this route excluded. Development computes static paths on demand
99
+ // instead of reading build-time prerender metadata.
100
+ (routeModule.isDev || isRouteCacheOwner(decodedPathname, routeModule.cacheOwner, prerenderManifest.routes[decodedPathname], (_nextConfig_i18n = nextConfig.i18n) == null ? void 0 : _nextConfig_i18n.locales));
101
+ const prerenderInfo = prerenderManifest.dynamicRoutes[srcPage];
102
+ if (prerenderInfo) {
103
+ if (prerenderInfo.fallback === false && !isPrerendered) {
104
+ if (nextConfig.adapterPath) {
105
+ return await render404();
106
+ }
107
+ throw new NoFallbackError();
108
+ }
109
+ if (typeof prerenderInfo.fallback === 'string' && !isPrerendered && !isNextDataRequest) {
110
+ isIsrFallback = true;
111
+ }
112
+ }
113
+ }
114
+ // When serving a bot request, we want to serve a blocking render and not
115
+ // the prerendered page. This ensures that the correct content is served
116
+ // to the bot in the head.
117
+ if (isIsrFallback && isBot(req.headers['user-agent'] || '') || isMinimalMode) {
118
+ isIsrFallback = false;
119
+ }
120
+ const tracer = getTracer();
121
+ const activeSpan = tracer.getActiveScopeSpan();
122
+ const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
123
+ const method = req.method || 'GET';
124
+ const resolvedUrl = formatUrl({
125
+ pathname: nextConfig.trailingSlash ? `${encodedResolvedPathname}${!encodedResolvedPathname.endsWith('/') && ((_parsedUrl_pathname = parsedUrl.pathname) == null ? void 0 : _parsedUrl_pathname.endsWith('/')) ? '/' : ''}` : removeTrailingSlash(encodedResolvedPathname || '/'),
126
+ // make sure to only add query values from original URL
127
+ query: hasStaticProps ? {} : originalQuery
128
+ });
129
+ let parentSpan;
130
+ const handleResponse = async (span)=>{
131
+ const responseGenerator = async ({ previousCacheEntry })=>{
132
+ var _previousCacheEntry_value;
133
+ const doRender = async ()=>{
134
+ try {
135
+ var _nextConfig_i18n;
136
+ return await routeModule.render(req, res, {
137
+ query: hasStaticProps && !isExperimentalCompile ? {
138
+ ...params
139
+ } : {
140
+ ...query,
141
+ ...params
142
+ },
143
+ params,
144
+ page: srcPage,
145
+ renderContext: {
146
+ isDraftMode,
147
+ isFallback: isIsrFallback,
148
+ developmentNotFoundSourcePage: getRequestMeta(req, 'developmentNotFoundSourcePage')
149
+ },
150
+ sharedContext: {
151
+ buildId,
152
+ customServer: Boolean(routerServerContext == null ? void 0 : routerServerContext.isCustomServer) || undefined,
153
+ deploymentId,
154
+ clientAssetToken
155
+ },
156
+ renderOpts: {
157
+ params,
158
+ routeModule,
159
+ page: srcPage,
160
+ pageConfig: config || {},
161
+ Component: interopDefault(userland),
162
+ ComponentMod: userland,
163
+ getStaticProps,
164
+ getStaticPaths,
165
+ getServerSideProps,
166
+ supportsDynamicResponse: !hasStaticProps,
167
+ buildManifest: isFallbackError ? fallbackBuildManifest : buildManifest,
168
+ nextFontManifest,
169
+ reactLoadableManifest,
170
+ assetPrefix: routeModule.getAssetPrefixForRender(routerServerContext, nextConfig.assetPrefix),
171
+ previewProps,
172
+ images: nextConfig.images,
173
+ nextConfigOutput: nextConfig.output,
174
+ optimizeCss: Boolean(nextConfig.experimental.optimizeCss),
175
+ nextScriptWorkers: Boolean(nextConfig.experimental.nextScriptWorkers),
176
+ domainLocales: (_nextConfig_i18n = nextConfig.i18n) == null ? void 0 : _nextConfig_i18n.domains,
177
+ crossOrigin: nextConfig.crossOrigin,
178
+ multiZoneDraftMode,
179
+ basePath: nextConfig.basePath,
180
+ disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
181
+ largePageDataBytes: nextConfig.experimental.largePageDataBytes,
182
+ isExperimentalCompile,
183
+ experimental: {
184
+ clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || []
185
+ },
186
+ locale,
187
+ locales,
188
+ defaultLocale,
189
+ setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus,
190
+ isNextDataRequest: isNextDataRequest && (hasServerProps || hasStaticProps),
191
+ resolvedUrl,
192
+ // For getServerSideProps and getInitialProps we need to ensure we use the original URL
193
+ // and not the resolved URL to prevent a hydration mismatch on
194
+ // asPath
195
+ resolvedAsPath: hasServerProps || hasGetInitialProps ? formatUrl({
196
+ // we use the original URL pathname less the _next/data prefix if
197
+ // present
198
+ pathname: isNextDataRequest ? normalizeDataPath(originalPathname) : originalPathname,
199
+ query: originalQuery
200
+ }) : resolvedUrl,
201
+ isOnDemandRevalidate,
202
+ ErrorDebug: getRequestMeta(req, 'PagesErrorDebug'),
203
+ err: getRequestMeta(req, 'invokeError'),
204
+ // needed for experimental.optimizeCss feature
205
+ distDir: path.join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir, routeModule.distDir)
206
+ }
207
+ }).then((renderResult)=>{
208
+ const { metadata } = renderResult;
209
+ let cacheControl = metadata.cacheControl;
210
+ // Apply the `expireTime` fallback as soon as we have the
211
+ // render's `cacheControl`, so every downstream consumer (the
212
+ // cache stored via `incrementalCache.set`, the response
213
+ // Cache-Control header, the outgoing entry returned from this
214
+ // responseGenerator) sees a finalized `cacheControl` with a
215
+ // populated `expire`. This mirrors the build-time fallback in
216
+ // `build/index.ts` so we don't apply an expire to routes that
217
+ // opt out of revalidation entirely (`revalidate: false`) or
218
+ // that are dynamic (`revalidate: 0`).
219
+ if (cacheControl && cacheControl.revalidate !== false && cacheControl.revalidate > 0 && cacheControl.expire === undefined) {
220
+ cacheControl.expire = nextConfig.expireTime;
221
+ }
222
+ if ('isNotFound' in metadata && metadata.isNotFound) {
223
+ return {
224
+ value: null,
225
+ cacheControl
226
+ };
227
+ }
228
+ // Handle `isRedirect`.
229
+ if (metadata.isRedirect) {
230
+ return {
231
+ value: {
232
+ kind: CachedRouteKind.REDIRECT,
233
+ props: metadata.pageData ?? metadata.flightData
234
+ },
235
+ cacheControl
236
+ };
237
+ }
238
+ return {
239
+ value: {
240
+ kind: CachedRouteKind.PAGES,
241
+ html: renderResult,
242
+ pageData: renderResult.metadata.pageData,
243
+ headers: renderResult.metadata.headers,
244
+ status: renderResult.metadata.statusCode
245
+ },
246
+ cacheControl
247
+ };
248
+ });
249
+ } catch (err) {
250
+ // if this is a background revalidate we need to report
251
+ // the request error here as it won't be bubbled
252
+ if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
253
+ const silenceLog = false;
254
+ await routeModule.onRequestError(req, err, {
255
+ routerKind: 'Pages Router',
256
+ routePath: srcPage,
257
+ routeType: 'render',
258
+ revalidateReason: getRevalidateReason({
259
+ isStaticGeneration: hasStaticProps,
260
+ isOnDemandRevalidate
261
+ })
262
+ }, silenceLog, routerServerContext);
263
+ }
264
+ throw err;
265
+ }
266
+ };
267
+ // if we've already generated this page we no longer
268
+ // serve the fallback
269
+ if (previousCacheEntry) {
270
+ isIsrFallback = false;
271
+ }
272
+ if (isIsrFallback) {
273
+ const fallbackResponse = await routeModule.getResponseCache(req).get(routeModule.isDev ? null : locale ? `/${locale}${srcPage}` : srcPage, async ({ previousCacheEntry: previousFallbackCacheEntry = null })=>{
274
+ if (!routeModule.isDev) {
275
+ return toResponseCacheEntry(previousFallbackCacheEntry);
276
+ }
277
+ return doRender();
278
+ }, {
279
+ routeKind: RouteKind.PAGES,
280
+ isFallback: true,
281
+ isRoutePPREnabled: false,
282
+ isOnDemandRevalidate: false,
283
+ incrementalCache: await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode),
284
+ waitUntil: ctx.waitUntil
285
+ });
286
+ if (fallbackResponse !== null && 'error' in fallbackResponse) {
287
+ throw fallbackResponse.error;
288
+ }
289
+ if (fallbackResponse) {
290
+ // Remove the cache control from the response to prevent it from being
291
+ // used in the surrounding cache.
292
+ delete fallbackResponse.cacheControl;
293
+ fallbackResponse.isMiss = true;
294
+ return fallbackResponse;
295
+ }
296
+ }
297
+ if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
298
+ res.statusCode = 404;
299
+ // on-demand revalidate always sets this header
300
+ res.setHeader('x-nextjs-cache', 'REVALIDATED');
301
+ res.end('This page could not be found');
302
+ return null;
303
+ }
304
+ if (isIsrFallback && (previousCacheEntry == null ? void 0 : (_previousCacheEntry_value = previousCacheEntry.value) == null ? void 0 : _previousCacheEntry_value.kind) === CachedRouteKind.PAGES) {
305
+ return {
306
+ value: {
307
+ kind: CachedRouteKind.PAGES,
308
+ html: new RenderResult(previousCacheEntry.value.html, {
309
+ contentType: HTML_CONTENT_TYPE_HEADER,
310
+ metadata: {
311
+ statusCode: previousCacheEntry.value.status,
312
+ headers: previousCacheEntry.value.headers
313
+ }
314
+ }),
315
+ pageData: {},
316
+ status: previousCacheEntry.value.status,
317
+ headers: previousCacheEntry.value.headers
318
+ },
319
+ cacheControl: {
320
+ revalidate: 0,
321
+ expire: undefined
322
+ }
323
+ };
324
+ }
325
+ return doRender();
326
+ };
327
+ try {
328
+ const result = await routeModule.handleResponse({
329
+ cacheKey,
330
+ req,
331
+ nextConfig,
332
+ routeKind: RouteKind.PAGES,
333
+ isOnDemandRevalidate,
334
+ revalidateOnlyGenerated,
335
+ waitUntil: ctx.waitUntil,
336
+ responseGenerator: responseGenerator,
337
+ previewProps,
338
+ prerenderManifest,
339
+ isMinimalMode
340
+ });
341
+ if (result !== null && 'error' in result) {
342
+ throw result.error;
343
+ }
344
+ // if we got a cache hit this wasn't an ISR fallback
345
+ // but it wasn't generated during build so isn't in the
346
+ // prerender-manifest
347
+ if (isIsrFallback && !(result == null ? void 0 : result.isMiss)) {
348
+ isIsrFallback = false;
349
+ }
350
+ // response is finished is no cache entry
351
+ if (!result) {
352
+ return;
353
+ }
354
+ if (hasStaticProps && !isMinimalMode) {
355
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : result.isMiss ? 'MISS' : result.isStale ? 'STALE' : 'HIT');
356
+ }
357
+ let cacheControl;
358
+ if (!hasStaticProps || isIsrFallback) {
359
+ if (!res.getHeader('Cache-Control')) {
360
+ cacheControl = {
361
+ revalidate: 0,
362
+ expire: undefined
363
+ };
364
+ }
365
+ } else if (is404Page) {
366
+ const notFoundRevalidate = getRequestMeta(req, 'notFoundRevalidate');
367
+ cacheControl = {
368
+ revalidate: typeof notFoundRevalidate === 'undefined' ? 0 : notFoundRevalidate,
369
+ expire: undefined
370
+ };
371
+ } else if (is500Page) {
372
+ cacheControl = {
373
+ revalidate: 0,
374
+ expire: undefined
375
+ };
376
+ } else if (result.cacheControl) {
377
+ // If the cache entry has a cache control with a revalidate value that's
378
+ // a number, use it.
379
+ if (typeof result.cacheControl.revalidate === 'number') {
380
+ if (result.cacheControl.revalidate < 1) {
381
+ throw new Error(`Invalid revalidate configuration provided: ${result.cacheControl.revalidate} < 1`);
382
+ }
383
+ cacheControl = {
384
+ revalidate: result.cacheControl.revalidate,
385
+ expire: result.cacheControl.expire
386
+ };
387
+ } else {
388
+ // revalidate: false
389
+ cacheControl = {
390
+ revalidate: CACHE_ONE_YEAR_SECONDS,
391
+ expire: undefined
392
+ };
393
+ }
394
+ }
395
+ // If cache control is already set on the response we don't
396
+ // override it to allow users to customize it via next.config
397
+ if (cacheControl && !res.getHeader('Cache-Control')) {
398
+ res.setHeader('Cache-Control', getCacheControlHeader(cacheControl));
399
+ }
400
+ // notFound: true case
401
+ if (!result.value) {
402
+ var _result_cacheControl;
403
+ // add revalidate metadata before rendering 404 page
404
+ // so that we can use this as source of truth for the
405
+ // cache-control header instead of what the 404 page returns
406
+ // for the revalidate value
407
+ addRequestMeta(req, 'notFoundRevalidate', (_result_cacheControl = result.cacheControl) == null ? void 0 : _result_cacheControl.revalidate);
408
+ res.statusCode = 404;
409
+ if (isNextDataRequest) {
410
+ if (deploymentId) {
411
+ res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId);
412
+ }
413
+ res.end('{"notFound":true}');
414
+ return;
415
+ }
416
+ return await render404();
417
+ }
418
+ if (result.value.kind === CachedRouteKind.REDIRECT) {
419
+ if (isNextDataRequest) {
420
+ if (deploymentId) {
421
+ res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId);
422
+ }
423
+ res.setHeader('content-type', JSON_CONTENT_TYPE_HEADER);
424
+ res.end(JSON.stringify(result.value.props));
425
+ return;
426
+ } else {
427
+ const handleRedirect = (pageData)=>{
428
+ const redirect = {
429
+ destination: pageData.pageProps.__N_REDIRECT,
430
+ statusCode: pageData.pageProps.__N_REDIRECT_STATUS,
431
+ basePath: pageData.pageProps.__N_REDIRECT_BASE_PATH
432
+ };
433
+ const statusCode = getRedirectStatus(redirect);
434
+ const { basePath } = nextConfig;
435
+ if (basePath && redirect.basePath !== false && redirect.destination.startsWith('/')) {
436
+ redirect.destination = `${basePath}${redirect.destination}`;
437
+ }
438
+ if (redirect.destination.startsWith('/')) {
439
+ redirect.destination = normalizeRepeatedSlashes(redirect.destination);
440
+ }
441
+ res.statusCode = statusCode;
442
+ res.setHeader('Location', redirect.destination);
443
+ if (statusCode === RedirectStatusCode.PermanentRedirect) {
444
+ res.setHeader('Refresh', `0;url=${redirect.destination}`);
445
+ }
446
+ res.end(redirect.destination);
447
+ };
448
+ await handleRedirect(result.value.props);
449
+ return null;
450
+ }
451
+ }
452
+ if (result.value.kind !== CachedRouteKind.PAGES) {
453
+ throw new Error(`Invariant: received non-pages cache entry in pages handler`);
454
+ }
455
+ // Documents and data responses must not be stored in development.
456
+ // Browsers reuse a stored response for a history navigation without
457
+ // revalidating it, so a back navigation would restore a page from
458
+ // before the latest edit. Static assets never reach this code. They
459
+ // keep a revalidatable `Cache-Control`, so the browser caches them
460
+ // between page loads.
461
+ if (routeModule.isDev) {
462
+ res.setHeader('Cache-Control', 'no-store');
463
+ }
464
+ // Draft mode should never be cached
465
+ if (isDraftMode) {
466
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
467
+ }
468
+ // when invoking _error before pages/500 we don't actually
469
+ // send the _error response
470
+ if (getRequestMeta(req, 'customErrorRender') || isErrorPage && isMinimalMode && res.statusCode === 500) {
471
+ return null;
472
+ }
473
+ // Add deployment ID header for data requests
474
+ if (isNextDataRequest && !isErrorPage && !is500Page) {
475
+ if (deploymentId) {
476
+ res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId);
477
+ }
478
+ }
479
+ await sendRenderResult({
480
+ req,
481
+ res,
482
+ // If we are rendering the error page it's not a data request
483
+ // anymore
484
+ result: isNextDataRequest && !isErrorPage && !is500Page ? new RenderResult(JSON.stringify(result.value.pageData), {
485
+ contentType: JSON_CONTENT_TYPE_HEADER,
486
+ metadata: result.value.html.metadata
487
+ }) : result.value.html,
488
+ generateEtags: nextConfig.generateEtags,
489
+ poweredByHeader: nextConfig.poweredByHeader,
490
+ cacheControl: routeModule.isDev ? undefined : cacheControl
491
+ });
492
+ } catch (err) {
493
+ if (!(err instanceof NoFallbackError)) {
494
+ const silenceLog = false;
495
+ await routeModule.onRequestError(req, err, {
496
+ routerKind: 'Pages Router',
497
+ routePath: srcPage,
498
+ routeType: 'render',
499
+ revalidateReason: getRevalidateReason({
500
+ isStaticGeneration: hasStaticProps,
501
+ isOnDemandRevalidate
502
+ })
503
+ }, silenceLog, routerServerContext);
504
+ }
505
+ // rethrow so that we can handle serving error page
506
+ throw err;
507
+ } finally{
508
+ // An IIFE to make early returns easier.
509
+ ;
510
+ (()=>{
511
+ if (!span) return;
512
+ span.setAttributes({
513
+ 'http.status_code': res.statusCode,
514
+ 'next.rsc': false
515
+ });
516
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
517
+ // We were unable to get attributes, probably OTEL is not enabled
518
+ if (!rootSpanAttributes) {
519
+ return;
520
+ }
521
+ if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {
522
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
523
+ return;
524
+ }
525
+ const route = rootSpanAttributes.get('next.route') || srcPage;
526
+ const name = `${method} ${route}`;
527
+ span.setAttributes({
528
+ 'next.route': route,
529
+ 'http.route': route,
530
+ 'next.span_name': name
531
+ });
532
+ span.updateName(name);
533
+ // Propagate http.route to the parent span if one exists
534
+ // (e.g. a platform-created HTTP span in adapter
535
+ // deployments).
536
+ if (parentSpan && parentSpan !== span) {
537
+ parentSpan.setAttribute('http.route', route);
538
+ parentSpan.updateName(name);
539
+ }
540
+ })();
541
+ }
542
+ };
543
+ // TODO: activeSpan code path is for when wrapped by
544
+ // next-server can be removed when this is no longer used
545
+ if (isWrappedByNextServer && activeSpan) {
546
+ await handleResponse(activeSpan);
547
+ } else {
548
+ parentSpan = tracer.getActiveScopeSpan();
549
+ await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {
550
+ spanName: `${method} ${srcPage}`,
551
+ kind: SpanKind.SERVER,
552
+ attributes: {
553
+ 'http.method': method,
554
+ 'http.target': req.url
555
+ }
556
+ }, handleResponse), undefined, !isWrappedByNextServer);
557
+ }
558
+ };
559
+ };
560
+
561
+ //# sourceMappingURL=pages-handler.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/pages-handler.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../src/server/route-modules/pages/pages-handler.ts"],"sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { ParsedUrlQuery } from 'node:querystring'\nimport { RouteKind } from '../../route-kind'\nimport { BaseServerSpan } from '../../lib/trace/constants'\nimport { getTracer, SpanKind, type Span } from '../../lib/trace/tracer'\nimport { formatUrl } from '../../../shared/lib/router/utils/format-url'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../request-meta'\nimport { interopDefault } from '../../app-render/interop-default'\nimport { getRevalidateReason } from '../../instrumentation/utils'\nimport { normalizeDataPath } from '../../../shared/lib/page-path/normalize-data-path'\nimport {\n CachedRouteKind,\n type CachedPageValue,\n type CachedRedirectValue,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../response-cache'\n\nimport {\n getCacheControlHeader,\n type CacheControl,\n} from '../../lib/cache-control'\nimport { normalizeRepeatedSlashes } from '../../../shared/lib/utils'\nimport { getRedirectStatus } from '../../../lib/redirect-status'\nimport {\n CACHE_ONE_YEAR_SECONDS,\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n NEXT_NAV_DEPLOYMENT_ID_HEADER,\n} from '../../../lib/constants'\nimport path from 'path'\nimport { sendRenderResult } from '../../send-payload'\nimport RenderResult from '../../render-result'\nimport { toResponseCacheEntry } from '../../response-cache/utils'\nimport { NoFallbackError } from '../../../shared/lib/no-fallback-error.external'\nimport { RedirectStatusCode } from '../../../client/components/redirect-status-code'\nimport { isBot } from '../../../shared/lib/router/utils/is-bot'\nimport { addPathPrefix } from '../../../shared/lib/router/utils/add-path-prefix'\nimport { removeTrailingSlash } from '../../../shared/lib/router/utils/remove-trailing-slash'\nimport { isRouteCacheOwner } from '../../lib/route-cache-key'\nimport type { PagesRouteModule } from './module.compiled'\nimport type {\n GetServerSideProps,\n GetStaticPaths,\n GetStaticProps,\n} from '../../../types'\n\nexport const getHandler = ({\n srcPage: originalSrcPage,\n config,\n userland,\n routeModule,\n isFallbackError,\n getStaticPaths,\n getStaticProps,\n getServerSideProps,\n}: {\n srcPage: string\n config: Record<string, any> | undefined\n userland: any\n isFallbackError?: boolean\n routeModule: PagesRouteModule\n getStaticProps?: GetStaticProps\n getStaticPaths?: GetStaticPaths\n getServerSideProps?: GetServerSideProps\n}) => {\n return async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n ) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(\n req,\n 'devRequestTimingInternalsEnd',\n process.hrtime.bigint()\n )\n }\n let srcPage = originalSrcPage\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return\n }\n\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n // When the Pages and App Routers coexist, a Pages Router 404 renders\n // the App Router not-found page. A direct route-module invocation\n // cannot provide the postponed state needed to resume that App Router\n // output, so an empty postponed state signals that the renderer must\n // perform a complete dynamic render instead.\n //\n // TODO: Re-enter routing with the App Router not-found output so its\n // prerender and postponed state can be selected and resumed.\n if (\n nextConfig.cacheComponents &&\n !routerServerContext.isWrappedByNextServer &&\n typeof getRequestMeta(req, 'postponed') !== 'string'\n ) {\n addRequestMeta(req, 'postponed', '')\n }\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n }\n\n const {\n buildId,\n query,\n params,\n parsedUrl,\n originalQuery,\n originalPathname,\n buildManifest,\n fallbackBuildManifest,\n nextFontManifest,\n serverFilesManifest,\n reactLoadableManifest,\n prerenderManifest,\n previewProps,\n isDraftMode,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n locale,\n locales,\n defaultLocale,\n routerServerContext,\n nextConfig,\n resolvedPathname,\n encodedResolvedPathname,\n deploymentId,\n clientAssetToken,\n } = prepareResult\n\n const isExperimentalCompile =\n serverFilesManifest?.config?.experimental?.isExperimentalCompile\n\n const hasServerProps = Boolean(getServerSideProps)\n const hasStaticProps = Boolean(getStaticProps)\n const hasStaticPaths = Boolean(getStaticPaths)\n const hasGetInitialProps = Boolean(\n (userland.default || userland).getInitialProps\n )\n let cacheKey: null | string = null\n let isIsrFallback = false\n let isNextDataRequest =\n prepareResult.isNextDataRequest && (hasStaticProps || hasServerProps)\n\n const is404Page = srcPage === '/404'\n const is500Page = srcPage === '/500'\n const isErrorPage = srcPage === '/_error'\n\n if (!routeModule.isDev && !isDraftMode && hasStaticProps) {\n cacheKey = `${locale ? `/${locale}` : ''}${\n (srcPage === '/' || resolvedPathname === '/') && locale\n ? ''\n : resolvedPathname\n }`\n\n if (is404Page || is500Page || isErrorPage) {\n cacheKey = `${locale ? `/${locale}` : ''}${srcPage}`\n }\n\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n if (hasStaticPaths && !isDraftMode) {\n const decodedPathname = removeTrailingSlash(\n locale\n ? addPathPrefix(resolvedPathname, `/${locale}`)\n : resolvedPathname\n )\n const isPrerendered =\n (Boolean(prerenderManifest.routes[decodedPathname]) ||\n prerenderManifest.notFoundRoutes.includes(decodedPathname)) &&\n // A sibling's positive or negative prerender cannot admit parameters\n // that this route excluded. Development computes static paths on demand\n // instead of reading build-time prerender metadata.\n (routeModule.isDev ||\n isRouteCacheOwner(\n decodedPathname,\n routeModule.cacheOwner,\n prerenderManifest.routes[decodedPathname],\n nextConfig.i18n?.locales\n ))\n\n const prerenderInfo = prerenderManifest.dynamicRoutes[srcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n\n if (\n typeof prerenderInfo.fallback === 'string' &&\n !isPrerendered &&\n !isNextDataRequest\n ) {\n isIsrFallback = true\n }\n }\n }\n\n // When serving a bot request, we want to serve a blocking render and not\n // the prerendered page. This ensures that the correct content is served\n // to the bot in the head.\n if (\n (isIsrFallback && isBot(req.headers['user-agent'] || '')) ||\n isMinimalMode\n ) {\n isIsrFallback = false\n }\n\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n\n const method = req.method || 'GET'\n\n const resolvedUrl = formatUrl({\n pathname: nextConfig.trailingSlash\n ? `${encodedResolvedPathname}${!encodedResolvedPathname.endsWith('/') && parsedUrl.pathname?.endsWith('/') ? '/' : ''}`\n : removeTrailingSlash(encodedResolvedPathname || '/'),\n // make sure to only add query values from original URL\n query: hasStaticProps ? {} : originalQuery,\n })\n\n let parentSpan: Span | undefined\n const handleResponse = async (span?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n const doRender = async () => {\n try {\n return await routeModule\n .render(req, res, {\n query:\n hasStaticProps && !isExperimentalCompile\n ? ({\n ...params,\n } as ParsedUrlQuery)\n : {\n ...query,\n ...params,\n },\n params,\n page: srcPage,\n renderContext: {\n isDraftMode,\n isFallback: isIsrFallback,\n developmentNotFoundSourcePage: getRequestMeta(\n req,\n 'developmentNotFoundSourcePage'\n ),\n },\n sharedContext: {\n buildId,\n customServer:\n Boolean(routerServerContext?.isCustomServer) || undefined,\n deploymentId,\n clientAssetToken,\n },\n renderOpts: {\n params,\n routeModule,\n page: srcPage,\n pageConfig: config || {},\n Component: interopDefault(userland),\n ComponentMod: userland,\n getStaticProps,\n getStaticPaths,\n getServerSideProps,\n supportsDynamicResponse: !hasStaticProps,\n buildManifest: isFallbackError\n ? fallbackBuildManifest\n : buildManifest,\n nextFontManifest,\n reactLoadableManifest,\n\n assetPrefix: routeModule.getAssetPrefixForRender(\n routerServerContext,\n nextConfig.assetPrefix\n ),\n previewProps,\n images: nextConfig.images as any,\n nextConfigOutput: nextConfig.output,\n optimizeCss: Boolean(nextConfig.experimental.optimizeCss),\n nextScriptWorkers: Boolean(\n nextConfig.experimental.nextScriptWorkers\n ),\n domainLocales: nextConfig.i18n?.domains,\n crossOrigin: nextConfig.crossOrigin,\n\n multiZoneDraftMode,\n basePath: nextConfig.basePath,\n disableOptimizedLoading:\n nextConfig.experimental.disableOptimizedLoading,\n largePageDataBytes:\n nextConfig.experimental.largePageDataBytes,\n\n isExperimentalCompile,\n\n experimental: {\n clientTraceMetadata:\n nextConfig.experimental.clientTraceMetadata ||\n ([] as any),\n },\n\n locale,\n locales,\n defaultLocale,\n setIsrStatus: routerServerContext?.setIsrStatus,\n\n isNextDataRequest:\n isNextDataRequest && (hasServerProps || hasStaticProps),\n\n resolvedUrl,\n // For getServerSideProps and getInitialProps we need to ensure we use the original URL\n // and not the resolved URL to prevent a hydration mismatch on\n // asPath\n resolvedAsPath:\n hasServerProps || hasGetInitialProps\n ? formatUrl({\n // we use the original URL pathname less the _next/data prefix if\n // present\n pathname: isNextDataRequest\n ? normalizeDataPath(originalPathname)\n : originalPathname,\n query: originalQuery,\n })\n : resolvedUrl,\n\n isOnDemandRevalidate,\n\n ErrorDebug: getRequestMeta(req, 'PagesErrorDebug'),\n err: getRequestMeta(req, 'invokeError'),\n\n // needed for experimental.optimizeCss feature\n distDir: path.join(\n /* turbopackIgnore: true */\n process.cwd(),\n routeModule.relativeProjectDir,\n routeModule.distDir\n ),\n },\n })\n .then((renderResult): ResponseCacheEntry => {\n const { metadata } = renderResult\n\n let cacheControl: CacheControl | undefined =\n metadata.cacheControl\n\n // Apply the `expireTime` fallback as soon as we have the\n // render's `cacheControl`, so every downstream consumer (the\n // cache stored via `incrementalCache.set`, the response\n // Cache-Control header, the outgoing entry returned from this\n // responseGenerator) sees a finalized `cacheControl` with a\n // populated `expire`. This mirrors the build-time fallback in\n // `build/index.ts` so we don't apply an expire to routes that\n // opt out of revalidation entirely (`revalidate: false`) or\n // that are dynamic (`revalidate: 0`).\n if (\n cacheControl &&\n cacheControl.revalidate !== false &&\n cacheControl.revalidate > 0 &&\n cacheControl.expire === undefined\n ) {\n cacheControl.expire = nextConfig.expireTime\n }\n\n if ('isNotFound' in metadata && metadata.isNotFound) {\n return {\n value: null,\n cacheControl,\n } satisfies ResponseCacheEntry\n }\n\n // Handle `isRedirect`.\n if (metadata.isRedirect) {\n return {\n value: {\n kind: CachedRouteKind.REDIRECT,\n props: metadata.pageData ?? metadata.flightData,\n } satisfies CachedRedirectValue,\n cacheControl,\n } satisfies ResponseCacheEntry\n }\n\n return {\n value: {\n kind: CachedRouteKind.PAGES,\n html: renderResult,\n pageData: renderResult.metadata.pageData,\n headers: renderResult.metadata.headers,\n status: renderResult.metadata.statusCode,\n },\n cacheControl,\n }\n })\n } catch (err: unknown) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'Pages Router',\n routePath: srcPage,\n routeType: 'render',\n revalidateReason: getRevalidateReason({\n isStaticGeneration: hasStaticProps,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n // if we've already generated this page we no longer\n // serve the fallback\n if (previousCacheEntry) {\n isIsrFallback = false\n }\n\n if (isIsrFallback) {\n const fallbackResponse = await routeModule.getResponseCache(req).get(\n routeModule.isDev\n ? null\n : locale\n ? `/${locale}${srcPage}`\n : srcPage,\n async ({\n previousCacheEntry: previousFallbackCacheEntry = null,\n }) => {\n if (!routeModule.isDev) {\n return toResponseCacheEntry(previousFallbackCacheEntry)\n }\n return doRender()\n },\n {\n routeKind: RouteKind.PAGES,\n isFallback: true,\n isRoutePPREnabled: false,\n isOnDemandRevalidate: false,\n incrementalCache: await routeModule.getIncrementalCache(\n req,\n nextConfig,\n previewProps,\n prerenderManifest,\n isMinimalMode\n ),\n waitUntil: ctx.waitUntil,\n }\n )\n if (fallbackResponse !== null && 'error' in fallbackResponse) {\n throw fallbackResponse.error\n }\n\n if (fallbackResponse) {\n // Remove the cache control from the response to prevent it from being\n // used in the surrounding cache.\n delete fallbackResponse.cacheControl\n fallbackResponse.isMiss = true\n return fallbackResponse\n }\n }\n\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n if (\n isIsrFallback &&\n previousCacheEntry?.value?.kind === CachedRouteKind.PAGES\n ) {\n return {\n value: {\n kind: CachedRouteKind.PAGES,\n html: new RenderResult(previousCacheEntry.value.html, {\n contentType: HTML_CONTENT_TYPE_HEADER,\n metadata: {\n statusCode: previousCacheEntry.value.status,\n headers: previousCacheEntry.value.headers,\n },\n }),\n pageData: {},\n status: previousCacheEntry.value.status,\n headers: previousCacheEntry.value.headers,\n } satisfies CachedPageValue,\n cacheControl: { revalidate: 0, expire: undefined },\n } satisfies ResponseCacheEntry\n }\n return doRender()\n }\n\n try {\n const result = await routeModule.handleResponse({\n cacheKey,\n req,\n nextConfig,\n routeKind: RouteKind.PAGES,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n waitUntil: ctx.waitUntil,\n responseGenerator: responseGenerator,\n previewProps,\n prerenderManifest,\n isMinimalMode,\n })\n\n if (result !== null && 'error' in result) {\n throw result.error\n }\n\n // if we got a cache hit this wasn't an ISR fallback\n // but it wasn't generated during build so isn't in the\n // prerender-manifest\n if (isIsrFallback && !result?.isMiss) {\n isIsrFallback = false\n }\n\n // response is finished is no cache entry\n if (!result) {\n return\n }\n\n if (hasStaticProps && !isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : result.isMiss\n ? 'MISS'\n : result.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n let cacheControl: CacheControl | undefined\n\n if (!hasStaticProps || isIsrFallback) {\n if (!res.getHeader('Cache-Control')) {\n cacheControl = { revalidate: 0, expire: undefined }\n }\n } else if (is404Page) {\n const notFoundRevalidate = getRequestMeta(req, 'notFoundRevalidate')\n\n cacheControl = {\n revalidate:\n typeof notFoundRevalidate === 'undefined'\n ? 0\n : notFoundRevalidate,\n expire: undefined,\n }\n } else if (is500Page) {\n cacheControl = { revalidate: 0, expire: undefined }\n } else if (result.cacheControl) {\n // If the cache entry has a cache control with a revalidate value that's\n // a number, use it.\n if (typeof result.cacheControl.revalidate === 'number') {\n if (result.cacheControl.revalidate < 1) {\n throw new Error(\n `Invalid revalidate configuration provided: ${result.cacheControl.revalidate} < 1`\n )\n }\n cacheControl = {\n revalidate: result.cacheControl.revalidate,\n expire: result.cacheControl.expire,\n }\n } else {\n // revalidate: false\n cacheControl = {\n revalidate: CACHE_ONE_YEAR_SECONDS,\n expire: undefined,\n }\n }\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheControl && !res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', getCacheControlHeader(cacheControl))\n }\n\n // notFound: true case\n if (!result.value) {\n // add revalidate metadata before rendering 404 page\n // so that we can use this as source of truth for the\n // cache-control header instead of what the 404 page returns\n // for the revalidate value\n addRequestMeta(\n req,\n 'notFoundRevalidate',\n result.cacheControl?.revalidate\n )\n\n res.statusCode = 404\n\n if (isNextDataRequest) {\n if (deploymentId) {\n res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId)\n }\n res.end('{\"notFound\":true}')\n return\n }\n return await render404()\n }\n\n if (result.value.kind === CachedRouteKind.REDIRECT) {\n if (isNextDataRequest) {\n if (deploymentId) {\n res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId)\n }\n res.setHeader('content-type', JSON_CONTENT_TYPE_HEADER)\n res.end(JSON.stringify(result.value.props))\n return\n } else {\n const handleRedirect = (pageData: any) => {\n const redirect = {\n destination: pageData.pageProps.__N_REDIRECT,\n statusCode: pageData.pageProps.__N_REDIRECT_STATUS,\n basePath: pageData.pageProps.__N_REDIRECT_BASE_PATH,\n }\n const statusCode = getRedirectStatus(redirect)\n const { basePath } = nextConfig\n\n if (\n basePath &&\n redirect.basePath !== false &&\n redirect.destination.startsWith('/')\n ) {\n redirect.destination = `${basePath}${redirect.destination}`\n }\n\n if (redirect.destination.startsWith('/')) {\n redirect.destination = normalizeRepeatedSlashes(\n redirect.destination\n )\n }\n\n res.statusCode = statusCode\n res.setHeader('Location', redirect.destination)\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n res.setHeader('Refresh', `0;url=${redirect.destination}`)\n }\n res.end(redirect.destination)\n }\n await handleRedirect(result.value.props)\n return null\n }\n }\n\n if (result.value.kind !== CachedRouteKind.PAGES) {\n throw new Error(\n `Invariant: received non-pages cache entry in pages handler`\n )\n }\n\n // Documents and data responses must not be stored in development.\n // Browsers reuse a stored response for a history navigation without\n // revalidating it, so a back navigation would restore a page from\n // before the latest edit. Static assets never reach this code. They\n // keep a revalidatable `Cache-Control`, so the browser caches them\n // between page loads.\n if (routeModule.isDev) {\n res.setHeader('Cache-Control', 'no-store')\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n // when invoking _error before pages/500 we don't actually\n // send the _error response\n if (\n getRequestMeta(req, 'customErrorRender') ||\n (isErrorPage && isMinimalMode && res.statusCode === 500)\n ) {\n return null\n }\n\n // Add deployment ID header for data requests\n if (isNextDataRequest && !isErrorPage && !is500Page) {\n if (deploymentId) {\n res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId)\n }\n }\n\n await sendRenderResult({\n req,\n res,\n // If we are rendering the error page it's not a data request\n // anymore\n result:\n isNextDataRequest && !isErrorPage && !is500Page\n ? new RenderResult(JSON.stringify(result.value.pageData), {\n contentType: JSON_CONTENT_TYPE_HEADER,\n metadata: result.value.html.metadata,\n })\n : result.value.html,\n generateEtags: nextConfig.generateEtags,\n poweredByHeader: nextConfig.poweredByHeader,\n cacheControl: routeModule.isDev ? undefined : cacheControl,\n })\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'Pages Router',\n routePath: srcPage,\n routeType: 'render',\n revalidateReason: getRevalidateReason({\n isStaticGeneration: hasStaticProps,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n throw err\n } finally {\n // An IIFE to make early returns easier.\n ;(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route') || srcPage\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n\n // Propagate http.route to the parent span if one exists\n // (e.g. a platform-created HTTP span in adapter\n // deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n })()\n }\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan)\n } else {\n parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n }\n}\n"],"names":["RouteKind","BaseServerSpan","getTracer","SpanKind","formatUrl","addRequestMeta","getRequestMeta","setRequestMeta","interopDefault","getRevalidateReason","normalizeDataPath","CachedRouteKind","getCacheControlHeader","normalizeRepeatedSlashes","getRedirectStatus","CACHE_ONE_YEAR_SECONDS","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_NAV_DEPLOYMENT_ID_HEADER","path","sendRenderResult","RenderResult","toResponseCacheEntry","NoFallbackError","RedirectStatusCode","isBot","addPathPrefix","removeTrailingSlash","isRouteCacheOwner","getHandler","srcPage","originalSrcPage","config","userland","routeModule","isFallbackError","getStaticPaths","getStaticProps","getServerSideProps","handler","req","res","ctx","serverFilesManifest","parsedUrl","requestMeta","isDev","process","hrtime","bigint","env","TURBOPACK","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","isMinimalMode","Boolean","render404","routerServerContext","nextConfig","cacheComponents","isWrappedByNextServer","buildId","query","params","originalQuery","originalPathname","buildManifest","fallbackBuildManifest","nextFontManifest","reactLoadableManifest","prerenderManifest","previewProps","isDraftMode","isOnDemandRevalidate","revalidateOnlyGenerated","locale","locales","defaultLocale","resolvedPathname","encodedResolvedPathname","deploymentId","clientAssetToken","isExperimentalCompile","experimental","hasServerProps","hasStaticProps","hasStaticPaths","hasGetInitialProps","default","getInitialProps","cacheKey","isIsrFallback","isNextDataRequest","is404Page","is500Page","isErrorPage","decodedPathname","isPrerendered","routes","notFoundRoutes","includes","cacheOwner","i18n","prerenderInfo","dynamicRoutes","fallback","adapterPath","headers","tracer","activeSpan","getActiveScopeSpan","method","resolvedUrl","pathname","trailingSlash","endsWith","parentSpan","handleResponse","span","responseGenerator","previousCacheEntry","doRender","render","page","renderContext","isFallback","developmentNotFoundSourcePage","sharedContext","customServer","isCustomServer","undefined","renderOpts","pageConfig","Component","ComponentMod","supportsDynamicResponse","assetPrefix","getAssetPrefixForRender","images","nextConfigOutput","output","optimizeCss","nextScriptWorkers","domainLocales","domains","crossOrigin","basePath","disableOptimizedLoading","largePageDataBytes","clientTraceMetadata","setIsrStatus","resolvedAsPath","ErrorDebug","err","distDir","join","cwd","relativeProjectDir","then","renderResult","metadata","cacheControl","revalidate","expire","expireTime","isNotFound","value","isRedirect","kind","REDIRECT","props","pageData","flightData","PAGES","html","status","isStale","silenceLog","onRequestError","routerKind","routePath","routeType","revalidateReason","isStaticGeneration","fallbackResponse","getResponseCache","get","previousFallbackCacheEntry","routeKind","isRoutePPREnabled","incrementalCache","getIncrementalCache","error","isMiss","setHeader","contentType","result","getHeader","notFoundRevalidate","Error","JSON","stringify","handleRedirect","redirect","destination","pageProps","__N_REDIRECT","__N_REDIRECT_STATUS","__N_REDIRECT_BASE_PATH","startsWith","PermanentRedirect","generateEtags","poweredByHeader","setAttributes","rootSpanAttributes","getRootSpanAttributes","handleRequest","console","warn","route","name","updateName","setAttribute","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"AAEA,SAASA,SAAS,QAAQ,mBAAkB;AAC5C,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAASC,SAAS,EAAEC,QAAQ,QAAmB,yBAAwB;AACvE,SAASC,SAAS,QAAQ,8CAA6C;AACvE,SACEC,cAAc,EACdC,cAAc,EACdC,cAAc,QAET,qBAAoB;AAC3B,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,mBAAmB,QAAQ,8BAA6B;AACjE,SAASC,iBAAiB,QAAQ,oDAAmD;AACrF,SACEC,eAAe,QAKV,uBAAsB;AAE7B,SACEC,qBA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cH;wBACtCvG,WAAWyG,UAAU,CAACD;oBACxB;gBACF,CAAA;YACF;QACF;QAEA,oDAAoD;QACpD,yDAAyD;QACzD,IAAIhK,yBAAyBiD,YAAY;YACvC,MAAMQ,eAAeR;QACvB,OAAO;YACLO,aAAaR,OAAOE,kBAAkB;YACtC,MAAMF,OAAOmH,qBAAqB,CAChC/L,IAAI2E,OAAO,EACX,IACEC,OAAOoH,KAAK,CACVvO,eAAe+N,aAAa,EAC5B;oBACES,UAAU,GAAGlH,OAAO,CAAC,EAAEzF,SAAS;oBAChCkJ,MAAM7K,SAASuO,MAAM;oBACrBC,YAAY;wBACV,eAAepH;wBACf,eAAe/E,IAAIoM,GAAG;oBACxB;gBACF,GACA/G,iBAEJa,WACA,CAACtE;QAEL;IACF;AACF,EAAC","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/app-router-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].AppRouterContext;
2
+
3
+ //# sourceMappingURL=app-router-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/app-router-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/app-router-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].AppRouterContext\n"],"names":["module","exports","require","vendored","AppRouterContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,gBAAgB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/entrypoints.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export * as RouterContext from '../../../../../shared/lib/router-context.shared-runtime';
2
+ export * as LoadableContext from '../../../../../shared/lib/loadable-context.shared-runtime';
3
+ export * as Loadable from '../../../../../shared/lib/loadable.shared-runtime';
4
+ export * as ImageConfigContext from '../../../../../shared/lib/image-config-context.shared-runtime';
5
+ export * as HtmlContext from '../../../../../shared/lib/html-context.shared-runtime';
6
+ export * as HooksClientContext from '../../../../../shared/lib/hooks-client-context.shared-runtime';
7
+ export * as HeadManagerContext from '../../../../../shared/lib/head-manager-context.shared-runtime';
8
+ export * as AppRouterContext from '../../../../../shared/lib/app-router-context.shared-runtime';
9
+ export * as ServerInsertedHtml from '../../../../../shared/lib/server-inserted-html.shared-runtime';
10
+
11
+ //# sourceMappingURL=entrypoints.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/entrypoints.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/entrypoints.ts"],"sourcesContent":["export * as RouterContext from '../../../../../shared/lib/router-context.shared-runtime'\nexport * as LoadableContext from '../../../../../shared/lib/loadable-context.shared-runtime'\nexport * as Loadable from '../../../../../shared/lib/loadable.shared-runtime'\nexport * as ImageConfigContext from '../../../../../shared/lib/image-config-context.shared-runtime'\nexport * as HtmlContext from '../../../../../shared/lib/html-context.shared-runtime'\nexport * as HooksClientContext from '../../../../../shared/lib/hooks-client-context.shared-runtime'\nexport * as HeadManagerContext from '../../../../../shared/lib/head-manager-context.shared-runtime'\nexport * as AppRouterContext from '../../../../../shared/lib/app-router-context.shared-runtime'\nexport * as ServerInsertedHtml from '../../../../../shared/lib/server-inserted-html.shared-runtime'\n"],"names":["RouterContext","LoadableContext","Loadable","ImageConfigContext","HtmlContext","HooksClientContext","HeadManagerContext","AppRouterContext","ServerInsertedHtml"],"mappings":"AAAA,OAAO,KAAKA,aAAa,MAAM,0DAAyD;AACxF,OAAO,KAAKC,eAAe,MAAM,4DAA2D;AAC5F,OAAO,KAAKC,QAAQ,MAAM,oDAAmD;AAC7E,OAAO,KAAKC,kBAAkB,MAAM,gEAA+D;AACnG,OAAO,KAAKC,WAAW,MAAM,wDAAuD;AACpF,OAAO,KAAKC,kBAAkB,MAAM,gEAA+D;AACnG,OAAO,KAAKC,kBAAkB,MAAM,gEAA+D;AACnG,OAAO,KAAKC,gBAAgB,MAAM,8DAA6D;AAC/F,OAAO,KAAKC,kBAAkB,MAAM,gEAA+D","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/head-manager-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].HeadManagerContext;
2
+
3
+ //# sourceMappingURL=head-manager-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/head-manager-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/head-manager-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].HeadManagerContext\n"],"names":["module","exports","require","vendored","HeadManagerContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,kBAAkB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/hooks-client-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].HooksClientContext;
2
+
3
+ //# sourceMappingURL=hooks-client-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/hooks-client-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/hooks-client-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].HooksClientContext\n"],"names":["module","exports","require","vendored","HooksClientContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,kBAAkB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/html-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].HtmlContext;
2
+
3
+ //# sourceMappingURL=html-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/html-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/html-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].HtmlContext\n"],"names":["module","exports","require","vendored","HtmlContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,WAAW","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/image-config-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].ImageConfigContext;
2
+
3
+ //# sourceMappingURL=image-config-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/image-config-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/image-config-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].ImageConfigContext\n"],"names":["module","exports","require","vendored","ImageConfigContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,kBAAkB","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable-context.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].LoadableContext;
2
+
3
+ //# sourceMappingURL=loadable-context.js.map
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable-context.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/loadable-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].LoadableContext\n"],"names":["module","exports","require","vendored","LoadableContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,eAAe","ignoreList":[0]}
e-commerce/node_modules/next/dist/esm/server/route-modules/pages/vendored/contexts/loadable.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ module.exports = require('../../module.compiled').vendored['contexts'].Loadable;
2
+
3
+ //# sourceMappingURL=loadable.js.map