vinext 0.0.38 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/README.md +33 -20
  2. package/dist/build/nitro-route-rules.d.ts +50 -0
  3. package/dist/build/nitro-route-rules.js +81 -0
  4. package/dist/build/nitro-route-rules.js.map +1 -0
  5. package/dist/build/precompress.d.ts +17 -0
  6. package/dist/build/precompress.js +102 -0
  7. package/dist/build/precompress.js.map +1 -0
  8. package/dist/build/prerender.d.ts +27 -22
  9. package/dist/build/prerender.js +17 -17
  10. package/dist/build/prerender.js.map +1 -1
  11. package/dist/build/report.d.ts +3 -4
  12. package/dist/build/report.js.map +1 -1
  13. package/dist/build/run-prerender.d.ts +3 -4
  14. package/dist/build/run-prerender.js.map +1 -1
  15. package/dist/build/standalone.d.ts +32 -0
  16. package/dist/build/standalone.js +199 -0
  17. package/dist/build/standalone.js.map +1 -0
  18. package/dist/build/static-export.d.ts +17 -29
  19. package/dist/build/static-export.js.map +1 -1
  20. package/dist/check.d.ts +4 -4
  21. package/dist/check.js +1 -1
  22. package/dist/check.js.map +1 -1
  23. package/dist/cli.js +31 -4
  24. package/dist/cli.js.map +1 -1
  25. package/dist/client/instrumentation-client.d.ts +2 -2
  26. package/dist/client/instrumentation-client.js.map +1 -1
  27. package/dist/client/vinext-next-data.d.ts +5 -8
  28. package/dist/cloudflare/index.js +1 -1
  29. package/dist/cloudflare/kv-cache-handler.d.ts +5 -3
  30. package/dist/cloudflare/kv-cache-handler.js +1 -1
  31. package/dist/cloudflare/kv-cache-handler.js.map +1 -1
  32. package/dist/cloudflare/tpr.d.ts +35 -27
  33. package/dist/cloudflare/tpr.js +36 -12
  34. package/dist/cloudflare/tpr.js.map +1 -1
  35. package/dist/config/config-matchers.d.ts +2 -2
  36. package/dist/config/config-matchers.js +1 -1
  37. package/dist/config/config-matchers.js.map +1 -1
  38. package/dist/config/dotenv.d.ts +4 -4
  39. package/dist/config/dotenv.js.map +1 -1
  40. package/dist/config/next-config.d.ts +40 -61
  41. package/dist/config/next-config.js +5 -4
  42. package/dist/config/next-config.js.map +1 -1
  43. package/dist/deploy.d.ts +25 -41
  44. package/dist/deploy.js +1 -1
  45. package/dist/deploy.js.map +1 -1
  46. package/dist/entries/app-rsc-entry.d.ts +6 -10
  47. package/dist/entries/app-rsc-entry.js +4 -6
  48. package/dist/entries/app-rsc-entry.js.map +1 -1
  49. package/dist/entries/pages-server-entry.js +1 -3
  50. package/dist/entries/pages-server-entry.js.map +1 -1
  51. package/dist/index.d.ts +23 -33
  52. package/dist/index.js +165 -84
  53. package/dist/index.js.map +1 -1
  54. package/dist/init.d.ts +14 -26
  55. package/dist/init.js +8 -2
  56. package/dist/init.js.map +1 -1
  57. package/dist/plugins/client-reference-dedup.js.map +1 -1
  58. package/dist/plugins/fix-use-server-closure-collision.js.map +1 -1
  59. package/dist/plugins/fonts.d.ts +18 -1
  60. package/dist/plugins/fonts.js +107 -8
  61. package/dist/plugins/fonts.js.map +1 -1
  62. package/dist/plugins/optimize-imports.d.ts +2 -2
  63. package/dist/plugins/optimize-imports.js +4 -4
  64. package/dist/plugins/optimize-imports.js.map +1 -1
  65. package/dist/plugins/server-externals-manifest.d.ts +27 -0
  66. package/dist/plugins/server-externals-manifest.js +76 -0
  67. package/dist/plugins/server-externals-manifest.js.map +1 -0
  68. package/dist/routing/app-router.d.ts +29 -55
  69. package/dist/routing/app-router.js.map +1 -1
  70. package/dist/routing/file-matcher.d.ts +2 -2
  71. package/dist/routing/file-matcher.js.map +1 -1
  72. package/dist/routing/pages-router.d.ts +6 -11
  73. package/dist/routing/pages-router.js.map +1 -1
  74. package/dist/routing/route-trie.d.ts +2 -2
  75. package/dist/routing/route-trie.js.map +1 -1
  76. package/dist/server/api-handler.js.map +1 -1
  77. package/dist/server/app-browser-entry.js +270 -39
  78. package/dist/server/app-browser-entry.js.map +1 -1
  79. package/dist/server/app-browser-stream.d.ts +6 -6
  80. package/dist/server/app-browser-stream.js.map +1 -1
  81. package/dist/server/app-page-boundary-render.d.ts +8 -8
  82. package/dist/server/app-page-boundary-render.js +2 -2
  83. package/dist/server/app-page-boundary-render.js.map +1 -1
  84. package/dist/server/app-page-boundary.d.ts +13 -11
  85. package/dist/server/app-page-boundary.js +1 -1
  86. package/dist/server/app-page-boundary.js.map +1 -1
  87. package/dist/server/app-page-cache.d.ts +10 -10
  88. package/dist/server/app-page-cache.js.map +1 -1
  89. package/dist/server/app-page-execution.d.ts +10 -10
  90. package/dist/server/app-page-execution.js.map +1 -1
  91. package/dist/server/app-page-probe.d.ts +2 -2
  92. package/dist/server/app-page-probe.js.map +1 -1
  93. package/dist/server/app-page-render.d.ts +4 -4
  94. package/dist/server/app-page-render.js.map +1 -1
  95. package/dist/server/app-page-request.d.ts +12 -12
  96. package/dist/server/app-page-request.js.map +1 -1
  97. package/dist/server/app-page-response.d.ts +18 -18
  98. package/dist/server/app-page-response.js.map +1 -1
  99. package/dist/server/app-page-stream.d.ts +18 -18
  100. package/dist/server/app-page-stream.js.map +1 -1
  101. package/dist/server/app-route-handler-cache.d.ts +2 -2
  102. package/dist/server/app-route-handler-cache.js.map +1 -1
  103. package/dist/server/app-route-handler-execution.d.ts +6 -6
  104. package/dist/server/app-route-handler-execution.js.map +1 -1
  105. package/dist/server/app-route-handler-policy.d.ts +8 -8
  106. package/dist/server/app-route-handler-policy.js.map +1 -1
  107. package/dist/server/app-route-handler-response.d.ts +6 -6
  108. package/dist/server/app-route-handler-response.js.map +1 -1
  109. package/dist/server/app-route-handler-runtime.d.ts +4 -4
  110. package/dist/server/app-route-handler-runtime.js.map +1 -1
  111. package/dist/server/app-ssr-entry.d.ts +4 -4
  112. package/dist/server/app-ssr-entry.js.map +1 -1
  113. package/dist/server/app-ssr-stream.d.ts +2 -2
  114. package/dist/server/app-ssr-stream.js +1 -3
  115. package/dist/server/app-ssr-stream.js.map +1 -1
  116. package/dist/server/dev-module-runner.d.ts +2 -2
  117. package/dist/server/dev-module-runner.js.map +1 -1
  118. package/dist/server/dev-server.js +5 -7
  119. package/dist/server/dev-server.js.map +1 -1
  120. package/dist/server/image-optimization.d.ts +7 -12
  121. package/dist/server/image-optimization.js.map +1 -1
  122. package/dist/server/instrumentation.d.ts +8 -12
  123. package/dist/server/instrumentation.js +1 -1
  124. package/dist/server/instrumentation.js.map +1 -1
  125. package/dist/server/isr-cache.d.ts +2 -2
  126. package/dist/server/isr-cache.js.map +1 -1
  127. package/dist/server/metadata-routes.d.ts +14 -19
  128. package/dist/server/metadata-routes.js.map +1 -1
  129. package/dist/server/middleware.d.ts +9 -17
  130. package/dist/server/middleware.js +1 -1
  131. package/dist/server/middleware.js.map +1 -1
  132. package/dist/server/pages-api-route.d.ts +6 -6
  133. package/dist/server/pages-api-route.js.map +1 -1
  134. package/dist/server/pages-i18n.d.ts +4 -4
  135. package/dist/server/pages-i18n.js.map +1 -1
  136. package/dist/server/pages-node-compat.d.ts +10 -10
  137. package/dist/server/pages-node-compat.js.map +1 -1
  138. package/dist/server/pages-page-data.d.ts +22 -22
  139. package/dist/server/pages-page-data.js.map +1 -1
  140. package/dist/server/pages-page-response.d.ts +8 -8
  141. package/dist/server/pages-page-response.js.map +1 -1
  142. package/dist/server/prod-server.d.ts +20 -15
  143. package/dist/server/prod-server.js +170 -53
  144. package/dist/server/prod-server.js.map +1 -1
  145. package/dist/server/seed-cache.js.map +1 -1
  146. package/dist/server/static-file-cache.d.ts +57 -0
  147. package/dist/server/static-file-cache.js +219 -0
  148. package/dist/server/static-file-cache.js.map +1 -0
  149. package/dist/shims/app.d.ts +2 -2
  150. package/dist/shims/cache-runtime.d.ts +6 -9
  151. package/dist/shims/cache-runtime.js.map +1 -1
  152. package/dist/shims/cache.d.ts +28 -31
  153. package/dist/shims/cache.js.map +1 -1
  154. package/dist/shims/config.d.ts +2 -2
  155. package/dist/shims/config.js.map +1 -1
  156. package/dist/shims/dynamic.d.ts +2 -2
  157. package/dist/shims/dynamic.js +5 -7
  158. package/dist/shims/dynamic.js.map +1 -1
  159. package/dist/shims/error-boundary.d.ts +7 -7
  160. package/dist/shims/error-boundary.js.map +1 -1
  161. package/dist/shims/error.d.ts +2 -2
  162. package/dist/shims/error.js.map +1 -1
  163. package/dist/shims/fetch-cache.d.ts +4 -4
  164. package/dist/shims/fetch-cache.js.map +1 -1
  165. package/dist/shims/font-google-base.d.ts +4 -4
  166. package/dist/shims/font-google-base.js.map +1 -1
  167. package/dist/shims/font-local.d.ts +6 -6
  168. package/dist/shims/font-local.js.map +1 -1
  169. package/dist/shims/form.d.ts +4 -8
  170. package/dist/shims/form.js +4 -6
  171. package/dist/shims/form.js.map +1 -1
  172. package/dist/shims/head-state.d.ts +2 -2
  173. package/dist/shims/head-state.js.map +1 -1
  174. package/dist/shims/head.d.ts +2 -2
  175. package/dist/shims/head.js +18 -20
  176. package/dist/shims/head.js.map +1 -1
  177. package/dist/shims/headers.d.ts +4 -4
  178. package/dist/shims/headers.js.map +1 -1
  179. package/dist/shims/i18n-context.d.ts +2 -2
  180. package/dist/shims/i18n-context.js.map +1 -1
  181. package/dist/shims/i18n-state.d.ts +2 -2
  182. package/dist/shims/i18n-state.js.map +1 -1
  183. package/dist/shims/image-config.d.ts +2 -2
  184. package/dist/shims/image-config.js.map +1 -1
  185. package/dist/shims/image.d.ts +5 -6
  186. package/dist/shims/image.js.map +1 -1
  187. package/dist/shims/internal/app-router-context.d.ts +6 -6
  188. package/dist/shims/internal/app-router-context.js.map +1 -1
  189. package/dist/shims/internal/utils.d.ts +2 -2
  190. package/dist/shims/internal/utils.js.map +1 -1
  191. package/dist/shims/layout-segment-context.d.ts +12 -5
  192. package/dist/shims/layout-segment-context.js +9 -4
  193. package/dist/shims/layout-segment-context.js.map +1 -1
  194. package/dist/shims/legacy-image.d.ts +5 -8
  195. package/dist/shims/legacy-image.js.map +1 -1
  196. package/dist/shims/link.d.ts +21 -31
  197. package/dist/shims/link.js +4 -58
  198. package/dist/shims/link.js.map +1 -1
  199. package/dist/shims/metadata.d.ts +23 -31
  200. package/dist/shims/metadata.js.map +1 -1
  201. package/dist/shims/navigation-state.d.ts +2 -2
  202. package/dist/shims/navigation-state.js.map +1 -1
  203. package/dist/shims/navigation.d.ts +102 -17
  204. package/dist/shims/navigation.js +359 -113
  205. package/dist/shims/navigation.js.map +1 -1
  206. package/dist/shims/request-context.d.ts +2 -2
  207. package/dist/shims/request-context.js.map +1 -1
  208. package/dist/shims/router-state.d.ts +4 -4
  209. package/dist/shims/router-state.js.map +1 -1
  210. package/dist/shims/router.d.ts +28 -47
  211. package/dist/shims/router.js.map +1 -1
  212. package/dist/shims/script.d.ts +16 -31
  213. package/dist/shims/script.js.map +1 -1
  214. package/dist/shims/server.d.ts +10 -10
  215. package/dist/shims/server.js.map +1 -1
  216. package/dist/shims/unified-request-context.d.ts +3 -5
  217. package/dist/shims/unified-request-context.js.map +1 -1
  218. package/dist/shims/web-vitals.d.ts +2 -2
  219. package/dist/shims/web-vitals.js.map +1 -1
  220. package/dist/utils/lazy-chunks.d.ts +34 -0
  221. package/dist/utils/lazy-chunks.js +50 -0
  222. package/dist/utils/lazy-chunks.js.map +1 -0
  223. package/dist/utils/vinext-root.d.ts +24 -0
  224. package/dist/utils/vinext-root.js +31 -0
  225. package/dist/utils/vinext-root.js.map +1 -0
  226. package/package.json +1 -1
