vinext 0.0.30 → 0.0.32

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 (435) hide show
  1. package/README.md +15 -7
  2. package/dist/build/prerender.d.ts +188 -0
  3. package/dist/build/prerender.js +675 -0
  4. package/dist/build/prerender.js.map +1 -0
  5. package/dist/build/report.d.ts +45 -46
  6. package/dist/build/report.js +581 -276
  7. package/dist/build/report.js.map +1 -1
  8. package/dist/build/run-prerender.d.ts +62 -0
  9. package/dist/build/run-prerender.js +183 -0
  10. package/dist/build/run-prerender.js.map +1 -0
  11. package/dist/build/server-manifest.d.ts +19 -0
  12. package/dist/build/server-manifest.js +29 -0
  13. package/dist/build/server-manifest.js.map +1 -0
  14. package/dist/build/static-export.d.ts +51 -66
  15. package/dist/build/static-export.js +51 -545
  16. package/dist/build/static-export.js.map +1 -1
  17. package/dist/check.d.ts +26 -24
  18. package/dist/check.js +681 -571
  19. package/dist/check.js.map +1 -1
  20. package/dist/cli.d.ts +1 -15
  21. package/dist/cli.js +432 -491
  22. package/dist/cli.js.map +1 -1
  23. package/dist/client/entry.d.ts +1 -2
  24. package/dist/client/entry.js +49 -62
  25. package/dist/client/entry.js.map +1 -1
  26. package/dist/client/validate-module-path.d.ts +4 -1
  27. package/dist/client/validate-module-path.js +23 -28
  28. package/dist/client/validate-module-path.js.map +1 -1
  29. package/dist/client/vinext-next-data.d.ts +15 -20
  30. package/dist/client/vinext-next-data.js +0 -1
  31. package/dist/cloudflare/index.d.ts +3 -8
  32. package/dist/cloudflare/index.js +3 -8
  33. package/dist/cloudflare/kv-cache-handler.d.ts +95 -105
  34. package/dist/cloudflare/kv-cache-handler.js +354 -380
  35. package/dist/cloudflare/kv-cache-handler.js.map +1 -1
  36. package/dist/cloudflare/tpr.d.ts +36 -34
  37. package/dist/cloudflare/tpr.js +460 -603
  38. package/dist/cloudflare/tpr.js.map +1 -1
  39. package/dist/config/config-matchers.d.ts +31 -40
  40. package/dist/config/config-matchers.js +727 -936
  41. package/dist/config/config-matchers.js.map +1 -1
  42. package/dist/config/dotenv.d.ts +18 -11
  43. package/dist/config/dotenv.js +79 -84
  44. package/dist/config/dotenv.js.map +1 -1
  45. package/dist/config/next-config.d.ts +156 -146
  46. package/dist/config/next-config.js +376 -464
  47. package/dist/config/next-config.js.map +1 -1
  48. package/dist/deploy.d.ts +87 -96
  49. package/dist/deploy.js +490 -628
  50. package/dist/deploy.js.map +1 -1
  51. package/dist/entries/app-browser-entry.d.ts +4 -1
  52. package/dist/entries/app-browser-entry.js +12 -8
  53. package/dist/entries/app-browser-entry.js.map +1 -1
  54. package/dist/entries/app-rsc-entry.d.ts +33 -20
  55. package/dist/entries/app-rsc-entry.js +444 -212
  56. package/dist/entries/app-rsc-entry.js.map +1 -1
  57. package/dist/entries/app-ssr-entry.d.ts +9 -1
  58. package/dist/entries/app-ssr-entry.js +61 -28
  59. package/dist/entries/app-ssr-entry.js.map +1 -1
  60. package/dist/entries/pages-client-entry.d.ts +6 -2
  61. package/dist/entries/pages-client-entry.js +30 -33
  62. package/dist/entries/pages-client-entry.js.map +1 -1
  63. package/dist/entries/pages-entry-helpers.d.ts +5 -1
  64. package/dist/entries/pages-entry-helpers.js +17 -14
  65. package/dist/entries/pages-entry-helpers.js.map +1 -1
  66. package/dist/entries/pages-server-entry.d.ts +6 -2
  67. package/dist/entries/pages-server-entry.js +86 -114
  68. package/dist/entries/pages-server-entry.js.map +1 -1
  69. package/dist/index.d.ts +92 -60
  70. package/dist/index.js +2151 -3133
  71. package/dist/index.js.map +1 -1
  72. package/dist/init.d.ts +40 -37
  73. package/dist/init.js +201 -258
  74. package/dist/init.js.map +1 -1
  75. package/dist/plugins/async-hooks-stub.d.ts +7 -3
  76. package/dist/plugins/async-hooks-stub.js +39 -42
  77. package/dist/plugins/async-hooks-stub.js.map +1 -1
  78. package/dist/plugins/client-reference-dedup.d.ts +7 -3
  79. package/dist/plugins/client-reference-dedup.js +63 -88
  80. package/dist/plugins/client-reference-dedup.js.map +1 -1
  81. package/dist/routing/app-router.d.ts +100 -96
  82. package/dist/routing/app-router.js +560 -670
  83. package/dist/routing/app-router.js.map +1 -1
  84. package/dist/routing/file-matcher.d.ts +18 -15
  85. package/dist/routing/file-matcher.js +65 -65
  86. package/dist/routing/file-matcher.js.map +1 -1
  87. package/dist/routing/pages-router.d.ts +23 -24
  88. package/dist/routing/pages-router.js +147 -172
  89. package/dist/routing/pages-router.js.map +1 -1
  90. package/dist/routing/route-trie.d.ts +23 -20
  91. package/dist/routing/route-trie.js +131 -151
  92. package/dist/routing/route-trie.js.map +1 -1
  93. package/dist/routing/route-validation.d.ts +5 -2
  94. package/dist/routing/route-validation.js +98 -130
  95. package/dist/routing/route-validation.js.map +1 -1
  96. package/dist/routing/utils.d.ts +10 -7
  97. package/dist/routing/utils.js +75 -111
  98. package/dist/routing/utils.js.map +1 -1
  99. package/dist/server/api-handler.d.ts +8 -13
  100. package/dist/server/api-handler.js +160 -193
  101. package/dist/server/api-handler.js.map +1 -1
  102. package/dist/server/app-router-entry.d.ts +6 -16
  103. package/dist/server/app-router-entry.js +26 -54
  104. package/dist/server/app-router-entry.js.map +1 -1
  105. package/dist/server/dev-module-runner.d.ts +11 -64
  106. package/dist/server/dev-module-runner.js +89 -101
  107. package/dist/server/dev-module-runner.js.map +1 -1
  108. package/dist/server/dev-origin-check.d.ts +12 -10
  109. package/dist/server/dev-origin-check.js +98 -108
  110. package/dist/server/dev-origin-check.js.map +1 -1
  111. package/dist/server/dev-server.d.ts +19 -15
  112. package/dist/server/dev-server.js +543 -871
  113. package/dist/server/dev-server.js.map +1 -1
  114. package/dist/server/html.d.ts +4 -1
  115. package/dist/server/html.js +25 -26
  116. package/dist/server/html.js.map +1 -1
  117. package/dist/server/image-optimization.d.ts +31 -28
  118. package/dist/server/image-optimization.js +181 -210
  119. package/dist/server/image-optimization.js.map +1 -1
  120. package/dist/server/instrumentation.d.ts +34 -59
  121. package/dist/server/instrumentation.js +112 -125
  122. package/dist/server/instrumentation.js.map +1 -1
  123. package/dist/server/isr-cache.d.ts +16 -26
  124. package/dist/server/isr-cache.js +106 -128
  125. package/dist/server/isr-cache.js.map +1 -1
  126. package/dist/server/metadata-routes.d.ts +85 -88
  127. package/dist/server/metadata-routes.js +270 -317
  128. package/dist/server/metadata-routes.js.map +1 -1
  129. package/dist/server/middleware-codegen.d.ts +7 -4
  130. package/dist/server/middleware-codegen.js +61 -61
  131. package/dist/server/middleware-codegen.js.map +1 -1
  132. package/dist/server/middleware-request-headers.d.ts +8 -6
  133. package/dist/server/middleware-request-headers.js +47 -65
  134. package/dist/server/middleware-request-headers.js.map +1 -1
  135. package/dist/server/middleware.d.ts +32 -47
  136. package/dist/server/middleware.js +261 -409
  137. package/dist/server/middleware.js.map +1 -1
  138. package/dist/server/normalize-path.d.ts +4 -1
  139. package/dist/server/normalize-path.js +33 -47
  140. package/dist/server/normalize-path.js.map +1 -1
  141. package/dist/server/pages-i18n.d.ts +38 -30
  142. package/dist/server/pages-i18n.js +112 -139
  143. package/dist/server/pages-i18n.js.map +1 -1
  144. package/dist/server/prod-server.d.ts +19 -31
  145. package/dist/server/prod-server.js +715 -945
  146. package/dist/server/prod-server.js.map +1 -1
  147. package/dist/server/request-log.d.ts +18 -12
  148. package/dist/server/request-log.js +45 -52
  149. package/dist/server/request-log.js.map +1 -1
  150. package/dist/server/request-pipeline.d.ts +9 -17
  151. package/dist/server/request-pipeline.js +133 -184
  152. package/dist/server/request-pipeline.js.map +1 -1
  153. package/dist/server/worker-utils.d.ts +4 -1
  154. package/dist/server/worker-utils.js +31 -37
  155. package/dist/server/worker-utils.js.map +1 -1
  156. package/dist/shims/amp.d.ts +5 -2
  157. package/dist/shims/amp.js +19 -15
  158. package/dist/shims/amp.js.map +1 -1
  159. package/dist/shims/app.d.ts +8 -10
  160. package/dist/shims/app.js +0 -1
  161. package/dist/shims/cache-runtime.d.ts +20 -45
  162. package/dist/shims/cache-runtime.js +271 -422
  163. package/dist/shims/cache-runtime.js.map +1 -1
  164. package/dist/shims/cache.d.ts +130 -121
  165. package/dist/shims/cache.js +339 -427
  166. package/dist/shims/cache.js.map +1 -1
  167. package/dist/shims/client-only.d.ts +1 -18
  168. package/dist/shims/client-only.js +0 -17
  169. package/dist/shims/compat-router.d.ts +6 -1
  170. package/dist/shims/compat-router.js +23 -19
  171. package/dist/shims/compat-router.js.map +1 -1
  172. package/dist/shims/config.d.ts +7 -5
  173. package/dist/shims/config.js +16 -23
  174. package/dist/shims/config.js.map +1 -1
  175. package/dist/shims/constants.d.ts +119 -118
  176. package/dist/shims/constants.js +159 -164
  177. package/dist/shims/constants.js.map +1 -1
  178. package/dist/shims/document.d.ts +20 -16
  179. package/dist/shims/document.js +41 -22
  180. package/dist/shims/document.js.map +1 -1
  181. package/dist/shims/dynamic.d.ts +13 -22
  182. package/dist/shims/dynamic.js +122 -136
  183. package/dist/shims/dynamic.js.map +1 -1
  184. package/dist/shims/error-boundary.d.ts +22 -15
  185. package/dist/shims/error-boundary.js +81 -79
  186. package/dist/shims/error-boundary.js.map +1 -1
  187. package/dist/shims/error.d.ts +11 -12
  188. package/dist/shims/error.js +35 -39
  189. package/dist/shims/error.js.map +1 -1
  190. package/dist/shims/fetch-cache.d.ts +16 -14
  191. package/dist/shims/fetch-cache.js +439 -645
  192. package/dist/shims/fetch-cache.js.map +1 -1
  193. package/dist/shims/font-google-base.d.ts +28 -26
  194. package/dist/shims/font-google-base.js +238 -325
  195. package/dist/shims/font-google-base.js.map +1 -1
  196. package/dist/shims/font-google.d.ts +3 -3
  197. package/dist/shims/font-google.generated.d.ts +1928 -1924
  198. package/dist/shims/font-google.generated.js +1928 -2133
  199. package/dist/shims/font-google.generated.js.map +1 -1
  200. package/dist/shims/font-google.js +3 -3
  201. package/dist/shims/font-local.d.ts +28 -26
  202. package/dist/shims/font-local.js +204 -260
  203. package/dist/shims/font-local.js.map +1 -1
  204. package/dist/shims/form.d.ts +13 -27
  205. package/dist/shims/form.js +128 -180
  206. package/dist/shims/form.js.map +1 -1
  207. package/dist/shims/head-state.d.ts +8 -13
  208. package/dist/shims/head-state.js +25 -42
  209. package/dist/shims/head-state.js.map +1 -1
  210. package/dist/shims/head.d.ts +17 -20
  211. package/dist/shims/head.js +194 -250
  212. package/dist/shims/head.js.map +1 -1
  213. package/dist/shims/headers.d.ts +84 -78
  214. package/dist/shims/headers.js +447 -575
  215. package/dist/shims/headers.js.map +1 -1
  216. package/dist/shims/i18n-context.d.ts +16 -20
  217. package/dist/shims/i18n-context.js +35 -48
  218. package/dist/shims/i18n-context.js.map +1 -1
  219. package/dist/shims/i18n-state.d.ts +8 -14
  220. package/dist/shims/i18n-state.js +34 -42
  221. package/dist/shims/i18n-state.js.map +1 -1
  222. package/dist/shims/image-config.d.ts +11 -8
  223. package/dist/shims/image-config.js +50 -83
  224. package/dist/shims/image-config.js.map +1 -1
  225. package/dist/shims/image.d.ts +37 -46
  226. package/dist/shims/image.js +283 -308
  227. package/dist/shims/image.js.map +1 -1
  228. package/dist/shims/internal/api-utils.d.ts +7 -4
  229. package/dist/shims/internal/api-utils.js +0 -6
  230. package/dist/shims/internal/app-router-context.d.ts +22 -17
  231. package/dist/shims/internal/app-router-context.js +17 -13
  232. package/dist/shims/internal/app-router-context.js.map +1 -1
  233. package/dist/shims/internal/cookies.d.ts +2 -9
  234. package/dist/shims/internal/cookies.js +2 -9
  235. package/dist/shims/internal/parse-cookie-header.d.ts +4 -1
  236. package/dist/shims/internal/parse-cookie-header.js +29 -29
  237. package/dist/shims/internal/parse-cookie-header.js.map +1 -1
  238. package/dist/shims/internal/router-context.d.ts +7 -1
  239. package/dist/shims/internal/router-context.js +11 -7
  240. package/dist/shims/internal/router-context.js.map +1 -1
  241. package/dist/shims/internal/utils.d.ts +40 -37
  242. package/dist/shims/internal/utils.js +24 -30
  243. package/dist/shims/internal/utils.js.map +1 -1
  244. package/dist/shims/internal/work-unit-async-storage.d.ts +6 -10
  245. package/dist/shims/internal/work-unit-async-storage.js +14 -11
  246. package/dist/shims/internal/work-unit-async-storage.js.map +1 -1
  247. package/dist/shims/layout-segment-context.d.ts +11 -14
  248. package/dist/shims/layout-segment-context.js +24 -23
  249. package/dist/shims/layout-segment-context.js.map +1 -1
  250. package/dist/shims/legacy-image.d.ts +39 -46
  251. package/dist/shims/legacy-image.js +47 -42
  252. package/dist/shims/legacy-image.js.map +1 -1
  253. package/dist/shims/link.d.ts +32 -36
  254. package/dist/shims/link.js +255 -391
  255. package/dist/shims/link.js.map +1 -1
  256. package/dist/shims/metadata.d.ts +210 -202
  257. package/dist/shims/metadata.js +545 -546
  258. package/dist/shims/metadata.js.map +1 -1
  259. package/dist/shims/navigation-state.d.ts +10 -18
  260. package/dist/shims/navigation-state.js +66 -74
  261. package/dist/shims/navigation-state.js.map +1 -1
  262. package/dist/shims/navigation.d.ts +59 -63
  263. package/dist/shims/navigation.js +505 -704
  264. package/dist/shims/navigation.js.map +1 -1
  265. package/dist/shims/og.d.ts +2 -20
  266. package/dist/shims/og.js +2 -19
  267. package/dist/shims/readonly-url-search-params.d.ts +8 -5
  268. package/dist/shims/readonly-url-search-params.js +26 -22
  269. package/dist/shims/readonly-url-search-params.js.map +1 -1
  270. package/dist/shims/request-context.d.ts +8 -5
  271. package/dist/shims/request-context.js +50 -60
  272. package/dist/shims/request-context.js.map +1 -1
  273. package/dist/shims/request-state-types.d.ts +11 -11
  274. package/dist/shims/request-state-types.js +0 -1
  275. package/dist/shims/router-state.d.ts +13 -10
  276. package/dist/shims/router-state.js +34 -43
  277. package/dist/shims/router-state.js.map +1 -1
  278. package/dist/shims/router.d.ts +81 -85
  279. package/dist/shims/router.js +506 -628
  280. package/dist/shims/router.js.map +1 -1
  281. package/dist/shims/script.d.ts +39 -48
  282. package/dist/shims/script.js +107 -160
  283. package/dist/shims/script.js.map +1 -1
  284. package/dist/shims/server-only.d.ts +1 -19
  285. package/dist/shims/server-only.js +0 -18
  286. package/dist/shims/server.d.ts +213 -164
  287. package/dist/shims/server.js +545 -478
  288. package/dist/shims/server.js.map +1 -1
  289. package/dist/shims/unified-request-context.d.ts +20 -20
  290. package/dist/shims/unified-request-context.js +81 -99
  291. package/dist/shims/unified-request-context.js.map +1 -1
  292. package/dist/shims/url-safety.d.ts +4 -1
  293. package/dist/shims/url-safety.js +15 -11
  294. package/dist/shims/url-safety.js.map +1 -1
  295. package/dist/shims/url-utils.d.ts +8 -5
  296. package/dist/shims/url-utils.js +62 -93
  297. package/dist/shims/url-utils.js.map +1 -1
  298. package/dist/shims/web-vitals.d.ts +10 -8
  299. package/dist/shims/web-vitals.js +9 -15
  300. package/dist/shims/web-vitals.js.map +1 -1
  301. package/dist/utils/base-path.d.ts +5 -2
  302. package/dist/utils/base-path.js +21 -19
  303. package/dist/utils/base-path.js.map +1 -1
  304. package/dist/utils/domain-locale.d.ts +17 -9
  305. package/dist/utils/domain-locale.js +36 -56
  306. package/dist/utils/domain-locale.js.map +1 -1
  307. package/dist/utils/hash.d.ts +4 -1
  308. package/dist/utils/hash.js +19 -17
  309. package/dist/utils/hash.js.map +1 -1
  310. package/dist/utils/manifest-paths.d.ts +6 -3
  311. package/dist/utils/manifest-paths.js +15 -16
  312. package/dist/utils/manifest-paths.js.map +1 -1
  313. package/dist/utils/project.d.ts +13 -11
  314. package/dist/utils/project.js +169 -216
  315. package/dist/utils/project.js.map +1 -1
  316. package/dist/utils/query.d.ts +8 -6
  317. package/dist/utils/query.js +57 -67
  318. package/dist/utils/query.js.map +1 -1
  319. package/package.json +10 -9
  320. package/dist/build/report.d.ts.map +0 -1
  321. package/dist/build/static-export.d.ts.map +0 -1
  322. package/dist/check.d.ts.map +0 -1
  323. package/dist/cli.d.ts.map +0 -1
  324. package/dist/client/entry.d.ts.map +0 -1
  325. package/dist/client/validate-module-path.d.ts.map +0 -1
  326. package/dist/client/vinext-next-data.d.ts.map +0 -1
  327. package/dist/client/vinext-next-data.js.map +0 -1
  328. package/dist/cloudflare/index.d.ts.map +0 -1
  329. package/dist/cloudflare/index.js.map +0 -1
  330. package/dist/cloudflare/kv-cache-handler.d.ts.map +0 -1
  331. package/dist/cloudflare/tpr.d.ts.map +0 -1
  332. package/dist/config/config-matchers.d.ts.map +0 -1
  333. package/dist/config/dotenv.d.ts.map +0 -1
  334. package/dist/config/next-config.d.ts.map +0 -1
  335. package/dist/deploy.d.ts.map +0 -1
  336. package/dist/entries/app-browser-entry.d.ts.map +0 -1
  337. package/dist/entries/app-rsc-entry.d.ts.map +0 -1
  338. package/dist/entries/app-ssr-entry.d.ts.map +0 -1
  339. package/dist/entries/pages-client-entry.d.ts.map +0 -1
  340. package/dist/entries/pages-entry-helpers.d.ts.map +0 -1
  341. package/dist/entries/pages-server-entry.d.ts.map +0 -1
  342. package/dist/index.d.ts.map +0 -1
  343. package/dist/init.d.ts.map +0 -1
  344. package/dist/plugins/async-hooks-stub.d.ts.map +0 -1
  345. package/dist/plugins/client-reference-dedup.d.ts.map +0 -1
  346. package/dist/routing/app-router.d.ts.map +0 -1
  347. package/dist/routing/file-matcher.d.ts.map +0 -1
  348. package/dist/routing/pages-router.d.ts.map +0 -1
  349. package/dist/routing/route-trie.d.ts.map +0 -1
  350. package/dist/routing/route-validation.d.ts.map +0 -1
  351. package/dist/routing/utils.d.ts.map +0 -1
  352. package/dist/server/api-handler.d.ts.map +0 -1
  353. package/dist/server/app-router-entry.d.ts.map +0 -1
  354. package/dist/server/dev-module-runner.d.ts.map +0 -1
  355. package/dist/server/dev-origin-check.d.ts.map +0 -1
  356. package/dist/server/dev-server.d.ts.map +0 -1
  357. package/dist/server/html.d.ts.map +0 -1
  358. package/dist/server/image-optimization.d.ts.map +0 -1
  359. package/dist/server/instrumentation.d.ts.map +0 -1
  360. package/dist/server/isr-cache.d.ts.map +0 -1
  361. package/dist/server/metadata-routes.d.ts.map +0 -1
  362. package/dist/server/middleware-codegen.d.ts.map +0 -1
  363. package/dist/server/middleware-request-headers.d.ts.map +0 -1
  364. package/dist/server/middleware.d.ts.map +0 -1
  365. package/dist/server/normalize-path.d.ts.map +0 -1
  366. package/dist/server/pages-i18n.d.ts.map +0 -1
  367. package/dist/server/prod-server.d.ts.map +0 -1
  368. package/dist/server/request-log.d.ts.map +0 -1
  369. package/dist/server/request-pipeline.d.ts.map +0 -1
  370. package/dist/server/worker-utils.d.ts.map +0 -1
  371. package/dist/shims/amp.d.ts.map +0 -1
  372. package/dist/shims/app.d.ts.map +0 -1
  373. package/dist/shims/app.js.map +0 -1
  374. package/dist/shims/cache-runtime.d.ts.map +0 -1
  375. package/dist/shims/cache.d.ts.map +0 -1
  376. package/dist/shims/client-only.d.ts.map +0 -1
  377. package/dist/shims/client-only.js.map +0 -1
  378. package/dist/shims/compat-router.d.ts.map +0 -1
  379. package/dist/shims/config.d.ts.map +0 -1
  380. package/dist/shims/constants.d.ts.map +0 -1
  381. package/dist/shims/document.d.ts.map +0 -1
  382. package/dist/shims/dynamic.d.ts.map +0 -1
  383. package/dist/shims/error-boundary.d.ts.map +0 -1
  384. package/dist/shims/error.d.ts.map +0 -1
  385. package/dist/shims/fetch-cache.d.ts.map +0 -1
  386. package/dist/shims/font-google-base.d.ts.map +0 -1
  387. package/dist/shims/font-google.d.ts.map +0 -1
  388. package/dist/shims/font-google.generated.d.ts.map +0 -1
  389. package/dist/shims/font-google.js.map +0 -1
  390. package/dist/shims/font-local.d.ts.map +0 -1
  391. package/dist/shims/form.d.ts.map +0 -1
  392. package/dist/shims/head-state.d.ts.map +0 -1
  393. package/dist/shims/head.d.ts.map +0 -1
  394. package/dist/shims/headers.d.ts.map +0 -1
  395. package/dist/shims/i18n-context.d.ts.map +0 -1
  396. package/dist/shims/i18n-state.d.ts.map +0 -1
  397. package/dist/shims/image-config.d.ts.map +0 -1
  398. package/dist/shims/image.d.ts.map +0 -1
  399. package/dist/shims/internal/api-utils.d.ts.map +0 -1
  400. package/dist/shims/internal/api-utils.js.map +0 -1
  401. package/dist/shims/internal/app-router-context.d.ts.map +0 -1
  402. package/dist/shims/internal/cookies.d.ts.map +0 -1
  403. package/dist/shims/internal/cookies.js.map +0 -1
  404. package/dist/shims/internal/parse-cookie-header.d.ts.map +0 -1
  405. package/dist/shims/internal/router-context.d.ts.map +0 -1
  406. package/dist/shims/internal/utils.d.ts.map +0 -1
  407. package/dist/shims/internal/work-unit-async-storage.d.ts.map +0 -1
  408. package/dist/shims/layout-segment-context.d.ts.map +0 -1
  409. package/dist/shims/legacy-image.d.ts.map +0 -1
  410. package/dist/shims/link.d.ts.map +0 -1
  411. package/dist/shims/metadata.d.ts.map +0 -1
  412. package/dist/shims/navigation-state.d.ts.map +0 -1
  413. package/dist/shims/navigation.d.ts.map +0 -1
  414. package/dist/shims/og.d.ts.map +0 -1
  415. package/dist/shims/og.js.map +0 -1
  416. package/dist/shims/readonly-url-search-params.d.ts.map +0 -1
  417. package/dist/shims/request-context.d.ts.map +0 -1
  418. package/dist/shims/request-state-types.d.ts.map +0 -1
  419. package/dist/shims/request-state-types.js.map +0 -1
  420. package/dist/shims/router-state.d.ts.map +0 -1
  421. package/dist/shims/router.d.ts.map +0 -1
  422. package/dist/shims/script.d.ts.map +0 -1
  423. package/dist/shims/server-only.d.ts.map +0 -1
  424. package/dist/shims/server-only.js.map +0 -1
  425. package/dist/shims/server.d.ts.map +0 -1
  426. package/dist/shims/unified-request-context.d.ts.map +0 -1
  427. package/dist/shims/url-safety.d.ts.map +0 -1
  428. package/dist/shims/url-utils.d.ts.map +0 -1
  429. package/dist/shims/web-vitals.d.ts.map +0 -1
  430. package/dist/utils/base-path.d.ts.map +0 -1
  431. package/dist/utils/domain-locale.d.ts.map +0 -1
  432. package/dist/utils/hash.d.ts.map +0 -1
  433. package/dist/utils/manifest-paths.d.ts.map +0 -1
  434. package/dist/utils/project.d.ts.map +0 -1
  435. package/dist/utils/query.d.ts.map +0 -1
