vinext 1.3.0 → 1.3.1

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 (391) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +1 -1
  2. package/dist/build/action-owner-manifest.d.ts +3 -2
  3. package/dist/build/action-owner-manifest.js +18 -2
  4. package/dist/build/app-page-static-eligibility.d.ts +17 -1
  5. package/dist/build/app-page-static-eligibility.js +80 -13
  6. package/dist/build/clean-output.d.ts +2 -1
  7. package/dist/build/client-build-config.d.ts +13 -3
  8. package/dist/build/client-build-config.js +46 -9
  9. package/dist/build/client-reference-async.d.ts +48 -0
  10. package/dist/build/client-reference-async.js +123 -0
  11. package/dist/build/client-reference-chunks.d.ts +32 -0
  12. package/dist/build/client-reference-chunks.js +111 -0
  13. package/dist/build/client-reference-groups.d.ts +9 -1
  14. package/dist/build/client-reference-groups.js +40 -2
  15. package/dist/build/css-url-assets.d.ts +2 -1
  16. package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
  17. package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
  18. package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
  19. package/dist/build/google-fonts/font-metadata.d.ts +2 -1
  20. package/dist/build/google-fonts/validate.d.ts +2 -1
  21. package/dist/build/inline-css.d.ts +2 -1
  22. package/dist/build/layout-classification.d.ts +2 -1
  23. package/dist/build/module-dependency-cache.d.ts +2 -1
  24. package/dist/build/next-client-runtime-manifests.d.ts +2 -1
  25. package/dist/build/precompress.d.ts +2 -1
  26. package/dist/build/precompress.js +1 -1
  27. package/dist/build/prerender-paths.d.ts +2 -1
  28. package/dist/build/prerender-phase.d.ts +2 -1
  29. package/dist/build/prerender-server-pool.js +1 -1
  30. package/dist/build/prerender.d.ts +3 -2
  31. package/dist/build/prerender.js +5 -4
  32. package/dist/build/report.d.ts +2 -1
  33. package/dist/build/route-classification-injector.d.ts +2 -1
  34. package/dist/build/route-classification-manifest.d.ts +2 -1
  35. package/dist/build/run-prerender.d.ts +2 -1
  36. package/dist/build/server-actions-encryption-key.d.ts +2 -1
  37. package/dist/build/ssr-manifest.js +25 -2
  38. package/dist/build/standalone.d.ts +2 -1
  39. package/dist/cache/cache-adapters-virtual.d.ts +2 -1
  40. package/dist/cache.js +1 -2
  41. package/dist/check.d.ts +2 -1
  42. package/dist/check.js +4 -0
  43. package/dist/cli-args.d.ts +2 -1
  44. package/dist/cli.js +2 -0
  45. package/dist/client/client-redirect-matcher.js +2 -1
  46. package/dist/client/client-redirects.d.ts +4 -3
  47. package/dist/client/client-redirects.js +2 -1
  48. package/dist/client/client-rewrites.d.ts +2 -1
  49. package/dist/client/dev-error-overlay-store.d.ts +2 -1
  50. package/dist/client/index.js +1 -2
  51. package/dist/client/instrumentation-client-state.js +5 -5
  52. package/dist/client/navigation-runtime.d.ts +3 -1
  53. package/dist/client/navigation-runtime.js +1 -1
  54. package/dist/client/pages-router-link-navigation.d.ts +2 -1
  55. package/dist/client/vinext-next-data.d.ts +25 -1
  56. package/dist/client/window-next.d.ts +2 -1
  57. package/dist/config/config-matchers.d.ts +12 -1
  58. package/dist/config/config-matchers.js +111 -16
  59. package/dist/config/dotenv.d.ts +2 -1
  60. package/dist/config/next-config.d.ts +13 -1
  61. package/dist/config/next-config.js +29 -4
  62. package/dist/config/tsconfig-paths.d.ts +2 -1
  63. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
  64. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
  65. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
  66. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
  67. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
  68. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
  69. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
  70. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
  71. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
  72. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
  73. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
  74. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
  75. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
  76. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
  77. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
  78. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
  79. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
  80. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
  81. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
  82. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
  83. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
  84. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
  85. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
  86. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
  87. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
  88. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
  89. package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
  90. package/dist/entries/app-browser-entry.d.ts +20 -5
  91. package/dist/entries/app-browser-entry.js +79 -6
  92. package/dist/entries/app-rsc-entry.d.ts +2 -1
  93. package/dist/entries/app-rsc-entry.js +42 -12
  94. package/dist/entries/app-rsc-manifest.d.ts +2 -1
  95. package/dist/entries/app-rsc-manifest.js +53 -0
  96. package/dist/entries/pages-entry-helpers.js +1 -2
  97. package/dist/entries/pages-server-entry.d.ts +2 -1
  98. package/dist/entries/pages-server-entry.js +1 -1
  99. package/dist/entries/runtime-entry-module.d.ts +1 -0
  100. package/dist/entries/runtime-entry-module.js +4 -1
  101. package/dist/image/image-adapters-virtual.d.ts +2 -1
  102. package/dist/index.js +102 -34
  103. package/dist/plugins/client-compile-hints.d.ts +30 -0
  104. package/dist/plugins/client-compile-hints.js +88 -0
  105. package/dist/plugins/client-reference-dedup.d.ts +2 -1
  106. package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
  107. package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
  108. package/dist/plugins/dynamic-preload-metadata.js +1 -1
  109. package/dist/plugins/environment.d.ts +2 -1
  110. package/dist/plugins/fonts.js +9 -12
  111. package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
  112. package/dist/plugins/import-meta-url.d.ts +2 -1
  113. package/dist/plugins/og-assets.d.ts +2 -1
  114. package/dist/plugins/og-assets.js +2 -3
  115. package/dist/plugins/optimize-imports.d.ts +2 -1
  116. package/dist/plugins/pages-node-externals.d.ts +2 -1
  117. package/dist/plugins/remove-console.d.ts +2 -1
  118. package/dist/plugins/require-condition-resolution.d.ts +2 -1
  119. package/dist/plugins/rsc-client-reference-loaders.d.ts +8 -0
  120. package/dist/plugins/rsc-client-reference-loaders.js +170 -68
  121. package/dist/plugins/rsc-client-shim-excludes.js +2 -0
  122. package/dist/plugins/sass.d.ts +2 -1
  123. package/dist/plugins/strip-server-exports.d.ts +2 -1
  124. package/dist/plugins/styled-jsx.d.ts +2 -1
  125. package/dist/plugins/transform-result.d.ts +2 -1
  126. package/dist/plugins/typeof-window.d.ts +2 -1
  127. package/dist/plugins/worker-image-imports.js +1 -1
  128. package/dist/plugins/worker-use-server.d.ts +2 -1
  129. package/dist/routing/app-route-graph.d.ts +40 -0
  130. package/dist/routing/app-route-graph.js +122 -50
  131. package/dist/routing/browser-route-manifest.d.ts +2 -1
  132. package/dist/routing/optimistic-route-trie.d.ts +2 -1
  133. package/dist/routing/route-matching.d.ts +2 -1
  134. package/dist/routing/route-pattern.d.ts +2 -1
  135. package/dist/server/accept-encoding.d.ts +2 -1
  136. package/dist/server/app-action-forwarding.d.ts +2 -1
  137. package/dist/server/app-bfcache-identity.d.ts +2 -1
  138. package/dist/server/app-browser-action-result.d.ts +2 -1
  139. package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
  140. package/dist/server/app-browser-entry.js +30 -6
  141. package/dist/server/app-browser-error.d.ts +2 -1
  142. package/dist/server/app-browser-history-controller.d.ts +2 -1
  143. package/dist/server/app-browser-hydration.d.ts +2 -1
  144. package/dist/server/app-browser-interception-context.d.ts +2 -1
  145. package/dist/server/app-browser-navigation-controller.js +15 -10
  146. package/dist/server/app-browser-popstate.d.ts +2 -1
  147. package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
  148. package/dist/server/app-browser-server-action-client.d.ts +2 -1
  149. package/dist/server/app-browser-state.js +1 -1
  150. package/dist/server/app-browser-stream.d.ts +2 -1
  151. package/dist/server/app-browser-visible-commit.d.ts +2 -1
  152. package/dist/server/app-client-reference-manifest.d.ts +31 -0
  153. package/dist/server/app-client-reference-manifest.js +46 -0
  154. package/dist/server/app-client-reference-preloader.d.ts +25 -5
  155. package/dist/server/app-client-reference-preloader.js +22 -7
  156. package/dist/server/app-elements-wire.d.ts +2 -1
  157. package/dist/server/app-elements.d.ts +2 -0
  158. package/dist/server/app-elements.js +3 -1
  159. package/dist/server/app-fallback-renderer.d.ts +9 -2
  160. package/dist/server/app-fallback-renderer.js +4 -1
  161. package/dist/server/app-history-state.d.ts +2 -1
  162. package/dist/server/app-inline-css-client.d.ts +2 -1
  163. package/dist/server/app-layout-param-observation.d.ts +2 -1
  164. package/dist/server/app-metadata-tracing.d.ts +2 -1
  165. package/dist/server/app-optimistic-routing.d.ts +18 -1
  166. package/dist/server/app-optimistic-routing.js +34 -1
  167. package/dist/server/app-page-boundary-render.d.ts +20 -2
  168. package/dist/server/app-page-boundary-render.js +221 -38
  169. package/dist/server/app-page-boundary.d.ts +34 -5
  170. package/dist/server/app-page-boundary.js +40 -7
  171. package/dist/server/app-page-cache-finalizer.d.ts +2 -1
  172. package/dist/server/app-page-cache-finalizer.js +1 -1
  173. package/dist/server/app-page-cache-render.d.ts +10 -2
  174. package/dist/server/app-page-cache-render.js +14 -2
  175. package/dist/server/app-page-cache.js +2 -2
  176. package/dist/server/app-page-dispatch.d.ts +34 -1
  177. package/dist/server/app-page-dispatch.js +163 -34
  178. package/dist/server/app-page-element-builder.d.ts +17 -1
  179. package/dist/server/app-page-element-builder.js +187 -66
  180. package/dist/server/app-page-execution.d.ts +28 -1
  181. package/dist/server/app-page-execution.js +114 -5
  182. package/dist/server/app-page-head.d.ts +95 -3
  183. package/dist/server/app-page-head.js +307 -152
  184. package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
  185. package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
  186. package/dist/server/app-page-method.d.ts +2 -1
  187. package/dist/server/app-page-probe.d.ts +2 -1
  188. package/dist/server/app-page-render-identity.d.ts +2 -1
  189. package/dist/server/app-page-render.d.ts +7 -1
  190. package/dist/server/app-page-render.js +35 -10
  191. package/dist/server/app-page-request.d.ts +14 -1
  192. package/dist/server/app-page-request.js +1 -1
  193. package/dist/server/app-page-route-wiring.d.ts +52 -2
  194. package/dist/server/app-page-route-wiring.js +197 -47
  195. package/dist/server/app-page-rsc-render-status.d.ts +2 -1
  196. package/dist/server/app-page-search-params-observation.d.ts +7 -2
  197. package/dist/server/app-page-search-params-observation.js +8 -1
  198. package/dist/server/app-page-segment-plan.d.ts +2 -1
  199. package/dist/server/app-page-stream.d.ts +31 -1
  200. package/dist/server/app-page-stream.js +23 -4
  201. package/dist/server/app-pages-bridge.d.ts +2 -1
  202. package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
  203. package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
  204. package/dist/server/app-prerender-endpoints.d.ts +2 -1
  205. package/dist/server/app-prerender-static-params.d.ts +2 -1
  206. package/dist/server/app-render-dependency.d.ts +11 -1
  207. package/dist/server/app-render-dependency.js +26 -7
  208. package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
  209. package/dist/server/app-response-stage-entry.d.ts +2 -1
  210. package/dist/server/app-route-handler-cache.d.ts +2 -1
  211. package/dist/server/app-route-handler-dispatch.d.ts +2 -1
  212. package/dist/server/app-route-handler-dispatch.js +1 -1
  213. package/dist/server/app-route-handler-execution.d.ts +2 -1
  214. package/dist/server/app-route-handler-response.d.ts +2 -1
  215. package/dist/server/app-route-handler-runtime.d.ts +2 -1
  216. package/dist/server/app-route-module-loader.d.ts +18 -1
  217. package/dist/server/app-route-module-loader.js +8 -0
  218. package/dist/server/app-route-tree-prefetch.d.ts +2 -1
  219. package/dist/server/app-rsc-error-handler.d.ts +2 -1
  220. package/dist/server/app-rsc-errors.d.ts +2 -1
  221. package/dist/server/app-rsc-handler.d.ts +2 -1
  222. package/dist/server/app-rsc-handler.js +6 -10
  223. package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
  224. package/dist/server/app-rsc-route-matching.d.ts +38 -1
  225. package/dist/server/app-rsc-route-matching.js +24 -0
  226. package/dist/server/app-segment-config.d.ts +2 -1
  227. package/dist/server/app-segment-config.js +1 -14
  228. package/dist/server/app-server-action-execution.d.ts +2 -1
  229. package/dist/server/app-server-action-execution.js +3 -3
  230. package/dist/server/app-ssr-entry.d.ts +6 -0
  231. package/dist/server/app-ssr-entry.js +91 -44
  232. package/dist/server/app-ssr-error-meta.d.ts +2 -1
  233. package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
  234. package/dist/server/app-ssr-stream.d.ts +22 -10
  235. package/dist/server/app-ssr-stream.js +299 -67
  236. package/dist/server/app-static-generation.d.ts +2 -1
  237. package/dist/server/app-streamed-client-references.d.ts +39 -0
  238. package/dist/server/app-streamed-client-references.js +156 -0
  239. package/dist/server/app-visited-response-cache.d.ts +2 -1
  240. package/dist/server/app-worker-stages.d.ts +2 -1
  241. package/dist/server/artifact-compatibility.d.ts +2 -1
  242. package/dist/server/bfcache-identity.d.ts +2 -1
  243. package/dist/server/cache-headers.d.ts +2 -1
  244. package/dist/server/cacheability-request.d.ts +2 -1
  245. package/dist/server/client-reuse-manifest.d.ts +2 -1
  246. package/dist/server/config-headers.d.ts +2 -1
  247. package/dist/server/csp.d.ts +2 -1
  248. package/dist/server/default-global-not-found-module.d.ts +2 -1
  249. package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
  250. package/dist/server/default-http-access-fallback-modules.js +31 -0
  251. package/dist/server/defer-until-stream-consumed.d.ts +34 -0
  252. package/dist/server/defer-until-stream-consumed.js +154 -21
  253. package/dist/server/dev-lockfile.d.ts +32 -2
  254. package/dist/server/dev-lockfile.js +46 -2
  255. package/dist/server/dev-module-runner.d.ts +2 -1
  256. package/dist/server/dev-server.js +10 -3
  257. package/dist/server/fetch-handler.js +1 -2
  258. package/dist/server/file-based-metadata.d.ts +2 -1
  259. package/dist/server/framework-tracer.d.ts +2 -1
  260. package/dist/server/html.d.ts +1 -0
  261. package/dist/server/html.js +19 -1
  262. package/dist/server/http-conditional.d.ts +2 -1
  263. package/dist/server/http-error-responses.d.ts +2 -1
  264. package/dist/server/implicit-tags.d.ts +2 -1
  265. package/dist/server/metadata-route-build-data.d.ts +2 -1
  266. package/dist/server/metadata-route-build-data.js +1 -1
  267. package/dist/server/metadata-route-response.d.ts +2 -1
  268. package/dist/server/metadata-route-response.js +1 -1
  269. package/dist/server/metadata-routes.d.ts +2 -1
  270. package/dist/server/middleware-runtime.d.ts +2 -1
  271. package/dist/server/navigation-trace.d.ts +2 -1
  272. package/dist/server/next-error-digest.d.ts +2 -1
  273. package/dist/server/nitro-public-files-plugin.d.ts +2 -1
  274. package/dist/server/nitro-public-files.d.ts +2 -1
  275. package/dist/server/opentelemetry-api.d.ts +2 -1
  276. package/dist/server/operation-token.d.ts +2 -1
  277. package/dist/server/pages-api-route.d.ts +2 -1
  278. package/dist/server/pages-asset-tags.d.ts +2 -1
  279. package/dist/server/pages-body-parser-config.d.ts +2 -1
  280. package/dist/server/pages-client-assets.d.ts +4 -0
  281. package/dist/server/pages-data-route.d.ts +2 -1
  282. package/dist/server/pages-document-asset-props.d.ts +2 -1
  283. package/dist/server/pages-document-initial-props.d.ts +2 -1
  284. package/dist/server/pages-execution-tracing.d.ts +2 -1
  285. package/dist/server/pages-execution-tracing.js +1 -1
  286. package/dist/server/pages-get-initial-props.d.ts +2 -1
  287. package/dist/server/pages-page-data.d.ts +7 -1
  288. package/dist/server/pages-page-data.js +35 -12
  289. package/dist/server/pages-page-handler.d.ts +3 -2
  290. package/dist/server/pages-page-handler.js +16 -7
  291. package/dist/server/pages-page-method.d.ts +2 -1
  292. package/dist/server/pages-page-response.d.ts +2 -1
  293. package/dist/server/pages-preview.d.ts +2 -1
  294. package/dist/server/pages-readiness.d.ts +2 -1
  295. package/dist/server/pages-request-pipeline.d.ts +2 -1
  296. package/dist/server/pages-request-pipeline.js +4 -5
  297. package/dist/server/pages-request-stage-entry.d.ts +2 -1
  298. package/dist/server/pages-response-stage-entry.d.ts +2 -1
  299. package/dist/server/pages-route-data-kind.d.ts +2 -1
  300. package/dist/server/prerender-cache-life-header.d.ts +2 -1
  301. package/dist/server/prerender-route-params.d.ts +2 -1
  302. package/dist/server/prod-server.js +9 -3
  303. package/dist/server/request-log.d.ts +2 -1
  304. package/dist/server/request-tracing.d.ts +2 -1
  305. package/dist/server/request-tracing.js +1 -1
  306. package/dist/server/response-start-tracing.js +7 -29
  307. package/dist/server/rsc-render-stream.d.ts +4 -0
  308. package/dist/server/rsc-render-stream.js +25 -0
  309. package/dist/server/seed-cache.d.ts +2 -1
  310. package/dist/server/seed-cache.js +1 -1
  311. package/dist/server/static-file-cache.d.ts +2 -1
  312. package/dist/server/static-file-cache.js +1 -0
  313. package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
  314. package/dist/server/worker-revalidation-context.d.ts +2 -1
  315. package/dist/server/worker-stages.d.ts +2 -1
  316. package/dist/shims/app.d.ts +2 -1
  317. package/dist/shims/cache-callable-runtime.d.ts +2 -1
  318. package/dist/shims/cache-handler.d.ts +8 -3
  319. package/dist/shims/cache-handler.js +29 -9
  320. package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
  321. package/dist/shims/caught-not-found-boundaries.js +48 -0
  322. package/dist/shims/cdn-purge-routes.d.ts +2 -1
  323. package/dist/shims/client-locale.js +2 -1
  324. package/dist/shims/client-page-root.d.ts +2 -1
  325. package/dist/shims/config.d.ts +2 -1
  326. package/dist/shims/default-forbidden.d.ts +4 -0
  327. package/dist/shims/default-forbidden.js +18 -0
  328. package/dist/shims/default-not-found.d.ts +0 -5
  329. package/dist/shims/default-not-found.js +5 -41
  330. package/dist/shims/default-unauthorized.d.ts +4 -0
  331. package/dist/shims/default-unauthorized.js +18 -0
  332. package/dist/shims/error-boundary.d.ts +39 -3
  333. package/dist/shims/error-boundary.js +31 -16
  334. package/dist/shims/font-google.js +1 -2
  335. package/dist/shims/font-utils.d.ts +3 -2
  336. package/dist/shims/font-utils.js +5 -3
  337. package/dist/shims/form.js +1 -1
  338. package/dist/shims/http-access-error-fallback.d.ts +7 -0
  339. package/dist/shims/http-access-error-fallback.js +47 -0
  340. package/dist/shims/image.d.ts +1 -22
  341. package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
  342. package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
  343. package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
  344. package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
  345. package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
  346. package/dist/shims/internal/client-reference-loader.d.ts +7 -0
  347. package/dist/shims/internal/client-reference-loader.js +91 -0
  348. package/dist/shims/internal/cookie-serialize.d.ts +2 -1
  349. package/dist/shims/internal/cookies.js +1 -2
  350. package/dist/shims/internal/headers-state.d.ts +2 -0
  351. package/dist/shims/internal/headers-state.js +6 -1
  352. package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
  353. package/dist/shims/internal/interpolate-as.d.ts +2 -1
  354. package/dist/shims/internal/pages-data-target.d.ts +2 -1
  355. package/dist/shims/internal/pages-data-url.d.ts +2 -1
  356. package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
  357. package/dist/shims/link.js +195 -52
  358. package/dist/shims/metadata.d.ts +32 -11
  359. package/dist/shims/metadata.js +88 -26
  360. package/dist/shims/navigation-errors.d.ts +2 -1
  361. package/dist/shims/navigation.d.ts +22 -2
  362. package/dist/shims/navigation.js +74 -20
  363. package/dist/shims/pages-router-runtime.d.ts +2 -1
  364. package/dist/shims/ppr-fallback-shell.d.ts +2 -1
  365. package/dist/shims/router.js +14 -3
  366. package/dist/shims/unified-request-context.js +3 -3
  367. package/dist/typegen.d.ts +2 -1
  368. package/dist/utils/client-build-manifest.d.ts +4 -1
  369. package/dist/utils/client-build-manifest.js +9 -2
  370. package/dist/utils/client-entry-manifest.d.ts +13 -0
  371. package/dist/utils/client-entry-manifest.js +20 -1
  372. package/dist/utils/client-reference-chunks.d.ts +45 -0
  373. package/dist/utils/client-reference-chunks.js +30 -0
  374. package/dist/utils/client-runtime-metadata.d.ts +9 -1
  375. package/dist/utils/client-runtime-metadata.js +40 -9
  376. package/dist/utils/compare.d.ts +9 -0
  377. package/dist/utils/compare.js +15 -1
  378. package/dist/utils/lazy-chunks.d.ts +14 -0
  379. package/dist/utils/lazy-chunks.js +27 -1
  380. package/dist/utils/middleware-request-headers.d.ts +2 -1
  381. package/dist/utils/project.d.ts +2 -1
  382. package/dist/utils/project.js +9 -1
  383. package/dist/utils/query.d.ts +2 -1
  384. package/dist/utils/sorted-array.d.ts +2 -1
  385. package/dist/utils/vite-cli-invocation.d.ts +2 -1
  386. package/package.json +5 -5
  387. package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
  388. package/dist/server/default-not-found-module.d.ts +0 -19
  389. package/dist/server/default-not-found-module.js +0 -18
  390. package/dist/server/rsc-stream-hints.d.ts +0 -21
  391. package/dist/server/rsc-stream-hints.js +0 -227