@@ -1,27 +1,19 @@
1
1
  import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/shims/metadata.d.ts
4
- interface Viewport {
5
- /** Viewport width (default: "device-width") */
6
- width?: string | number;
7
- /** Viewport height */
8
- height?: string | number;
9
- /** Initial scale */
10
- initialScale?: number;
11
- /** Minimum scale */
12
- minimumScale?: number;
13
- /** Maximum scale */
14
- maximumScale?: number;
15
- /** Whether user can scale */
16
- userScalable?: boolean;
17
- /** Theme color — single color or array of { media, color } */
4
+ type Viewport = {
5
+ /** Viewport width (default: "device-width") */width?: string | number; /** Viewport height */
6
+ height?: string | number; /** Initial scale */
7
+ initialScale?: number; /** Minimum scale */
8
+ minimumScale?: number; /** Maximum scale */
9
+ maximumScale?: number; /** Whether user can scale */
10
+ userScalable?: boolean; /** Theme color — single color or array of { media, color } */
18
11
  themeColor?: string | Array<{
19
12
  media?: string;
20
13
  color: string;
21
- }>;
22
- /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */
14
+ }>; /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */
23
15
  colorScheme?: string;
24
- }
16
+ };
25
17
  /**
26
18
  * Resolve viewport config from a module. Handles both static `viewport` export
27
19
  * and async `generateViewport()` function.
@@ -41,7 +33,7 @@ declare function ViewportHead({
41
33
  }: {
42
34
  viewport: Viewport;
43
35
  }): react_jsx_runtime0.JSX.Element;
44
- interface Metadata {
36
+ type Metadata = {
45
37
  title?: string | {
46
38
  default?: string;
47
39
  template?: string;
@@ -188,34 +180,34 @@ interface Metadata {
188
180
  };
189
181
  other?: Record<string, string | string[]>;
190
182
  [key: string]: unknown;
191
- }
192
- interface AppLinksApple {
183
+ };
184
+ type AppLinksApple = {
193
185
  url: string | URL;
194
186
  app_store_id?: string | number;
195
187
  app_name?: string;
196
- }
197
- interface AppLinksAndroid {
188
+ };
189
+ type AppLinksAndroid = {
198
190
  package: string;
199
191
  url?: string | URL;
200
192
  class?: string;
201
193
  app_name?: string;
202
- }
203
- interface AppLinksWindows {
194
+ };
195
+ type AppLinksWindows = {
204
196
  url: string | URL;
205
197
  app_id?: string;
206
198
  app_name?: string;
207
- }
208
- interface AppLinksWeb {
199
+ };
200
+ type AppLinksWeb = {
209
201
  url: string | URL;
210
202
  should_fallback?: boolean;
211
- }
212
- interface TwitterPlayerDescriptor {
203
+ };
204
+ type TwitterPlayerDescriptor = {
213
205
  playerUrl: string | URL;
214
206
  streamUrl: string | URL;
215
207
  width: number;
216
208
  height: number;
217
- }
218
- interface TwitterAppDescriptor {
209
+ };
210
+ type TwitterAppDescriptor = {
219
211
  id: {
220
212
  iphone?: string | number;
221
213
  ipad?: string | number;
@@ -227,7 +219,7 @@ interface TwitterAppDescriptor {
227
219
  googleplay?: string | URL;
228
220
  };
229
221
  name?: string;
230
- }
222
+ };
231
223
  /**
232
224
  * Merge metadata from multiple sources (layouts + page).
233
225
  *
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","names":[],"sources":["../../src/shims/metadata.tsx"],"sourcesContent":["/**\n * Metadata support for App Router.\n *\n * Handles `export const metadata` and `export async function generateMetadata()`.\n * Resolves metadata from layouts and pages (pages override layouts).\n */\nimport React from \"react\";\n\n// ---------------------------------------------------------------------------\n// Viewport types and resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Normalize null-prototype objects from matchPattern() into thenable objects.\n * See entries/app-rsc-entry.ts makeThenableParams() for full explanation.\n */\nfunction makeThenableParams<T extends Record<string, unknown>>(obj: T): Promise<T> & T {\n const plain = { ...obj } as T;\n return Object.assign(Promise.resolve(plain), plain);\n}\n\nexport interface Viewport {\n /** Viewport width (default: \"device-width\") */\n width?: string | number;\n /** Viewport height */\n height?: string | number;\n /** Initial scale */\n initialScale?: number;\n /** Minimum scale */\n minimumScale?: number;\n /** Maximum scale */\n maximumScale?: number;\n /** Whether user can scale */\n userScalable?: boolean;\n /** Theme color — single color or array of { media, color } */\n themeColor?: string | Array<{ media?: string; color: string }>;\n /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */\n colorScheme?: string;\n}\n\n/**\n * Resolve viewport config from a module. Handles both static `viewport` export\n * and async `generateViewport()` function.\n */\nexport async function resolveModuleViewport(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]>,\n): Promise<Viewport | null> {\n if (typeof mod.generateViewport === \"function\") {\n const asyncParams = makeThenableParams(params);\n return await mod.generateViewport({ params: asyncParams });\n }\n if (mod.viewport && typeof mod.viewport === \"object\") {\n return mod.viewport as Viewport;\n }\n return null;\n}\n\n/**\n * Merge viewport configs from multiple sources (layouts + page).\n * Later entries override earlier ones.\n */\nexport const DEFAULT_VIEWPORT: Viewport = {\n width: \"device-width\",\n initialScale: 1,\n};\n\nexport function mergeViewport(viewportList: Viewport[]): Viewport {\n const merged: Viewport = { ...DEFAULT_VIEWPORT };\n for (const vp of viewportList) {\n Object.assign(merged, vp);\n }\n return merged;\n}\n\n/**\n * React component that renders viewport meta tags into <head>.\n */\nexport function ViewportHead({ viewport }: { viewport: Viewport }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Build viewport content string\n const parts: string[] = [];\n if (viewport.width !== undefined) parts.push(`width=${viewport.width}`);\n if (viewport.height !== undefined) parts.push(`height=${viewport.height}`);\n if (viewport.initialScale !== undefined) parts.push(`initial-scale=${viewport.initialScale}`);\n if (viewport.minimumScale !== undefined) parts.push(`minimum-scale=${viewport.minimumScale}`);\n if (viewport.maximumScale !== undefined) parts.push(`maximum-scale=${viewport.maximumScale}`);\n if (viewport.userScalable !== undefined)\n parts.push(`user-scalable=${viewport.userScalable ? \"yes\" : \"no\"}`);\n\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"viewport\" content={parts.join(\", \")} />);\n }\n\n // Theme color\n if (viewport.themeColor) {\n if (typeof viewport.themeColor === \"string\") {\n elements.push(<meta key={key++} name=\"theme-color\" content={viewport.themeColor} />);\n } else if (Array.isArray(viewport.themeColor)) {\n for (const entry of viewport.themeColor) {\n elements.push(\n <meta\n key={key++}\n name=\"theme-color\"\n content={entry.color}\n {...(entry.media ? { media: entry.media } : {})}\n />,\n );\n }\n }\n }\n\n // Color scheme\n if (viewport.colorScheme) {\n elements.push(<meta key={key++} name=\"color-scheme\" content={viewport.colorScheme} />);\n }\n\n return <>{elements}</>;\n}\n\n// ---------------------------------------------------------------------------\n// Metadata types and resolution\n// ---------------------------------------------------------------------------\n\nexport interface Metadata {\n title?: string | { default?: string; template?: string; absolute?: string };\n description?: string;\n generator?: string;\n applicationName?: string;\n referrer?: string;\n keywords?: string | string[];\n authors?: Array<{ name?: string; url?: string }> | { name?: string; url?: string };\n creator?: string;\n publisher?: string;\n robots?:\n | string\n | {\n index?: boolean;\n follow?: boolean;\n googleBot?: string | { index?: boolean; follow?: boolean; [key: string]: unknown };\n [key: string]: unknown;\n };\n openGraph?: {\n title?: string;\n description?: string;\n url?: string | URL;\n siteName?: string;\n images?:\n | string\n | URL\n | { url: string | URL; width?: number; height?: number; alt?: string }\n | Array<string | URL | { url: string | URL; width?: number; height?: number; alt?: string }>;\n videos?: Array<{ url: string | URL; width?: number; height?: number }>;\n audio?: Array<{ url: string | URL }>;\n locale?: string;\n type?: string;\n publishedTime?: string;\n modifiedTime?: string;\n authors?: string[];\n };\n twitter?: {\n card?: string;\n site?: string;\n siteId?: string;\n title?: string;\n description?: string;\n images?:\n | string\n | URL\n | { url: string | URL; alt?: string; width?: number; height?: number }\n | Array<string | URL | { url: string | URL; alt?: string; width?: number; height?: number }>;\n creator?: string;\n creatorId?: string;\n players?: TwitterPlayerDescriptor | TwitterPlayerDescriptor[];\n app?: TwitterAppDescriptor;\n };\n icons?: {\n icon?:\n | string\n | URL\n | Array<{ url: string | URL; sizes?: string; type?: string; media?: string }>;\n shortcut?: string | URL | Array<string | URL>;\n apple?: string | URL | Array<{ url: string | URL; sizes?: string; type?: string }>;\n other?: Array<{ rel: string; url: string | URL; sizes?: string; type?: string }>;\n };\n manifest?: string | URL;\n alternates?: {\n canonical?: string | URL;\n languages?: Record<string, string | URL>;\n media?: Record<string, string | URL>;\n types?: Record<string, string | URL>;\n };\n verification?: {\n google?: string;\n yahoo?: string;\n yandex?: string;\n other?: Record<string, string | string[]>;\n };\n metadataBase?: URL | null;\n appleWebApp?: {\n capable?: boolean;\n title?: string;\n statusBarStyle?: string;\n startupImage?: string | Array<{ url: string; media?: string }>;\n };\n formatDetection?: {\n email?: boolean;\n address?: boolean;\n telephone?: boolean;\n };\n category?: string;\n itunes?: {\n appId: string;\n appArgument?: string;\n };\n appLinks?: {\n ios?: AppLinksApple | AppLinksApple[];\n iphone?: AppLinksApple | AppLinksApple[];\n ipad?: AppLinksApple | AppLinksApple[];\n android?: AppLinksAndroid | AppLinksAndroid[];\n windows_phone?: AppLinksWindows | AppLinksWindows[];\n windows?: AppLinksWindows | AppLinksWindows[];\n windows_universal?: AppLinksWindows | AppLinksWindows[];\n web?: AppLinksWeb | AppLinksWeb[];\n };\n other?: Record<string, string | string[]>;\n [key: string]: unknown;\n}\n\ninterface AppLinksApple {\n url: string | URL;\n app_store_id?: string | number;\n app_name?: string;\n}\n\ninterface AppLinksAndroid {\n package: string;\n url?: string | URL;\n class?: string;\n app_name?: string;\n}\n\ninterface AppLinksWindows {\n url: string | URL;\n app_id?: string;\n app_name?: string;\n}\n\ninterface AppLinksWeb {\n url: string | URL;\n should_fallback?: boolean;\n}\n\ninterface TwitterPlayerDescriptor {\n playerUrl: string | URL;\n streamUrl: string | URL;\n width: number;\n height: number;\n}\n\ninterface TwitterAppDescriptor {\n id: {\n iphone?: string | number;\n ipad?: string | number;\n googleplay?: string;\n };\n url?: {\n iphone?: string | URL;\n ipad?: string | URL;\n googleplay?: string | URL;\n };\n name?: string;\n}\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * Shallow merge: later entries override earlier ones (per Next.js docs).\n */\nexport function mergeMetadata(metadataList: Metadata[]): Metadata {\n if (metadataList.length === 0) return {};\n\n const merged: Metadata = {};\n\n // Track the most recent title template from LAYOUTS (not from page).\n // The page is always the last entry in metadataList.\n let parentTemplate: string | undefined;\n\n for (let i = 0; i < metadataList.length; i++) {\n const meta = metadataList[i];\n const isPage = i === metadataList.length - 1;\n\n // Collect template from layouts only (page templates are ignored per Next.js spec)\n if (!isPage && meta.title && typeof meta.title === \"object\" && meta.title.template) {\n parentTemplate = meta.title.template;\n }\n\n // Shallow merge — later entries override earlier for top-level keys\n for (const key of Object.keys(meta)) {\n if (key === \"title\") continue; // Handle title separately below\n (merged as Record<string, unknown>)[key] = (meta as Record<string, unknown>)[key];\n }\n\n // Title resolution\n if (meta.title !== undefined) {\n merged.title = meta.title;\n }\n }\n\n // Now resolve the final title, applying the parent template if applicable\n const finalTitle = merged.title;\n if (finalTitle) {\n if (typeof finalTitle === \"string\") {\n // Simple string title — apply parent template\n if (parentTemplate) {\n merged.title = parentTemplate.replace(\"%s\", finalTitle);\n }\n } else if (typeof finalTitle === \"object\") {\n if (finalTitle.absolute) {\n // Absolute title — skip all templates\n merged.title = finalTitle.absolute;\n } else if (finalTitle.default) {\n // Title object with default — this is used when the segment IS the\n // defining layout (its own default doesn't get template-wrapped)\n merged.title = finalTitle.default;\n } else if (finalTitle.template && !finalTitle.default && !finalTitle.absolute) {\n // Template only with no default — no title to render\n merged.title = undefined;\n }\n }\n }\n\n return merged;\n}\n\n/**\n * Resolve metadata from a module. Handles both static `metadata` export\n * and async `generateMetadata()` function.\n *\n * @param parent - A Promise that resolves to the accumulated (merged) metadata\n * from all ancestor segments. Passed as the second argument to\n * `generateMetadata()`, matching Next.js's eager-execution-with-serial-\n * resolution approach. If not provided, defaults to a promise that resolves\n * to an empty object (so `await parent` never throws).\n */\nexport async function resolveModuleMetadata(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]> = {},\n searchParams?: Record<string, string>,\n parent: Promise<Metadata> = Promise.resolve({}),\n): Promise<Metadata | null> {\n if (typeof mod.generateMetadata === \"function\") {\n // Next.js 16 passes params/searchParams as Promises (async pattern).\n // makeThenableParams() normalises null-prototype + preserves sync access.\n const asyncParams = makeThenableParams(params);\n const sp = searchParams ?? {};\n const asyncSp = makeThenableParams(sp);\n return await mod.generateMetadata({ params: asyncParams, searchParams: asyncSp }, parent);\n }\n if (mod.metadata && typeof mod.metadata === \"object\") {\n return mod.metadata as Metadata;\n }\n return null;\n}\n\n/**\n * React component that renders metadata as HTML head elements.\n * Used by the RSC entry to inject into the <head>.\n */\nexport function MetadataHead({ metadata }: { metadata: Metadata }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Resolve metadataBase for URL composition\n const base = metadata.metadataBase;\n function resolveUrl(url: string | URL): string;\n function resolveUrl(url: string | URL | undefined): string | undefined;\n function resolveUrl(url: string | URL | undefined): string | undefined {\n if (!url) return undefined;\n // Coerce URL objects to strings (Next.js metadata allows string | URL)\n const s = typeof url === \"string\" ? url : url instanceof URL ? url.toString() : String(url);\n if (!base) return s;\n if (s.startsWith(\"http://\") || s.startsWith(\"https://\") || s.startsWith(\"//\")) return s;\n try {\n return new URL(s, base).toString();\n } catch {\n return s;\n }\n }\n\n // Title\n const title =\n typeof metadata.title === \"string\"\n ? metadata.title\n : typeof metadata.title === \"object\"\n ? metadata.title.absolute || metadata.title.default\n : undefined;\n if (title) {\n elements.push(<title key={key++}>{title}</title>);\n }\n\n // Description\n if (metadata.description) {\n elements.push(<meta key={key++} name=\"description\" content={metadata.description} />);\n }\n\n // Generator\n if (metadata.generator) {\n elements.push(<meta key={key++} name=\"generator\" content={metadata.generator} />);\n }\n\n // Application name\n if (metadata.applicationName) {\n elements.push(<meta key={key++} name=\"application-name\" content={metadata.applicationName} />);\n }\n\n // Referrer\n if (metadata.referrer) {\n elements.push(<meta key={key++} name=\"referrer\" content={metadata.referrer} />);\n }\n\n // Keywords\n if (metadata.keywords) {\n const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(\",\") : metadata.keywords;\n elements.push(<meta key={key++} name=\"keywords\" content={kw} />);\n }\n\n // Authors\n if (metadata.authors) {\n const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];\n for (const author of authorList) {\n if (author.name) {\n elements.push(<meta key={key++} name=\"author\" content={author.name} />);\n }\n if (author.url) {\n elements.push(<link key={key++} rel=\"author\" href={author.url} />);\n }\n }\n }\n\n // Creator\n if (metadata.creator) {\n elements.push(<meta key={key++} name=\"creator\" content={metadata.creator} />);\n }\n\n // Publisher\n if (metadata.publisher) {\n elements.push(<meta key={key++} name=\"publisher\" content={metadata.publisher} />);\n }\n\n // Format detection\n if (metadata.formatDetection) {\n const parts: string[] = [];\n if (metadata.formatDetection.telephone === false) parts.push(\"telephone=no\");\n if (metadata.formatDetection.address === false) parts.push(\"address=no\");\n if (metadata.formatDetection.email === false) parts.push(\"email=no\");\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"format-detection\" content={parts.join(\", \")} />);\n }\n }\n\n // Category\n if (metadata.category) {\n elements.push(<meta key={key++} name=\"category\" content={metadata.category} />);\n }\n\n // Robots\n if (metadata.robots) {\n if (typeof metadata.robots === \"string\") {\n elements.push(<meta key={key++} name=\"robots\" content={metadata.robots} />);\n } else {\n const { googleBot, ...robotsRest } = metadata.robots;\n const robotParts: string[] = [];\n for (const [k, v] of Object.entries(robotsRest)) {\n if (v === true) robotParts.push(k);\n else if (v === false) robotParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") robotParts.push(`${k}:${v}`);\n }\n if (robotParts.length > 0) {\n elements.push(<meta key={key++} name=\"robots\" content={robotParts.join(\", \")} />);\n }\n // googlebot\n if (googleBot) {\n if (typeof googleBot === \"string\") {\n elements.push(<meta key={key++} name=\"googlebot\" content={googleBot} />);\n } else {\n const gbParts: string[] = [];\n for (const [k, v] of Object.entries(googleBot)) {\n if (v === true) gbParts.push(k);\n else if (v === false) gbParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") gbParts.push(`${k}:${v}`);\n }\n if (gbParts.length > 0) {\n elements.push(<meta key={key++} name=\"googlebot\" content={gbParts.join(\", \")} />);\n }\n }\n }\n }\n }\n\n // Open Graph\n if (metadata.openGraph) {\n const og = metadata.openGraph;\n if (og.title) elements.push(<meta key={key++} property=\"og:title\" content={og.title} />);\n if (og.description)\n elements.push(<meta key={key++} property=\"og:description\" content={og.description} />);\n if (og.url) elements.push(<meta key={key++} property=\"og:url\" content={resolveUrl(og.url)} />);\n if (og.siteName)\n elements.push(<meta key={key++} property=\"og:site_name\" content={og.siteName} />);\n if (og.type) elements.push(<meta key={key++} property=\"og:type\" content={og.type} />);\n if (og.locale) elements.push(<meta key={key++} property=\"og:locale\" content={og.locale} />);\n if (og.publishedTime)\n elements.push(\n <meta key={key++} property=\"article:published_time\" content={og.publishedTime} />,\n );\n if (og.modifiedTime)\n elements.push(\n <meta key={key++} property=\"article:modified_time\" content={og.modifiedTime} />,\n );\n if (og.authors) {\n for (const author of og.authors) {\n elements.push(<meta key={key++} property=\"article:author\" content={author} />);\n }\n }\n if (og.images) {\n const imgList =\n typeof og.images === \"string\" || og.images instanceof URL\n ? [{ url: og.images }]\n : Array.isArray(og.images)\n ? og.images\n : [og.images];\n for (const img of imgList) {\n const imgUrl = typeof img === \"string\" || img instanceof URL ? img : img.url;\n elements.push(<meta key={key++} property=\"og:image\" content={resolveUrl(imgUrl)} />);\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.width)\n elements.push(\n <meta key={key++} property=\"og:image:width\" content={String(img.width)} />,\n );\n if (img.height)\n elements.push(\n <meta key={key++} property=\"og:image:height\" content={String(img.height)} />,\n );\n if (img.alt)\n elements.push(<meta key={key++} property=\"og:image:alt\" content={img.alt} />);\n }\n }\n }\n if (og.videos) {\n for (const video of og.videos) {\n elements.push(<meta key={key++} property=\"og:video\" content={resolveUrl(video.url)} />);\n if (video.width)\n elements.push(\n <meta key={key++} property=\"og:video:width\" content={String(video.width)} />,\n );\n if (video.height)\n elements.push(\n <meta key={key++} property=\"og:video:height\" content={String(video.height)} />,\n );\n }\n }\n if (og.audio) {\n for (const audio of og.audio) {\n elements.push(<meta key={key++} property=\"og:audio\" content={resolveUrl(audio.url)} />);\n }\n }\n }\n\n // Twitter\n if (metadata.twitter) {\n const tw = metadata.twitter;\n if (tw.card) elements.push(<meta key={key++} name=\"twitter:card\" content={tw.card} />);\n if (tw.site) elements.push(<meta key={key++} name=\"twitter:site\" content={tw.site} />);\n if (tw.siteId) elements.push(<meta key={key++} name=\"twitter:site:id\" content={tw.siteId} />);\n if (tw.title) elements.push(<meta key={key++} name=\"twitter:title\" content={tw.title} />);\n if (tw.description)\n elements.push(<meta key={key++} name=\"twitter:description\" content={tw.description} />);\n if (tw.creator) elements.push(<meta key={key++} name=\"twitter:creator\" content={tw.creator} />);\n if (tw.creatorId)\n elements.push(<meta key={key++} name=\"twitter:creator:id\" content={tw.creatorId} />);\n if (tw.images) {\n const imgList =\n typeof tw.images === \"string\" || tw.images instanceof URL\n ? [tw.images]\n : Array.isArray(tw.images)\n ? tw.images\n : [tw.images];\n for (const img of imgList) {\n const imgUrl = typeof img === \"string\" || img instanceof URL ? img : img.url;\n elements.push(<meta key={key++} name=\"twitter:image\" content={resolveUrl(imgUrl)} />);\n if (typeof img !== \"string\" && !(img instanceof URL) && img.alt) {\n elements.push(<meta key={key++} name=\"twitter:image:alt\" content={img.alt} />);\n }\n }\n }\n // Twitter player cards\n if (tw.players) {\n const players = Array.isArray(tw.players) ? tw.players : [tw.players];\n for (const player of players) {\n const playerUrl = player.playerUrl.toString();\n const streamUrl = player.streamUrl.toString();\n elements.push(<meta key={key++} name=\"twitter:player\" content={resolveUrl(playerUrl)} />);\n elements.push(\n <meta key={key++} name=\"twitter:player:stream\" content={resolveUrl(streamUrl)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:width\" content={String(player.width)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:height\" content={String(player.height)} />,\n );\n }\n }\n // Twitter app cards\n if (tw.app) {\n const { app } = tw;\n for (const platform of [\"iphone\", \"ipad\", \"googleplay\"] as const) {\n if (app.name) {\n elements.push(\n <meta key={key++} name={`twitter:app:name:${platform}`} content={app.name} />,\n );\n }\n if (app.id[platform] !== undefined) {\n elements.push(\n <meta\n key={key++}\n name={`twitter:app:id:${platform}`}\n content={String(app.id[platform])}\n />,\n );\n }\n if (app.url?.[platform] !== undefined) {\n const appUrl = app.url[platform]!.toString();\n elements.push(\n <meta key={key++} name={`twitter:app:url:${platform}`} content={resolveUrl(appUrl)} />,\n );\n }\n }\n }\n }\n\n // Icons\n if (metadata.icons) {\n const { icon, shortcut, apple, other } = metadata.icons;\n // Shortcut icon\n if (shortcut) {\n const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];\n for (const s of shortcuts) {\n elements.push(<link key={key++} rel=\"shortcut icon\" href={resolveUrl(s)} />);\n }\n }\n // Icon\n if (icon) {\n const icons = typeof icon === \"string\" || icon instanceof URL ? [{ url: icon }] : icon;\n for (const i of icons) {\n elements.push(\n <link\n key={key++}\n rel=\"icon\"\n href={resolveUrl(i.url)}\n {...(i.sizes ? { sizes: i.sizes } : {})}\n {...(i.type ? { type: i.type } : {})}\n {...(i.media ? { media: i.media } : {})}\n />,\n );\n }\n }\n // Apple touch icon\n if (apple) {\n const apples = typeof apple === \"string\" || apple instanceof URL ? [{ url: apple }] : apple;\n for (const a of apples) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-icon\"\n href={resolveUrl(a.url)}\n {...(a.sizes ? { sizes: a.sizes } : {})}\n {...(a.type ? { type: a.type } : {})}\n />,\n );\n }\n }\n // Other custom icon relations\n if (other) {\n for (const o of other) {\n elements.push(\n <link\n key={key++}\n rel={o.rel}\n href={resolveUrl(o.url)}\n {...(o.sizes ? { sizes: o.sizes } : {})}\n />,\n );\n }\n }\n }\n\n // Manifest\n if (metadata.manifest) {\n elements.push(<link key={key++} rel=\"manifest\" href={resolveUrl(metadata.manifest)} />);\n }\n\n // Alternates\n if (metadata.alternates) {\n const alt = metadata.alternates;\n if (alt.canonical) {\n elements.push(<link key={key++} rel=\"canonical\" href={resolveUrl(alt.canonical)} />);\n }\n if (alt.languages) {\n for (const [lang, href] of Object.entries(alt.languages)) {\n elements.push(<link key={key++} rel=\"alternate\" hrefLang={lang} href={resolveUrl(href)} />);\n }\n }\n if (alt.media) {\n for (const [media, href] of Object.entries(alt.media)) {\n elements.push(<link key={key++} rel=\"alternate\" media={media} href={resolveUrl(href)} />);\n }\n }\n if (alt.types) {\n for (const [type, href] of Object.entries(alt.types)) {\n elements.push(<link key={key++} rel=\"alternate\" type={type} href={resolveUrl(href)} />);\n }\n }\n }\n\n // Verification\n if (metadata.verification) {\n const v = metadata.verification;\n if (v.google)\n elements.push(<meta key={key++} name=\"google-site-verification\" content={v.google} />);\n if (v.yahoo) elements.push(<meta key={key++} name=\"y_key\" content={v.yahoo} />);\n if (v.yandex) elements.push(<meta key={key++} name=\"yandex-verification\" content={v.yandex} />);\n if (v.other) {\n for (const [name, content] of Object.entries(v.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n }\n\n // Apple Web App\n if (metadata.appleWebApp) {\n const awa = metadata.appleWebApp;\n if (awa.capable !== false) {\n elements.push(<meta key={key++} name=\"mobile-web-app-capable\" content=\"yes\" />);\n }\n if (awa.title) {\n elements.push(<meta key={key++} name=\"apple-mobile-web-app-title\" content={awa.title} />);\n }\n if (awa.statusBarStyle) {\n elements.push(\n <meta\n key={key++}\n name=\"apple-mobile-web-app-status-bar-style\"\n content={awa.statusBarStyle}\n />,\n );\n }\n if (awa.startupImage) {\n const imgs =\n typeof awa.startupImage === \"string\" ? [{ url: awa.startupImage }] : awa.startupImage;\n for (const img of imgs) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-startup-image\"\n href={resolveUrl(img.url)}\n {...(img.media ? { media: img.media } : {})}\n />,\n );\n }\n }\n }\n\n // iTunes\n if (metadata.itunes) {\n const { appId, appArgument } = metadata.itunes;\n let content = `app-id=${appId}`;\n if (appArgument) {\n content += `, app-argument=${appArgument}`;\n }\n elements.push(<meta key={key++} name=\"apple-itunes-app\" content={content} />);\n }\n\n // App Links\n if (metadata.appLinks) {\n const al = metadata.appLinks;\n const platforms = [\n \"ios\",\n \"iphone\",\n \"ipad\",\n \"android\",\n \"windows_phone\",\n \"windows\",\n \"windows_universal\",\n \"web\",\n ] as const;\n for (const platform of platforms) {\n const entries = al[platform];\n if (!entries) continue;\n const list = Array.isArray(entries) ? entries : [entries];\n for (const entry of list) {\n for (const [k, v] of Object.entries(entry)) {\n if (v === undefined || v === null) continue;\n const str = String(v);\n const content = k === \"url\" ? resolveUrl(str) : str;\n elements.push(<meta key={key++} property={`al:${platform}:${k}`} content={content} />);\n }\n }\n }\n }\n\n // Other custom meta tags\n if (metadata.other) {\n for (const [name, content] of Object.entries(metadata.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n\n return <>{elements}</>;\n}\n"],"mappings":";;;;;;;AAgBA,SAAS,mBAAsD,KAAwB;CACrF,MAAM,QAAQ,EAAE,GAAG,KAAK;AACxB,QAAO,OAAO,OAAO,QAAQ,QAAQ,MAAM,EAAE,MAAM;;;;;;AA0BrD,eAAsB,sBACpB,KACA,QAC0B;AAC1B,KAAI,OAAO,IAAI,qBAAqB,YAAY;EAC9C,MAAM,cAAc,mBAAmB,OAAO;AAC9C,SAAO,MAAM,IAAI,iBAAiB,EAAE,QAAQ,aAAa,CAAC;;AAE5D,KAAI,IAAI,YAAY,OAAO,IAAI,aAAa,SAC1C,QAAO,IAAI;AAEb,QAAO;;;;;;AAOT,MAAa,mBAA6B;CACxC,OAAO;CACP,cAAc;CACf;AAED,SAAgB,cAAc,cAAoC;CAChE,MAAM,SAAmB,EAAE,GAAG,kBAAkB;AAChD,MAAK,MAAM,MAAM,aACf,QAAO,OAAO,QAAQ,GAAG;AAE3B,QAAO;;;;;AAMT,SAAgB,aAAa,EAAE,YAAoC;CACjE,MAAM,WAAiC,EAAE;CACzC,IAAI,MAAM;CAGV,MAAM,QAAkB,EAAE;AAC1B,KAAI,SAAS,UAAU,KAAA,EAAW,OAAM,KAAK,SAAS,SAAS,QAAQ;AACvE,KAAI,SAAS,WAAW,KAAA,EAAW,OAAM,KAAK,UAAU,SAAS,SAAS;AAC1E,KAAI,SAAS,iBAAiB,KAAA,EAAW,OAAM,KAAK,iBAAiB,SAAS,eAAe;AAC7F,KAAI,SAAS,iBAAiB,KAAA,EAAW,OAAM,KAAK,iBAAiB,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O,gBAAgB,SAAS;EACxC,IAAI,UAAU,UAAU;AACxB,MAAI,YACF,YAAW,kBAAkB;AAE/B,WAAS,KAAK,oBAAC,QAAD;GAAkB,MAAK;GAA4B;GAAW,EAAnD,MAAmD,CAAC;;AAI/E,KAAI,SAAS,UAAU;EACrB,MAAM,KAAK,SAAS;AAWpB,OAAK,MAAM,YAVO;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,EACiC;GAChC,MAAM,UAAU,GAAG;AACnB,OAAI,CAAC,QAAS;GACd,MAAM,OAAO,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACzD,QAAK,MAAM,SAAS,KAClB,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,EAAE;AAC1C,QAAI,MAAM,KAAA,KAAa,MAAM,KAAM;IACnC,MAAM,MAAM,OAAO,EAAE;IACrB,MAAM,UAAU,MAAM,QAAQ,WAAW,IAAI,GAAG;AAChD,aAAS,KAAK,oBAAC,QAAD;KAAkB,UAAU,MAAM,SAAS,GAAG;KAAc;KAAW,EAA5D,MAA4D,CAAC;;;;AAO9F,KAAI,SAAS,MACX,MAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,SAAS,MAAM,EAAE;EAC5D,MAAM,SAAS,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;AAC3D,OAAK,MAAM,OAAO,OAChB,UAAS,KAAK,oBAAC,QAAD;GAAwB;GAAM,SAAS;GAAO,EAAnC,MAAmC,CAAC;;AAKnE,QAAO,oBAAA,YAAA,EAAA,UAAG,UAAY,CAAA"}
1
+ {"version":3,"file":"metadata.js","names":[],"sources":["../../src/shims/metadata.tsx"],"sourcesContent":["/**\n * Metadata support for App Router.\n *\n * Handles `export const metadata` and `export async function generateMetadata()`.\n * Resolves metadata from layouts and pages (pages override layouts).\n */\nimport React from \"react\";\n\n// ---------------------------------------------------------------------------\n// Viewport types and resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Normalize null-prototype objects from matchPattern() into thenable objects.\n * See entries/app-rsc-entry.ts makeThenableParams() for full explanation.\n */\nfunction makeThenableParams<T extends Record<string, unknown>>(obj: T): Promise<T> & T {\n const plain = { ...obj } as T;\n return Object.assign(Promise.resolve(plain), plain);\n}\n\nexport type Viewport = {\n /** Viewport width (default: \"device-width\") */\n width?: string | number;\n /** Viewport height */\n height?: string | number;\n /** Initial scale */\n initialScale?: number;\n /** Minimum scale */\n minimumScale?: number;\n /** Maximum scale */\n maximumScale?: number;\n /** Whether user can scale */\n userScalable?: boolean;\n /** Theme color — single color or array of { media, color } */\n themeColor?: string | Array<{ media?: string; color: string }>;\n /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */\n colorScheme?: string;\n};\n\n/**\n * Resolve viewport config from a module. Handles both static `viewport` export\n * and async `generateViewport()` function.\n */\nexport async function resolveModuleViewport(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]>,\n): Promise<Viewport | null> {\n if (typeof mod.generateViewport === \"function\") {\n const asyncParams = makeThenableParams(params);\n return await mod.generateViewport({ params: asyncParams });\n }\n if (mod.viewport && typeof mod.viewport === \"object\") {\n return mod.viewport as Viewport;\n }\n return null;\n}\n\n/**\n * Merge viewport configs from multiple sources (layouts + page).\n * Later entries override earlier ones.\n */\nexport const DEFAULT_VIEWPORT: Viewport = {\n width: \"device-width\",\n initialScale: 1,\n};\n\nexport function mergeViewport(viewportList: Viewport[]): Viewport {\n const merged: Viewport = { ...DEFAULT_VIEWPORT };\n for (const vp of viewportList) {\n Object.assign(merged, vp);\n }\n return merged;\n}\n\n/**\n * React component that renders viewport meta tags into <head>.\n */\nexport function ViewportHead({ viewport }: { viewport: Viewport }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Build viewport content string\n const parts: string[] = [];\n if (viewport.width !== undefined) parts.push(`width=${viewport.width}`);\n if (viewport.height !== undefined) parts.push(`height=${viewport.height}`);\n if (viewport.initialScale !== undefined) parts.push(`initial-scale=${viewport.initialScale}`);\n if (viewport.minimumScale !== undefined) parts.push(`minimum-scale=${viewport.minimumScale}`);\n if (viewport.maximumScale !== undefined) parts.push(`maximum-scale=${viewport.maximumScale}`);\n if (viewport.userScalable !== undefined)\n parts.push(`user-scalable=${viewport.userScalable ? \"yes\" : \"no\"}`);\n\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"viewport\" content={parts.join(\", \")} />);\n }\n\n // Theme color\n if (viewport.themeColor) {\n if (typeof viewport.themeColor === \"string\") {\n elements.push(<meta key={key++} name=\"theme-color\" content={viewport.themeColor} />);\n } else if (Array.isArray(viewport.themeColor)) {\n for (const entry of viewport.themeColor) {\n elements.push(\n <meta\n key={key++}\n name=\"theme-color\"\n content={entry.color}\n {...(entry.media ? { media: entry.media } : {})}\n />,\n );\n }\n }\n }\n\n // Color scheme\n if (viewport.colorScheme) {\n elements.push(<meta key={key++} name=\"color-scheme\" content={viewport.colorScheme} />);\n }\n\n return <>{elements}</>;\n}\n\n// ---------------------------------------------------------------------------\n// Metadata types and resolution\n// ---------------------------------------------------------------------------\n\nexport type Metadata = {\n title?: string | { default?: string; template?: string; absolute?: string };\n description?: string;\n generator?: string;\n applicationName?: string;\n referrer?: string;\n keywords?: string | string[];\n authors?: Array<{ name?: string; url?: string }> | { name?: string; url?: string };\n creator?: string;\n publisher?: string;\n robots?:\n | string\n | {\n index?: boolean;\n follow?: boolean;\n googleBot?: string | { index?: boolean; follow?: boolean; [key: string]: unknown };\n [key: string]: unknown;\n };\n openGraph?: {\n title?: string;\n description?: string;\n url?: string | URL;\n siteName?: string;\n images?:\n | string\n | URL\n | { url: string | URL; width?: number; height?: number; alt?: string }\n | Array<string | URL | { url: string | URL; width?: number; height?: number; alt?: string }>;\n videos?: Array<{ url: string | URL; width?: number; height?: number }>;\n audio?: Array<{ url: string | URL }>;\n locale?: string;\n type?: string;\n publishedTime?: string;\n modifiedTime?: string;\n authors?: string[];\n };\n twitter?: {\n card?: string;\n site?: string;\n siteId?: string;\n title?: string;\n description?: string;\n images?:\n | string\n | URL\n | { url: string | URL; alt?: string; width?: number; height?: number }\n | Array<string | URL | { url: string | URL; alt?: string; width?: number; height?: number }>;\n creator?: string;\n creatorId?: string;\n players?: TwitterPlayerDescriptor | TwitterPlayerDescriptor[];\n app?: TwitterAppDescriptor;\n };\n icons?: {\n icon?:\n | string\n | URL\n | Array<{ url: string | URL; sizes?: string; type?: string; media?: string }>;\n shortcut?: string | URL | Array<string | URL>;\n apple?: string | URL | Array<{ url: string | URL; sizes?: string; type?: string }>;\n other?: Array<{ rel: string; url: string | URL; sizes?: string; type?: string }>;\n };\n manifest?: string | URL;\n alternates?: {\n canonical?: string | URL;\n languages?: Record<string, string | URL>;\n media?: Record<string, string | URL>;\n types?: Record<string, string | URL>;\n };\n verification?: {\n google?: string;\n yahoo?: string;\n yandex?: string;\n other?: Record<string, string | string[]>;\n };\n metadataBase?: URL | null;\n appleWebApp?: {\n capable?: boolean;\n title?: string;\n statusBarStyle?: string;\n startupImage?: string | Array<{ url: string; media?: string }>;\n };\n formatDetection?: {\n email?: boolean;\n address?: boolean;\n telephone?: boolean;\n };\n category?: string;\n itunes?: {\n appId: string;\n appArgument?: string;\n };\n appLinks?: {\n ios?: AppLinksApple | AppLinksApple[];\n iphone?: AppLinksApple | AppLinksApple[];\n ipad?: AppLinksApple | AppLinksApple[];\n android?: AppLinksAndroid | AppLinksAndroid[];\n windows_phone?: AppLinksWindows | AppLinksWindows[];\n windows?: AppLinksWindows | AppLinksWindows[];\n windows_universal?: AppLinksWindows | AppLinksWindows[];\n web?: AppLinksWeb | AppLinksWeb[];\n };\n other?: Record<string, string | string[]>;\n [key: string]: unknown;\n};\n\ntype AppLinksApple = {\n url: string | URL;\n app_store_id?: string | number;\n app_name?: string;\n};\n\ntype AppLinksAndroid = {\n package: string;\n url?: string | URL;\n class?: string;\n app_name?: string;\n};\n\ntype AppLinksWindows = {\n url: string | URL;\n app_id?: string;\n app_name?: string;\n};\n\ntype AppLinksWeb = {\n url: string | URL;\n should_fallback?: boolean;\n};\n\ntype TwitterPlayerDescriptor = {\n playerUrl: string | URL;\n streamUrl: string | URL;\n width: number;\n height: number;\n};\n\ntype TwitterAppDescriptor = {\n id: {\n iphone?: string | number;\n ipad?: string | number;\n googleplay?: string;\n };\n url?: {\n iphone?: string | URL;\n ipad?: string | URL;\n googleplay?: string | URL;\n };\n name?: string;\n};\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * Shallow merge: later entries override earlier ones (per Next.js docs).\n */\nexport function mergeMetadata(metadataList: Metadata[]): Metadata {\n if (metadataList.length === 0) return {};\n\n const merged: Metadata = {};\n\n // Track the most recent title template from LAYOUTS (not from page).\n // The page is always the last entry in metadataList.\n let parentTemplate: string | undefined;\n\n for (let i = 0; i < metadataList.length; i++) {\n const meta = metadataList[i];\n const isPage = i === metadataList.length - 1;\n\n // Collect template from layouts only (page templates are ignored per Next.js spec)\n if (!isPage && meta.title && typeof meta.title === \"object\" && meta.title.template) {\n parentTemplate = meta.title.template;\n }\n\n // Shallow merge — later entries override earlier for top-level keys\n for (const key of Object.keys(meta)) {\n if (key === \"title\") continue; // Handle title separately below\n (merged as Record<string, unknown>)[key] = (meta as Record<string, unknown>)[key];\n }\n\n // Title resolution\n if (meta.title !== undefined) {\n merged.title = meta.title;\n }\n }\n\n // Now resolve the final title, applying the parent template if applicable\n const finalTitle = merged.title;\n if (finalTitle) {\n if (typeof finalTitle === \"string\") {\n // Simple string title — apply parent template\n if (parentTemplate) {\n merged.title = parentTemplate.replace(\"%s\", finalTitle);\n }\n } else if (typeof finalTitle === \"object\") {\n if (finalTitle.absolute) {\n // Absolute title — skip all templates\n merged.title = finalTitle.absolute;\n } else if (finalTitle.default) {\n // Title object with default — this is used when the segment IS the\n // defining layout (its own default doesn't get template-wrapped)\n merged.title = finalTitle.default;\n } else if (finalTitle.template && !finalTitle.default && !finalTitle.absolute) {\n // Template only with no default — no title to render\n merged.title = undefined;\n }\n }\n }\n\n return merged;\n}\n\n/**\n * Resolve metadata from a module. Handles both static `metadata` export\n * and async `generateMetadata()` function.\n *\n * @param parent - A Promise that resolves to the accumulated (merged) metadata\n * from all ancestor segments. Passed as the second argument to\n * `generateMetadata()`, matching Next.js's eager-execution-with-serial-\n * resolution approach. If not provided, defaults to a promise that resolves\n * to an empty object (so `await parent` never throws).\n */\nexport async function resolveModuleMetadata(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]> = {},\n searchParams?: Record<string, string>,\n parent: Promise<Metadata> = Promise.resolve({}),\n): Promise<Metadata | null> {\n if (typeof mod.generateMetadata === \"function\") {\n // Next.js 16 passes params/searchParams as Promises (async pattern).\n // makeThenableParams() normalises null-prototype + preserves sync access.\n const asyncParams = makeThenableParams(params);\n const sp = searchParams ?? {};\n const asyncSp = makeThenableParams(sp);\n return await mod.generateMetadata({ params: asyncParams, searchParams: asyncSp }, parent);\n }\n if (mod.metadata && typeof mod.metadata === \"object\") {\n return mod.metadata as Metadata;\n }\n return null;\n}\n\n/**\n * React component that renders metadata as HTML head elements.\n * Used by the RSC entry to inject into the <head>.\n */\nexport function MetadataHead({ metadata }: { metadata: Metadata }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Resolve metadataBase for URL composition\n const base = metadata.metadataBase;\n function resolveUrl(url: string | URL): string;\n function resolveUrl(url: string | URL | undefined): string | undefined;\n function resolveUrl(url: string | URL | undefined): string | undefined {\n if (!url) return undefined;\n // Coerce URL objects to strings (Next.js metadata allows string | URL)\n const s = typeof url === \"string\" ? url : url instanceof URL ? url.toString() : String(url);\n if (!base) return s;\n if (s.startsWith(\"http://\") || s.startsWith(\"https://\") || s.startsWith(\"//\")) return s;\n try {\n return new URL(s, base).toString();\n } catch {\n return s;\n }\n }\n\n // Title\n const title =\n typeof metadata.title === \"string\"\n ? metadata.title\n : typeof metadata.title === \"object\"\n ? metadata.title.absolute || metadata.title.default\n : undefined;\n if (title) {\n elements.push(<title key={key++}>{title}</title>);\n }\n\n // Description\n if (metadata.description) {\n elements.push(<meta key={key++} name=\"description\" content={metadata.description} />);\n }\n\n // Generator\n if (metadata.generator) {\n elements.push(<meta key={key++} name=\"generator\" content={metadata.generator} />);\n }\n\n // Application name\n if (metadata.applicationName) {\n elements.push(<meta key={key++} name=\"application-name\" content={metadata.applicationName} />);\n }\n\n // Referrer\n if (metadata.referrer) {\n elements.push(<meta key={key++} name=\"referrer\" content={metadata.referrer} />);\n }\n\n // Keywords\n if (metadata.keywords) {\n const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(\",\") : metadata.keywords;\n elements.push(<meta key={key++} name=\"keywords\" content={kw} />);\n }\n\n // Authors\n if (metadata.authors) {\n const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];\n for (const author of authorList) {\n if (author.name) {\n elements.push(<meta key={key++} name=\"author\" content={author.name} />);\n }\n if (author.url) {\n elements.push(<link key={key++} rel=\"author\" href={author.url} />);\n }\n }\n }\n\n // Creator\n if (metadata.creator) {\n elements.push(<meta key={key++} name=\"creator\" content={metadata.creator} />);\n }\n\n // Publisher\n if (metadata.publisher) {\n elements.push(<meta key={key++} name=\"publisher\" content={metadata.publisher} />);\n }\n\n // Format detection\n if (metadata.formatDetection) {\n const parts: string[] = [];\n if (metadata.formatDetection.telephone === false) parts.push(\"telephone=no\");\n if (metadata.formatDetection.address === false) parts.push(\"address=no\");\n if (metadata.formatDetection.email === false) parts.push(\"email=no\");\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"format-detection\" content={parts.join(\", \")} />);\n }\n }\n\n // Category\n if (metadata.category) {\n elements.push(<meta key={key++} name=\"category\" content={metadata.category} />);\n }\n\n // Robots\n if (metadata.robots) {\n if (typeof metadata.robots === \"string\") {\n elements.push(<meta key={key++} name=\"robots\" content={metadata.robots} />);\n } else {\n const { googleBot, ...robotsRest } = metadata.robots;\n const robotParts: string[] = [];\n for (const [k, v] of Object.entries(robotsRest)) {\n if (v === true) robotParts.push(k);\n else if (v === false) robotParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") robotParts.push(`${k}:${v}`);\n }\n if (robotParts.length > 0) {\n elements.push(<meta key={key++} name=\"robots\" content={robotParts.join(\", \")} />);\n }\n // googlebot\n if (googleBot) {\n if (typeof googleBot === \"string\") {\n elements.push(<meta key={key++} name=\"googlebot\" content={googleBot} />);\n } else {\n const gbParts: string[] = [];\n for (const [k, v] of Object.entries(googleBot)) {\n if (v === true) gbParts.push(k);\n else if (v === false) gbParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") gbParts.push(`${k}:${v}`);\n }\n if (gbParts.length > 0) {\n elements.push(<meta key={key++} name=\"googlebot\" content={gbParts.join(\", \")} />);\n }\n }\n }\n }\n }\n\n // Open Graph\n if (metadata.openGraph) {\n const og = metadata.openGraph;\n if (og.title) elements.push(<meta key={key++} property=\"og:title\" content={og.title} />);\n if (og.description)\n elements.push(<meta key={key++} property=\"og:description\" content={og.description} />);\n if (og.url) elements.push(<meta key={key++} property=\"og:url\" content={resolveUrl(og.url)} />);\n if (og.siteName)\n elements.push(<meta key={key++} property=\"og:site_name\" content={og.siteName} />);\n if (og.type) elements.push(<meta key={key++} property=\"og:type\" content={og.type} />);\n if (og.locale) elements.push(<meta key={key++} property=\"og:locale\" content={og.locale} />);\n if (og.publishedTime)\n elements.push(\n <meta key={key++} property=\"article:published_time\" content={og.publishedTime} />,\n );\n if (og.modifiedTime)\n elements.push(\n <meta key={key++} property=\"article:modified_time\" content={og.modifiedTime} />,\n );\n if (og.authors) {\n for (const author of og.authors) {\n elements.push(<meta key={key++} property=\"article:author\" content={author} />);\n }\n }\n if (og.images) {\n const imgList =\n typeof og.images === \"string\" || og.images instanceof URL\n ? [{ url: og.images }]\n : Array.isArray(og.images)\n ? og.images\n : [og.images];\n for (const img of imgList) {\n const imgUrl = typeof img === \"string\" || img instanceof URL ? img : img.url;\n elements.push(<meta key={key++} property=\"og:image\" content={resolveUrl(imgUrl)} />);\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.width)\n elements.push(\n <meta key={key++} property=\"og:image:width\" content={String(img.width)} />,\n );\n if (img.height)\n elements.push(\n <meta key={key++} property=\"og:image:height\" content={String(img.height)} />,\n );\n if (img.alt)\n elements.push(<meta key={key++} property=\"og:image:alt\" content={img.alt} />);\n }\n }\n }\n if (og.videos) {\n for (const video of og.videos) {\n elements.push(<meta key={key++} property=\"og:video\" content={resolveUrl(video.url)} />);\n if (video.width)\n elements.push(\n <meta key={key++} property=\"og:video:width\" content={String(video.width)} />,\n );\n if (video.height)\n elements.push(\n <meta key={key++} property=\"og:video:height\" content={String(video.height)} />,\n );\n }\n }\n if (og.audio) {\n for (const audio of og.audio) {\n elements.push(<meta key={key++} property=\"og:audio\" content={resolveUrl(audio.url)} />);\n }\n }\n }\n\n // Twitter\n if (metadata.twitter) {\n const tw = metadata.twitter;\n if (tw.card) elements.push(<meta key={key++} name=\"twitter:card\" content={tw.card} />);\n if (tw.site) elements.push(<meta key={key++} name=\"twitter:site\" content={tw.site} />);\n if (tw.siteId) elements.push(<meta key={key++} name=\"twitter:site:id\" content={tw.siteId} />);\n if (tw.title) elements.push(<meta key={key++} name=\"twitter:title\" content={tw.title} />);\n if (tw.description)\n elements.push(<meta key={key++} name=\"twitter:description\" content={tw.description} />);\n if (tw.creator) elements.push(<meta key={key++} name=\"twitter:creator\" content={tw.creator} />);\n if (tw.creatorId)\n elements.push(<meta key={key++} name=\"twitter:creator:id\" content={tw.creatorId} />);\n if (tw.images) {\n const imgList =\n typeof tw.images === \"string\" || tw.images instanceof URL\n ? [tw.images]\n : Array.isArray(tw.images)\n ? tw.images\n : [tw.images];\n for (const img of imgList) {\n const imgUrl = typeof img === \"string\" || img instanceof URL ? img : img.url;\n elements.push(<meta key={key++} name=\"twitter:image\" content={resolveUrl(imgUrl)} />);\n if (typeof img !== \"string\" && !(img instanceof URL) && img.alt) {\n elements.push(<meta key={key++} name=\"twitter:image:alt\" content={img.alt} />);\n }\n }\n }\n // Twitter player cards\n if (tw.players) {\n const players = Array.isArray(tw.players) ? tw.players : [tw.players];\n for (const player of players) {\n const playerUrl = player.playerUrl.toString();\n const streamUrl = player.streamUrl.toString();\n elements.push(<meta key={key++} name=\"twitter:player\" content={resolveUrl(playerUrl)} />);\n elements.push(\n <meta key={key++} name=\"twitter:player:stream\" content={resolveUrl(streamUrl)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:width\" content={String(player.width)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:height\" content={String(player.height)} />,\n );\n }\n }\n // Twitter app cards\n if (tw.app) {\n const { app } = tw;\n for (const platform of [\"iphone\", \"ipad\", \"googleplay\"] as const) {\n if (app.name) {\n elements.push(\n <meta key={key++} name={`twitter:app:name:${platform}`} content={app.name} />,\n );\n }\n if (app.id[platform] !== undefined) {\n elements.push(\n <meta\n key={key++}\n name={`twitter:app:id:${platform}`}\n content={String(app.id[platform])}\n />,\n );\n }\n if (app.url?.[platform] !== undefined) {\n const appUrl = app.url[platform]!.toString();\n elements.push(\n <meta key={key++} name={`twitter:app:url:${platform}`} content={resolveUrl(appUrl)} />,\n );\n }\n }\n }\n }\n\n // Icons\n if (metadata.icons) {\n const { icon, shortcut, apple, other } = metadata.icons;\n // Shortcut icon\n if (shortcut) {\n const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];\n for (const s of shortcuts) {\n elements.push(<link key={key++} rel=\"shortcut icon\" href={resolveUrl(s)} />);\n }\n }\n // Icon\n if (icon) {\n const icons = typeof icon === \"string\" || icon instanceof URL ? [{ url: icon }] : icon;\n for (const i of icons) {\n elements.push(\n <link\n key={key++}\n rel=\"icon\"\n href={resolveUrl(i.url)}\n {...(i.sizes ? { sizes: i.sizes } : {})}\n {...(i.type ? { type: i.type } : {})}\n {...(i.media ? { media: i.media } : {})}\n />,\n );\n }\n }\n // Apple touch icon\n if (apple) {\n const apples = typeof apple === \"string\" || apple instanceof URL ? [{ url: apple }] : apple;\n for (const a of apples) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-icon\"\n href={resolveUrl(a.url)}\n {...(a.sizes ? { sizes: a.sizes } : {})}\n {...(a.type ? { type: a.type } : {})}\n />,\n );\n }\n }\n // Other custom icon relations\n if (other) {\n for (const o of other) {\n elements.push(\n <link\n key={key++}\n rel={o.rel}\n href={resolveUrl(o.url)}\n {...(o.sizes ? { sizes: o.sizes } : {})}\n />,\n );\n }\n }\n }\n\n // Manifest\n if (metadata.manifest) {\n elements.push(<link key={key++} rel=\"manifest\" href={resolveUrl(metadata.manifest)} />);\n }\n\n // Alternates\n if (metadata.alternates) {\n const alt = metadata.alternates;\n if (alt.canonical) {\n elements.push(<link key={key++} rel=\"canonical\" href={resolveUrl(alt.canonical)} />);\n }\n if (alt.languages) {\n for (const [lang, href] of Object.entries(alt.languages)) {\n elements.push(<link key={key++} rel=\"alternate\" hrefLang={lang} href={resolveUrl(href)} />);\n }\n }\n if (alt.media) {\n for (const [media, href] of Object.entries(alt.media)) {\n elements.push(<link key={key++} rel=\"alternate\" media={media} href={resolveUrl(href)} />);\n }\n }\n if (alt.types) {\n for (const [type, href] of Object.entries(alt.types)) {\n elements.push(<link key={key++} rel=\"alternate\" type={type} href={resolveUrl(href)} />);\n }\n }\n }\n\n // Verification\n if (metadata.verification) {\n const v = metadata.verification;\n if (v.google)\n elements.push(<meta key={key++} name=\"google-site-verification\" content={v.google} />);\n if (v.yahoo) elements.push(<meta key={key++} name=\"y_key\" content={v.yahoo} />);\n if (v.yandex) elements.push(<meta key={key++} name=\"yandex-verification\" content={v.yandex} />);\n if (v.other) {\n for (const [name, content] of Object.entries(v.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n }\n\n // Apple Web App\n if (metadata.appleWebApp) {\n const awa = metadata.appleWebApp;\n if (awa.capable !== false) {\n elements.push(<meta key={key++} name=\"mobile-web-app-capable\" content=\"yes\" />);\n }\n if (awa.title) {\n elements.push(<meta key={key++} name=\"apple-mobile-web-app-title\" content={awa.title} />);\n }\n if (awa.statusBarStyle) {\n elements.push(\n <meta\n key={key++}\n name=\"apple-mobile-web-app-status-bar-style\"\n content={awa.statusBarStyle}\n />,\n );\n }\n if (awa.startupImage) {\n const imgs =\n typeof awa.startupImage === \"string\" ? [{ url: awa.startupImage }] : awa.startupImage;\n for (const img of imgs) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-startup-image\"\n href={resolveUrl(img.url)}\n {...(img.media ? { media: img.media } : {})}\n />,\n );\n }\n }\n }\n\n // iTunes\n if (metadata.itunes) {\n const { appId, appArgument } = metadata.itunes;\n let content = `app-id=${appId}`;\n if (appArgument) {\n content += `, app-argument=${appArgument}`;\n }\n elements.push(<meta key={key++} name=\"apple-itunes-app\" content={content} />);\n }\n\n // App Links\n if (metadata.appLinks) {\n const al = metadata.appLinks;\n const platforms = [\n \"ios\",\n \"iphone\",\n \"ipad\",\n \"android\",\n \"windows_phone\",\n \"windows\",\n \"windows_universal\",\n \"web\",\n ] as const;\n for (const platform of platforms) {\n const entries = al[platform];\n if (!entries) continue;\n const list = Array.isArray(entries) ? entries : [entries];\n for (const entry of list) {\n for (const [k, v] of Object.entries(entry)) {\n if (v === undefined || v === null) continue;\n const str = String(v);\n const content = k === \"url\" ? resolveUrl(str) : str;\n elements.push(<meta key={key++} property={`al:${platform}:${k}`} content={content} />);\n }\n }\n }\n }\n\n // Other custom meta tags\n if (metadata.other) {\n for (const [name, content] of Object.entries(metadata.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n\n return <>{elements}</>;\n}\n"],"mappings":";;;;;;;AAgBA,SAAS,mBAAsD,KAAwB;CACrF,MAAM,QAAQ,EAAE,GAAG,KAAK;AACxB,QA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CAAC,QAAQ;AACzD,QAAK,MAAM,SAAS,KAClB,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,EAAE;AAC1C,QAAI,MAAM,KAAA,KAAa,MAAM,KAAM;IACnC,MAAM,MAAM,OAAO,EAAE;IACrB,MAAM,UAAU,MAAM,QAAQ,WAAW,IAAI,GAAG;AAChD,aAAS,KAAK,oBAAC,QAAD;KAAkB,UAAU,MAAM,SAAS,GAAG;KAAc;KAAW,EAA5D,MAA4D,CAAC;;;;AAO9F,KAAI,SAAS,MACX,MAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,SAAS,MAAM,EAAE;EAC5D,MAAM,SAAS,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;AAC3D,OAAK,MAAM,OAAO,OAChB,UAAS,KAAK,oBAAC,QAAD;GAAwB;GAAM,SAAS;GAAO,EAAnC,MAAmC,CAAC;;AAKnE,QAAO,oBAAA,YAAA,EAAA,UAAG,UAAY,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import { NavigationContext } from "./navigation.js";
2
2
 
3
3
  //#region src/shims/navigation-state.d.ts
4
- interface NavigationState {
4
+ type NavigationState = {
5
5
  serverContext: NavigationContext | null;
6
6
  serverInsertedHTMLCallbacks: Array<() => unknown>;
7
- }
7
+ };
8
8
  /**
9
9
  * Run a function within a navigation ALS scope.
10
10
  * Ensures per-request isolation for navigation context and
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-state.js","names":[],"sources":["../../src/shims/navigation-state.ts"],"sourcesContent":["/**\n * Server-only navigation state backed by AsyncLocalStorage.\n *\n * This module provides request-scoped isolation for navigation context\n * and useServerInsertedHTML callbacks. Without ALS, concurrent requests\n * on Cloudflare Workers would share module-level state and leak data\n * (pathnames, params, CSS-in-JS styles) between requests.\n *\n * This module is server-only — it imports node:async_hooks and must NOT\n * be bundled for the browser. The dual-environment navigation.ts shim\n * uses a registration pattern so it works in both environments.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { _registerStateAccessors, type NavigationContext } from \"./navigation.js\";\nimport {\n isInsideUnifiedScope,\n getRequestContext,\n runWithUnifiedStateMutation,\n} from \"./unified-request-context.js\";\n\n// ---------------------------------------------------------------------------\n// ALS setup — same pattern as headers.ts\n// ---------------------------------------------------------------------------\n\nexport interface NavigationState {\n serverContext: NavigationContext | null;\n serverInsertedHTMLCallbacks: Array<() => unknown>;\n}\n\nconst _ALS_KEY = Symbol.for(\"vinext.navigation.als\");\nconst _FALLBACK_KEY = Symbol.for(\"vinext.navigation.fallback\");\nconst _g = globalThis as unknown as Record<PropertyKey, unknown>;\nconst _als = (_g[_ALS_KEY] ??=\n new AsyncLocalStorage<NavigationState>()) as AsyncLocalStorage<NavigationState>;\n\nconst _fallbackState = (_g[_FALLBACK_KEY] ??= {\n serverContext: null,\n serverInsertedHTMLCallbacks: [],\n} satisfies NavigationState) as NavigationState;\n\nfunction _getState(): NavigationState {\n if (isInsideUnifiedScope()) {\n return getRequestContext();\n }\n return _als.getStore() ?? _fallbackState;\n}\n\n/**\n * Run a function within a navigation ALS scope.\n * Ensures per-request isolation for navigation context and\n * useServerInsertedHTML callbacks on concurrent runtimes.\n */\nexport function runWithNavigationContext<T>(fn: () => T | Promise<T>): T | Promise<T> {\n if (isInsideUnifiedScope()) {\n return runWithUnifiedStateMutation((uCtx) => {\n uCtx.serverContext = null;\n uCtx.serverInsertedHTMLCallbacks = [];\n }, fn);\n }\n const state: NavigationState = {\n serverContext: null,\n serverInsertedHTMLCallbacks: [],\n };\n return _als.run(state, fn);\n}\n\n/**\n * Run a function with a fresh useServerInsertedHTML callback list while\n * preserving the current navigation context.\n *\n * Used by the Pages Router ISR cache-fill pass: it is the same request/path,\n * but it needs a fresh callback collection so CSS-in-JS insertions from the\n * streamed render cannot accumulate into the cache-fill render.\n */\nexport function runWithServerInsertedHTMLState<T>(fn: () => T | Promise<T>): T | Promise<T> {\n if (isInsideUnifiedScope()) {\n return runWithUnifiedStateMutation((uCtx) => {\n uCtx.serverInsertedHTMLCallbacks = [];\n }, fn);\n }\n\n const parentState = _als.getStore() ?? _fallbackState;\n const state: NavigationState = {\n serverContext: parentState.serverContext,\n serverInsertedHTMLCallbacks: [],\n };\n return _als.run(state, fn);\n}\n\n// ---------------------------------------------------------------------------\n// Register ALS-backed accessors into navigation.ts\n//\n// Two registration paths (issue #688):\n// 1. _registerStateAccessors — updates the module-level function pointers\n// in the same module instance that imported us (the SSR entry's copy).\n// 2. globalThis[Symbol.for(...)] — makes the accessors discoverable by ANY\n// module instance of navigation.ts, even if Vite created a separate one\n// for \"use client\" components due to pre-bundling or env separation.\n// ---------------------------------------------------------------------------\n\nimport { GLOBAL_ACCESSORS_KEY } from \"./navigation\";\n\nconst _accessors = {\n getServerContext(): NavigationContext | null {\n return _getState().serverContext;\n },\n\n setServerContext(ctx: NavigationContext | null): void {\n _getState().serverContext = ctx;\n },\n\n getInsertedHTMLCallbacks(): Array<() => unknown> {\n return _getState().serverInsertedHTMLCallbacks;\n },\n\n clearInsertedHTMLCallbacks(): void {\n _getState().serverInsertedHTMLCallbacks = [];\n },\n} satisfies Parameters<typeof _registerStateAccessors>[0];\n\n_registerStateAccessors(_accessors);\n(globalThis as unknown as Record<PropertyKey, unknown>)[GLOBAL_ACCESSORS_KEY] = _accessors;\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,MAAM,WAAW,OAAO,IAAI,wBAAwB;AACpD,MAAM,gBAAgB,OAAO,IAAI,6BAA6B;AAC9D,MAAM,KAAK;AACX,MAAM,OAAQ,GAAG,cACf,IAAI,mBAAoC;AAE1C,MAAM,iBAAkB,GAAG,mBAAmB;CAC5C,eAAe;CACf,6BAA6B,EAAE;CAChC;AAED,SAAS,YAA6B;AACpC,KAAI,sBAAsB,CACxB,QAAO,mBAAmB;AAE5B,QAAO,KAAK,UAAU,IAAI;;;;;;;AAQ5B,SAAgB,yBAA4B,IAA0C;AACpF,KAAI,sBAAsB,CACxB,QAAO,6BAA6B,SAAS;AAC3C,OAAK,gBAAgB;AACrB,OAAK,8BAA8B,EAAE;IACpC,GAAG;AAMR,QAAO,KAAK,IAJmB;EAC7B,eAAe;EACf,6BAA6B,EAAE;EAChC,EACsB,GAAG;;;;;;;;;;AAW5B,SAAgB,+BAAkC,IAA0C;AAC1F,KAAI,sBAAsB,CACxB,QAAO,6BAA6B,SAAS;AAC3C,OAAK,8BAA8B,EAAE;IACpC,GAAG;CAIR,MAAM,QAAyB;EAC7B,gBAFkB,KAAK,UAAU,IAAI,gBAEV;EAC3B,6BAA6B,EAAE;EAChC;AACD,QAAO,KAAK,IAAI,OAAO,GAAG;;AAgB5B,MAAM,aAAa;CACjB,mBAA6C;AAC3C,SAAO,WAAW,CAAC;;CAGrB,iBAAiB,KAAqC;AACpD,aAAW,CAAC,gBAAgB;;CAG9B,2BAAiD;AAC/C,SAAO,WAAW,CAAC;;CAGrB,6BAAmC;AACjC,aAAW,CAAC,8BAA8B,EAAE;;CAE/C;AAED,wBAAwB,WAAW;AACnC,WAAwD,wBAAwB"}
1
+ {"version":3,"file":"navigation-state.js","names":[],"sources":["../../src/shims/navigation-state.ts"],"sourcesContent":["/**\n * Server-only navigation state backed by AsyncLocalStorage.\n *\n * This module provides request-scoped isolation for navigation context\n * and useServerInsertedHTML callbacks. Without ALS, concurrent requests\n * on Cloudflare Workers would share module-level state and leak data\n * (pathnames, params, CSS-in-JS styles) between requests.\n *\n * This module is server-only — it imports node:async_hooks and must NOT\n * be bundled for the browser. The dual-environment navigation.ts shim\n * uses a registration pattern so it works in both environments.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport {\n _registerStateAccessors,\n type NavigationContext,\n GLOBAL_ACCESSORS_KEY,\n} from \"./navigation.js\";\nimport {\n isInsideUnifiedScope,\n getRequestContext,\n runWithUnifiedStateMutation,\n} from \"./unified-request-context.js\";\n\n// ---------------------------------------------------------------------------\n// ALS setup — same pattern as headers.ts\n// ---------------------------------------------------------------------------\n\nexport type NavigationState = {\n serverContext: NavigationContext | null;\n serverInsertedHTMLCallbacks: Array<() => unknown>;\n};\n\nconst _ALS_KEY = Symbol.for(\"vinext.navigation.als\");\nconst _FALLBACK_KEY = Symbol.for(\"vinext.navigation.fallback\");\nconst _g = globalThis as unknown as Record<PropertyKey, unknown>;\nconst _als = (_g[_ALS_KEY] ??=\n new AsyncLocalStorage<NavigationState>()) as AsyncLocalStorage<NavigationState>;\n\nconst _fallbackState = (_g[_FALLBACK_KEY] ??= {\n serverContext: null,\n serverInsertedHTMLCallbacks: [],\n} satisfies NavigationState) as NavigationState;\n\nfunction _getState(): NavigationState {\n if (isInsideUnifiedScope()) {\n return getRequestContext();\n }\n return _als.getStore() ?? _fallbackState;\n}\n\n/**\n * Run a function within a navigation ALS scope.\n * Ensures per-request isolation for navigation context and\n * useServerInsertedHTML callbacks on concurrent runtimes.\n */\nexport function runWithNavigationContext<T>(fn: () => T | Promise<T>): T | Promise<T> {\n if (isInsideUnifiedScope()) {\n return runWithUnifiedStateMutation((uCtx) => {\n uCtx.serverContext = null;\n uCtx.serverInsertedHTMLCallbacks = [];\n }, fn);\n }\n const state: NavigationState = {\n serverContext: null,\n serverInsertedHTMLCallbacks: [],\n };\n return _als.run(state, fn);\n}\n\n/**\n * Run a function with a fresh useServerInsertedHTML callback list while\n * preserving the current navigation context.\n *\n * Used by the Pages Router ISR cache-fill pass: it is the same request/path,\n * but it needs a fresh callback collection so CSS-in-JS insertions from the\n * streamed render cannot accumulate into the cache-fill render.\n */\nexport function runWithServerInsertedHTMLState<T>(fn: () => T | Promise<T>): T | Promise<T> {\n if (isInsideUnifiedScope()) {\n return runWithUnifiedStateMutation((uCtx) => {\n uCtx.serverInsertedHTMLCallbacks = [];\n }, fn);\n }\n\n const parentState = _als.getStore() ?? _fallbackState;\n const state: NavigationState = {\n serverContext: parentState.serverContext,\n serverInsertedHTMLCallbacks: [],\n };\n return _als.run(state, fn);\n}\n\n// ---------------------------------------------------------------------------\n// Register ALS-backed accessors into navigation.ts\n//\n// Two registration paths (issue #688):\n// 1. _registerStateAccessors — updates the module-level function pointers\n// in the same module instance that imported us (the SSR entry's copy).\n// 2. globalThis[Symbol.for(...)] — makes the accessors discoverable by ANY\n// module instance of navigation.ts, even if Vite created a separate one\n// for \"use client\" components due to pre-bundling or env separation.\n// ---------------------------------------------------------------------------\n\nconst _accessors = {\n getServerContext(): NavigationContext | null {\n return _getState().serverContext;\n },\n\n setServerContext(ctx: NavigationContext | null): void {\n _getState().serverContext = ctx;\n },\n\n getInsertedHTMLCallbacks(): Array<() => unknown> {\n return _getState().serverInsertedHTMLCallbacks;\n },\n\n clearInsertedHTMLCallbacks(): void {\n _getState().serverInsertedHTMLCallbacks = [];\n },\n} satisfies Parameters<typeof _registerStateAccessors>[0];\n\n_registerStateAccessors(_accessors);\n(globalThis as unknown as Record<PropertyKey, unknown>)[GLOBAL_ACCESSORS_KEY] = _accessors;\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAM,WAAW,OAAO,IAAI,wBAAwB;AACpD,MAAM,gBAAgB,OAAO,IAAI,6BAA6B;AAC9D,MAAM,KAAK;AACX,MAAM,OAAQ,GAAG,cACf,IAAI,mBAAoC;AAE1C,MAAM,iBAAkB,GAAG,mBAAmB;CAC5C,eAAe;CACf,6BAA6B,EAAE;CAChC;AAED,SAAS,YAA6B;AACpC,KAAI,sBAAsB,CACxB,QAAO,mBAAmB;AAE5B,QAAO,KAAK,UAAU,IAAI;;;;;;;AAQ5B,SAAgB,yBAA4B,IAA0C;AACpF,KAAI,sBAAsB,CACxB,QAAO,6BAA6B,SAAS;AAC3C,OAAK,gBAAgB;AACrB,OAAK,8BAA8B,EAAE;IACpC,GAAG;AAMR,QAAO,KAAK,IAJmB;EAC7B,eAAe;EACf,6BAA6B,EAAE;EAChC,EACsB,GAAG;;;;;;;;;;AAW5B,SAAgB,+BAAkC,IAA0C;AAC1F,KAAI,sBAAsB,CACxB,QAAO,6BAA6B,SAAS;AAC3C,OAAK,8BAA8B,EAAE;IACpC,GAAG;CAIR,MAAM,QAAyB;EAC7B,gBAFkB,KAAK,UAAU,IAAI,gBAEV;EAC3B,6BAA6B,EAAE;EAChC;AACD,QAAO,KAAK,IAAI,OAAO,GAAG;;AAc5B,MAAM,aAAa;CACjB,mBAA6C;AAC3C,SAAO,WAAW,CAAC;;CAGrB,iBAAiB,KAAqC;AACpD,aAAW,CAAC,gBAAgB;;CAG9B,2BAAiD;AAC/C,SAAO,WAAW,CAAC;;CAGrB,6BAAmC;AACjC,aAAW,CAAC,8BAA8B,EAAE;;CAE/C;AAED,wBAAwB,WAAW;AACnC,WAAwD,wBAAwB"}
@@ -2,23 +2,34 @@ import { ReadonlyURLSearchParams } from "./readonly-url-search-params.js";
2
2
  import * as React$1 from "react";
3
3
 
4
4
  //#region src/shims/navigation.d.ts
5
+ /**
6
+ * Map of parallel route key → child segments below the current layout.
7
+ * The "children" key is always present (the default parallel route).
8
+ * Named parallel routes add their own keys (e.g., "team", "analytics").
9
+ *
10
+ * Arrays are mutable (`string[]`) to match Next.js's public API return type
11
+ * without requiring `as` casts. The map itself is Readonly — no key addition.
12
+ */
13
+ type SegmentMap = Readonly<Record<string, string[]>> & {
14
+ readonly children: string[];
15
+ };
5
16
  declare const ServerInsertedHTMLContext: React$1.Context<((callback: () => unknown) => void) | null> | null;
6
17
  /**
7
18
  * Get or create the layout segment context.
8
19
  * Returns null in the RSC environment (createContext unavailable).
9
20
  */
10
- declare function getLayoutSegmentContext(): React$1.Context<string[]> | null;
11
- interface NavigationContext {
21
+ declare function getLayoutSegmentContext(): React$1.Context<SegmentMap> | null;
22
+ type NavigationContext = {
12
23
  pathname: string;
13
24
  searchParams: URLSearchParams;
14
25
  params: Record<string, string | string[]>;
15
- }
16
- interface _StateAccessors {
26
+ };
27
+ type _StateAccessors = {
17
28
  getServerContext: () => NavigationContext | null;
18
29
  setServerContext: (ctx: NavigationContext | null) => void;
19
30
  getInsertedHTMLCallbacks: () => Array<() => unknown>;
20
31
  clearInsertedHTMLCallbacks: () => void;
21
- }
32
+ };
22
33
  declare const GLOBAL_ACCESSORS_KEY: unique symbol;
23
34
  /**
24
35
  * Register ALS-backed state accessors. Called by navigation-state.ts on import.
@@ -36,14 +47,24 @@ declare function getNavigationContext(): NavigationContext | null;
36
47
  * Called by the framework entry before rendering each request.
37
48
  */
38
49
  declare function setNavigationContext(ctx: NavigationContext | null): void;
50
+ /** basePath from next.config.js, injected by the plugin at build time */
51
+ declare const __basePath: string;
39
52
  /** Maximum number of entries in the RSC prefetch cache. */
40
53
  declare const MAX_PREFETCH_CACHE_SIZE = 50;
41
54
  /** TTL for prefetch cache entries in ms (matches Next.js static prefetch TTL). */
42
55
  declare const PREFETCH_CACHE_TTL = 30000;
43
- interface PrefetchCacheEntry {
44
- response: Response;
56
+ /** A buffered RSC response stored as an ArrayBuffer for replay. */
57
+ type CachedRscResponse = {
58
+ buffer: ArrayBuffer;
59
+ contentType: string;
60
+ paramsHeader: string | null;
61
+ url: string;
62
+ };
63
+ type PrefetchCacheEntry = {
64
+ snapshot?: CachedRscResponse;
65
+ pending?: Promise<void>;
45
66
  timestamp: number;
46
- }
67
+ };
47
68
  /**
48
69
  * Convert a pathname (with optional query/hash) to its .rsc URL.
49
70
  * Strips trailing slashes before appending `.rsc` so that cache keys
@@ -58,12 +79,71 @@ declare function getPrefetchCache(): Map<string, PrefetchCacheEntry>;
58
79
  */
59
80
  declare function getPrefetchedUrls(): Set<string>;
60
81
  /**
61
- * Store a prefetched RSC response in the cache.
82
+ * Store a prefetched RSC response in the cache by snapshotting it to an
83
+ * ArrayBuffer. The snapshot completes asynchronously; during that window
84
+ * the entry is marked `pending` so consumePrefetchResponse() will skip it
85
+ * (the caller falls back to a fresh fetch, which is acceptable).
86
+ *
87
+ * Prefer prefetchRscResponse() for new call-sites — it handles the full
88
+ * prefetch lifecycle including dedup. storePrefetchResponse() is kept for
89
+ * backward compatibility and test helpers.
90
+ *
91
+ * NB: Caller is responsible for managing getPrefetchedUrls() — this
92
+ * function only stores the response in the prefetch cache.
93
+ */
94
+ declare function storePrefetchResponse(rscUrl: string, response: Response): void;
95
+ /**
96
+ * Snapshot an RSC response to an ArrayBuffer for caching and replay.
97
+ * Consumes the response body and stores it with content-type and URL metadata.
98
+ */
99
+ declare function snapshotRscResponse(response: Response): Promise<CachedRscResponse>;
100
+ /**
101
+ * Reconstruct a Response from a cached RSC snapshot.
102
+ * Creates a new Response with the original ArrayBuffer so createFromFetch
103
+ * can consume the stream from scratch.
104
+ *
105
+ * NOTE: The reconstructed Response always has `url === ""` — the Response
106
+ * constructor does not accept a `url` option, and `response.url` is read-only
107
+ * set by the fetch infrastructure. Callers that need the original URL should
108
+ * read it from `cached.url` directly rather than from the restored Response.
109
+ *
110
+ * @param copy - When true (default), copies the ArrayBuffer so the cached
111
+ * snapshot remains replayable (needed for the visited-response cache).
112
+ * Pass false for single-consumption paths (e.g. prefetch cache entries
113
+ * that are deleted after consumption) to avoid the extra allocation.
114
+ */
115
+ declare function restoreRscResponse(cached: CachedRscResponse, copy?: boolean): Response;
116
+ /**
117
+ * Prefetch an RSC response and snapshot it for later consumption.
118
+ * Stores the in-flight promise so immediate clicks can await it instead
119
+ * of firing a duplicate fetch.
62
120
  * Enforces a maximum cache size to prevent unbounded memory growth on
63
121
  * link-heavy pages.
64
122
  */
65
- declare function storePrefetchResponse(rscUrl: string, response: Response): void;
123
+ declare function prefetchRscResponse(rscUrl: string, fetchPromise: Promise<Response>): void;
124
+ /**
125
+ * Consume a prefetched response for a given rscUrl.
126
+ * Only returns settled (non-pending) snapshots synchronously.
127
+ * Returns null if the entry is still in flight or doesn't exist.
128
+ */
129
+ declare function consumePrefetchResponse(rscUrl: string): CachedRscResponse | null;
130
+ /**
131
+ * Mark a navigation snapshot as active. Called before startTransition
132
+ * in renderNavigationPayload. While active, hooks prefer the snapshot
133
+ * context value over useSyncExternalStore. Uses a counter (not boolean)
134
+ * to handle overlapping navigations — rapid clicks can interleave
135
+ * activate/deactivate if multiple transitions are in flight.
136
+ */
137
+ declare function activateNavigationSnapshot(): void;
138
+ type ClientNavigationRenderSnapshot = {
139
+ pathname: string;
140
+ searchParams: ReadonlyURLSearchParams;
141
+ params: Record<string, string | string[]>;
142
+ };
143
+ declare function getClientNavigationRenderContext(): React$1.Context<ClientNavigationRenderSnapshot | null> | null;
144
+ declare function createClientNavigationRenderSnapshot(href: string, params: Record<string, string | string[]>): ClientNavigationRenderSnapshot;
66
145
  declare function setClientParams(params: Record<string, string | string[]>): void;
146
+ declare function replaceClientParamsWithoutNotify(params: Record<string, string | string[]>): void;
67
147
  /** Get the current client params (for testing referential stability). */
68
148
  declare function getClientParams(): Record<string, string | string[]>;
69
149
  /**
@@ -79,6 +159,13 @@ declare function useSearchParams(): ReadonlyURLSearchParams;
79
159
  * Returns the dynamic params for the current route.
80
160
  */
81
161
  declare function useParams<T extends Record<string, string | string[]> = Record<string, string | string[]>>(): T;
162
+ declare function commitClientNavigationState(): void;
163
+ declare function pushHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null): void;
164
+ declare function replaceHistoryStateWithoutNotify(data: unknown, unused: string, url?: string | URL | null): void;
165
+ /**
166
+ * Navigate to a URL, handling external URLs, hash-only changes, and RSC navigation.
167
+ */
168
+ declare function navigateClientSide(href: string, mode: "push" | "replace", scroll: boolean): Promise<void>;
82
169
  /**
83
170
  * App Router's useRouter — returns push/replace/back/forward/refresh.
84
171
  * Different from Pages Router's useRouter (next/router).
@@ -108,19 +195,17 @@ declare function useRouter(): {
108
195
  *
109
196
  * @param parallelRoutesKey - Which parallel route to read (default: "children")
110
197
  */
111
- declare function useSelectedLayoutSegment(_parallelRoutesKey?: string): string | null;
198
+ declare function useSelectedLayoutSegment(parallelRoutesKey?: string): string | null;
112
199
  /**
113
200
  * Returns all active segments below the layout where it's called.
114
201
  *
115
202
  * Each layout in the App Router tree wraps its children with a
116
- * LayoutSegmentProvider whose value is the remaining route tree segments
117
- * (including route groups, with dynamic params resolved to actual values
118
- * and catch-all segments joined with "/"). This hook reads those segments
119
- * directly from context.
203
+ * LayoutSegmentProvider whose value is a map of parallel route key to
204
+ * segment arrays. The "children" key is the default parallel route.
120
205
  *
121
206
  * @param parallelRoutesKey - Which parallel route to read (default: "children")
122
207
  */
123
- declare function useSelectedLayoutSegments(_parallelRoutesKey?: string): string[];
208
+ declare function useSelectedLayoutSegments(parallelRoutesKey?: string): string[];
124
209
  /**
125
210
  * useServerInsertedHTML — inject HTML during SSR from client components.
126
211
  *
@@ -197,5 +282,5 @@ declare function forbidden(): never;
197
282
  */
198
283
  declare function unauthorized(): never;
199
284
  //#endregion
200
- export { GLOBAL_ACCESSORS_KEY, HTTP_ERROR_FALLBACK_ERROR_CODE, MAX_PREFETCH_CACHE_SIZE, NavigationContext, PREFETCH_CACHE_TTL, PrefetchCacheEntry, ReadonlyURLSearchParams, RedirectType, ServerInsertedHTMLContext, _registerStateAccessors, clearServerInsertedHTML, flushServerInsertedHTML, forbidden, getAccessFallbackHTTPStatus, getClientParams, getLayoutSegmentContext, getNavigationContext, getPrefetchCache, getPrefetchedUrls, isHTTPAccessFallbackError, notFound, permanentRedirect, redirect, setClientParams, setNavigationContext, storePrefetchResponse, toRscUrl, unauthorized, useParams, usePathname, useRouter, useSearchParams, useSelectedLayoutSegment, useSelectedLayoutSegments, useServerInsertedHTML };
285
+ export { CachedRscResponse, ClientNavigationRenderSnapshot, GLOBAL_ACCESSORS_KEY, HTTP_ERROR_FALLBACK_ERROR_CODE, MAX_PREFETCH_CACHE_SIZE, NavigationContext, PREFETCH_CACHE_TTL, PrefetchCacheEntry, ReadonlyURLSearchParams, RedirectType, SegmentMap, ServerInsertedHTMLContext, __basePath, _registerStateAccessors, activateNavigationSnapshot, clearServerInsertedHTML, commitClientNavigationState, consumePrefetchResponse, createClientNavigationRenderSnapshot, flushServerInsertedHTML, forbidden, getAccessFallbackHTTPStatus, getClientNavigationRenderContext, getClientParams, getLayoutSegmentContext, getNavigationContext, getPrefetchCache, getPrefetchedUrls, isHTTPAccessFallbackError, navigateClientSide, notFound, permanentRedirect, prefetchRscResponse, pushHistoryStateWithoutNotify, redirect, replaceClientParamsWithoutNotify, replaceHistoryStateWithoutNotify, restoreRscResponse, setClientParams, setNavigationContext, snapshotRscResponse, storePrefetchResponse, toRscUrl, unauthorized, useParams, usePathname, useRouter, useSearchParams, useSelectedLayoutSegment, useSelectedLayoutSegments, useServerInsertedHTML };
201
286
  //# sourceMappingURL=navigation.d.ts.map