@@ -1,563 +1,562 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- // ---------------------------------------------------------------------------
3
- // Viewport types and resolution
4
- // ---------------------------------------------------------------------------
1
+ import "react";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ //#region src/shims/metadata.tsx
5
4
  /**
6
- * Normalize null-prototype objects from matchPattern() into thenable objects.
7
- * See entries/app-rsc-entry.ts makeThenableParams() for full explanation.
8
- */
5
+ * Normalize null-prototype objects from matchPattern() into thenable objects.
6
+ * See entries/app-rsc-entry.ts makeThenableParams() for full explanation.
7
+ */
9
8
  function makeThenableParams(obj) {
10
- const plain = { ...obj };
11
- return Object.assign(Promise.resolve(plain), plain);
9
+ const plain = { ...obj };
10
+ return Object.assign(Promise.resolve(plain), plain);
12
11
  }
13
12
  /**
14
- * Resolve viewport config from a module. Handles both static `viewport` export
15
- * and async `generateViewport()` function.
16
- */
17
- export async function resolveModuleViewport(mod, params) {
18
- if (typeof mod.generateViewport === "function") {
19
- const asyncParams = makeThenableParams(params);
20
- return await mod.generateViewport({ params: asyncParams });
21
- }
22
- if (mod.viewport && typeof mod.viewport === "object") {
23
- return mod.viewport;
24
- }
25
- return null;
13
+ * Resolve viewport config from a module. Handles both static `viewport` export
14
+ * and async `generateViewport()` function.
15
+ */
16
+ async function resolveModuleViewport(mod, params) {
17
+ if (typeof mod.generateViewport === "function") {
18
+ const asyncParams = makeThenableParams(params);
19
+ return await mod.generateViewport({ params: asyncParams });
20
+ }
21
+ if (mod.viewport && typeof mod.viewport === "object") return mod.viewport;
22
+ return null;
26
23
  }
27
24
  /**
28
- * Merge viewport configs from multiple sources (layouts + page).
29
- * Later entries override earlier ones.
30
- */
31
- export const DEFAULT_VIEWPORT = {
32
- width: "device-width",
33
- initialScale: 1,
25
+ * Merge viewport configs from multiple sources (layouts + page).
26
+ * Later entries override earlier ones.
27
+ */
28
+ const DEFAULT_VIEWPORT = {
29
+ width: "device-width",
30
+ initialScale: 1
34
31
  };
35
- export function mergeViewport(viewportList) {
36
- const merged = { ...DEFAULT_VIEWPORT };
37
- for (const vp of viewportList) {
38
- Object.assign(merged, vp);
39
- }
40
- return merged;
32
+ function mergeViewport(viewportList) {
33
+ const merged = { ...DEFAULT_VIEWPORT };
34
+ for (const vp of viewportList) Object.assign(merged, vp);
35
+ return merged;
41
36
  }
42
37
  /**
43
- * React component that renders viewport meta tags into <head>.
44
- */
45
- export function ViewportHead({ viewport }) {
46
- const elements = [];
47
- let key = 0;
48
- // Build viewport content string
49
- const parts = [];
50
- if (viewport.width !== undefined)
51
- parts.push(`width=${viewport.width}`);
52
- if (viewport.height !== undefined)
53
- parts.push(`height=${viewport.height}`);
54
- if (viewport.initialScale !== undefined)
55
- parts.push(`initial-scale=${viewport.initialScale}`);
56
- if (viewport.minimumScale !== undefined)
57
- parts.push(`minimum-scale=${viewport.minimumScale}`);
58
- if (viewport.maximumScale !== undefined)
59
- parts.push(`maximum-scale=${viewport.maximumScale}`);
60
- if (viewport.userScalable !== undefined)
61
- parts.push(`user-scalable=${viewport.userScalable ? "yes" : "no"}`);
62
- if (parts.length > 0) {
63
- elements.push(_jsx("meta", { name: "viewport", content: parts.join(", ") }, key++));
64
- }
65
- // Theme color
66
- if (viewport.themeColor) {
67
- if (typeof viewport.themeColor === "string") {
68
- elements.push(_jsx("meta", { name: "theme-color", content: viewport.themeColor }, key++));
69
- }
70
- else if (Array.isArray(viewport.themeColor)) {
71
- for (const entry of viewport.themeColor) {
72
- elements.push(_jsx("meta", { name: "theme-color", content: entry.color, ...(entry.media ? { media: entry.media } : {}) }, key++));
73
- }
74
- }
75
- }
76
- // Color scheme
77
- if (viewport.colorScheme) {
78
- elements.push(_jsx("meta", { name: "color-scheme", content: viewport.colorScheme }, key++));
79
- }
80
- return _jsx(_Fragment, { children: elements });
38
+ * React component that renders viewport meta tags into <head>.
39
+ */
40
+ function ViewportHead({ viewport }) {
41
+ const elements = [];
42
+ let key = 0;
43
+ const parts = [];
44
+ if (viewport.width !== void 0) parts.push(`width=${viewport.width}`);
45
+ if (viewport.height !== void 0) parts.push(`height=${viewport.height}`);
46
+ if (viewport.initialScale !== void 0) parts.push(`initial-scale=${viewport.initialScale}`);
47
+ if (viewport.minimumScale !== void 0) parts.push(`minimum-scale=${viewport.minimumScale}`);
48
+ if (viewport.maximumScale !== void 0) parts.push(`maximum-scale=${viewport.maximumScale}`);
49
+ if (viewport.userScalable !== void 0) parts.push(`user-scalable=${viewport.userScalable ? "yes" : "no"}`);
50
+ if (parts.length > 0) elements.push(/* @__PURE__ */ jsx("meta", {
51
+ name: "viewport",
52
+ content: parts.join(", ")
53
+ }, key++));
54
+ if (viewport.themeColor) {
55
+ if (typeof viewport.themeColor === "string") elements.push(/* @__PURE__ */ jsx("meta", {
56
+ name: "theme-color",
57
+ content: viewport.themeColor
58
+ }, key++));
59
+ else if (Array.isArray(viewport.themeColor)) for (const entry of viewport.themeColor) elements.push(/* @__PURE__ */ jsx("meta", {
60
+ name: "theme-color",
61
+ content: entry.color,
62
+ ...entry.media ? { media: entry.media } : {}
63
+ }, key++));
64
+ }
65
+ if (viewport.colorScheme) elements.push(/* @__PURE__ */ jsx("meta", {
66
+ name: "color-scheme",
67
+ content: viewport.colorScheme
68
+ }, key++));
69
+ return /* @__PURE__ */ jsx(Fragment, { children: elements });
81
70
  }
82
71
  /**
83
- * Merge metadata from multiple sources (layouts + page).
84
- *
85
- * The list is ordered [rootLayout, nestedLayout, ..., page].
86
- * Title template from layouts applies to the page title but NOT to
87
- * the segment that defines the template itself. `title.absolute`
88
- * skips all templates. `title.default` is the fallback when no
89
- * child provides a title.
90
- *
91
- * Shallow merge: later entries override earlier ones (per Next.js docs).
92
- */
93
- export function mergeMetadata(metadataList) {
94
- if (metadataList.length === 0)
95
- return {};
96
- const merged = {};
97
- // Track the most recent title template from LAYOUTS (not from page).
98
- // The page is always the last entry in metadataList.
99
- let parentTemplate;
100
- for (let i = 0; i < metadataList.length; i++) {
101
- const meta = metadataList[i];
102
- const isPage = i === metadataList.length - 1;
103
- // Collect template from layouts only (page templates are ignored per Next.js spec)
104
- if (!isPage && meta.title && typeof meta.title === "object" && meta.title.template) {
105
- parentTemplate = meta.title.template;
106
- }
107
- // Shallow merge — later entries override earlier for top-level keys
108
- for (const key of Object.keys(meta)) {
109
- if (key === "title")
110
- continue; // Handle title separately below
111
- merged[key] = meta[key];
112
- }
113
- // Title resolution
114
- if (meta.title !== undefined) {
115
- merged.title = meta.title;
116
- }
117
- }
118
- // Now resolve the final title, applying the parent template if applicable
119
- const finalTitle = merged.title;
120
- if (finalTitle) {
121
- if (typeof finalTitle === "string") {
122
- // Simple string title — apply parent template
123
- if (parentTemplate) {
124
- merged.title = parentTemplate.replace("%s", finalTitle);
125
- }
126
- }
127
- else if (typeof finalTitle === "object") {
128
- if (finalTitle.absolute) {
129
- // Absolute title — skip all templates
130
- merged.title = finalTitle.absolute;
131
- }
132
- else if (finalTitle.default) {
133
- // Title object with default — this is used when the segment IS the
134
- // defining layout (its own default doesn't get template-wrapped)
135
- merged.title = finalTitle.default;
136
- }
137
- else if (finalTitle.template && !finalTitle.default && !finalTitle.absolute) {
138
- // Template only with no default — no title to render
139
- merged.title = undefined;
140
- }
141
- }
142
- }
143
- return merged;
72
+ * Merge metadata from multiple sources (layouts + page).
73
+ *
74
+ * The list is ordered [rootLayout, nestedLayout, ..., page].
75
+ * Title template from layouts applies to the page title but NOT to
76
+ * the segment that defines the template itself. `title.absolute`
77
+ * skips all templates. `title.default` is the fallback when no
78
+ * child provides a title.
79
+ *
80
+ * Shallow merge: later entries override earlier ones (per Next.js docs).
81
+ */
82
+ function mergeMetadata(metadataList) {
83
+ if (metadataList.length === 0) return {};
84
+ const merged = {};
85
+ let parentTemplate;
86
+ for (let i = 0; i < metadataList.length; i++) {
87
+ const meta = metadataList[i];
88
+ if (!(i === metadataList.length - 1) && meta.title && typeof meta.title === "object" && meta.title.template) parentTemplate = meta.title.template;
89
+ for (const key of Object.keys(meta)) {
90
+ if (key === "title") continue;
91
+ merged[key] = meta[key];
92
+ }
93
+ if (meta.title !== void 0) merged.title = meta.title;
94
+ }
95
+ const finalTitle = merged.title;
96
+ if (finalTitle) {
97
+ if (typeof finalTitle === "string") {
98
+ if (parentTemplate) merged.title = parentTemplate.replace("%s", finalTitle);
99
+ } else if (typeof finalTitle === "object") {
100
+ if (finalTitle.absolute) merged.title = finalTitle.absolute;
101
+ else if (finalTitle.default) merged.title = finalTitle.default;
102
+ else if (finalTitle.template && !finalTitle.default && !finalTitle.absolute) merged.title = void 0;
103
+ }
104
+ }
105
+ return merged;
144
106
  }
145
107
  /**
146
- * Resolve metadata from a module. Handles both static `metadata` export
147
- * and async `generateMetadata()` function.
148
- *
149
- * @param parent - A Promise that resolves to the accumulated (merged) metadata
150
- * from all ancestor segments. Passed as the second argument to
151
- * `generateMetadata()`, matching Next.js's eager-execution-with-serial-
152
- * resolution approach. If not provided, defaults to a promise that resolves
153
- * to an empty object (so `await parent` never throws).
154
- */
155
- export async function resolveModuleMetadata(mod, params = {}, searchParams, parent = Promise.resolve({})) {
156
- if (typeof mod.generateMetadata === "function") {
157
- // Next.js 16 passes params/searchParams as Promises (async pattern).
158
- // makeThenableParams() normalises null-prototype + preserves sync access.
159
- const asyncParams = makeThenableParams(params);
160
- const sp = searchParams ?? {};
161
- const asyncSp = makeThenableParams(sp);
162
- return await mod.generateMetadata({ params: asyncParams, searchParams: asyncSp }, parent);
163
- }
164
- if (mod.metadata && typeof mod.metadata === "object") {
165
- return mod.metadata;
166
- }
167
- return null;
108
+ * Resolve metadata from a module. Handles both static `metadata` export
109
+ * and async `generateMetadata()` function.
110
+ *
111
+ * @param parent - A Promise that resolves to the accumulated (merged) metadata
112
+ * from all ancestor segments. Passed as the second argument to
113
+ * `generateMetadata()`, matching Next.js's eager-execution-with-serial-
114
+ * resolution approach. If not provided, defaults to a promise that resolves
115
+ * to an empty object (so `await parent` never throws).
116
+ */
117
+ async function resolveModuleMetadata(mod, params = {}, searchParams, parent = Promise.resolve({})) {
118
+ if (typeof mod.generateMetadata === "function") {
119
+ const asyncParams = makeThenableParams(params);
120
+ const asyncSp = makeThenableParams(searchParams ?? {});
121
+ return await mod.generateMetadata({
122
+ params: asyncParams,
123
+ searchParams: asyncSp
124
+ }, parent);
125
+ }
126
+ if (mod.metadata && typeof mod.metadata === "object") return mod.metadata;
127
+ return null;
168
128
  }
169
129
  /**
170
- * React component that renders metadata as HTML head elements.
171
- * Used by the RSC entry to inject into the <head>.
172
- */
173
- export function MetadataHead({ metadata }) {
174
- const elements = [];
175
- let key = 0;
176
- // Resolve metadataBase for URL composition
177
- const base = metadata.metadataBase;
178
- function resolveUrl(url) {
179
- if (!url)
180
- return undefined;
181
- // Coerce URL objects to strings (Next.js metadata allows string | URL)
182
- const s = typeof url === "string" ? url : url instanceof URL ? url.toString() : String(url);
183
- if (!base)
184
- return s;
185
- if (s.startsWith("http://") || s.startsWith("https://") || s.startsWith("//"))
186
- return s;
187
- try {
188
- return new URL(s, base).toString();
189
- }
190
- catch {
191
- return s;
192
- }
193
- }
194
- // Title
195
- const title = typeof metadata.title === "string"
196
- ? metadata.title
197
- : typeof metadata.title === "object"
198
- ? metadata.title.absolute || metadata.title.default
199
- : undefined;
200
- if (title) {
201
- elements.push(_jsx("title", { children: title }, key++));
202
- }
203
- // Description
204
- if (metadata.description) {
205
- elements.push(_jsx("meta", { name: "description", content: metadata.description }, key++));
206
- }
207
- // Generator
208
- if (metadata.generator) {
209
- elements.push(_jsx("meta", { name: "generator", content: metadata.generator }, key++));
210
- }
211
- // Application name
212
- if (metadata.applicationName) {
213
- elements.push(_jsx("meta", { name: "application-name", content: metadata.applicationName }, key++));
214
- }
215
- // Referrer
216
- if (metadata.referrer) {
217
- elements.push(_jsx("meta", { name: "referrer", content: metadata.referrer }, key++));
218
- }
219
- // Keywords
220
- if (metadata.keywords) {
221
- const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(",") : metadata.keywords;
222
- elements.push(_jsx("meta", { name: "keywords", content: kw }, key++));
223
- }
224
- // Authors
225
- if (metadata.authors) {
226
- const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];
227
- for (const author of authorList) {
228
- if (author.name) {
229
- elements.push(_jsx("meta", { name: "author", content: author.name }, key++));
230
- }
231
- if (author.url) {
232
- elements.push(_jsx("link", { rel: "author", href: author.url }, key++));
233
- }
234
- }
235
- }
236
- // Creator
237
- if (metadata.creator) {
238
- elements.push(_jsx("meta", { name: "creator", content: metadata.creator }, key++));
239
- }
240
- // Publisher
241
- if (metadata.publisher) {
242
- elements.push(_jsx("meta", { name: "publisher", content: metadata.publisher }, key++));
243
- }
244
- // Format detection
245
- if (metadata.formatDetection) {
246
- const parts = [];
247
- if (metadata.formatDetection.telephone === false)
248
- parts.push("telephone=no");
249
- if (metadata.formatDetection.address === false)
250
- parts.push("address=no");
251
- if (metadata.formatDetection.email === false)
252
- parts.push("email=no");
253
- if (parts.length > 0) {
254
- elements.push(_jsx("meta", { name: "format-detection", content: parts.join(", ") }, key++));
255
- }
256
- }
257
- // Category
258
- if (metadata.category) {
259
- elements.push(_jsx("meta", { name: "category", content: metadata.category }, key++));
260
- }
261
- // Robots
262
- if (metadata.robots) {
263
- if (typeof metadata.robots === "string") {
264
- elements.push(_jsx("meta", { name: "robots", content: metadata.robots }, key++));
265
- }
266
- else {
267
- const { googleBot, ...robotsRest } = metadata.robots;
268
- const robotParts = [];
269
- for (const [k, v] of Object.entries(robotsRest)) {
270
- if (v === true)
271
- robotParts.push(k);
272
- else if (v === false)
273
- robotParts.push(`no${k}`);
274
- else if (typeof v === "string" || typeof v === "number")
275
- robotParts.push(`${k}:${v}`);
276
- }
277
- if (robotParts.length > 0) {
278
- elements.push(_jsx("meta", { name: "robots", content: robotParts.join(", ") }, key++));
279
- }
280
- // googlebot
281
- if (googleBot) {
282
- if (typeof googleBot === "string") {
283
- elements.push(_jsx("meta", { name: "googlebot", content: googleBot }, key++));
284
- }
285
- else {
286
- const gbParts = [];
287
- for (const [k, v] of Object.entries(googleBot)) {
288
- if (v === true)
289
- gbParts.push(k);
290
- else if (v === false)
291
- gbParts.push(`no${k}`);
292
- else if (typeof v === "string" || typeof v === "number")
293
- gbParts.push(`${k}:${v}`);
294
- }
295
- if (gbParts.length > 0) {
296
- elements.push(_jsx("meta", { name: "googlebot", content: gbParts.join(", ") }, key++));
297
- }
298
- }
299
- }
300
- }
301
- }
302
- // Open Graph
303
- if (metadata.openGraph) {
304
- const og = metadata.openGraph;
305
- if (og.title)
306
- elements.push(_jsx("meta", { property: "og:title", content: og.title }, key++));
307
- if (og.description)
308
- elements.push(_jsx("meta", { property: "og:description", content: og.description }, key++));
309
- if (og.url)
310
- elements.push(_jsx("meta", { property: "og:url", content: resolveUrl(og.url) }, key++));
311
- if (og.siteName)
312
- elements.push(_jsx("meta", { property: "og:site_name", content: og.siteName }, key++));
313
- if (og.type)
314
- elements.push(_jsx("meta", { property: "og:type", content: og.type }, key++));
315
- if (og.locale)
316
- elements.push(_jsx("meta", { property: "og:locale", content: og.locale }, key++));
317
- if (og.publishedTime)
318
- elements.push(_jsx("meta", { property: "article:published_time", content: og.publishedTime }, key++));
319
- if (og.modifiedTime)
320
- elements.push(_jsx("meta", { property: "article:modified_time", content: og.modifiedTime }, key++));
321
- if (og.authors) {
322
- for (const author of og.authors) {
323
- elements.push(_jsx("meta", { property: "article:author", content: author }, key++));
324
- }
325
- }
326
- if (og.images) {
327
- const imgList = typeof og.images === "string" || og.images instanceof URL
328
- ? [{ url: og.images }]
329
- : Array.isArray(og.images)
330
- ? og.images
331
- : [og.images];
332
- for (const img of imgList) {
333
- const imgUrl = typeof img === "string" || img instanceof URL ? img : img.url;
334
- elements.push(_jsx("meta", { property: "og:image", content: resolveUrl(imgUrl) }, key++));
335
- if (typeof img !== "string" && !(img instanceof URL)) {
336
- if (img.width)
337
- elements.push(_jsx("meta", { property: "og:image:width", content: String(img.width) }, key++));
338
- if (img.height)
339
- elements.push(_jsx("meta", { property: "og:image:height", content: String(img.height) }, key++));
340
- if (img.alt)
341
- elements.push(_jsx("meta", { property: "og:image:alt", content: img.alt }, key++));
342
- }
343
- }
344
- }
345
- if (og.videos) {
346
- for (const video of og.videos) {
347
- elements.push(_jsx("meta", { property: "og:video", content: resolveUrl(video.url) }, key++));
348
- if (video.width)
349
- elements.push(_jsx("meta", { property: "og:video:width", content: String(video.width) }, key++));
350
- if (video.height)
351
- elements.push(_jsx("meta", { property: "og:video:height", content: String(video.height) }, key++));
352
- }
353
- }
354
- if (og.audio) {
355
- for (const audio of og.audio) {
356
- elements.push(_jsx("meta", { property: "og:audio", content: resolveUrl(audio.url) }, key++));
357
- }
358
- }
359
- }
360
- // Twitter
361
- if (metadata.twitter) {
362
- const tw = metadata.twitter;
363
- if (tw.card)
364
- elements.push(_jsx("meta", { name: "twitter:card", content: tw.card }, key++));
365
- if (tw.site)
366
- elements.push(_jsx("meta", { name: "twitter:site", content: tw.site }, key++));
367
- if (tw.siteId)
368
- elements.push(_jsx("meta", { name: "twitter:site:id", content: tw.siteId }, key++));
369
- if (tw.title)
370
- elements.push(_jsx("meta", { name: "twitter:title", content: tw.title }, key++));
371
- if (tw.description)
372
- elements.push(_jsx("meta", { name: "twitter:description", content: tw.description }, key++));
373
- if (tw.creator)
374
- elements.push(_jsx("meta", { name: "twitter:creator", content: tw.creator }, key++));
375
- if (tw.creatorId)
376
- elements.push(_jsx("meta", { name: "twitter:creator:id", content: tw.creatorId }, key++));
377
- if (tw.images) {
378
- const imgList = typeof tw.images === "string" || tw.images instanceof URL
379
- ? [tw.images]
380
- : Array.isArray(tw.images)
381
- ? tw.images
382
- : [tw.images];
383
- for (const img of imgList) {
384
- const imgUrl = typeof img === "string" || img instanceof URL ? img : img.url;
385
- elements.push(_jsx("meta", { name: "twitter:image", content: resolveUrl(imgUrl) }, key++));
386
- if (typeof img !== "string" && !(img instanceof URL) && img.alt) {
387
- elements.push(_jsx("meta", { name: "twitter:image:alt", content: img.alt }, key++));
388
- }
389
- }
390
- }
391
- // Twitter player cards
392
- if (tw.players) {
393
- const players = Array.isArray(tw.players) ? tw.players : [tw.players];
394
- for (const player of players) {
395
- const playerUrl = player.playerUrl.toString();
396
- const streamUrl = player.streamUrl.toString();
397
- elements.push(_jsx("meta", { name: "twitter:player", content: resolveUrl(playerUrl) }, key++));
398
- elements.push(_jsx("meta", { name: "twitter:player:stream", content: resolveUrl(streamUrl) }, key++));
399
- elements.push(_jsx("meta", { name: "twitter:player:width", content: String(player.width) }, key++));
400
- elements.push(_jsx("meta", { name: "twitter:player:height", content: String(player.height) }, key++));
401
- }
402
- }
403
- // Twitter app cards
404
- if (tw.app) {
405
- const { app } = tw;
406
- for (const platform of ["iphone", "ipad", "googleplay"]) {
407
- if (app.name) {
408
- elements.push(_jsx("meta", { name: `twitter:app:name:${platform}`, content: app.name }, key++));
409
- }
410
- if (app.id[platform] !== undefined) {
411
- elements.push(_jsx("meta", { name: `twitter:app:id:${platform}`, content: String(app.id[platform]) }, key++));
412
- }
413
- if (app.url?.[platform] !== undefined) {
414
- const appUrl = app.url[platform].toString();
415
- elements.push(_jsx("meta", { name: `twitter:app:url:${platform}`, content: resolveUrl(appUrl) }, key++));
416
- }
417
- }
418
- }
419
- }
420
- // Icons
421
- if (metadata.icons) {
422
- const { icon, shortcut, apple, other } = metadata.icons;
423
- // Shortcut icon
424
- if (shortcut) {
425
- const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
426
- for (const s of shortcuts) {
427
- elements.push(_jsx("link", { rel: "shortcut icon", href: resolveUrl(s) }, key++));
428
- }
429
- }
430
- // Icon
431
- if (icon) {
432
- const icons = typeof icon === "string" || icon instanceof URL ? [{ url: icon }] : icon;
433
- for (const i of icons) {
434
- elements.push(_jsx("link", { rel: "icon", href: resolveUrl(i.url), ...(i.sizes ? { sizes: i.sizes } : {}), ...(i.type ? { type: i.type } : {}), ...(i.media ? { media: i.media } : {}) }, key++));
435
- }
436
- }
437
- // Apple touch icon
438
- if (apple) {
439
- const apples = typeof apple === "string" || apple instanceof URL ? [{ url: apple }] : apple;
440
- for (const a of apples) {
441
- elements.push(_jsx("link", { rel: "apple-touch-icon", href: resolveUrl(a.url), ...(a.sizes ? { sizes: a.sizes } : {}), ...(a.type ? { type: a.type } : {}) }, key++));
442
- }
443
- }
444
- // Other custom icon relations
445
- if (other) {
446
- for (const o of other) {
447
- elements.push(_jsx("link", { rel: o.rel, href: resolveUrl(o.url), ...(o.sizes ? { sizes: o.sizes } : {}) }, key++));
448
- }
449
- }
450
- }
451
- // Manifest
452
- if (metadata.manifest) {
453
- elements.push(_jsx("link", { rel: "manifest", href: resolveUrl(metadata.manifest) }, key++));
454
- }
455
- // Alternates
456
- if (metadata.alternates) {
457
- const alt = metadata.alternates;
458
- if (alt.canonical) {
459
- elements.push(_jsx("link", { rel: "canonical", href: resolveUrl(alt.canonical) }, key++));
460
- }
461
- if (alt.languages) {
462
- for (const [lang, href] of Object.entries(alt.languages)) {
463
- elements.push(_jsx("link", { rel: "alternate", hrefLang: lang, href: resolveUrl(href) }, key++));
464
- }
465
- }
466
- if (alt.media) {
467
- for (const [media, href] of Object.entries(alt.media)) {
468
- elements.push(_jsx("link", { rel: "alternate", media: media, href: resolveUrl(href) }, key++));
469
- }
470
- }
471
- if (alt.types) {
472
- for (const [type, href] of Object.entries(alt.types)) {
473
- elements.push(_jsx("link", { rel: "alternate", type: type, href: resolveUrl(href) }, key++));
474
- }
475
- }
476
- }
477
- // Verification
478
- if (metadata.verification) {
479
- const v = metadata.verification;
480
- if (v.google)
481
- elements.push(_jsx("meta", { name: "google-site-verification", content: v.google }, key++));
482
- if (v.yahoo)
483
- elements.push(_jsx("meta", { name: "y_key", content: v.yahoo }, key++));
484
- if (v.yandex)
485
- elements.push(_jsx("meta", { name: "yandex-verification", content: v.yandex }, key++));
486
- if (v.other) {
487
- for (const [name, content] of Object.entries(v.other)) {
488
- const values = Array.isArray(content) ? content : [content];
489
- for (const val of values) {
490
- elements.push(_jsx("meta", { name: name, content: val }, key++));
491
- }
492
- }
493
- }
494
- }
495
- // Apple Web App
496
- if (metadata.appleWebApp) {
497
- const awa = metadata.appleWebApp;
498
- if (awa.capable !== false) {
499
- elements.push(_jsx("meta", { name: "mobile-web-app-capable", content: "yes" }, key++));
500
- }
501
- if (awa.title) {
502
- elements.push(_jsx("meta", { name: "apple-mobile-web-app-title", content: awa.title }, key++));
503
- }
504
- if (awa.statusBarStyle) {
505
- elements.push(_jsx("meta", { name: "apple-mobile-web-app-status-bar-style", content: awa.statusBarStyle }, key++));
506
- }
507
- if (awa.startupImage) {
508
- const imgs = typeof awa.startupImage === "string" ? [{ url: awa.startupImage }] : awa.startupImage;
509
- for (const img of imgs) {
510
- elements.push(_jsx("link", { rel: "apple-touch-startup-image", href: resolveUrl(img.url), ...(img.media ? { media: img.media } : {}) }, key++));
511
- }
512
- }
513
- }
514
- // iTunes
515
- if (metadata.itunes) {
516
- const { appId, appArgument } = metadata.itunes;
517
- let content = `app-id=${appId}`;
518
- if (appArgument) {
519
- content += `, app-argument=${appArgument}`;
520
- }
521
- elements.push(_jsx("meta", { name: "apple-itunes-app", content: content }, key++));
522
- }
523
- // App Links
524
- if (metadata.appLinks) {
525
- const al = metadata.appLinks;
526
- const platforms = [
527
- "ios",
528
- "iphone",
529
- "ipad",
530
- "android",
531
- "windows_phone",
532
- "windows",
533
- "windows_universal",
534
- "web",
535
- ];
536
- for (const platform of platforms) {
537
- const entries = al[platform];
538
- if (!entries)
539
- continue;
540
- const list = Array.isArray(entries) ? entries : [entries];
541
- for (const entry of list) {
542
- for (const [k, v] of Object.entries(entry)) {
543
- if (v === undefined || v === null)
544
- continue;
545
- const str = String(v);
546
- const content = k === "url" ? resolveUrl(str) : str;
547
- elements.push(_jsx("meta", { property: `al:${platform}:${k}`, content: content }, key++));
548
- }
549
- }
550
- }
551
- }
552
- // Other custom meta tags
553
- if (metadata.other) {
554
- for (const [name, content] of Object.entries(metadata.other)) {
555
- const values = Array.isArray(content) ? content : [content];
556
- for (const val of values) {
557
- elements.push(_jsx("meta", { name: name, content: val }, key++));
558
- }
559
- }
560
- }
561
- return _jsx(_Fragment, { children: elements });
130
+ * React component that renders metadata as HTML head elements.
131
+ * Used by the RSC entry to inject into the <head>.
132
+ */
133
+ function MetadataHead({ metadata }) {
134
+ const elements = [];
135
+ let key = 0;
136
+ const base = metadata.metadataBase;
137
+ function resolveUrl(url) {
138
+ if (!url) return void 0;
139
+ const s = typeof url === "string" ? url : url instanceof URL ? url.toString() : String(url);
140
+ if (!base) return s;
141
+ if (s.startsWith("http://") || s.startsWith("https://") || s.startsWith("//")) return s;
142
+ try {
143
+ return new URL(s, base).toString();
144
+ } catch {
145
+ return s;
146
+ }
147
+ }
148
+ const title = typeof metadata.title === "string" ? metadata.title : typeof metadata.title === "object" ? metadata.title.absolute || metadata.title.default : void 0;
149
+ if (title) elements.push(/* @__PURE__ */ jsx("title", { children: title }, key++));
150
+ if (metadata.description) elements.push(/* @__PURE__ */ jsx("meta", {
151
+ name: "description",
152
+ content: metadata.description
153
+ }, key++));
154
+ if (metadata.generator) elements.push(/* @__PURE__ */ jsx("meta", {
155
+ name: "generator",
156
+ content: metadata.generator
157
+ }, key++));
158
+ if (metadata.applicationName) elements.push(/* @__PURE__ */ jsx("meta", {
159
+ name: "application-name",
160
+ content: metadata.applicationName
161
+ }, key++));
162
+ if (metadata.referrer) elements.push(/* @__PURE__ */ jsx("meta", {
163
+ name: "referrer",
164
+ content: metadata.referrer
165
+ }, key++));
166
+ if (metadata.keywords) {
167
+ const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(",") : metadata.keywords;
168
+ elements.push(/* @__PURE__ */ jsx("meta", {
169
+ name: "keywords",
170
+ content: kw
171
+ }, key++));
172
+ }
173
+ if (metadata.authors) {
174
+ const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];
175
+ for (const author of authorList) {
176
+ if (author.name) elements.push(/* @__PURE__ */ jsx("meta", {
177
+ name: "author",
178
+ content: author.name
179
+ }, key++));
180
+ if (author.url) elements.push(/* @__PURE__ */ jsx("link", {
181
+ rel: "author",
182
+ href: author.url
183
+ }, key++));
184
+ }
185
+ }
186
+ if (metadata.creator) elements.push(/* @__PURE__ */ jsx("meta", {
187
+ name: "creator",
188
+ content: metadata.creator
189
+ }, key++));
190
+ if (metadata.publisher) elements.push(/* @__PURE__ */ jsx("meta", {
191
+ name: "publisher",
192
+ content: metadata.publisher
193
+ }, key++));
194
+ if (metadata.formatDetection) {
195
+ const parts = [];
196
+ if (metadata.formatDetection.telephone === false) parts.push("telephone=no");
197
+ if (metadata.formatDetection.address === false) parts.push("address=no");
198
+ if (metadata.formatDetection.email === false) parts.push("email=no");
199
+ if (parts.length > 0) elements.push(/* @__PURE__ */ jsx("meta", {
200
+ name: "format-detection",
201
+ content: parts.join(", ")
202
+ }, key++));
203
+ }
204
+ if (metadata.category) elements.push(/* @__PURE__ */ jsx("meta", {
205
+ name: "category",
206
+ content: metadata.category
207
+ }, key++));
208
+ if (metadata.robots) if (typeof metadata.robots === "string") elements.push(/* @__PURE__ */ jsx("meta", {
209
+ name: "robots",
210
+ content: metadata.robots
211
+ }, key++));
212
+ else {
213
+ const { googleBot, ...robotsRest } = metadata.robots;
214
+ const robotParts = [];
215
+ for (const [k, v] of Object.entries(robotsRest)) if (v === true) robotParts.push(k);
216
+ else if (v === false) robotParts.push(`no${k}`);
217
+ else if (typeof v === "string" || typeof v === "number") robotParts.push(`${k}:${v}`);
218
+ if (robotParts.length > 0) elements.push(/* @__PURE__ */ jsx("meta", {
219
+ name: "robots",
220
+ content: robotParts.join(", ")
221
+ }, key++));
222
+ if (googleBot) if (typeof googleBot === "string") elements.push(/* @__PURE__ */ jsx("meta", {
223
+ name: "googlebot",
224
+ content: googleBot
225
+ }, key++));
226
+ else {
227
+ const gbParts = [];
228
+ for (const [k, v] of Object.entries(googleBot)) if (v === true) gbParts.push(k);
229
+ else if (v === false) gbParts.push(`no${k}`);
230
+ else if (typeof v === "string" || typeof v === "number") gbParts.push(`${k}:${v}`);
231
+ if (gbParts.length > 0) elements.push(/* @__PURE__ */ jsx("meta", {
232
+ name: "googlebot",
233
+ content: gbParts.join(", ")
234
+ }, key++));
235
+ }
236
+ }
237
+ if (metadata.openGraph) {
238
+ const og = metadata.openGraph;
239
+ if (og.title) elements.push(/* @__PURE__ */ jsx("meta", {
240
+ property: "og:title",
241
+ content: og.title
242
+ }, key++));
243
+ if (og.description) elements.push(/* @__PURE__ */ jsx("meta", {
244
+ property: "og:description",
245
+ content: og.description
246
+ }, key++));
247
+ if (og.url) elements.push(/* @__PURE__ */ jsx("meta", {
248
+ property: "og:url",
249
+ content: resolveUrl(og.url)
250
+ }, key++));
251
+ if (og.siteName) elements.push(/* @__PURE__ */ jsx("meta", {
252
+ property: "og:site_name",
253
+ content: og.siteName
254
+ }, key++));
255
+ if (og.type) elements.push(/* @__PURE__ */ jsx("meta", {
256
+ property: "og:type",
257
+ content: og.type
258
+ }, key++));
259
+ if (og.locale) elements.push(/* @__PURE__ */ jsx("meta", {
260
+ property: "og:locale",
261
+ content: og.locale
262
+ }, key++));
263
+ if (og.publishedTime) elements.push(/* @__PURE__ */ jsx("meta", {
264
+ property: "article:published_time",
265
+ content: og.publishedTime
266
+ }, key++));
267
+ if (og.modifiedTime) elements.push(/* @__PURE__ */ jsx("meta", {
268
+ property: "article:modified_time",
269
+ content: og.modifiedTime
270
+ }, key++));
271
+ if (og.authors) for (const author of og.authors) elements.push(/* @__PURE__ */ jsx("meta", {
272
+ property: "article:author",
273
+ content: author
274
+ }, key++));
275
+ if (og.images) {
276
+ const imgList = typeof og.images === "string" || og.images instanceof URL ? [{ url: og.images }] : Array.isArray(og.images) ? og.images : [og.images];
277
+ for (const img of imgList) {
278
+ const imgUrl = typeof img === "string" || img instanceof URL ? img : img.url;
279
+ elements.push(/* @__PURE__ */ jsx("meta", {
280
+ property: "og:image",
281
+ content: resolveUrl(imgUrl)
282
+ }, key++));
283
+ if (typeof img !== "string" && !(img instanceof URL)) {
284
+ if (img.width) elements.push(/* @__PURE__ */ jsx("meta", {
285
+ property: "og:image:width",
286
+ content: String(img.width)
287
+ }, key++));
288
+ if (img.height) elements.push(/* @__PURE__ */ jsx("meta", {
289
+ property: "og:image:height",
290
+ content: String(img.height)
291
+ }, key++));
292
+ if (img.alt) elements.push(/* @__PURE__ */ jsx("meta", {
293
+ property: "og:image:alt",
294
+ content: img.alt
295
+ }, key++));
296
+ }
297
+ }
298
+ }
299
+ if (og.videos) for (const video of og.videos) {
300
+ elements.push(/* @__PURE__ */ jsx("meta", {
301
+ property: "og:video",
302
+ content: resolveUrl(video.url)
303
+ }, key++));
304
+ if (video.width) elements.push(/* @__PURE__ */ jsx("meta", {
305
+ property: "og:video:width",
306
+ content: String(video.width)
307
+ }, key++));
308
+ if (video.height) elements.push(/* @__PURE__ */ jsx("meta", {
309
+ property: "og:video:height",
310
+ content: String(video.height)
311
+ }, key++));
312
+ }
313
+ if (og.audio) for (const audio of og.audio) elements.push(/* @__PURE__ */ jsx("meta", {
314
+ property: "og:audio",
315
+ content: resolveUrl(audio.url)
316
+ }, key++));
317
+ }
318
+ if (metadata.twitter) {
319
+ const tw = metadata.twitter;
320
+ if (tw.card) elements.push(/* @__PURE__ */ jsx("meta", {
321
+ name: "twitter:card",
322
+ content: tw.card
323
+ }, key++));
324
+ if (tw.site) elements.push(/* @__PURE__ */ jsx("meta", {
325
+ name: "twitter:site",
326
+ content: tw.site
327
+ }, key++));
328
+ if (tw.siteId) elements.push(/* @__PURE__ */ jsx("meta", {
329
+ name: "twitter:site:id",
330
+ content: tw.siteId
331
+ }, key++));
332
+ if (tw.title) elements.push(/* @__PURE__ */ jsx("meta", {
333
+ name: "twitter:title",
334
+ content: tw.title
335
+ }, key++));
336
+ if (tw.description) elements.push(/* @__PURE__ */ jsx("meta", {
337
+ name: "twitter:description",
338
+ content: tw.description
339
+ }, key++));
340
+ if (tw.creator) elements.push(/* @__PURE__ */ jsx("meta", {
341
+ name: "twitter:creator",
342
+ content: tw.creator
343
+ }, key++));
344
+ if (tw.creatorId) elements.push(/* @__PURE__ */ jsx("meta", {
345
+ name: "twitter:creator:id",
346
+ content: tw.creatorId
347
+ }, key++));
348
+ if (tw.images) {
349
+ const imgList = typeof tw.images === "string" || tw.images instanceof URL ? [tw.images] : Array.isArray(tw.images) ? tw.images : [tw.images];
350
+ for (const img of imgList) {
351
+ const imgUrl = typeof img === "string" || img instanceof URL ? img : img.url;
352
+ elements.push(/* @__PURE__ */ jsx("meta", {
353
+ name: "twitter:image",
354
+ content: resolveUrl(imgUrl)
355
+ }, key++));
356
+ if (typeof img !== "string" && !(img instanceof URL) && img.alt) elements.push(/* @__PURE__ */ jsx("meta", {
357
+ name: "twitter:image:alt",
358
+ content: img.alt
359
+ }, key++));
360
+ }
361
+ }
362
+ if (tw.players) {
363
+ const players = Array.isArray(tw.players) ? tw.players : [tw.players];
364
+ for (const player of players) {
365
+ const playerUrl = player.playerUrl.toString();
366
+ const streamUrl = player.streamUrl.toString();
367
+ elements.push(/* @__PURE__ */ jsx("meta", {
368
+ name: "twitter:player",
369
+ content: resolveUrl(playerUrl)
370
+ }, key++));
371
+ elements.push(/* @__PURE__ */ jsx("meta", {
372
+ name: "twitter:player:stream",
373
+ content: resolveUrl(streamUrl)
374
+ }, key++));
375
+ elements.push(/* @__PURE__ */ jsx("meta", {
376
+ name: "twitter:player:width",
377
+ content: String(player.width)
378
+ }, key++));
379
+ elements.push(/* @__PURE__ */ jsx("meta", {
380
+ name: "twitter:player:height",
381
+ content: String(player.height)
382
+ }, key++));
383
+ }
384
+ }
385
+ if (tw.app) {
386
+ const { app } = tw;
387
+ for (const platform of [
388
+ "iphone",
389
+ "ipad",
390
+ "googleplay"
391
+ ]) {
392
+ if (app.name) elements.push(/* @__PURE__ */ jsx("meta", {
393
+ name: `twitter:app:name:${platform}`,
394
+ content: app.name
395
+ }, key++));
396
+ if (app.id[platform] !== void 0) elements.push(/* @__PURE__ */ jsx("meta", {
397
+ name: `twitter:app:id:${platform}`,
398
+ content: String(app.id[platform])
399
+ }, key++));
400
+ if (app.url?.[platform] !== void 0) {
401
+ const appUrl = app.url[platform].toString();
402
+ elements.push(/* @__PURE__ */ jsx("meta", {
403
+ name: `twitter:app:url:${platform}`,
404
+ content: resolveUrl(appUrl)
405
+ }, key++));
406
+ }
407
+ }
408
+ }
409
+ }
410
+ if (metadata.icons) {
411
+ const { icon, shortcut, apple, other } = metadata.icons;
412
+ if (shortcut) {
413
+ const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
414
+ for (const s of shortcuts) elements.push(/* @__PURE__ */ jsx("link", {
415
+ rel: "shortcut icon",
416
+ href: resolveUrl(s)
417
+ }, key++));
418
+ }
419
+ if (icon) {
420
+ const icons = typeof icon === "string" || icon instanceof URL ? [{ url: icon }] : icon;
421
+ for (const i of icons) elements.push(/* @__PURE__ */ jsx("link", {
422
+ rel: "icon",
423
+ href: resolveUrl(i.url),
424
+ ...i.sizes ? { sizes: i.sizes } : {},
425
+ ...i.type ? { type: i.type } : {},
426
+ ...i.media ? { media: i.media } : {}
427
+ }, key++));
428
+ }
429
+ if (apple) {
430
+ const apples = typeof apple === "string" || apple instanceof URL ? [{ url: apple }] : apple;
431
+ for (const a of apples) elements.push(/* @__PURE__ */ jsx("link", {
432
+ rel: "apple-touch-icon",
433
+ href: resolveUrl(a.url),
434
+ ...a.sizes ? { sizes: a.sizes } : {},
435
+ ...a.type ? { type: a.type } : {}
436
+ }, key++));
437
+ }
438
+ if (other) for (const o of other) elements.push(/* @__PURE__ */ jsx("link", {
439
+ rel: o.rel,
440
+ href: resolveUrl(o.url),
441
+ ...o.sizes ? { sizes: o.sizes } : {}
442
+ }, key++));
443
+ }
444
+ if (metadata.manifest) elements.push(/* @__PURE__ */ jsx("link", {
445
+ rel: "manifest",
446
+ href: resolveUrl(metadata.manifest)
447
+ }, key++));
448
+ if (metadata.alternates) {
449
+ const alt = metadata.alternates;
450
+ if (alt.canonical) elements.push(/* @__PURE__ */ jsx("link", {
451
+ rel: "canonical",
452
+ href: resolveUrl(alt.canonical)
453
+ }, key++));
454
+ if (alt.languages) for (const [lang, href] of Object.entries(alt.languages)) elements.push(/* @__PURE__ */ jsx("link", {
455
+ rel: "alternate",
456
+ hrefLang: lang,
457
+ href: resolveUrl(href)
458
+ }, key++));
459
+ if (alt.media) for (const [media, href] of Object.entries(alt.media)) elements.push(/* @__PURE__ */ jsx("link", {
460
+ rel: "alternate",
461
+ media,
462
+ href: resolveUrl(href)
463
+ }, key++));
464
+ if (alt.types) for (const [type, href] of Object.entries(alt.types)) elements.push(/* @__PURE__ */ jsx("link", {
465
+ rel: "alternate",
466
+ type,
467
+ href: resolveUrl(href)
468
+ }, key++));
469
+ }
470
+ if (metadata.verification) {
471
+ const v = metadata.verification;
472
+ if (v.google) elements.push(/* @__PURE__ */ jsx("meta", {
473
+ name: "google-site-verification",
474
+ content: v.google
475
+ }, key++));
476
+ if (v.yahoo) elements.push(/* @__PURE__ */ jsx("meta", {
477
+ name: "y_key",
478
+ content: v.yahoo
479
+ }, key++));
480
+ if (v.yandex) elements.push(/* @__PURE__ */ jsx("meta", {
481
+ name: "yandex-verification",
482
+ content: v.yandex
483
+ }, key++));
484
+ if (v.other) for (const [name, content] of Object.entries(v.other)) {
485
+ const values = Array.isArray(content) ? content : [content];
486
+ for (const val of values) elements.push(/* @__PURE__ */ jsx("meta", {
487
+ name,
488
+ content: val
489
+ }, key++));
490
+ }
491
+ }
492
+ if (metadata.appleWebApp) {
493
+ const awa = metadata.appleWebApp;
494
+ if (awa.capable !== false) elements.push(/* @__PURE__ */ jsx("meta", {
495
+ name: "mobile-web-app-capable",
496
+ content: "yes"
497
+ }, key++));
498
+ if (awa.title) elements.push(/* @__PURE__ */ jsx("meta", {
499
+ name: "apple-mobile-web-app-title",
500
+ content: awa.title
501
+ }, key++));
502
+ if (awa.statusBarStyle) elements.push(/* @__PURE__ */ jsx("meta", {
503
+ name: "apple-mobile-web-app-status-bar-style",
504
+ content: awa.statusBarStyle
505
+ }, key++));
506
+ if (awa.startupImage) {
507
+ const imgs = typeof awa.startupImage === "string" ? [{ url: awa.startupImage }] : awa.startupImage;
508
+ for (const img of imgs) elements.push(/* @__PURE__ */ jsx("link", {
509
+ rel: "apple-touch-startup-image",
510
+ href: resolveUrl(img.url),
511
+ ...img.media ? { media: img.media } : {}
512
+ }, key++));
513
+ }
514
+ }
515
+ if (metadata.itunes) {
516
+ const { appId, appArgument } = metadata.itunes;
517
+ let content = `app-id=${appId}`;
518
+ if (appArgument) content += `, app-argument=${appArgument}`;
519
+ elements.push(/* @__PURE__ */ jsx("meta", {
520
+ name: "apple-itunes-app",
521
+ content
522
+ }, key++));
523
+ }
524
+ if (metadata.appLinks) {
525
+ const al = metadata.appLinks;
526
+ for (const platform of [
527
+ "ios",
528
+ "iphone",
529
+ "ipad",
530
+ "android",
531
+ "windows_phone",
532
+ "windows",
533
+ "windows_universal",
534
+ "web"
535
+ ]) {
536
+ const entries = al[platform];
537
+ if (!entries) continue;
538
+ const list = Array.isArray(entries) ? entries : [entries];
539
+ for (const entry of list) for (const [k, v] of Object.entries(entry)) {
540
+ if (v === void 0 || v === null) continue;
541
+ const str = String(v);
542
+ const content = k === "url" ? resolveUrl(str) : str;
543
+ elements.push(/* @__PURE__ */ jsx("meta", {
544
+ property: `al:${platform}:${k}`,
545
+ content
546
+ }, key++));
547
+ }
548
+ }
549
+ }
550
+ if (metadata.other) for (const [name, content] of Object.entries(metadata.other)) {
551
+ const values = Array.isArray(content) ? content : [content];
552
+ for (const val of values) elements.push(/* @__PURE__ */ jsx("meta", {
553
+ name,
554
+ content: val
555
+ }, key++));
556
+ }
557
+ return /* @__PURE__ */ jsx(Fragment, { children: elements });
562
558
  }
559
+ //#endregion
560
+ export { DEFAULT_VIEWPORT, MetadataHead, ViewportHead, mergeMetadata, mergeViewport, resolveModuleMetadata, resolveModuleViewport };
561
+
563
562
  //# sourceMappingURL=metadata.js.map