@@ -0,0 +1,39 @@
1
+ import { readUInt16LE } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/ico.js
3
+ const TYPE_ICON = 1;
4
+ const SIZE_HEADER = 6;
5
+ const SIZE_IMAGE_ENTRY = 16;
6
+ function getSizeFromOffset(input, offset) {
7
+ const value = input[offset];
8
+ return value === 0 ? 256 : value;
9
+ }
10
+ function getImageSize(input, imageIndex) {
11
+ const offset = SIZE_HEADER + imageIndex * SIZE_IMAGE_ENTRY;
12
+ return {
13
+ height: getSizeFromOffset(input, offset + 1),
14
+ width: getSizeFromOffset(input, offset)
15
+ };
16
+ }
17
+ const ICO = {
18
+ validate(input) {
19
+ const reserved = readUInt16LE(input, 0);
20
+ const imageCount = readUInt16LE(input, 4);
21
+ if (reserved !== 0 || imageCount === 0) return false;
22
+ return readUInt16LE(input, 2) === TYPE_ICON;
23
+ },
24
+ calculate(input) {
25
+ const nbImages = readUInt16LE(input, 4);
26
+ if (SIZE_HEADER + nbImages * SIZE_IMAGE_ENTRY > input.length) throw new TypeError("Invalid ICO");
27
+ const imageSize = getImageSize(input, 0);
28
+ if (nbImages === 1) return imageSize;
29
+ const images = [];
30
+ for (let imageIndex = 0; imageIndex < nbImages; imageIndex += 1) images.push(getImageSize(input, imageIndex));
31
+ return {
32
+ width: imageSize.width,
33
+ height: imageSize.height,
34
+ images
35
+ };
36
+ }
37
+ };
38
+ //#endregion
39
+ export { ICO };
@@ -0,0 +1,46 @@
1
+ import { BMP } from "./bmp.js";
2
+ import { ICO } from "./ico.js";
3
+ import { CUR } from "./cur.js";
4
+ import { DDS } from "./dds.js";
5
+ import { GIF } from "./gif.js";
6
+ import { HEIF } from "./heif.js";
7
+ import { ICNS } from "./icns.js";
8
+ import { J2C } from "./j2c.js";
9
+ import { JP2 } from "./jp2.js";
10
+ import { JPG } from "./jpg.js";
11
+ import { JXLStream } from "./jxl-stream.js";
12
+ import { JXL } from "./jxl.js";
13
+ import { KTX } from "./ktx.js";
14
+ import { PNG } from "./png.js";
15
+ import { PNM } from "./pnm.js";
16
+ import { PSD } from "./psd.js";
17
+ import { SVG } from "./svg.js";
18
+ import { TGA } from "./tga.js";
19
+ import { TIFF } from "./tiff.js";
20
+ import { WEBP } from "./webp.js";
21
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/index.js
22
+ const typeHandlers = /* @__PURE__ */ new Map([
23
+ ["bmp", BMP],
24
+ ["cur", CUR],
25
+ ["dds", DDS],
26
+ ["gif", GIF],
27
+ ["heif", HEIF],
28
+ ["icns", ICNS],
29
+ ["ico", ICO],
30
+ ["j2c", J2C],
31
+ ["jp2", JP2],
32
+ ["jpg", JPG],
33
+ ["jxl", JXL],
34
+ ["jxl-stream", JXLStream],
35
+ ["ktx", KTX],
36
+ ["png", PNG],
37
+ ["pnm", PNM],
38
+ ["psd", PSD],
39
+ ["svg", SVG],
40
+ ["tga", TGA],
41
+ ["tiff", TIFF],
42
+ ["webp", WEBP]
43
+ ]);
44
+ const types = Array.from(typeHandlers.keys());
45
+ //#endregion
46
+ export { typeHandlers, types };
@@ -0,0 +1,11 @@
1
+ import { readUInt32BE } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/j2c.js
3
+ const J2C = {
4
+ validate: (input) => readUInt32BE(input, 0) === 4283432785,
5
+ calculate: (input) => ({
6
+ height: readUInt32BE(input, 12),
7
+ width: readUInt32BE(input, 8)
8
+ })
9
+ };
10
+ //#endregion
11
+ export { J2C };
@@ -0,0 +1,21 @@
1
+ import { findBox, readUInt32BE, toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jp2.js
3
+ const JP2 = {
4
+ validate(input) {
5
+ if (toUTF8String(input, 4, 8) !== "jP ") return false;
6
+ const ftypBox = findBox(input, "ftyp", 0);
7
+ if (!ftypBox) return false;
8
+ return toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12) === "jp2 ";
9
+ },
10
+ calculate(input) {
11
+ const jp2hBox = findBox(input, "jp2h", 0);
12
+ const ihdrBox = jp2hBox && findBox(input, "ihdr", jp2hBox.offset + 8);
13
+ if (ihdrBox) return {
14
+ height: readUInt32BE(input, ihdrBox.offset + 8),
15
+ width: readUInt32BE(input, ihdrBox.offset + 12)
16
+ };
17
+ throw new TypeError("Unsupported JPEG 2000 format");
18
+ }
19
+ };
20
+ //#endregion
21
+ export { JP2 };
@@ -0,0 +1,71 @@
1
+ import { readUInt, readUInt16BE, toHexString } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jpg.js
3
+ const EXIF_MARKER = "45786966";
4
+ const APP1_DATA_SIZE_BYTES = 2;
5
+ const EXIF_HEADER_BYTES = 6;
6
+ const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
7
+ const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
8
+ const IDF_ENTRY_BYTES = 12;
9
+ function isEXIF(input) {
10
+ return toHexString(input, 2, 6) === EXIF_MARKER;
11
+ }
12
+ function extractSize(input, index) {
13
+ return {
14
+ height: readUInt16BE(input, index),
15
+ width: readUInt16BE(input, index + 2)
16
+ };
17
+ }
18
+ function extractOrientation(exifBlock, isBigEndian) {
19
+ const idfDirectoryEntries = readUInt(exifBlock, 16, 14, isBigEndian);
20
+ for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
21
+ const start = 16 + directoryEntryNumber * IDF_ENTRY_BYTES;
22
+ const end = start + IDF_ENTRY_BYTES;
23
+ if (start > exifBlock.length) return;
24
+ const block = exifBlock.slice(start, end);
25
+ if (readUInt(block, 16, 0, isBigEndian) === 274) {
26
+ if (readUInt(block, 16, 2, isBigEndian) !== 3) return;
27
+ if (readUInt(block, 32, 4, isBigEndian) !== 1) return;
28
+ return readUInt(block, 16, 8, isBigEndian);
29
+ }
30
+ }
31
+ }
32
+ function validateExifBlock(input, index) {
33
+ const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
34
+ const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, 8);
35
+ const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
36
+ if (isBigEndian || byteAlign === LITTLE_ENDIAN_BYTE_ALIGN) return extractOrientation(exifBlock, isBigEndian);
37
+ }
38
+ function validateInput(input, index) {
39
+ if (index > input.length) throw new TypeError("Corrupt JPG, exceeded buffer limits");
40
+ }
41
+ const JPG = {
42
+ validate: (input) => toHexString(input, 0, 2) === "ffd8",
43
+ calculate(_input) {
44
+ let input = _input.slice(4);
45
+ let orientation;
46
+ let next;
47
+ while (input.length) {
48
+ const i = readUInt16BE(input, 0);
49
+ validateInput(input, i);
50
+ if (input[i] !== 255) {
51
+ input = input.slice(1);
52
+ continue;
53
+ }
54
+ if (isEXIF(input)) orientation = validateExifBlock(input, i);
55
+ next = input[i + 1];
56
+ if (next === 192 || next === 193 || next === 194) {
57
+ const size = extractSize(input, i + 5);
58
+ if (!orientation) return size;
59
+ return {
60
+ height: size.height,
61
+ orientation,
62
+ width: size.width
63
+ };
64
+ }
65
+ input = input.slice(i + 2);
66
+ }
67
+ throw new TypeError("Invalid JPG, no size found");
68
+ }
69
+ };
70
+ //#endregion
71
+ export { JPG };
@@ -0,0 +1,42 @@
1
+ import { toHexString } from "./utils.js";
2
+ import { BitReader } from "../utils/bit-reader.js";
3
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jxl-stream.js
4
+ function calculateImageDimension(reader, isSmallImage) {
5
+ if (isSmallImage) return 8 * (1 + reader.getBits(5));
6
+ const extraBits = [
7
+ 9,
8
+ 13,
9
+ 18,
10
+ 30
11
+ ][reader.getBits(2)];
12
+ return 1 + reader.getBits(extraBits);
13
+ }
14
+ function calculateImageWidth(reader, isSmallImage, widthMode, height) {
15
+ if (isSmallImage && widthMode === 0) return 8 * (1 + reader.getBits(5));
16
+ if (widthMode === 0) return calculateImageDimension(reader, false);
17
+ return Math.floor(height * [
18
+ 1,
19
+ 1.2,
20
+ 4 / 3,
21
+ 1.5,
22
+ 16 / 9,
23
+ 5 / 4,
24
+ 2
25
+ ][widthMode - 1]);
26
+ }
27
+ const JXLStream = {
28
+ validate: (input) => {
29
+ return toHexString(input, 0, 2) === "ff0a";
30
+ },
31
+ calculate(input) {
32
+ const reader = new BitReader(input, "little-endian");
33
+ const isSmallImage = reader.getBits(1) === 1;
34
+ const height = calculateImageDimension(reader, isSmallImage);
35
+ return {
36
+ width: calculateImageWidth(reader, isSmallImage, reader.getBits(3), height),
37
+ height
38
+ };
39
+ }
40
+ };
41
+ //#endregion
42
+ export { JXLStream };
@@ -0,0 +1,46 @@
1
+ import { findBox, toUTF8String } from "./utils.js";
2
+ import { JXLStream } from "./jxl-stream.js";
3
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jxl.js
4
+ function extractCodestream(input) {
5
+ const jxlcBox = findBox(input, "jxlc", 0);
6
+ if (jxlcBox) return input.slice(jxlcBox.offset + 8, jxlcBox.offset + jxlcBox.size);
7
+ const partialStreams = extractPartialStreams(input);
8
+ if (partialStreams.length > 0) return concatenateCodestreams(partialStreams);
9
+ }
10
+ function extractPartialStreams(input) {
11
+ const partialStreams = [];
12
+ let offset = 0;
13
+ while (offset < input.length) {
14
+ const jxlpBox = findBox(input, "jxlp", offset);
15
+ if (!jxlpBox) break;
16
+ if (jxlpBox.size < 12) throw new TypeError("Invalid JXL");
17
+ partialStreams.push(input.slice(jxlpBox.offset + 12, jxlpBox.offset + jxlpBox.size));
18
+ offset = jxlpBox.offset + jxlpBox.size;
19
+ }
20
+ return partialStreams;
21
+ }
22
+ function concatenateCodestreams(partialCodestreams) {
23
+ const totalLength = partialCodestreams.reduce((acc, curr) => acc + curr.length, 0);
24
+ const codestream = new Uint8Array(totalLength);
25
+ let position = 0;
26
+ for (const partial of partialCodestreams) {
27
+ codestream.set(partial, position);
28
+ position += partial.length;
29
+ }
30
+ return codestream;
31
+ }
32
+ const JXL = {
33
+ validate: (input) => {
34
+ if (toUTF8String(input, 4, 8) !== "JXL ") return false;
35
+ const ftypBox = findBox(input, "ftyp", 0);
36
+ if (!ftypBox) return false;
37
+ return toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12) === "jxl ";
38
+ },
39
+ calculate(input) {
40
+ const codestream = extractCodestream(input);
41
+ if (codestream) return JXLStream.calculate(codestream);
42
+ throw new TypeError("Invalid JXL");
43
+ }
44
+ };
45
+ //#endregion
46
+ export { JXL };
@@ -0,0 +1,19 @@
1
+ import { readUInt32LE, toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/ktx.js
3
+ const KTX = {
4
+ validate: (input) => {
5
+ const signature = toUTF8String(input, 1, 7);
6
+ return ["KTX 11", "KTX 20"].includes(signature);
7
+ },
8
+ calculate: (input) => {
9
+ const type = input[5] === 49 ? "ktx" : "ktx2";
10
+ const offset = type === "ktx" ? 36 : 20;
11
+ return {
12
+ height: readUInt32LE(input, offset + 4),
13
+ width: readUInt32LE(input, offset),
14
+ type
15
+ };
16
+ }
17
+ };
18
+ //#endregion
19
+ export { KTX };
@@ -0,0 +1,28 @@
1
+ import { readUInt32BE, toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/png.js
3
+ const pngSignature = "PNG\r\n\n";
4
+ const pngImageHeaderChunkName = "IHDR";
5
+ const pngFriedChunkName = "CgBI";
6
+ const PNG = {
7
+ validate(input) {
8
+ if (pngSignature === toUTF8String(input, 1, 8)) {
9
+ let chunkName = toUTF8String(input, 12, 16);
10
+ if (chunkName === pngFriedChunkName) chunkName = toUTF8String(input, 28, 32);
11
+ if (chunkName !== pngImageHeaderChunkName) throw new TypeError("Invalid PNG");
12
+ return true;
13
+ }
14
+ return false;
15
+ },
16
+ calculate(input) {
17
+ if (toUTF8String(input, 12, 16) === pngFriedChunkName) return {
18
+ height: readUInt32BE(input, 36),
19
+ width: readUInt32BE(input, 32)
20
+ };
21
+ return {
22
+ height: readUInt32BE(input, 20),
23
+ width: readUInt32BE(input, 16)
24
+ };
25
+ }
26
+ };
27
+ //#endregion
28
+ export { PNG };
@@ -0,0 +1,54 @@
1
+ import { toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/pnm.js
3
+ const PNMTypes = {
4
+ P1: "pbm/ascii",
5
+ P2: "pgm/ascii",
6
+ P3: "ppm/ascii",
7
+ P4: "pbm",
8
+ P5: "pgm",
9
+ P6: "ppm",
10
+ P7: "pam",
11
+ PF: "pfm"
12
+ };
13
+ const handlers = {
14
+ default: (lines) => {
15
+ let dimensions = [];
16
+ while (lines.length > 0) {
17
+ const line = lines.shift();
18
+ if (line[0] === "#") continue;
19
+ dimensions = line.split(" ");
20
+ break;
21
+ }
22
+ if (dimensions.length === 2) return {
23
+ height: Number.parseInt(dimensions[1], 10),
24
+ width: Number.parseInt(dimensions[0], 10)
25
+ };
26
+ throw new TypeError("Invalid PNM");
27
+ },
28
+ pam: (lines) => {
29
+ const size = {};
30
+ while (lines.length > 0) {
31
+ const line = lines.shift();
32
+ if (line.length > 16 || line.charCodeAt(0) > 128) continue;
33
+ const [key, value] = line.split(" ");
34
+ if (key && value) size[key.toLowerCase()] = Number.parseInt(value, 10);
35
+ if (size.height && size.width) break;
36
+ }
37
+ if (size.height && size.width) return {
38
+ height: size.height,
39
+ width: size.width
40
+ };
41
+ throw new TypeError("Invalid PAM");
42
+ }
43
+ };
44
+ const PNM = {
45
+ validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
46
+ calculate(input) {
47
+ const signature = toUTF8String(input, 0, 2);
48
+ const type = PNMTypes[signature];
49
+ const lines = toUTF8String(input, 3).split(/[\r\n]+/);
50
+ return (handlers[type] || handlers.default)(lines);
51
+ }
52
+ };
53
+ //#endregion
54
+ export { PNM };
@@ -0,0 +1,11 @@
1
+ import { readUInt32BE, toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/psd.js
3
+ const PSD = {
4
+ validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
5
+ calculate: (input) => ({
6
+ height: readUInt32BE(input, 14),
7
+ width: readUInt32BE(input, 18)
8
+ })
9
+ };
10
+ //#endregion
11
+ export { PSD };
@@ -0,0 +1,79 @@
1
+ import { toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/svg.js
3
+ const svgReg = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/;
4
+ const extractorRegExps = {
5
+ height: /\sheight=(['"])([^%]+?)\1/,
6
+ root: svgReg,
7
+ viewbox: /\sviewBox=(['"])(.+?)\1/i,
8
+ width: /\swidth=(['"])([^%]+?)\1/
9
+ };
10
+ const INCH_CM = 2.54;
11
+ const units = {
12
+ in: 96,
13
+ cm: 96 / INCH_CM,
14
+ em: 16,
15
+ ex: 8,
16
+ m: 96 / INCH_CM * 100,
17
+ mm: 96 / INCH_CM / 10,
18
+ pc: 96 / 72 / 12,
19
+ pt: 96 / 72,
20
+ px: 1
21
+ };
22
+ const unitsReg = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);
23
+ function parseLength(len) {
24
+ const m = unitsReg.exec(len);
25
+ if (!m) return;
26
+ return Math.round(Number(m[1]) * (units[m[2]] || 1));
27
+ }
28
+ function parseViewbox(viewbox) {
29
+ const bounds = viewbox.split(" ");
30
+ return {
31
+ height: parseLength(bounds[3]),
32
+ width: parseLength(bounds[2])
33
+ };
34
+ }
35
+ function parseAttributes(root) {
36
+ const width = root.match(extractorRegExps.width);
37
+ const height = root.match(extractorRegExps.height);
38
+ const viewbox = root.match(extractorRegExps.viewbox);
39
+ return {
40
+ height: height && parseLength(height[2]),
41
+ viewbox: viewbox && parseViewbox(viewbox[2]),
42
+ width: width && parseLength(width[2])
43
+ };
44
+ }
45
+ function calculateByDimensions(attrs) {
46
+ return {
47
+ height: attrs.height,
48
+ width: attrs.width
49
+ };
50
+ }
51
+ function calculateByViewbox(attrs, viewbox) {
52
+ const ratio = viewbox.width / viewbox.height;
53
+ if (attrs.width) return {
54
+ height: Math.floor(attrs.width / ratio),
55
+ width: attrs.width
56
+ };
57
+ if (attrs.height) return {
58
+ height: attrs.height,
59
+ width: Math.floor(attrs.height * ratio)
60
+ };
61
+ return {
62
+ height: viewbox.height,
63
+ width: viewbox.width
64
+ };
65
+ }
66
+ const SVG = {
67
+ validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
68
+ calculate(input) {
69
+ const root = toUTF8String(input).match(extractorRegExps.root);
70
+ if (root) {
71
+ const attrs = parseAttributes(root[0]);
72
+ if (attrs.width && attrs.height) return calculateByDimensions(attrs);
73
+ if (attrs.viewbox) return calculateByViewbox(attrs, attrs.viewbox);
74
+ }
75
+ throw new TypeError("Invalid SVG");
76
+ }
77
+ };
78
+ //#endregion
79
+ export { SVG };
@@ -0,0 +1,15 @@
1
+ import { readUInt16LE } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/tga.js
3
+ const TGA = {
4
+ validate(input) {
5
+ return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
6
+ },
7
+ calculate(input) {
8
+ return {
9
+ height: readUInt16LE(input, 14),
10
+ width: readUInt16LE(input, 12)
11
+ };
12
+ }
13
+ };
14
+ //#endregion
15
+ export { TGA };
@@ -0,0 +1,96 @@
1
+ import { readUInt, readUInt64, toHexString, toUTF8String } from "./utils.js";
2
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/tiff.js
3
+ const CONSTANTS = {
4
+ TAG: {
5
+ WIDTH: 256,
6
+ HEIGHT: 257,
7
+ COMPRESSION: 259
8
+ },
9
+ TYPE: {
10
+ SHORT: 3,
11
+ LONG: 4,
12
+ LONG8: 16
13
+ },
14
+ ENTRY_SIZE: {
15
+ STANDARD: 12,
16
+ BIG: 20
17
+ },
18
+ COUNT_SIZE: {
19
+ STANDARD: 2,
20
+ BIG: 8
21
+ }
22
+ };
23
+ function readIFD(input, { isBigEndian, isBigTiff }) {
24
+ const ifdOffset = isBigTiff ? Number(readUInt64(input, 8, isBigEndian)) : readUInt(input, 32, 4, isBigEndian);
25
+ const entryCountSize = isBigTiff ? CONSTANTS.COUNT_SIZE.BIG : CONSTANTS.COUNT_SIZE.STANDARD;
26
+ return input.slice(ifdOffset + entryCountSize);
27
+ }
28
+ function readTagValue(input, type, offset, isBigEndian) {
29
+ switch (type) {
30
+ case CONSTANTS.TYPE.SHORT: return readUInt(input, 16, offset, isBigEndian);
31
+ case CONSTANTS.TYPE.LONG: return readUInt(input, 32, offset, isBigEndian);
32
+ case CONSTANTS.TYPE.LONG8: {
33
+ const value = Number(readUInt64(input, offset, isBigEndian));
34
+ if (value > Number.MAX_SAFE_INTEGER) throw new TypeError("Value too large");
35
+ return value;
36
+ }
37
+ default: return 0;
38
+ }
39
+ }
40
+ function nextTag(input, isBigTiff) {
41
+ const entrySize = isBigTiff ? CONSTANTS.ENTRY_SIZE.BIG : CONSTANTS.ENTRY_SIZE.STANDARD;
42
+ if (input.length > entrySize) return input.slice(entrySize);
43
+ }
44
+ function extractTags(input, { isBigEndian, isBigTiff }) {
45
+ const tags = {};
46
+ let temp = input;
47
+ while (temp?.length) {
48
+ const code = readUInt(temp, 16, 0, isBigEndian);
49
+ const type = readUInt(temp, 16, 2, isBigEndian);
50
+ const length = isBigTiff ? Number(readUInt64(temp, 4, isBigEndian)) : readUInt(temp, 32, 4, isBigEndian);
51
+ if (code === 0) break;
52
+ if (length === 1 && (type === CONSTANTS.TYPE.SHORT || type === CONSTANTS.TYPE.LONG || isBigTiff && type === CONSTANTS.TYPE.LONG8)) tags[code] = readTagValue(temp, type, isBigTiff ? 12 : 8, isBigEndian);
53
+ temp = nextTag(temp, isBigTiff);
54
+ }
55
+ return tags;
56
+ }
57
+ function determineFormat(input) {
58
+ const signature = toUTF8String(input, 0, 2);
59
+ const version = readUInt(input, 16, 2, signature === "MM");
60
+ return {
61
+ isBigEndian: signature === "MM",
62
+ isBigTiff: version === 43
63
+ };
64
+ }
65
+ function validateBigTIFFHeader(input, isBigEndian) {
66
+ const byteSize = readUInt(input, 16, 4, isBigEndian);
67
+ const reserved = readUInt(input, 16, 6, isBigEndian);
68
+ if (byteSize !== 8 || reserved !== 0) throw new TypeError("Invalid BigTIFF header");
69
+ }
70
+ const signatures = /* @__PURE__ */ new Set([
71
+ "49492a00",
72
+ "4d4d002a",
73
+ "49492b00",
74
+ "4d4d002b"
75
+ ]);
76
+ const TIFF = {
77
+ validate: (input) => {
78
+ const signature = toHexString(input, 0, 4);
79
+ return signatures.has(signature);
80
+ },
81
+ calculate(input) {
82
+ const format = determineFormat(input);
83
+ if (format.isBigTiff) validateBigTIFFHeader(input, format.isBigEndian);
84
+ const tags = extractTags(readIFD(input, format), format);
85
+ const info = {
86
+ height: tags[CONSTANTS.TAG.HEIGHT],
87
+ width: tags[CONSTANTS.TAG.WIDTH],
88
+ type: format.isBigTiff ? "bigtiff" : "tiff"
89
+ };
90
+ if (tags[CONSTANTS.TAG.COMPRESSION]) info.compression = tags[CONSTANTS.TAG.COMPRESSION];
91
+ if (!info.width || !info.height) throw new TypeError("Invalid Tiff. Missing tags");
92
+ return info;
93
+ }
94
+ };
95
+ //#endregion
96
+ export { TIFF };
@@ -0,0 +1,53 @@
1
+ //#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/utils.js
2
+ const decoder = new TextDecoder();
3
+ const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
4
+ const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + `0${i.toString(16)}`.slice(-2), "");
5
+ const getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
6
+ const readInt16LE = (input, offset = 0) => getView(input, offset).getInt16(0, true);
7
+ const readUInt16BE = (input, offset = 0) => getView(input, offset).getUint16(0, false);
8
+ const readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
9
+ const readUInt24LE = (input, offset = 0) => {
10
+ const view = getView(input, offset);
11
+ return view.getUint16(0, true) + (view.getUint8(2) << 16);
12
+ };
13
+ const readInt32LE = (input, offset = 0) => getView(input, offset).getInt32(0, true);
14
+ const readUInt32BE = (input, offset = 0) => getView(input, offset).getUint32(0, false);
15
+ const readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
16
+ const readUInt64 = (input, offset, isBigEndian) => getView(input, offset).getBigUint64(0, !isBigEndian);
17
+ const methods = {
18
+ readUInt16BE,
19
+ readUInt16LE,
20
+ readUInt32BE,
21
+ readUInt32LE
22
+ };
23
+ function readUInt(input, bits, offset = 0, isBigEndian = false) {
24
+ const methodName = `readUInt${bits}${isBigEndian ? "BE" : "LE"}`;
25
+ return methods[methodName](input, offset);
26
+ }
27
+ const BOX_HEADER_SIZE = 8;
28
+ function readBox(input, offset) {
29
+ if (input.length - offset < BOX_HEADER_SIZE) return void 0;
30
+ const boxSize = readUInt32BE(input, offset);
31
+ if (input.length - offset < boxSize) return void 0;
32
+ return {
33
+ name: toUTF8String(input, 4 + offset, 8 + offset),
34
+ offset,
35
+ size: boxSize
36
+ };
37
+ }
38
+ function findBox(input, boxName, startOffset) {
39
+ let currentOffset = startOffset;
40
+ while (currentOffset < input.length) {
41
+ if (input.length - currentOffset < 4) break;
42
+ if (readUInt32BE(input, currentOffset) < BOX_HEADER_SIZE) {
43
+ currentOffset += BOX_HEADER_SIZE;
44
+ continue;
45
+ }
46
+ const box = readBox(input, currentOffset);
47
+ if (!box) break;
48
+ if (box.name === boxName) return box;
49
+ currentOffset += box.size;
50
+ }
51
+ }
52
+ //#endregion
53
+ export { findBox, readInt16LE, readInt32LE, readUInt, readUInt16BE, readUInt16LE, readUInt24LE, readUInt32BE, readUInt32LE, readUInt64, toHexString, toUTF8String };