@timber-js/app 0.2.0-alpha.18 → 0.2.0-alpha.180
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.
- package/LICENSE +8 -0
- package/agent-skill.md +344 -0
- package/dist/_chunks/actions-O_LsyCE4.js +317 -0
- package/dist/_chunks/actions-O_LsyCE4.js.map +1 -0
- package/dist/_chunks/build-output-helper-DF5uScqS.js +158 -0
- package/dist/_chunks/build-output-helper-DF5uScqS.js.map +1 -0
- package/dist/_chunks/cache-api-B-lhk9p4.js +1202 -0
- package/dist/_chunks/cache-api-B-lhk9p4.js.map +1 -0
- package/dist/_chunks/canonicalize-DQHyFClh.js +248 -0
- package/dist/_chunks/canonicalize-DQHyFClh.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-D3naS3eH.js +688 -0
- package/dist/_chunks/cli-schema-sync-D3naS3eH.js.map +1 -0
- package/dist/_chunks/cloudflare-AHoWYTYr.js +1188 -0
- package/dist/_chunks/cloudflare-AHoWYTYr.js.map +1 -0
- package/dist/_chunks/codec-registry-oOUxugz3.js +21 -0
- package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -0
- package/dist/_chunks/define-COtkxMRT.js +191 -0
- package/dist/_chunks/define-COtkxMRT.js.map +1 -0
- package/dist/_chunks/define-c4au4I9R.js +82 -0
- package/dist/_chunks/define-c4au4I9R.js.map +1 -0
- package/dist/_chunks/dist-BA3u1z3W.js +423 -0
- package/dist/_chunks/dist-BA3u1z3W.js.map +1 -0
- package/dist/_chunks/fast-hash-D6hIVt1Y.js +36 -0
- package/dist/_chunks/fast-hash-D6hIVt1Y.js.map +1 -0
- package/dist/_chunks/format-CfwjgPz9.js +14 -0
- package/dist/_chunks/format-CfwjgPz9.js.map +1 -0
- package/dist/_chunks/href-validation-CMc5JRls.js +141 -0
- package/dist/_chunks/href-validation-CMc5JRls.js.map +1 -0
- package/dist/_chunks/json-lossy-check-ClNvBM_3.js +63 -0
- package/dist/_chunks/json-lossy-check-ClNvBM_3.js.map +1 -0
- package/dist/_chunks/logger-AWfuX-KJ.js +1468 -0
- package/dist/_chunks/logger-AWfuX-KJ.js.map +1 -0
- package/dist/_chunks/navigation-root-bUDZLw74.js +124 -0
- package/dist/_chunks/navigation-root-bUDZLw74.js.map +1 -0
- package/dist/_chunks/plugin-context---kTF5v8.js +315 -0
- package/dist/_chunks/plugin-context---kTF5v8.js.map +1 -0
- package/dist/_chunks/registry-DbJPKoBp.js +20 -0
- package/dist/_chunks/registry-DbJPKoBp.js.map +1 -0
- package/dist/_chunks/resolve-schema-Dz3fcFUo.js +50 -0
- package/dist/_chunks/resolve-schema-Dz3fcFUo.js.map +1 -0
- package/dist/_chunks/router-ref-CtmF-aPv.js +28 -0
- package/dist/_chunks/router-ref-CtmF-aPv.js.map +1 -0
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js +119 -0
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js.map +1 -0
- package/dist/_chunks/segment-classify-Byy425ng.js +176 -0
- package/dist/_chunks/segment-classify-Byy425ng.js.map +1 -0
- package/dist/_chunks/segment-context-ZDnXDkbz.js +34 -0
- package/dist/_chunks/segment-context-ZDnXDkbz.js.map +1 -0
- package/dist/_chunks/sizeof-lXffQ1Vr.js +35 -0
- package/dist/_chunks/sizeof-lXffQ1Vr.js.map +1 -0
- package/dist/_chunks/{ssr-data-MjmprTmO.js → ssr-data-BOWsq18U.js} +1 -1
- package/dist/_chunks/ssr-data-BOWsq18U.js.map +1 -0
- package/dist/_chunks/{use-query-states-D5KaffOK.js → use-query-states-DFvWd-EA.js} +71 -26
- package/dist/_chunks/use-query-states-DFvWd-EA.js.map +1 -0
- package/dist/_chunks/use-segment-params-D1CzlgBo.js +151 -0
- package/dist/_chunks/use-segment-params-D1CzlgBo.js.map +1 -0
- package/dist/_chunks/walkers-BtTlKviE.js +1002 -0
- package/dist/_chunks/walkers-BtTlKviE.js.map +1 -0
- package/dist/adapters/build-output-helper.d.ts +29 -0
- package/dist/adapters/build-output-helper.d.ts.map +1 -0
- package/dist/adapters/cloudflare-dev.d.ts +109 -0
- package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
- package/dist/adapters/cloudflare-dev.js +73 -0
- package/dist/adapters/cloudflare-dev.js.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts +65 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.js +124 -0
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
- package/dist/adapters/cloudflare.d.ts +189 -21
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +2 -188
- package/dist/adapters/compress-module.d.ts +5 -4
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/nitro.d.ts +41 -3
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +224 -172
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +6 -0
- package/dist/adapters/shared.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +2 -6
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cache/cache-api.d.ts +48 -0
- package/dist/cache/cache-api.d.ts.map +1 -0
- package/dist/cache/handler-store.d.ts +33 -0
- package/dist/cache/handler-store.d.ts.map +1 -0
- package/dist/cache/index.d.ts +31 -8
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +3 -326
- package/dist/cache/invalidation-epoch.d.ts +43 -0
- package/dist/cache/invalidation-epoch.d.ts.map +1 -0
- package/dist/cache/json-lossy-check.d.ts +11 -0
- package/dist/cache/json-lossy-check.d.ts.map +1 -0
- package/dist/cache/redis-handler.d.ts +140 -8
- package/dist/cache/redis-handler.d.ts.map +1 -1
- package/dist/cache/singleflight.d.ts +19 -2
- package/dist/cache/singleflight.d.ts.map +1 -1
- package/dist/cache/sizeof.d.ts +22 -0
- package/dist/cache/sizeof.d.ts.map +1 -0
- package/dist/cache/stable-stringify.d.ts +9 -0
- package/dist/cache/stable-stringify.d.ts.map +1 -1
- package/dist/cache/store.d.ts +53 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
- package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
- package/dist/cache/stores/cloudflare-kv.js +29 -0
- package/dist/cache/stores/cloudflare-kv.js.map +1 -0
- package/dist/cache/stores/memory.d.ts +42 -0
- package/dist/cache/stores/memory.d.ts.map +1 -0
- package/dist/cache/stores/memory.js +90 -0
- package/dist/cache/stores/memory.js.map +1 -0
- package/dist/cache/stores/redis.d.ts +69 -0
- package/dist/cache/stores/redis.d.ts.map +1 -0
- package/dist/cache/stores/redis.js +35 -0
- package/dist/cache/stores/redis.js.map +1 -0
- package/dist/cache/stores/vercel.d.ts +36 -0
- package/dist/cache/stores/vercel.d.ts.map +1 -0
- package/dist/cache/stores/vercel.js +33 -0
- package/dist/cache/stores/vercel.js.map +1 -0
- package/dist/cache/tag-aware-handler.d.ts +52 -0
- package/dist/cache/tag-aware-handler.d.ts.map +1 -0
- package/dist/cache/timber-cache.d.ts +20 -10
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cdn/cloudflare-purge.d.ts +23 -0
- package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
- package/dist/cdn/fastly-purge.d.ts +25 -0
- package/dist/cdn/fastly-purge.d.ts.map +1 -0
- package/dist/cdn/headers.d.ts +97 -0
- package/dist/cdn/headers.d.ts.map +1 -0
- package/dist/cdn/index.d.ts +5 -0
- package/dist/cdn/index.d.ts.map +1 -0
- package/dist/cdn/purge-store.d.ts +23 -0
- package/dist/cdn/purge-store.d.ts.map +1 -0
- package/dist/cdn/workers-cache-purge.d.ts +16 -0
- package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
- package/dist/cli-schema-sync.d.ts +59 -0
- package/dist/cli-schema-sync.d.ts.map +1 -0
- package/dist/cli.d.ts +35 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +113 -34
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +37 -1
- package/dist/client/browser-dev.d.ts.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
- package/dist/client/browser-entry/hmr.d.ts +21 -0
- package/dist/client/browser-entry/hmr.d.ts.map +1 -0
- package/dist/client/browser-entry/hydrate.d.ts +46 -0
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
- package/dist/client/browser-entry/index.d.ts +29 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -0
- package/dist/client/browser-entry/post-hydration.d.ts +26 -0
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts +27 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -0
- package/dist/client/browser-entry/rsc-stream.d.ts +24 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
- package/dist/client/browser-entry/scroll.d.ts +28 -0
- package/dist/client/browser-entry/scroll.d.ts.map +1 -0
- package/dist/client/error-boundary.d.ts +12 -5
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +47 -10
- package/dist/client/error-boundary.js.map +1 -1
- package/dist/client/error-reconstituter.d.ts +61 -0
- package/dist/client/error-reconstituter.d.ts.map +1 -0
- package/dist/client/form.d.ts +16 -27
- package/dist/client/form.d.ts.map +1 -1
- package/dist/client/history.d.ts +21 -6
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +10 -24
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +185 -1134
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +19 -0
- package/dist/client/internal.d.ts.map +1 -0
- package/dist/client/internal.js +887 -0
- package/dist/client/internal.js.map +1 -0
- package/dist/client/link.d.ts +69 -60
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-api.d.ts +121 -0
- package/dist/client/navigation-api.d.ts.map +1 -0
- package/dist/client/navigation-context.d.ts +3 -2
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +119 -0
- package/dist/client/navigation-root.d.ts.map +1 -0
- package/dist/client/nuqs-adapter.d.ts +1 -1
- package/dist/client/nuqs-adapter.d.ts.map +1 -1
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/router.d.ts +99 -14
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +48 -15
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +26 -7
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +57 -0
- package/dist/client/segment-outlet.d.ts.map +1 -0
- package/dist/client/segment-update-context.d.ts +21 -0
- package/dist/client/segment-update-context.d.ts.map +1 -0
- package/dist/client/shallow-url.d.ts +10 -0
- package/dist/client/shallow-url.d.ts.map +1 -0
- package/dist/client/slot-context.d.ts +31 -0
- package/dist/client/slot-context.d.ts.map +1 -0
- package/dist/client/slot-outlet.d.ts +16 -0
- package/dist/client/slot-outlet.d.ts.map +1 -0
- package/dist/client/slot-provider.d.ts +25 -0
- package/dist/client/slot-provider.d.ts.map +1 -0
- package/dist/client/ssr-data.d.ts +13 -4
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/state.d.ts +1 -1
- package/dist/client/top-loader.d.ts +5 -5
- package/dist/client/top-loader.d.ts.map +1 -1
- package/dist/client/use-cookie.d.ts +12 -0
- package/dist/client/use-cookie.d.ts.map +1 -1
- package/dist/client/use-link-status.d.ts +5 -5
- package/dist/client/use-link-status.d.ts.map +1 -1
- package/dist/client/use-pathname.d.ts.map +1 -1
- package/dist/client/use-pending-navigation.d.ts +23 -0
- package/dist/client/use-pending-navigation.d.ts.map +1 -0
- package/dist/client/use-query-states.d.ts +1 -1
- package/dist/client/use-query-states.d.ts.map +1 -1
- package/dist/client/use-router.d.ts +1 -1
- package/dist/client/use-router.d.ts.map +1 -1
- package/dist/client/use-search-params.d.ts +12 -5
- package/dist/client/use-search-params.d.ts.map +1 -1
- package/dist/client/{use-params.d.ts → use-segment-params.d.ts} +8 -6
- package/dist/client/use-segment-params.d.ts.map +1 -0
- package/dist/codec.d.ts +69 -0
- package/dist/codec.d.ts.map +1 -0
- package/dist/codec.js +76 -0
- package/dist/codec.js.map +1 -0
- package/dist/config-types.d.ts +284 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/config-validation.d.ts +51 -0
- package/dist/config-validation.d.ts.map +1 -0
- package/dist/content/index.d.ts +1 -10
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +0 -2
- package/dist/cookies/define-cookie.d.ts +58 -25
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.d.ts +2 -1
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +257 -36
- package/dist/cookies/index.js.map +1 -1
- package/dist/cookies/json-cookie.d.ts +64 -0
- package/dist/cookies/json-cookie.d.ts.map +1 -0
- package/dist/cookies/validation.d.ts +34 -0
- package/dist/cookies/validation.d.ts.map +1 -0
- package/dist/dev-tools/404-page.d.ts +50 -0
- package/dist/dev-tools/404-page.d.ts.map +1 -0
- package/dist/dev-tools/browser-logs.d.ts +40 -0
- package/dist/dev-tools/browser-logs.d.ts.map +1 -0
- package/dist/dev-tools/dev-page-shell.d.ts +78 -0
- package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
- package/dist/dev-tools/error-page.d.ts +32 -0
- package/dist/dev-tools/error-page.d.ts.map +1 -0
- package/dist/dev-tools/holding-server.d.ts +54 -0
- package/dist/dev-tools/holding-server.d.ts.map +1 -0
- package/dist/dev-tools/hydration-overlay.d.ts +11 -0
- package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
- package/dist/dev-tools/index.d.ts +31 -0
- package/dist/dev-tools/index.d.ts.map +1 -0
- package/dist/dev-tools/instrumentation.d.ts +59 -0
- package/dist/dev-tools/instrumentation.d.ts.map +1 -0
- package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
- package/dist/dev-tools/logger.d.ts.map +1 -0
- package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +17 -3
- package/dist/dev-tools/logs.d.ts.map +1 -0
- package/dist/dev-tools/overlay.d.ts +91 -0
- package/dist/dev-tools/overlay.d.ts.map +1 -0
- package/dist/dev-tools/stack-classifier.d.ts +34 -0
- package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
- package/dist/dev-tools/terminal.d.ts +28 -0
- package/dist/dev-tools/terminal.d.ts.map +1 -0
- package/dist/fonts/ast-walk.d.ts +68 -0
- package/dist/fonts/ast-walk.d.ts.map +1 -0
- package/dist/fonts/ast.d.ts +110 -6
- package/dist/fonts/ast.d.ts.map +1 -1
- package/dist/fonts/bundle.d.ts +50 -0
- package/dist/fonts/bundle.d.ts.map +1 -0
- package/dist/fonts/dev-middleware.d.ts +22 -0
- package/dist/fonts/dev-middleware.d.ts.map +1 -0
- package/dist/fonts/fallbacks.d.ts +0 -7
- package/dist/fonts/fallbacks.d.ts.map +1 -1
- package/dist/fonts/google.d.ts +4 -2
- package/dist/fonts/google.d.ts.map +1 -1
- package/dist/fonts/local.d.ts +4 -4
- package/dist/fonts/local.d.ts.map +1 -1
- package/dist/fonts/paths.d.ts +43 -0
- package/dist/fonts/paths.d.ts.map +1 -0
- package/dist/fonts/pipeline.d.ts +177 -0
- package/dist/fonts/pipeline.d.ts.map +1 -0
- package/dist/fonts/transform.d.ts +82 -0
- package/dist/fonts/transform.d.ts.map +1 -0
- package/dist/fonts/types.d.ts +47 -1
- package/dist/fonts/types.d.ts.map +1 -1
- package/dist/fonts/virtual-modules.d.ts +77 -0
- package/dist/fonts/virtual-modules.d.ts.map +1 -0
- package/dist/index.d.ts +46 -180
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9243 -14093
- package/dist/index.js.map +1 -1
- package/dist/params/codec-registry.d.ts +26 -0
- package/dist/params/codec-registry.d.ts.map +1 -0
- package/dist/params/define-schema.d.ts +81 -0
- package/dist/params/define-schema.d.ts.map +1 -0
- package/dist/params/index.d.ts +5 -0
- package/dist/params/index.d.ts.map +1 -0
- package/dist/params/index.js +34 -0
- package/dist/params/index.js.map +1 -0
- package/dist/params/resolve-schema.d.ts +34 -0
- package/dist/params/resolve-schema.d.ts.map +1 -0
- package/dist/plugin-context.d.ts +217 -0
- package/dist/plugin-context.d.ts.map +1 -0
- package/dist/plugins/adapter-build.d.ts +21 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +7 -3
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/build-report.d.ts +43 -7
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/cache.d.ts +64 -0
- package/dist/plugins/cache.d.ts.map +1 -0
- package/dist/plugins/callsite-ast.d.ts +117 -0
- package/dist/plugins/callsite-ast.d.ts.map +1 -0
- package/dist/plugins/callsite-jsx.d.ts +35 -0
- package/dist/plugins/callsite-jsx.d.ts.map +1 -0
- package/dist/plugins/chunks.d.ts +11 -4
- package/dist/plugins/chunks.d.ts.map +1 -1
- package/dist/plugins/client-chunks.d.ts +40 -0
- package/dist/plugins/client-chunks.d.ts.map +1 -0
- package/dist/plugins/cloudflare-wasm.d.ts +21 -0
- package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
- package/dist/plugins/content.d.ts +1 -1
- package/dist/plugins/content.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts +17 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +28 -4
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +16 -73
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/mdx.d.ts +1 -1
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/prebuilt-capture.d.ts +60 -0
- package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
- package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
- package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
- package/dist/plugins/prebuilt.d.ts +82 -0
- package/dist/plugins/prebuilt.d.ts.map +1 -0
- package/dist/plugins/prerender-sugar.d.ts +42 -0
- package/dist/plugins/prerender-sugar.d.ts.map +1 -0
- package/dist/plugins/request-dep.d.ts +21 -0
- package/dist/plugins/request-dep.d.ts.map +1 -0
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/server-bundle.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts +29 -5
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +5 -26
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-shared.d.ts +67 -0
- package/dist/routing/codegen-shared.d.ts.map +1 -0
- package/dist/routing/codegen-types.d.ts +64 -0
- package/dist/routing/codegen-types.d.ts.map +1 -0
- package/dist/routing/codegen.d.ts +7 -2
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/convention-lint.d.ts +41 -0
- package/dist/routing/convention-lint.d.ts.map +1 -0
- package/dist/routing/export-detect.d.ts +56 -0
- package/dist/routing/export-detect.d.ts.map +1 -0
- package/dist/routing/file-cache.d.ts +8 -0
- package/dist/routing/file-cache.d.ts.map +1 -0
- package/dist/routing/index.d.ts +7 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +4 -2
- package/dist/routing/interception.d.ts +0 -5
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/routing/link-codegen.d.ts +90 -0
- package/dist/routing/link-codegen.d.ts.map +1 -0
- package/dist/routing/manifest-codegen.d.ts +32 -0
- package/dist/routing/manifest-codegen.d.ts.map +1 -0
- package/dist/routing/scanner.d.ts +1 -10
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/schema-validation.d.ts +35 -0
- package/dist/routing/schema-validation.d.ts.map +1 -0
- package/dist/routing/segment-classify.d.ts +81 -0
- package/dist/routing/segment-classify.d.ts.map +1 -0
- package/dist/routing/segment-codegen.d.ts +38 -0
- package/dist/routing/segment-codegen.d.ts.map +1 -0
- package/dist/routing/types.d.ts +81 -25
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/routing/walkers.d.ts +51 -0
- package/dist/routing/walkers.d.ts.map +1 -0
- package/dist/rsc-runtime/rsc.d.ts +1 -1
- package/dist/rsc-runtime/rsc.d.ts.map +1 -1
- package/dist/rsc-runtime/ssr.d.ts +12 -0
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts +91 -0
- package/dist/schema-bridge.d.ts.map +1 -0
- package/dist/search-params/define.d.ts +188 -0
- package/dist/search-params/define.d.ts.map +1 -0
- package/dist/search-params/index.d.ts +4 -7
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +34 -441
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/registry.d.ts +2 -2
- package/dist/search-params/registry.d.ts.map +1 -1
- package/dist/search-params/wrappers.d.ts +53 -0
- package/dist/search-params/wrappers.d.ts.map +1 -0
- package/dist/segment-params/define.d.ts +89 -0
- package/dist/segment-params/define.d.ts.map +1 -0
- package/dist/segment-params/index.d.ts +3 -0
- package/dist/segment-params/index.d.ts.map +1 -0
- package/dist/segment-params/index.js +2 -0
- package/dist/server/access-gate.d.ts +8 -3
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-client.d.ts +42 -7
- package/dist/server/action-client.d.ts.map +1 -1
- package/dist/server/action-encryption.d.ts +76 -0
- package/dist/server/action-encryption.d.ts.map +1 -0
- package/dist/server/action-handler.d.ts +35 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +6 -30
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +93 -11
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/asset-headers.d.ts +8 -18
- package/dist/server/asset-headers.d.ts.map +1 -1
- package/dist/server/body-limits.d.ts.map +1 -1
- package/dist/server/build-manifest.d.ts +12 -29
- package/dist/server/build-manifest.d.ts.map +1 -1
- package/dist/server/canonicalize.d.ts +10 -0
- package/dist/server/canonicalize.d.ts.map +1 -1
- package/dist/server/coalesce-tick.d.ts +40 -0
- package/dist/server/coalesce-tick.d.ts.map +1 -0
- package/dist/server/cookie-context.d.ts +170 -0
- package/dist/server/cookie-context.d.ts.map +1 -0
- package/dist/server/cookie-parsing.d.ts +65 -0
- package/dist/server/cookie-parsing.d.ts.map +1 -0
- package/dist/server/csrf.d.ts +3 -2
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/default-logger.d.ts +22 -0
- package/dist/server/default-logger.d.ts.map +1 -0
- package/dist/server/deny-boundary.d.ts +117 -0
- package/dist/server/deny-boundary.d.ts.map +1 -0
- package/dist/server/deny-renderer.d.ts +2 -2
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/dev-source-map.d.ts +22 -0
- package/dist/server/dev-source-map.d.ts.map +1 -0
- package/dist/server/early-hints-sender.d.ts.map +1 -1
- package/dist/server/early-hints.d.ts +13 -11
- package/dist/server/early-hints.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +7 -1
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/fallback-error.d.ts +12 -7
- package/dist/server/fallback-error.d.ts.map +1 -1
- package/dist/server/flight-injection-state.d.ts +66 -0
- package/dist/server/flight-injection-state.d.ts.map +1 -0
- package/dist/server/flight-scripts.d.ts +42 -0
- package/dist/server/flight-scripts.d.ts.map +1 -0
- package/dist/server/form-data.d.ts +41 -0
- package/dist/server/form-data.d.ts.map +1 -1
- package/dist/server/html-injector-core.d.ts +242 -0
- package/dist/server/html-injector-core.d.ts.map +1 -0
- package/dist/server/html-injectors.d.ts +82 -41
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.d.ts +11 -47
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +182 -2906
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +49 -0
- package/dist/server/internal.d.ts.map +1 -0
- package/dist/server/internal.js +3892 -0
- package/dist/server/internal.js.map +1 -0
- package/dist/server/logger.d.ts +39 -7
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/metadata-routes.d.ts +60 -11
- package/dist/server/metadata-routes.d.ts.map +1 -1
- package/dist/server/metadata.d.ts +8 -0
- package/dist/server/metadata.d.ts.map +1 -1
- package/dist/server/middleware-runner.d.ts +19 -4
- package/dist/server/middleware-runner.d.ts.map +1 -1
- package/dist/server/node-stream-transforms.d.ts +119 -0
- package/dist/server/node-stream-transforms.d.ts.map +1 -0
- package/dist/server/param-coercion.d.ts +54 -0
- package/dist/server/param-coercion.d.ts.map +1 -0
- package/dist/server/pipeline-helpers.d.ts +95 -0
- package/dist/server/pipeline-helpers.d.ts.map +1 -0
- package/dist/server/pipeline-interception.d.ts +1 -1
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-metadata.d.ts +6 -0
- package/dist/server/pipeline-metadata.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts +49 -0
- package/dist/server/pipeline-outcome.d.ts.map +1 -0
- package/dist/server/pipeline-phases.d.ts +59 -0
- package/dist/server/pipeline-phases.d.ts.map +1 -0
- package/dist/server/pipeline.d.ts +140 -19
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/port-resolution.d.ts +117 -0
- package/dist/server/port-resolution.d.ts.map +1 -0
- package/dist/server/prebuilt/cache-key.d.ts +62 -0
- package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-state.d.ts +57 -0
- package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
- package/dist/server/prebuilt/key-discipline.d.ts +23 -0
- package/dist/server/prebuilt/key-discipline.d.ts.map +1 -0
- package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
- package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
- package/dist/server/prebuilt/overlay.d.ts +100 -0
- package/dist/server/prebuilt/overlay.d.ts.map +1 -0
- package/dist/server/prebuilt/payload-source.d.ts +78 -0
- package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
- package/dist/server/prebuilt/slots.d.ts +99 -0
- package/dist/server/prebuilt/slots.d.ts.map +1 -0
- package/dist/server/prebuilt/synthetic-store.d.ts +66 -0
- package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
- package/dist/server/prebuilt-builder.d.ts +120 -0
- package/dist/server/prebuilt-builder.d.ts.map +1 -0
- package/dist/server/prebuilt-runtime.d.ts +111 -0
- package/dist/server/prebuilt-runtime.d.ts.map +1 -0
- package/dist/server/primitives.d.ts +88 -43
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/render-timeout.d.ts +51 -0
- package/dist/server/render-timeout.d.ts.map +1 -0
- package/dist/server/render-utils.d.ts +25 -0
- package/dist/server/render-utils.d.ts.map +1 -0
- package/dist/server/request-context.d.ts +62 -107
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-dep.d.ts +15 -0
- package/dist/server/request-dep.d.ts.map +1 -0
- package/dist/server/route-element-builder.d.ts +53 -25
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +25 -36
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
- package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
- package/dist/server/rsc-entry/api-handler.d.ts +12 -3
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts +29 -0
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
- package/dist/server/rsc-entry/error-renderer.d.ts +26 -13
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +69 -37
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +28 -6
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +51 -0
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +108 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
- package/dist/server/rsc-entry/rsc-payload.d.ts +6 -6
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +25 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts +5 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +36 -4
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +89 -0
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -0
- package/dist/server/safe-load.d.ts +46 -0
- package/dist/server/safe-load.d.ts.map +1 -0
- package/dist/server/sensitive-fields.d.ts +74 -0
- package/dist/server/sensitive-fields.d.ts.map +1 -0
- package/dist/server/sitemap-generator.d.ts +129 -0
- package/dist/server/sitemap-generator.d.ts.map +1 -0
- package/dist/server/sitemap-handler.d.ts +22 -0
- package/dist/server/sitemap-handler.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +66 -5
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +121 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -0
- package/dist/server/ssr-entry.d.ts +2 -43
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts +64 -21
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +50 -0
- package/dist/server/ssr-wrappers.d.ts.map +1 -0
- package/dist/server/state-tree-diff.d.ts +72 -9
- package/dist/server/state-tree-diff.d.ts.map +1 -1
- package/dist/server/status-code-resolver.d.ts +22 -11
- package/dist/server/status-code-resolver.d.ts.map +1 -1
- package/dist/server/stream-utils.d.ts +47 -0
- package/dist/server/stream-utils.d.ts.map +1 -0
- package/dist/server/tracing.d.ts +44 -9
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts +69 -30
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/dist/server/tree-match.d.ts +49 -0
- package/dist/server/tree-match.d.ts.map +1 -0
- package/dist/server/types.d.ts +71 -6
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils/escape-html.d.ts +14 -0
- package/dist/server/utils/escape-html.d.ts.map +1 -0
- package/dist/server/utils/mdx-file.d.ts +15 -0
- package/dist/server/utils/mdx-file.d.ts.map +1 -0
- package/dist/server/version-skew.d.ts +61 -0
- package/dist/server/version-skew.d.ts.map +1 -0
- package/dist/server/workers-cache-bridge.d.ts +26 -0
- package/dist/server/workers-cache-bridge.d.ts.map +1 -0
- package/dist/shared/href-validation.d.ts +49 -0
- package/dist/shared/href-validation.d.ts.map +1 -0
- package/dist/shared/merge-search-params.d.ts +22 -0
- package/dist/shared/merge-search-params.d.ts.map +1 -0
- package/dist/shared/redirect-type.d.ts +17 -0
- package/dist/shared/redirect-type.d.ts.map +1 -0
- package/dist/shims/font-google.d.ts +1 -1
- package/dist/shims/font-google.d.ts.map +1 -1
- package/dist/shims/font-google.js +42 -0
- package/dist/shims/font-google.js.map +1 -0
- package/dist/shims/font-local.d.ts +26 -0
- package/dist/shims/font-local.d.ts.map +1 -0
- package/dist/shims/font-local.js +20 -0
- package/dist/shims/font-local.js.map +1 -0
- package/dist/shims/headers.d.ts +53 -1
- package/dist/shims/headers.d.ts.map +1 -1
- package/dist/shims/image.d.ts +120 -120
- package/dist/shims/image.d.ts.map +1 -1
- package/dist/shims/navigation-client.d.ts +35 -11
- package/dist/shims/navigation-client.d.ts.map +1 -1
- package/dist/shims/navigation.d.ts +11 -5
- package/dist/shims/navigation.d.ts.map +1 -1
- package/dist/utils/state-machine.d.ts +80 -0
- package/dist/utils/state-machine.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +233 -0
- package/docs/api/31-api-client.mdx +161 -0
- package/docs/api/32-api-cache.mdx +311 -0
- package/docs/api/33-api-search-params.mdx +154 -0
- package/docs/api/34-api-config.mdx +325 -0
- package/docs/api/35-api-typescript.mdx +170 -0
- package/docs/api/36-cli.mdx +143 -0
- package/docs/learn/00-introduction.mdx +109 -0
- package/docs/learn/01-quick-start.mdx +94 -0
- package/docs/learn/02-pages-and-layouts.mdx +147 -0
- package/docs/learn/03-fetching-data.mdx +211 -0
- package/docs/learn/03b-access-control.mdx +130 -0
- package/docs/learn/04-loading-states.mdx +67 -0
- package/docs/learn/04b-the-flush-point.mdx +115 -0
- package/docs/learn/05-typed-params.mdx +275 -0
- package/docs/learn/06-forms-and-actions.mdx +146 -0
- package/docs/learn/07-typed-routes.mdx +127 -0
- package/docs/learn/08-streaming.mdx +146 -0
- package/docs/learn/09-caching.mdx +252 -0
- package/docs/learn/10-middleware.mdx +157 -0
- package/docs/learn/11-error-handling.mdx +156 -0
- package/docs/learn/12-client-navigation.mdx +176 -0
- package/docs/learn/13-configuration.mdx +162 -0
- package/docs/learn/14-deploying.mdx +264 -0
- package/docs/more/01-advanced-routing.mdx +173 -0
- package/docs/more/02-advanced-forms.mdx +137 -0
- package/docs/more/03-coming-from-nextjs.mdx +186 -0
- package/docs/more/04-metadata-and-fonts.mdx +193 -0
- package/docs/more/04b-mdx.mdx +209 -0
- package/docs/more/05-content-collections.mdx +90 -0
- package/docs/more/06-instrumentation.mdx +214 -0
- package/docs/more/07-security.mdx +129 -0
- package/docs/more/08-developer-experience.mdx +134 -0
- package/docs/more/40-why-timber.mdx +50 -0
- package/docs/more/41-timber-vs-nextjs.mdx +81 -0
- package/docs/more/42-timber-vs-others.mdx +68 -0
- package/docs/more/50-ai-agent-instructions.mdx +169 -0
- package/llms.txt +55 -0
- package/package.json +105 -26
- package/src/adapters/build-output-helper.ts +199 -0
- package/src/adapters/cloudflare-dev.ts +177 -0
- package/src/adapters/cloudflare-kv-cache.ts +204 -0
- package/src/adapters/cloudflare.ts +620 -129
- package/src/adapters/compress-module.ts +27 -92
- package/src/adapters/nitro.ts +266 -122
- package/src/adapters/raw-imports.d.ts +5 -0
- package/src/adapters/shared.ts +68 -0
- package/src/adapters/types.ts +2 -7
- package/src/adapters/wrangler.d.ts +7 -0
- package/src/cache/cache-api.ts +107 -0
- package/src/cache/handler-store.ts +76 -0
- package/src/cache/index.ts +114 -21
- package/src/cache/invalidation-epoch.ts +93 -0
- package/src/cache/json-lossy-check.ts +75 -0
- package/src/cache/redis-handler.ts +197 -19
- package/src/cache/singleflight.ts +64 -6
- package/src/cache/sizeof.ts +33 -0
- package/src/cache/stable-stringify.ts +65 -2
- package/src/cache/store.ts +71 -0
- package/src/cache/stores/cloudflare-kv.ts +52 -0
- package/src/cache/stores/memory.ts +125 -0
- package/src/cache/stores/redis.ts +97 -0
- package/src/cache/stores/vercel.ts +59 -0
- package/src/cache/tag-aware-handler.ts +237 -0
- package/src/cache/timber-cache.ts +161 -36
- package/src/cdn/cloudflare-purge.ts +50 -0
- package/src/cdn/fastly-purge.ts +63 -0
- package/src/cdn/headers.ts +153 -0
- package/src/cdn/index.ts +17 -0
- package/src/cdn/purge-store.ts +34 -0
- package/src/cdn/workers-cache-purge.ts +30 -0
- package/src/cli-schema-sync.ts +401 -0
- package/src/cli.ts +167 -34
- package/src/client/browser-dev.ts +156 -1
- package/src/client/browser-entry/action-dispatch.ts +124 -0
- package/src/client/browser-entry/hmr.ts +70 -0
- package/src/client/browser-entry/hydrate.ts +187 -0
- package/src/client/browser-entry/index.ts +113 -0
- package/src/client/browser-entry/post-hydration.ts +110 -0
- package/src/client/browser-entry/router-init.ts +286 -0
- package/src/client/browser-entry/rsc-stream.ts +157 -0
- package/src/client/browser-entry/scroll.ts +50 -0
- package/src/client/error-boundary.tsx +127 -22
- package/src/client/error-reconstituter.tsx +79 -0
- package/src/client/form.tsx +31 -32
- package/src/client/history.ts +21 -6
- package/src/client/index.ts +67 -45
- package/src/client/internal.ts +58 -0
- package/src/client/link.tsx +349 -150
- package/src/client/navigation-api.ts +345 -0
- package/src/client/navigation-context.ts +15 -7
- package/src/client/navigation-root.tsx +355 -0
- package/src/client/nuqs-adapter.tsx +16 -3
- package/src/client/router-ref.ts +1 -1
- package/src/client/router.ts +565 -212
- package/src/client/rsc-fetch.ts +215 -34
- package/src/client/segment-cache.ts +91 -17
- package/src/client/segment-outlet.tsx +141 -0
- package/src/client/segment-update-context.ts +42 -0
- package/src/client/shallow-url.ts +22 -0
- package/src/client/slot-context.ts +50 -0
- package/src/client/slot-outlet.tsx +22 -0
- package/src/client/slot-provider.tsx +32 -0
- package/src/client/ssr-data.ts +13 -5
- package/src/client/state.ts +2 -2
- package/src/client/top-loader.tsx +11 -9
- package/src/client/use-cookie.ts +60 -15
- package/src/client/use-link-status.ts +7 -7
- package/src/client/use-pathname.ts +1 -0
- package/src/client/use-pending-navigation.ts +40 -0
- package/src/client/use-query-states.ts +108 -10
- package/src/client/use-router.ts +4 -1
- package/src/client/use-search-params.ts +31 -44
- package/src/client/{use-params.ts → use-segment-params.ts} +9 -6
- package/src/codec.ts +149 -0
- package/src/config-types.ts +282 -0
- package/src/config-validation.ts +330 -0
- package/src/content/index.ts +5 -13
- package/src/cookies/define-cookie.ts +217 -53
- package/src/cookies/index.ts +12 -1
- package/src/cookies/json-cookie.ts +105 -0
- package/src/cookies/validation.ts +192 -0
- package/src/dev-tools/404-page.ts +286 -0
- package/src/dev-tools/browser-logs.ts +55 -0
- package/src/dev-tools/dev-page-shell.ts +260 -0
- package/src/dev-tools/error-page.ts +331 -0
- package/src/dev-tools/holding-server.ts +187 -0
- package/src/dev-tools/hydration-overlay.ts +158 -0
- package/src/dev-tools/index.ts +83 -0
- package/src/dev-tools/instrumentation.ts +213 -0
- package/src/{server/dev-logger.ts → dev-tools/logger.ts} +33 -51
- package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +122 -26
- package/src/dev-tools/overlay.ts +469 -0
- package/src/dev-tools/stack-classifier.ts +75 -0
- package/src/dev-tools/terminal.ts +182 -0
- package/src/fonts/ast-walk.ts +235 -0
- package/src/fonts/ast.ts +477 -126
- package/src/fonts/bundle.ts +138 -0
- package/src/fonts/dev-middleware.ts +85 -0
- package/src/fonts/fallbacks.ts +0 -23
- package/src/fonts/google.ts +100 -18
- package/src/fonts/local.ts +9 -8
- package/src/fonts/paths.ts +58 -0
- package/src/fonts/pipeline.ts +348 -0
- package/src/fonts/transform.ts +311 -0
- package/src/fonts/types.ts +52 -1
- package/src/fonts/virtual-modules.ts +179 -0
- package/src/index.ts +446 -352
- package/src/params/codec-registry.ts +34 -0
- package/src/params/define-schema.ts +115 -0
- package/src/params/index.ts +17 -0
- package/src/params/resolve-schema.ts +84 -0
- package/src/plugin-context.ts +432 -0
- package/src/plugins/adapter-build.ts +220 -7
- package/src/plugins/build-manifest.ts +177 -23
- package/src/plugins/build-report.ts +253 -35
- package/src/plugins/cache.ts +243 -0
- package/src/plugins/callsite-ast.ts +472 -0
- package/src/plugins/callsite-jsx.ts +243 -0
- package/src/plugins/chunks.ts +74 -5
- package/src/plugins/client-chunks.ts +185 -0
- package/src/plugins/cloudflare-wasm.ts +141 -0
- package/src/plugins/content.ts +1 -1
- package/src/plugins/dev-server.ts +284 -94
- package/src/plugins/entries.ts +134 -16
- package/src/plugins/fonts.ts +225 -660
- package/src/plugins/mdx.ts +47 -10
- package/src/plugins/prebuilt-capture.ts +217 -0
- package/src/plugins/prebuilt-options-analysis.ts +175 -0
- package/src/plugins/prebuilt.ts +655 -0
- package/src/plugins/prerender-sugar.ts +328 -0
- package/src/plugins/request-dep.ts +458 -0
- package/src/plugins/routing.ts +237 -241
- package/src/plugins/server-bundle.ts +89 -12
- package/src/plugins/shims.ts +241 -64
- package/src/plugins/static-build.ts +15 -90
- package/src/routing/codegen-shared.ts +115 -0
- package/src/routing/codegen-types.ts +65 -0
- package/src/routing/codegen.ts +372 -178
- package/src/routing/convention-lint.ts +394 -0
- package/src/routing/export-detect.ts +304 -0
- package/src/routing/file-cache.ts +23 -0
- package/src/routing/index.ts +10 -1
- package/src/routing/interception.ts +3 -22
- package/src/routing/link-codegen.ts +313 -0
- package/src/routing/manifest-codegen.ts +287 -0
- package/src/routing/scanner.ts +338 -189
- package/src/routing/schema-validation.ts +155 -0
- package/src/routing/segment-classify.ts +223 -0
- package/src/routing/segment-codegen.ts +98 -0
- package/src/routing/types.ts +82 -25
- package/src/routing/walkers.ts +90 -0
- package/src/rsc-runtime/rsc.ts +9 -0
- package/src/rsc-runtime/ssr.ts +50 -0
- package/src/rsc-runtime/vendor-types.d.ts +7 -0
- package/src/schema-bridge.ts +253 -0
- package/src/search-params/define.ts +576 -0
- package/src/search-params/index.ts +14 -20
- package/src/search-params/registry.ts +2 -2
- package/src/search-params/wrappers.ts +101 -0
- package/src/segment-params/define.ts +249 -0
- package/src/segment-params/index.ts +9 -0
- package/src/server/access-gate.tsx +111 -34
- package/src/server/action-client.ts +120 -29
- package/src/server/action-encryption.ts +144 -0
- package/src/server/action-handler.ts +123 -33
- package/src/server/actions.ts +48 -54
- package/src/server/als-registry.ts +137 -20
- package/src/server/asset-headers.ts +15 -37
- package/src/server/body-limits.ts +10 -2
- package/src/server/build-manifest.ts +19 -56
- package/src/server/canonicalize.ts +6 -3
- package/src/server/coalesce-tick.ts +75 -0
- package/src/server/compress.ts +34 -7
- package/src/server/cookie-context.ts +484 -0
- package/src/server/cookie-parsing.ts +163 -0
- package/src/server/csrf.ts +39 -6
- package/src/server/default-logger.ts +99 -0
- package/src/server/deny-boundary.ts +314 -0
- package/src/server/deny-renderer.ts +85 -77
- package/src/server/dev-source-map.ts +31 -0
- package/src/server/early-hints-sender.ts +3 -2
- package/src/server/early-hints.ts +37 -27
- package/src/server/error-boundary-wrapper.ts +61 -22
- package/src/server/fallback-error.ts +79 -102
- package/src/server/flight-injection-state.ts +113 -0
- package/src/server/flight-scripts.ts +62 -0
- package/src/server/form-data.ts +124 -12
- package/src/server/html-injector-core.ts +495 -0
- package/src/server/html-injectors.ts +271 -254
- package/src/server/index.ts +31 -185
- package/src/server/internal.ts +181 -0
- package/src/server/logger.ts +72 -36
- package/src/server/metadata-routes.ts +205 -24
- package/src/server/metadata.ts +21 -0
- package/src/server/middleware-runner.ts +31 -4
- package/src/server/node-stream-transforms.ts +336 -0
- package/src/server/param-coercion.ts +207 -0
- package/src/server/pipeline-helpers.ts +204 -0
- package/src/server/pipeline-interception.ts +45 -18
- package/src/server/pipeline-metadata.ts +14 -0
- package/src/server/pipeline-outcome.ts +197 -0
- package/src/server/pipeline-phases.ts +545 -0
- package/src/server/pipeline.ts +274 -382
- package/src/server/port-resolution.ts +215 -0
- package/src/server/prebuilt/cache-key.ts +298 -0
- package/src/server/prebuilt/capture-state.ts +89 -0
- package/src/server/prebuilt/key-discipline.ts +53 -0
- package/src/server/prebuilt/manifest-tag-index.ts +46 -0
- package/src/server/prebuilt/overlay.ts +256 -0
- package/src/server/prebuilt/payload-source.ts +201 -0
- package/src/server/prebuilt/slots.ts +190 -0
- package/src/server/prebuilt/synthetic-store.ts +121 -0
- package/src/server/prebuilt-builder.ts +809 -0
- package/src/server/prebuilt-runtime.ts +815 -0
- package/src/server/primitives.ts +160 -83
- package/src/server/render-timeout.ts +108 -0
- package/src/server/render-utils.ts +31 -0
- package/src/server/request-context.ts +170 -337
- package/src/server/request-dep.ts +37 -0
- package/src/server/route-element-builder.ts +699 -295
- package/src/server/route-handler.ts +31 -4
- package/src/server/route-matcher.ts +158 -277
- package/src/server/rsc-entry/action-middleware-runner.ts +167 -0
- package/src/server/rsc-entry/api-handler.ts +69 -32
- package/src/server/rsc-entry/deny-fallback.ts +92 -0
- package/src/server/rsc-entry/error-renderer.ts +306 -89
- package/src/server/rsc-entry/helpers.ts +210 -85
- package/src/server/rsc-entry/index.ts +332 -332
- package/src/server/rsc-entry/render-route.ts +300 -0
- package/src/server/rsc-entry/revalidate-renderer.ts +349 -0
- package/src/server/rsc-entry/rsc-payload.ts +102 -42
- package/src/server/rsc-entry/rsc-stream.ts +93 -13
- package/src/server/rsc-entry/ssr-bridge.ts +18 -5
- package/src/server/rsc-entry/ssr-renderer.ts +275 -43
- package/src/server/rsc-entry/wrap-action-dispatch.ts +186 -0
- package/src/server/safe-load.ts +60 -0
- package/src/server/sensitive-fields.ts +230 -0
- package/src/server/server-only-guard-noop.js +3 -0
- package/src/server/sitemap-generator.ts +345 -0
- package/src/server/sitemap-handler.ts +157 -0
- package/src/server/slot-resolver.ts +574 -250
- package/src/server/ssr-bridge-types.ts +124 -0
- package/src/server/ssr-entry.ts +206 -86
- package/src/server/ssr-render.ts +345 -86
- package/src/server/ssr-wrappers.tsx +141 -0
- package/src/server/state-tree-diff.ts +177 -30
- package/src/server/status-code-resolver.ts +115 -130
- package/src/server/stream-utils.ts +288 -0
- package/src/server/tracing.ts +126 -14
- package/src/server/tree-builder.ts +214 -90
- package/src/server/tree-match.ts +262 -0
- package/src/server/types.ts +78 -9
- package/src/server/utils/escape-html.ts +20 -0
- package/src/server/utils/mdx-file.ts +22 -0
- package/src/server/version-skew.ts +104 -0
- package/src/server/workers-cache-bridge.ts +33 -0
- package/src/shared/href-validation.ts +159 -0
- package/src/shared/merge-search-params.ts +55 -0
- package/src/shared/redirect-type.ts +17 -0
- package/src/shims/font-google.ts +1 -1
- package/src/shims/font-local.ts +34 -0
- package/src/shims/headers.ts +122 -1
- package/src/shims/navigation-client.ts +51 -29
- package/src/shims/navigation.ts +14 -7
- package/src/utils/state-machine.ts +111 -0
- package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
- package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
- package/dist/_chunks/debug-B3Gypr3D.js +0 -108
- package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
- package/dist/_chunks/format-RyoGQL74.js +0 -164
- package/dist/_chunks/format-RyoGQL74.js.map +0 -1
- package/dist/_chunks/interception-BOoWmLUA.js +0 -676
- package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
- package/dist/_chunks/metadata-routes-Cjmvi3rQ.js +0 -153
- package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
- package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
- package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
- package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
- package/dist/_chunks/tracing-CemImE6h.js +0 -187
- package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
- package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
- package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
- package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
- package/dist/adapters/cloudflare.js.map +0 -1
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/register-cached-function.d.ts +0 -17
- package/dist/cache/register-cached-function.d.ts.map +0 -1
- package/dist/client/browser-entry.d.ts +0 -21
- package/dist/client/browser-entry.d.ts.map +0 -1
- package/dist/client/head.d.ts +0 -16
- package/dist/client/head.d.ts.map +0 -1
- package/dist/client/link-status-provider.d.ts +0 -11
- package/dist/client/link-status-provider.d.ts.map +0 -1
- package/dist/client/segment-merger.d.ts +0 -119
- package/dist/client/segment-merger.d.ts.map +0 -1
- package/dist/client/stale-reload.d.ts +0 -44
- package/dist/client/stale-reload.d.ts.map +0 -1
- package/dist/client/transition-root.d.ts +0 -74
- package/dist/client/transition-root.d.ts.map +0 -1
- package/dist/client/use-navigation-pending.d.ts +0 -26
- package/dist/client/use-navigation-pending.d.ts.map +0 -1
- package/dist/client/use-params.d.ts.map +0 -1
- package/dist/plugins/cache-transform.d.ts +0 -36
- package/dist/plugins/cache-transform.d.ts.map +0 -1
- package/dist/plugins/dev-error-overlay.d.ts +0 -60
- package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
- package/dist/plugins/dev-logs.d.ts.map +0 -1
- package/dist/plugins/dynamic-transform.d.ts +0 -72
- package/dist/plugins/dynamic-transform.d.ts.map +0 -1
- package/dist/plugins/server-action-exports.d.ts +0 -26
- package/dist/plugins/server-action-exports.d.ts.map +0 -1
- package/dist/routing/status-file-lint.d.ts +0 -33
- package/dist/routing/status-file-lint.d.ts.map +0 -1
- package/dist/search-params/analyze.d.ts +0 -54
- package/dist/search-params/analyze.d.ts.map +0 -1
- package/dist/search-params/builtin-codecs.d.ts +0 -105
- package/dist/search-params/builtin-codecs.d.ts.map +0 -1
- package/dist/search-params/codecs.d.ts +0 -53
- package/dist/search-params/codecs.d.ts.map +0 -1
- package/dist/search-params/create.d.ts +0 -106
- package/dist/search-params/create.d.ts.map +0 -1
- package/dist/server/client-module-map.d.ts +0 -47
- package/dist/server/client-module-map.d.ts.map +0 -1
- package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
- package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
- package/dist/server/dev-logger.d.ts.map +0 -1
- package/dist/server/dev-span-processor.d.ts +0 -29
- package/dist/server/dev-span-processor.d.ts.map +0 -1
- package/dist/server/dev-warnings.d.ts +0 -129
- package/dist/server/dev-warnings.d.ts.map +0 -1
- package/dist/server/flush.d.ts +0 -74
- package/dist/server/flush.d.ts.map +0 -1
- package/dist/server/manifest-status-resolver.d.ts +0 -58
- package/dist/server/manifest-status-resolver.d.ts.map +0 -1
- package/dist/server/prerender.d.ts +0 -77
- package/dist/server/prerender.d.ts.map +0 -1
- package/dist/utils/directive-parser.d.ts +0 -70
- package/dist/utils/directive-parser.d.ts.map +0 -1
- package/src/cache/register-cached-function.ts +0 -103
- package/src/client/browser-entry.ts +0 -678
- package/src/client/head.ts +0 -61
- package/src/client/link-status-provider.tsx +0 -30
- package/src/client/segment-merger.ts +0 -339
- package/src/client/stale-reload.ts +0 -87
- package/src/client/transition-root.tsx +0 -166
- package/src/client/use-navigation-pending.ts +0 -38
- package/src/plugins/cache-transform.ts +0 -199
- package/src/plugins/dev-error-overlay.ts +0 -230
- package/src/plugins/dynamic-transform.ts +0 -161
- package/src/plugins/server-action-exports.ts +0 -220
- package/src/routing/status-file-lint.ts +0 -112
- package/src/search-params/analyze.ts +0 -192
- package/src/search-params/builtin-codecs.ts +0 -228
- package/src/search-params/codecs.ts +0 -153
- package/src/search-params/create.ts +0 -321
- package/src/server/client-module-map.ts +0 -58
- package/src/server/dev-fetch-instrumentation.ts +0 -96
- package/src/server/dev-span-processor.ts +0 -78
- package/src/server/dev-warnings.ts +0 -283
- package/src/server/flush.ts +0 -182
- package/src/server/manifest-status-resolver.ts +0 -215
- package/src/server/prerender.ts +0 -139
- package/src/utils/directive-parser.ts +0 -529
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["exports"],"sources":["../../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs","../../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/xhtml.js","../../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.js","../../../node_modules/.pnpm/acorn-jsx@5.3.2_acorn@8.16.0/node_modules/acorn-jsx/index.js","../src/utils/directive-parser.ts","../src/plugins/cache-transform.ts","../src/plugins/content.ts","../src/plugins/dev-error-overlay.ts","../src/server/compress.ts","../src/plugins/dev-server.ts","../src/plugins/entries.ts","../src/plugins/mdx.ts","../src/routing/status-file-lint.ts","../src/plugins/routing.ts","../src/plugins/shims.ts","../src/fonts/css.ts","../src/fonts/fallbacks.ts","../src/fonts/ast.ts","../src/fonts/local.ts","../src/fonts/google.ts","../src/plugins/fonts.ts","../src/plugins/static-build.ts","../src/plugins/dynamic-transform.ts","../src/plugins/server-action-exports.ts","../src/plugins/build-manifest.ts","../src/plugins/dev-logs.ts","../src/plugins/react-prod.ts","../src/plugins/chunks.ts","../src/plugins/server-bundle.ts","../src/plugins/adapter-build.ts","../src/plugins/build-report.ts","../src/utils/startup-timer.ts","../src/index.ts"],"sourcesContent":["// This file was generated. Do not modify manually!\nvar astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\n// This file was generated. Do not modify manually!\nvar astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n\n// These are a run-length and offset encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range.\n\n// Reserved word lists for various dialects of the language\n\nvar reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n};\n\n// And the keywords\n\nvar ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n\nvar keywords$1 = {\n 5: ecma5AndLessKeywords,\n \"5module\": ecma5AndLessKeywords + \" export import\",\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n};\n\nvar keywordRelationalOperator = /^in(stanceof)?$/;\n\n// ## Character categories\n\nvar nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nvar nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n var pos = 0x10000;\n for (var i = 0; i < set.length; i += 2) {\n pos += set[i];\n if (pos > code) { return false }\n pos += set[i + 1];\n if (pos >= code) { return true }\n }\n return false\n}\n\n// Test whether a given character code starts an identifier.\n\nfunction isIdentifierStart(code, astral) {\n if (code < 65) { return code === 36 }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nfunction isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nvar TokenType = function TokenType(label, conf) {\n if ( conf === void 0 ) conf = {};\n\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop || null;\n this.updateContext = null;\n};\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nvar beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};\n\n// Map keyword names to token types.\n\nvar keywords = {};\n\n// Succinct definitions of keyword token types\nfunction kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name;\n return keywords[name] = new TokenType(name, options)\n}\n\nvar types$1 = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n privateId: new TokenType(\"privateId\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"</>/<=/>=\", 7),\n bitShift: binop(\"<</>>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n coalesce: binop(\"??\", 1),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\", startsExpr),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n};\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nvar lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\nvar lineBreakG = new RegExp(lineBreak.source, \"g\");\n\nfunction isNewLine(code) {\n return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n}\n\nfunction nextLineBreak(code, from, end) {\n if ( end === void 0 ) end = code.length;\n\n for (var i = from; i < end; i++) {\n var next = code.charCodeAt(i);\n if (isNewLine(next))\n { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }\n }\n return -1\n}\n\nvar nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n\nvar skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nvar ref = Object.prototype;\nvar hasOwnProperty = ref.hasOwnProperty;\nvar toString = ref.toString;\n\nvar hasOwn = Object.hasOwn || (function (obj, propName) { return (\n hasOwnProperty.call(obj, propName)\n); });\n\nvar isArray = Array.isArray || (function (obj) { return (\n toString.call(obj) === \"[object Array]\"\n); });\n\nvar regexpCache = Object.create(null);\n\nfunction wordsRegexp(words) {\n return regexpCache[words] || (regexpCache[words] = new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\"))\n}\n\nfunction codePointToString(code) {\n // UTF-16 Decoding\n if (code <= 0xFFFF) { return String.fromCharCode(code) }\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n}\n\nvar loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nvar Position = function Position(line, col) {\n this.line = line;\n this.column = col;\n};\n\nPosition.prototype.offset = function offset (n) {\n return new Position(this.line, this.column + n)\n};\n\nvar SourceLocation = function SourceLocation(p, start, end) {\n this.start = start;\n this.end = end;\n if (p.sourceFile !== null) { this.source = p.sourceFile; }\n};\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nfunction getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}\n\n// A second argument must be given to configure the parser process.\n// These options are recognized (only `ecmaVersion` is required):\n\nvar defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `\"latest\"`\n // (the latest version the library supports). This influences\n // support for strict mode, the set of reserved words, and support\n // for new syntax features.\n ecmaVersion: null,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"`, `\"module\"` or `\"commonjs\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called when\n // a semicolon is automatically inserted. It will be passed the\n // position of the inserted semicolon as an offset, and if\n // `locations` is enabled, it is given the location as a `{line,\n // column}` object as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program, and an import.meta expression\n // in a script isn't considered an error.\n allowImportExportEverywhere: false,\n // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: null,\n // When enabled, super identifiers are not constrained to\n // appearing in methods and do not raise an error when they appear elsewhere.\n allowSuperOutsideMethod: null,\n // When enabled, hashbang directive in the beginning of file is\n // allowed and treated as a line comment. Enabled by default when\n // `ecmaVersion` >= 2023.\n allowHashBang: false,\n // By default, the parser will verify that private properties are\n // only used in places where they are valid and have been declared.\n // Set this to false to turn such checks off.\n checkPrivateFields: true,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n // When this option has an array as value, objects representing the\n // comments are pushed to it.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n};\n\n// Interpret and default an options object\n\nvar warnedAboutEcmaVersion = false;\n\nfunction getOptions(opts) {\n var options = {};\n\n for (var opt in defaultOptions)\n { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }\n\n if (options.ecmaVersion === \"latest\") {\n options.ecmaVersion = 1e8;\n } else if (options.ecmaVersion == null) {\n if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n warnedAboutEcmaVersion = true;\n console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n }\n options.ecmaVersion = 11;\n } else if (options.ecmaVersion >= 2015) {\n options.ecmaVersion -= 2009;\n }\n\n if (options.allowReserved == null)\n { options.allowReserved = options.ecmaVersion < 5; }\n\n if (!opts || opts.allowHashBang == null)\n { options.allowHashBang = options.ecmaVersion >= 14; }\n\n if (isArray(options.onToken)) {\n var tokens = options.onToken;\n options.onToken = function (token) { return tokens.push(token); };\n }\n if (isArray(options.onComment))\n { options.onComment = pushComment(options, options.onComment); }\n\n if (options.sourceType === \"commonjs\" && options.allowAwaitOutsideFunction)\n { throw new Error(\"Cannot use allowAwaitOutsideFunction with sourceType: commonjs\") }\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n var comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n };\n if (options.locations)\n { comment.loc = new SourceLocation(this, startLoc, endLoc); }\n if (options.ranges)\n { comment.range = [start, end]; }\n array.push(comment);\n }\n}\n\n// Each scope gets a bitset that may contain these flags\nvar\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128,\n SCOPE_CLASS_STATIC_BLOCK = 256,\n SCOPE_CLASS_FIELD_INIT = 512,\n SCOPE_SWITCH = 1024,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n\nfunction functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal* and declareName to determine the type of a binding\nvar\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n\nvar Parser = function Parser(options, input, startPos) {\n this.options = options = getOptions(options);\n this.sourceFile = options.sourceFile;\n this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n var reserved = \"\";\n if (options.allowReserved !== true) {\n reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n if (options.sourceType === \"module\") { reserved += \" await\"; }\n }\n this.reservedWords = wordsRegexp(reserved);\n var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n this.reservedWordsStrict = wordsRegexp(reservedStrict);\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n this.input = String(input);\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false;\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos;\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n } else {\n this.pos = this.lineStart = 0;\n this.curLine = 1;\n }\n\n // Properties of the current token:\n // Its type\n this.type = types$1.eof;\n // For tokens that include more information than their type, the value\n this.value = null;\n // Its start and end offset\n this.start = this.end = this.pos;\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition();\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null;\n this.lastTokStart = this.lastTokEnd = this.pos;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext();\n this.exprAllowed = true;\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\";\n this.strict = this.inModule || this.strictDirective(this.pos);\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1;\n this.potentialArrowInForAwait = false;\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n // Labels in scope.\n this.labels = [];\n // Thus-far undefined exports.\n this.undefinedExports = Object.create(null);\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n { this.skipLineComment(2); }\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = [];\n this.enterScope(\n this.options.sourceType === \"commonjs\"\n // In commonjs, the top-level scope behaves like a function scope\n ? SCOPE_FUNCTION\n : SCOPE_TOP\n );\n\n // For RegExp validation\n this.regexpState = null;\n\n // The stack of private names.\n // Each element has two properties: 'declared' and 'used'.\n // When it exited from the outermost class definition, all used private names must be declared.\n this.privateNameStack = [];\n};\n\nvar prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };\n\nParser.prototype.parse = function parse () {\n var node = this.options.program || this.startNode();\n this.nextToken();\n return this.parseTopLevel(node)\n};\n\nprototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };\n\nprototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };\n\nprototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };\n\nprototypeAccessors.canAwait.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var ref = this.scopeStack[i];\n var flags = ref.flags;\n if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }\n if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }\n }\n return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n};\n\nprototypeAccessors.allowReturn.get = function () {\n if (this.inFunction) { return true }\n if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }\n return false\n};\n\nprototypeAccessors.allowSuper.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod\n};\n\nprototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };\n\nprototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };\n\nprototypeAccessors.allowNewDotTarget.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var ref = this.scopeStack[i];\n var flags = ref.flags;\n if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||\n ((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }\n }\n return false\n};\n\nprototypeAccessors.allowUsing.get = function () {\n var ref = this.currentScope();\n var flags = ref.flags;\n if (flags & SCOPE_SWITCH) { return false }\n if (!this.inModule && flags & SCOPE_TOP) { return false }\n return true\n};\n\nprototypeAccessors.inClassStaticBlock.get = function () {\n return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n};\n\nParser.extend = function extend () {\n var plugins = [], len = arguments.length;\n while ( len-- ) plugins[ len ] = arguments[ len ];\n\n var cls = this;\n for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }\n return cls\n};\n\nParser.parse = function parse (input, options) {\n return new this(options, input).parse()\n};\n\nParser.parseExpressionAt = function parseExpressionAt (input, pos, options) {\n var parser = new this(options, input, pos);\n parser.nextToken();\n return parser.parseExpression()\n};\n\nParser.tokenizer = function tokenizer (input, options) {\n return new this(options, input)\n};\n\nObject.defineProperties( Parser.prototype, prototypeAccessors );\n\nvar pp$9 = Parser.prototype;\n\n// ## Parser utilities\n\nvar literal = /^(?:'((?:\\\\[^]|[^'\\\\])*?)'|\"((?:\\\\[^]|[^\"\\\\])*?)\")/;\npp$9.strictDirective = function(start) {\n if (this.options.ecmaVersion < 5) { return false }\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n var match = literal.exec(this.input.slice(start));\n if (!match) { return false }\n if ((match[1] || match[2]) === \"use strict\") {\n skipWhiteSpace.lastIndex = start + match[0].length;\n var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;\n var next = this.input.charAt(end);\n return next === \";\" || next === \"}\" ||\n (lineBreak.test(spaceAfter[0]) &&\n !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n }\n start += match[0].length;\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n if (this.input[start] === \";\")\n { start++; }\n }\n};\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp$9.eat = function(type) {\n if (this.type === type) {\n this.next();\n return true\n } else {\n return false\n }\n};\n\n// Tests whether parsed token is a contextual keyword.\n\npp$9.isContextual = function(name) {\n return this.type === types$1.name && this.value === name && !this.containsEsc\n};\n\n// Consumes contextual keyword if possible.\n\npp$9.eatContextual = function(name) {\n if (!this.isContextual(name)) { return false }\n this.next();\n return true\n};\n\n// Asserts that following token is given contextual keyword.\n\npp$9.expectContextual = function(name) {\n if (!this.eatContextual(name)) { this.unexpected(); }\n};\n\n// Test whether a semicolon can be inserted at the current position.\n\npp$9.canInsertSemicolon = function() {\n return this.type === types$1.eof ||\n this.type === types$1.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\npp$9.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }\n return true\n }\n};\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp$9.semicolon = function() {\n if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }\n};\n\npp$9.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }\n if (!notNext)\n { this.next(); }\n return true\n }\n};\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp$9.expect = function(type) {\n this.eat(type) || this.unexpected();\n};\n\n// Raise an unexpected token error.\n\npp$9.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n};\n\nvar DestructuringErrors = function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1;\n};\n\npp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) { return }\n if (refDestructuringErrors.trailingComma > -1)\n { this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\"); }\n var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n if (parens > -1) { this.raiseRecoverable(parens, isAssign ? \"Assigning to rvalue\" : \"Parenthesized pattern\"); }\n};\n\npp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) { return false }\n var shorthandAssign = refDestructuringErrors.shorthandAssign;\n var doubleProto = refDestructuringErrors.doubleProto;\n if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }\n if (shorthandAssign >= 0)\n { this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\"); }\n if (doubleProto >= 0)\n { this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\"); }\n};\n\npp$9.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n { this.raise(this.yieldPos, \"Yield expression cannot be a default value\"); }\n if (this.awaitPos)\n { this.raise(this.awaitPos, \"Await expression cannot be a default value\"); }\n};\n\npp$9.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n { return this.isSimpleAssignTarget(expr.expression) }\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n};\n\nvar pp$8 = Parser.prototype;\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp$8.parseTopLevel = function(node) {\n var exports = Object.create(null);\n if (!node.body) { node.body = []; }\n while (this.type !== types$1.eof) {\n var stmt = this.parseStatement(null, true, exports);\n node.body.push(stmt);\n }\n if (this.inModule)\n { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)\n {\n var name = list[i];\n\n this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n } }\n this.adaptDirectivePrologue(node.body);\n this.next();\n node.sourceType = this.options.sourceType === \"commonjs\" ? \"script\" : this.options.sourceType;\n return this.finishNode(node, \"Program\")\n};\n\nvar loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"};\n\npp$8.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) { return false }\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91 || nextCh === 92) { return true } // '[', '\\'\n if (context) { return false }\n\n if (nextCh === 123) { return true } // '{'\n if (isIdentifierStart(nextCh)) {\n var start = next;\n do { next += nextCh <= 0xffff ? 1 : 2; }\n while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))\n if (nextCh === 92) { return true }\n var ident = this.input.slice(start, next);\n if (!keywordRelationalOperator.test(ident)) { return true }\n }\n return false\n};\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp$8.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, after;\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length ||\n !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\\' */))\n};\n\npp$8.isUsingKeyword = function(isAwaitUsing, isFor) {\n if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? \"await\" : \"using\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length;\n\n if (lineBreak.test(this.input.slice(this.pos, next))) { return false }\n\n if (isAwaitUsing) {\n var usingEndPos = next + 5 /* using */, after;\n if (this.input.slice(next, usingEndPos) !== \"using\" ||\n usingEndPos === this.input.length ||\n isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||\n after === 92 /* '\\' */\n ) { return false }\n\n skipWhiteSpace.lastIndex = usingEndPos;\n var skipAfterUsing = skipWhiteSpace.exec(this.input);\n next = usingEndPos + skipAfterUsing[0].length;\n if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }\n }\n\n var ch = this.fullCharCodeAt(next);\n if (!isIdentifierStart(ch) && ch !== 92 /* '\\' */) { return false }\n var idStart = next;\n do { next += ch <= 0xffff ? 1 : 2; }\n while (isIdentifierChar(ch = this.fullCharCodeAt(next)))\n if (ch === 92) { return true }\n var id = this.input.slice(idStart, next);\n if (keywordRelationalOperator.test(id) || isFor && id === \"of\") { return false }\n return true\n};\n\npp$8.isAwaitUsing = function(isFor) {\n return this.isUsingKeyword(true, isFor)\n};\n\npp$8.isUsing = function(isFor) {\n return this.isUsingKeyword(false, isFor)\n};\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp$8.parseStatement = function(context, topLevel, exports) {\n var starttype = this.type, node = this.startNode(), kind;\n\n if (this.isLet(context)) {\n starttype = types$1._var;\n kind = \"let\";\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case types$1._debugger: return this.parseDebuggerStatement(node)\n case types$1._do: return this.parseDoStatement(node)\n case types$1._for: return this.parseForStatement(node)\n case types$1._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) { this.unexpected(); }\n return this.parseFunctionStatement(node, false, !context)\n case types$1._class:\n if (context) { this.unexpected(); }\n return this.parseClass(node, true)\n case types$1._if: return this.parseIfStatement(node)\n case types$1._return: return this.parseReturnStatement(node)\n case types$1._switch: return this.parseSwitchStatement(node)\n case types$1._throw: return this.parseThrowStatement(node)\n case types$1._try: return this.parseTryStatement(node)\n case types$1._const: case types$1._var:\n kind = kind || this.value;\n if (context && kind !== \"var\") { this.unexpected(); }\n return this.parseVarStatement(node, kind)\n case types$1._while: return this.parseWhileStatement(node)\n case types$1._with: return this.parseWithStatement(node)\n case types$1.braceL: return this.parseBlock(true, node)\n case types$1.semi: return this.parseEmptyStatement(node)\n case types$1._export:\n case types$1._import:\n if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n if (nextCh === 40 || nextCh === 46) // '(' or '.'\n { return this.parseExpressionStatement(node, this.parseExpression()) }\n }\n\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n { this.raise(this.start, \"'import' and 'export' may only appear at the top level\"); }\n if (!this.inModule)\n { this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\"); }\n }\n return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) { this.unexpected(); }\n this.next();\n return this.parseFunctionStatement(node, true, !context)\n }\n\n var usingKind = this.isAwaitUsing(false) ? \"await using\" : this.isUsing(false) ? \"using\" : null;\n if (usingKind) {\n if (!this.allowUsing) {\n this.raise(this.start, \"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement\");\n }\n if (usingKind === \"await using\") {\n if (!this.canAwait) {\n this.raise(this.start, \"Await using cannot appear outside of async function\");\n }\n this.next();\n }\n this.next();\n this.parseVar(node, false, usingKind);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n }\n\n var maybeName = this.value, expr = this.parseExpression();\n if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon))\n { return this.parseLabeledStatement(node, maybeName, expr, context) }\n else { return this.parseExpressionStatement(node, expr) }\n }\n};\n\npp$8.parseBreakContinueStatement = function(node, keyword) {\n var isBreak = keyword === \"break\";\n this.next();\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }\n else if (this.type !== types$1.name) { this.unexpected(); }\n else {\n node.label = this.parseIdent();\n this.semicolon();\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n var i = 0;\n for (; i < this.labels.length; ++i) {\n var lab = this.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) { break }\n if (node.label && isBreak) { break }\n }\n }\n if (i === this.labels.length) { this.raise(node.start, \"Unsyntactic \" + keyword); }\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n};\n\npp$8.parseDebuggerStatement = function(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\")\n};\n\npp$8.parseDoStatement = function(node) {\n this.next();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"do\");\n this.labels.pop();\n this.expect(types$1._while);\n node.test = this.parseParenExpression();\n if (this.options.ecmaVersion >= 6)\n { this.eat(types$1.semi); }\n else\n { this.semicolon(); }\n return this.finishNode(node, \"DoWhileStatement\")\n};\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp$8.parseForStatement = function(node) {\n this.next();\n var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n this.labels.push(loopLabel);\n this.enterScope(0);\n this.expect(types$1.parenL);\n if (this.type === types$1.semi) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, null)\n }\n var isLet = this.isLet();\n if (this.type === types$1._var || this.type === types$1._const || isLet) {\n var init$1 = this.startNode(), kind = isLet ? \"let\" : this.value;\n this.next();\n this.parseVar(init$1, true, kind);\n this.finishNode(init$1, \"VariableDeclaration\");\n return this.parseForAfterInit(node, init$1, awaitAt)\n }\n var startsWithLet = this.isContextual(\"let\"), isForOf = false;\n\n var usingKind = this.isUsing(true) ? \"using\" : this.isAwaitUsing(true) ? \"await using\" : null;\n if (usingKind) {\n var init$2 = this.startNode();\n this.next();\n if (usingKind === \"await using\") {\n if (!this.canAwait) {\n this.raise(this.start, \"Await using cannot appear outside of async function\");\n }\n this.next();\n }\n this.parseVar(init$2, true, usingKind);\n this.finishNode(init$2, \"VariableDeclaration\");\n return this.parseForAfterInit(node, init$2, awaitAt)\n }\n var containsEsc = this.containsEsc;\n var refDestructuringErrors = new DestructuringErrors;\n var initPos = this.start;\n var init = awaitAt > -1\n ? this.parseExprSubscripts(refDestructuringErrors, \"await\")\n : this.parseExpression(true, refDestructuringErrors);\n if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)\n if (this.type === types$1._in) { this.unexpected(awaitAt); }\n node.await = true;\n } else if (isForOf && this.options.ecmaVersion >= 8) {\n if (init.start === initPos && !containsEsc && init.type === \"Identifier\" && init.name === \"async\") { this.unexpected(); }\n else if (this.options.ecmaVersion >= 9) { node.await = false; }\n }\n if (startsWithLet && isForOf) { this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\"); }\n this.toAssignable(init, false, refDestructuringErrors);\n this.checkLValPattern(init);\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true);\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n};\n\n// Helper method to parse for loop after variable initialization\npp$8.parseForAfterInit = function(node, init, awaitAt) {\n if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n};\n\npp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next();\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n};\n\npp$8.parseIfStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\");\n node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n return this.finishNode(node, \"IfStatement\")\n};\n\npp$8.parseReturnStatement = function(node) {\n if (!this.allowReturn)\n { this.raise(this.start, \"'return' outside of function\"); }\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }\n else { node.argument = this.parseExpression(); this.semicolon(); }\n return this.finishNode(node, \"ReturnStatement\")\n};\n\npp$8.parseSwitchStatement = function(node) {\n this.next();\n node.discriminant = this.parseParenExpression();\n node.cases = [];\n this.expect(types$1.braceL);\n this.labels.push(switchLabel);\n this.enterScope(SCOPE_SWITCH);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n var cur;\n for (var sawDefault = false; this.type !== types$1.braceR;) {\n if (this.type === types$1._case || this.type === types$1._default) {\n var isCase = this.type === types$1._case;\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n node.cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) { this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\"); }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(types$1.colon);\n } else {\n if (!cur) { this.unexpected(); }\n cur.consequent.push(this.parseStatement(null));\n }\n }\n this.exitScope();\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n this.next(); // Closing brace\n this.labels.pop();\n return this.finishNode(node, \"SwitchStatement\")\n};\n\npp$8.parseThrowStatement = function(node) {\n this.next();\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n { this.raise(this.lastTokEnd, \"Illegal newline after throw\"); }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\")\n};\n\n// Reused empty array added for node fields that are always empty.\n\nvar empty$1 = [];\n\npp$8.parseCatchClauseParam = function() {\n var param = this.parseBindingAtom();\n var simple = param.type === \"Identifier\";\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n this.expect(types$1.parenR);\n\n return param\n};\n\npp$8.parseTryStatement = function(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.type === types$1._catch) {\n var clause = this.startNode();\n this.next();\n if (this.eat(types$1.parenL)) {\n clause.param = this.parseCatchClauseParam();\n } else {\n if (this.options.ecmaVersion < 10) { this.unexpected(); }\n clause.param = null;\n this.enterScope(0);\n }\n clause.body = this.parseBlock(false);\n this.exitScope();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer)\n { this.raise(node.start, \"Missing catch or finally clause\"); }\n return this.finishNode(node, \"TryStatement\")\n};\n\npp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n};\n\npp$8.parseWhileStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"while\");\n this.labels.pop();\n return this.finishNode(node, \"WhileStatement\")\n};\n\npp$8.parseWithStatement = function(node) {\n if (this.strict) { this.raise(this.start, \"'with' in strict mode\"); }\n this.next();\n node.object = this.parseParenExpression();\n node.body = this.parseStatement(\"with\");\n return this.finishNode(node, \"WithStatement\")\n};\n\npp$8.parseEmptyStatement = function(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\")\n};\n\npp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)\n {\n var label = list[i$1];\n\n if (label.name === maybeName)\n { this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n } }\n var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n for (var i = this.labels.length - 1; i >= 0; i--) {\n var label$1 = this.labels[i];\n if (label$1.statementStart === node.start) {\n // Update information about previous labels on this node\n label$1.statementStart = this.start;\n label$1.kind = kind;\n } else { break }\n }\n this.labels.push({name: maybeName, kind: kind, statementStart: this.start});\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n this.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\")\n};\n\npp$8.parseExpressionStatement = function(node, expr) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\")\n};\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;\n if ( node === void 0 ) node = this.startNode();\n\n node.body = [];\n this.expect(types$1.braceL);\n if (createNewLexicalScope) { this.enterScope(0); }\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n if (exitStrict) { this.strict = false; }\n this.next();\n if (createNewLexicalScope) { this.exitScope(); }\n return this.finishNode(node, \"BlockStatement\")\n};\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp$8.parseFor = function(node, init) {\n node.init = init;\n this.expect(types$1.semi);\n node.test = this.type === types$1.semi ? null : this.parseExpression();\n this.expect(types$1.semi);\n node.update = this.type === types$1.parenR ? null : this.parseExpression();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, \"ForStatement\")\n};\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp$8.parseForIn = function(node, init) {\n var isForIn = this.type === types$1._in;\n this.next();\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (\n !isForIn ||\n this.options.ecmaVersion < 8 ||\n this.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\"\n )\n ) {\n this.raise(\n init.start,\n ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n );\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n};\n\n// Parse a list of variable declarations.\n\npp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = this.startNode();\n this.parseVarId(decl, kind);\n if (this.eat(types$1.eq)) {\n decl.init = this.parseMaybeAssign(isFor);\n } else if (!allowMissingInitializer && kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected();\n } else if (!allowMissingInitializer && (kind === \"using\" || kind === \"await using\") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual(\"of\")) {\n this.raise(this.lastTokEnd, (\"Missing initializer in \" + kind + \" declaration\"));\n } else if (!allowMissingInitializer && decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n } else {\n decl.init = null;\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types$1.comma)) { break }\n }\n return node\n};\n\npp$8.parseVarId = function(decl, kind) {\n decl.id = kind === \"using\" || kind === \"await using\"\n ? this.parseIdent()\n : this.parseBindingAtom();\n\n this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n};\n\nvar FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;\n\n// Parse a function declaration or literal (depending on the\n// `statement & FUNC_STATEMENT`).\n\n// Remove `allowExpressionBody` for 7.0.0, as it is only called with false\npp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n this.initFunction(node);\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))\n { this.unexpected(); }\n node.generator = this.eat(types$1.star);\n }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }\n }\n\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(node.async, node.generator));\n\n if (!(statement & FUNC_STATEMENT))\n { node.id = this.type === types$1.name ? this.parseIdent() : null; }\n\n this.parseFunctionParams(node);\n this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n};\n\npp$8.parseFunctionParams = function(node) {\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n};\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp$8.parseClass = function(node, isStatement) {\n this.next();\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n var oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement);\n this.parseClassSuper(node);\n var privateNameMap = this.enterClassBody();\n var classBody = this.startNode();\n var hadConstructor = false;\n classBody.body = [];\n this.expect(types$1.braceL);\n while (this.type !== types$1.braceR) {\n var element = this.parseClassElement(node.superClass !== null);\n if (element) {\n classBody.body.push(element);\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) { this.raiseRecoverable(element.start, \"Duplicate constructor in the same class\"); }\n hadConstructor = true;\n } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n }\n }\n }\n this.strict = oldStrict;\n this.next();\n node.body = this.finishNode(classBody, \"ClassBody\");\n this.exitClassBody();\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n};\n\npp$8.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(types$1.semi)) { return null }\n\n var ecmaVersion = this.options.ecmaVersion;\n var node = this.startNode();\n var keyName = \"\";\n var isGenerator = false;\n var isAsync = false;\n var kind = \"method\";\n var isStatic = false;\n\n if (this.eatContextual(\"static\")) {\n // Parse static init block\n if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n this.parseClassStaticBlock(node);\n return node\n }\n if (this.isClassElementNameStart() || this.type === types$1.star) {\n isStatic = true;\n } else {\n keyName = \"static\";\n }\n }\n node.static = isStatic;\n if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n isAsync = true;\n } else {\n keyName = \"async\";\n }\n }\n if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n isGenerator = true;\n }\n if (!keyName && !isAsync && !isGenerator) {\n var lastValue = this.value;\n if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n if (this.isClassElementNameStart()) {\n kind = lastValue;\n } else {\n keyName = lastValue;\n }\n }\n }\n\n // Parse element name\n if (keyName) {\n // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n // The last token is any of those. Make it the element name.\n node.computed = false;\n node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n node.key.name = keyName;\n this.finishNode(node.key, \"Identifier\");\n } else {\n this.parseClassElementName(node);\n }\n\n // Parse element value\n if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n if (isConstructor && kind !== \"method\") { this.raise(node.key.start, \"Constructor can't have get/set modifier\"); }\n node.kind = isConstructor ? \"constructor\" : kind;\n this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n } else {\n this.parseClassField(node);\n }\n\n return node\n};\n\npp$8.isClassElementNameStart = function() {\n return (\n this.type === types$1.name ||\n this.type === types$1.privateId ||\n this.type === types$1.num ||\n this.type === types$1.string ||\n this.type === types$1.bracketL ||\n this.type.keyword\n )\n};\n\npp$8.parseClassElementName = function(element) {\n if (this.type === types$1.privateId) {\n if (this.value === \"constructor\") {\n this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n }\n element.computed = false;\n element.key = this.parsePrivateIdent();\n } else {\n this.parsePropertyName(element);\n }\n};\n\npp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n // Check key and flags\n var key = method.key;\n if (method.kind === \"constructor\") {\n if (isGenerator) { this.raise(key.start, \"Constructor can't be a generator\"); }\n if (isAsync) { this.raise(key.start, \"Constructor can't be an async method\"); }\n } else if (method.static && checkKeyName(method, \"prototype\")) {\n this.raise(key.start, \"Classes may not have a static property named prototype\");\n }\n\n // Parse value\n var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n\n // Check value\n if (method.kind === \"get\" && value.params.length !== 0)\n { this.raiseRecoverable(value.start, \"getter should have no params\"); }\n if (method.kind === \"set\" && value.params.length !== 1)\n { this.raiseRecoverable(value.start, \"setter should have exactly one param\"); }\n if (method.kind === \"set\" && value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\"); }\n\n return this.finishNode(method, \"MethodDefinition\")\n};\n\npp$8.parseClassField = function(field) {\n if (checkKeyName(field, \"constructor\")) {\n this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n } else if (field.static && checkKeyName(field, \"prototype\")) {\n this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n }\n\n if (this.eat(types$1.eq)) {\n // To raise SyntaxError if 'arguments' exists in the initializer.\n this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);\n field.value = this.parseMaybeAssign();\n this.exitScope();\n } else {\n field.value = null;\n }\n this.semicolon();\n\n return this.finishNode(field, \"PropertyDefinition\")\n};\n\npp$8.parseClassStaticBlock = function(node) {\n node.body = [];\n\n var oldLabels = this.labels;\n this.labels = [];\n this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n this.next();\n this.exitScope();\n this.labels = oldLabels;\n\n return this.finishNode(node, \"StaticBlock\")\n};\n\npp$8.parseClassId = function(node, isStatement) {\n if (this.type === types$1.name) {\n node.id = this.parseIdent();\n if (isStatement)\n { this.checkLValSimple(node.id, BIND_LEXICAL, false); }\n } else {\n if (isStatement === true)\n { this.unexpected(); }\n node.id = null;\n }\n};\n\npp$8.parseClassSuper = function(node) {\n node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;\n};\n\npp$8.enterClassBody = function() {\n var element = {declared: Object.create(null), used: []};\n this.privateNameStack.push(element);\n return element.declared\n};\n\npp$8.exitClassBody = function() {\n var ref = this.privateNameStack.pop();\n var declared = ref.declared;\n var used = ref.used;\n if (!this.options.checkPrivateFields) { return }\n var len = this.privateNameStack.length;\n var parent = len === 0 ? null : this.privateNameStack[len - 1];\n for (var i = 0; i < used.length; ++i) {\n var id = used[i];\n if (!hasOwn(declared, id.name)) {\n if (parent) {\n parent.used.push(id);\n } else {\n this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n }\n }\n }\n};\n\nfunction isPrivateNameConflicted(privateNameMap, element) {\n var name = element.key.name;\n var curr = privateNameMap[name];\n\n var next = \"true\";\n if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n next = (element.static ? \"s\" : \"i\") + element.kind;\n }\n\n // `class { get #a(){}; static set #a(_){} }` is also conflict.\n if (\n curr === \"iget\" && next === \"iset\" ||\n curr === \"iset\" && next === \"iget\" ||\n curr === \"sget\" && next === \"sset\" ||\n curr === \"sset\" && next === \"sget\"\n ) {\n privateNameMap[name] = \"true\";\n return false\n } else if (!curr) {\n privateNameMap[name] = next;\n return false\n } else {\n return true\n }\n}\n\nfunction checkKeyName(node, name) {\n var computed = node.computed;\n var key = node.key;\n return !computed && (\n key.type === \"Identifier\" && key.name === name ||\n key.type === \"Literal\" && key.value === name\n )\n}\n\n// Parses module export declaration.\n\npp$8.parseExportAllDeclaration = function(node, exports) {\n if (this.options.ecmaVersion >= 11) {\n if (this.eatContextual(\"as\")) {\n node.exported = this.parseModuleExportName();\n this.checkExport(exports, node.exported, this.lastTokStart);\n } else {\n node.exported = null;\n }\n }\n this.expectContextual(\"from\");\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n this.semicolon();\n return this.finishNode(node, \"ExportAllDeclaration\")\n};\n\npp$8.parseExport = function(node, exports) {\n this.next();\n // export * from '...'\n if (this.eat(types$1.star)) {\n return this.parseExportAllDeclaration(node, exports)\n }\n if (this.eat(types$1._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart);\n node.declaration = this.parseExportDefaultDeclaration();\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseExportDeclaration(node);\n if (node.declaration.type === \"VariableDeclaration\")\n { this.checkVariableExport(exports, node.declaration.declarations); }\n else\n { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }\n node.specifiers = [];\n node.source = null;\n if (this.options.ecmaVersion >= 16)\n { node.attributes = []; }\n } else { // export { x, y as z } [from '...']\n node.declaration = null;\n node.specifiers = this.parseExportSpecifiers(exports);\n if (this.eatContextual(\"from\")) {\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n } else {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n // check for keywords used as local names\n var spec = list[i];\n\n this.checkUnreserved(spec.local);\n // check if export is defined\n this.checkLocalExport(spec.local);\n\n if (spec.local.type === \"Literal\") {\n this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n }\n }\n\n node.source = null;\n if (this.options.ecmaVersion >= 16)\n { node.attributes = []; }\n }\n this.semicolon();\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n};\n\npp$8.parseExportDeclaration = function(node) {\n return this.parseStatement(null)\n};\n\npp$8.parseExportDefaultDeclaration = function() {\n var isAsync;\n if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n var fNode = this.startNode();\n this.next();\n if (isAsync) { this.next(); }\n return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)\n } else if (this.type === types$1._class) {\n var cNode = this.startNode();\n return this.parseClass(cNode, \"nullableID\")\n } else {\n var declaration = this.parseMaybeAssign();\n this.semicolon();\n return declaration\n }\n};\n\npp$8.checkExport = function(exports, name, pos) {\n if (!exports) { return }\n if (typeof name !== \"string\")\n { name = name.type === \"Identifier\" ? name.name : name.value; }\n if (hasOwn(exports, name))\n { this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\"); }\n exports[name] = true;\n};\n\npp$8.checkPatternExport = function(exports, pat) {\n var type = pat.type;\n if (type === \"Identifier\")\n { this.checkExport(exports, pat, pat.start); }\n else if (type === \"ObjectPattern\")\n { for (var i = 0, list = pat.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n this.checkPatternExport(exports, prop);\n } }\n else if (type === \"ArrayPattern\")\n { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n var elt = list$1[i$1];\n\n if (elt) { this.checkPatternExport(exports, elt); }\n } }\n else if (type === \"Property\")\n { this.checkPatternExport(exports, pat.value); }\n else if (type === \"AssignmentPattern\")\n { this.checkPatternExport(exports, pat.left); }\n else if (type === \"RestElement\")\n { this.checkPatternExport(exports, pat.argument); }\n};\n\npp$8.checkVariableExport = function(exports, decls) {\n if (!exports) { return }\n for (var i = 0, list = decls; i < list.length; i += 1)\n {\n var decl = list[i];\n\n this.checkPatternExport(exports, decl.id);\n }\n};\n\npp$8.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n};\n\n// Parses a comma-separated list of module exports.\n\npp$8.parseExportSpecifier = function(exports) {\n var node = this.startNode();\n node.local = this.parseModuleExportName();\n\n node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n this.checkExport(\n exports,\n node.exported,\n node.exported.start\n );\n\n return this.finishNode(node, \"ExportSpecifier\")\n};\n\npp$8.parseExportSpecifiers = function(exports) {\n var nodes = [], first = true;\n // export { x, y as z } [from '...']\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n nodes.push(this.parseExportSpecifier(exports));\n }\n return nodes\n};\n\n// Parses import declaration.\n\npp$8.parseImport = function(node) {\n this.next();\n\n // import '...'\n if (this.type === types$1.string) {\n node.specifiers = empty$1;\n node.source = this.parseExprAtom();\n } else {\n node.specifiers = this.parseImportSpecifiers();\n this.expectContextual(\"from\");\n node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n }\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\")\n};\n\n// Parses a comma-separated list of module imports.\n\npp$8.parseImportSpecifier = function() {\n var node = this.startNode();\n node.imported = this.parseModuleExportName();\n\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent();\n } else {\n this.checkUnreserved(node.imported);\n node.local = node.imported;\n }\n this.checkLValSimple(node.local, BIND_LEXICAL);\n\n return this.finishNode(node, \"ImportSpecifier\")\n};\n\npp$8.parseImportDefaultSpecifier = function() {\n // import defaultObj, { x, y as z } from '...'\n var node = this.startNode();\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n return this.finishNode(node, \"ImportDefaultSpecifier\")\n};\n\npp$8.parseImportNamespaceSpecifier = function() {\n var node = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n return this.finishNode(node, \"ImportNamespaceSpecifier\")\n};\n\npp$8.parseImportSpecifiers = function() {\n var nodes = [], first = true;\n if (this.type === types$1.name) {\n nodes.push(this.parseImportDefaultSpecifier());\n if (!this.eat(types$1.comma)) { return nodes }\n }\n if (this.type === types$1.star) {\n nodes.push(this.parseImportNamespaceSpecifier());\n return nodes\n }\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n nodes.push(this.parseImportSpecifier());\n }\n return nodes\n};\n\npp$8.parseWithClause = function() {\n var nodes = [];\n if (!this.eat(types$1._with)) {\n return nodes\n }\n this.expect(types$1.braceL);\n var attributeKeys = {};\n var first = true;\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var attr = this.parseImportAttribute();\n var keyName = attr.key.type === \"Identifier\" ? attr.key.name : attr.key.value;\n if (hasOwn(attributeKeys, keyName))\n { this.raiseRecoverable(attr.key.start, \"Duplicate attribute key '\" + keyName + \"'\"); }\n attributeKeys[keyName] = true;\n nodes.push(attr);\n }\n return nodes\n};\n\npp$8.parseImportAttribute = function() {\n var node = this.startNode();\n node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\");\n this.expect(types$1.colon);\n if (this.type !== types$1.string) {\n this.unexpected();\n }\n node.value = this.parseExprAtom();\n return this.finishNode(node, \"ImportAttribute\")\n};\n\npp$8.parseModuleExportName = function() {\n if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n var stringLiteral = this.parseLiteral(this.value);\n if (loneSurrogate.test(stringLiteral.value)) {\n this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n }\n return stringLiteral\n }\n return this.parseIdent(true)\n};\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp$8.adaptDirectivePrologue = function(statements) {\n for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1);\n }\n};\npp$8.isDirectiveCandidate = function(statement) {\n return (\n this.options.ecmaVersion >= 5 &&\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n};\n\nvar pp$7 = Parser.prototype;\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n { this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\"); }\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.toAssignable(prop, isBinding);\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\");\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") { this.raise(node.key.start, \"Object pattern can't contain getter or setter\"); }\n this.toAssignable(node.value, isBinding);\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n this.toAssignableList(node.elements, isBinding);\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\";\n this.toAssignable(node.argument, isBinding);\n if (node.argument.type === \"AssignmentPattern\")\n { this.raise(node.argument.start, \"Rest elements cannot have a default value\"); }\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") { this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\"); }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isBinding);\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (!isBinding) { break }\n\n default:\n this.raise(node.start, \"Assigning to rvalue\");\n }\n } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n return node\n};\n\n// Convert list of expression atoms to binding list.\n\npp$7.toAssignableList = function(exprList, isBinding) {\n var end = exprList.length;\n for (var i = 0; i < end; i++) {\n var elt = exprList[i];\n if (elt) { this.toAssignable(elt, isBinding); }\n }\n if (end) {\n var last = exprList[end - 1];\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n { this.unexpected(last.argument.start); }\n }\n return exprList\n};\n\n// Parses spread element.\n\npp$7.parseSpread = function(refDestructuringErrors) {\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n return this.finishNode(node, \"SpreadElement\")\n};\n\npp$7.parseRestBinding = function() {\n var node = this.startNode();\n this.next();\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== types$1.name)\n { this.unexpected(); }\n\n node.argument = this.parseBindingAtom();\n\n return this.finishNode(node, \"RestElement\")\n};\n\n// Parses lvalue (assignable) atom.\n\npp$7.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case types$1.bracketL:\n var node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(types$1.bracketR, true, true);\n return this.finishNode(node, \"ArrayPattern\")\n\n case types$1.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n};\n\npp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (first) { first = false; }\n else { this.expect(types$1.comma); }\n if (allowEmpty && this.type === types$1.comma) {\n elts.push(null);\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === types$1.ellipsis) {\n var rest = this.parseRestBinding();\n this.parseBindingListItem(rest);\n elts.push(rest);\n if (this.type === types$1.comma) { this.raiseRecoverable(this.start, \"Comma is not permitted after the rest element\"); }\n this.expect(close);\n break\n } else {\n elts.push(this.parseAssignableListItem(allowModifiers));\n }\n }\n return elts\n};\n\npp$7.parseAssignableListItem = function(allowModifiers) {\n var elem = this.parseMaybeDefault(this.start, this.startLoc);\n this.parseBindingListItem(elem);\n return elem\n};\n\npp$7.parseBindingListItem = function(param) {\n return param\n};\n\n// Parses assignment pattern around given atom if possible.\n\npp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom();\n if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.right = this.parseMaybeAssign();\n return this.finishNode(node, \"AssignmentPattern\")\n};\n\n// The following three functions all verify that a node is an lvalue —\n// something that can be bound, or assigned to. In order to do so, they perform\n// a variety of checks:\n//\n// - Check that none of the bound/assigned-to identifiers are reserved words.\n// - Record name declarations for bindings in the appropriate scope.\n// - Check duplicate argument names, if checkClashes is set.\n//\n// If a complex binding pattern is encountered (e.g., object and array\n// destructuring), the entire pattern is recursively checked.\n//\n// There are three versions of checkLVal*() appropriate for different\n// circumstances:\n//\n// - checkLValSimple() shall be used if the syntactic construct supports\n// nothing other than identifiers and member expressions. Parenthesized\n// expressions are also correctly handled. This is generally appropriate for\n// constructs for which the spec says\n//\n// > It is a Syntax Error if AssignmentTargetType of [the production] is not\n// > simple.\n//\n// It is also appropriate for checking if an identifier is valid and not\n// defined elsewhere, like import declarations or function/class identifiers.\n//\n// Examples where this is used include:\n// a += …;\n// import a from '…';\n// where a is the node to be checked.\n//\n// - checkLValPattern() shall be used if the syntactic construct supports\n// anything checkLValSimple() supports, as well as object and array\n// destructuring patterns. This is generally appropriate for constructs for\n// which the spec says\n//\n// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n// > an ArrayLiteral and AssignmentTargetType of [the production] is not\n// > simple.\n//\n// Examples where this is used include:\n// (a = …);\n// const a = …;\n// try { … } catch (a) { … }\n// where a is the node to be checked.\n//\n// - checkLValInnerPattern() shall be used if the syntactic construct supports\n// anything checkLValPattern() supports, as well as default assignment\n// patterns, rest elements, and other constructs that may appear within an\n// object or array destructuring pattern.\n//\n// As a special case, function parameters also use checkLValInnerPattern(),\n// as they also support defaults and rest constructs.\n//\n// These functions deliberately support both assignment and binding constructs,\n// as the logic for both is exceedingly similar. If the node is the target of\n// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n// should be set to the appropriate BIND_* constant, like BIND_VAR or\n// BIND_LEXICAL.\n//\n// If the function is called with a non-BIND_NONE bindingType, then\n// additionally a checkClashes object may be specified to allow checking for\n// duplicate argument names. checkClashes is ignored if the provided construct\n// is an assignment (i.e., bindingType is BIND_NONE).\n\npp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n var isBind = bindingType !== BIND_NONE;\n\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n { this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\"); }\n if (isBind) {\n if (bindingType === BIND_LEXICAL && expr.name === \"let\")\n { this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\"); }\n if (checkClashes) {\n if (hasOwn(checkClashes, expr.name))\n { this.raiseRecoverable(expr.start, \"Argument name clash\"); }\n checkClashes[expr.name] = true;\n }\n if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }\n }\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding member expression\"); }\n break\n\n case \"ParenthesizedExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding parenthesized expression\"); }\n return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n\n default:\n this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n }\n};\n\npp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"ObjectPattern\":\n for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.checkLValInnerPattern(prop, bindingType, checkClashes);\n }\n break\n\n case \"ArrayPattern\":\n for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n var elem = list$1[i$1];\n\n if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }\n }\n break\n\n default:\n this.checkLValSimple(expr, bindingType, checkClashes);\n }\n};\n\npp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n break\n\n case \"AssignmentPattern\":\n this.checkLValPattern(expr.left, bindingType, checkClashes);\n break\n\n case \"RestElement\":\n this.checkLValPattern(expr.argument, bindingType, checkClashes);\n break\n\n default:\n this.checkLValPattern(expr, bindingType, checkClashes);\n }\n};\n\n// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\n\nvar TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n this.generator = !!generator;\n};\n\nvar types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, function (p) { return p.tryReadTemplateToken(); }),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n};\n\nvar pp$6 = Parser.prototype;\n\npp$6.initialContext = function() {\n return [types.b_stat]\n};\n\npp$6.curContext = function() {\n return this.context[this.context.length - 1]\n};\n\npp$6.braceIsBlock = function(prevType) {\n var parent = this.curContext();\n if (parent === types.f_expr || parent === types.f_stat)\n { return true }\n if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))\n { return !parent.isExpr }\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)\n { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }\n if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)\n { return true }\n if (prevType === types$1.braceL)\n { return parent === types.b_stat }\n if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)\n { return false }\n return !this.exprAllowed\n};\n\npp$6.inGeneratorContext = function() {\n for (var i = this.context.length - 1; i >= 1; i--) {\n var context = this.context[i];\n if (context.token === \"function\")\n { return context.generator }\n }\n return false\n};\n\npp$6.updateContext = function(prevType) {\n var update, type = this.type;\n if (type.keyword && prevType === types$1.dot)\n { this.exprAllowed = false; }\n else if (update = type.updateContext)\n { update.call(this, prevType); }\n else\n { this.exprAllowed = type.beforeExpr; }\n};\n\n// Used to handle edge cases when token context could not be inferred correctly during tokenization phase\n\npp$6.overrideContext = function(tokenCtx) {\n if (this.curContext() !== tokenCtx) {\n this.context[this.context.length - 1] = tokenCtx;\n }\n};\n\n// Token-specific context update code\n\ntypes$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true;\n return\n }\n var out = this.context.pop();\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop();\n }\n this.exprAllowed = !out.isExpr;\n};\n\ntypes$1.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl);\n this.exprAllowed = true;\n};\n\ntypes$1.parenL.updateContext = function(prevType) {\n var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n this.context.push(statementParens ? types.p_stat : types.p_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n};\n\ntypes$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== types$1._else &&\n !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))\n { this.context.push(types.f_expr); }\n else\n { this.context.push(types.f_stat); }\n this.exprAllowed = false;\n};\n\ntypes$1.colon.updateContext = function() {\n if (this.curContext().token === \"function\") { this.context.pop(); }\n this.exprAllowed = true;\n};\n\ntypes$1.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n { this.context.pop(); }\n else\n { this.context.push(types.q_tmpl); }\n this.exprAllowed = false;\n};\n\ntypes$1.star.updateContext = function(prevType) {\n if (prevType === types$1._function) {\n var index = this.context.length - 1;\n if (this.context[index] === types.f_expr)\n { this.context[index] = types.f_expr_gen; }\n else\n { this.context[index] = types.f_gen; }\n }\n this.exprAllowed = true;\n};\n\ntypes$1.name.updateContext = function(prevType) {\n var allowed = false;\n if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n { allowed = true; }\n }\n this.exprAllowed = allowed;\n};\n\n// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\n\nvar pp$5 = Parser.prototype;\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n { return }\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n { return }\n var key = prop.key;\n var name;\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n var kind = prop.kind;\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors) {\n if (refDestructuringErrors.doubleProto < 0) {\n refDestructuringErrors.doubleProto = key.start;\n }\n } else {\n this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n }\n propHash.proto = true;\n }\n return\n }\n name = \"$\" + name;\n var other = propHash[name];\n if (other) {\n var redefinition;\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set;\n } else {\n redefinition = other.init || other[kind];\n }\n if (redefinition)\n { this.raiseRecoverable(key.start, \"Redefinition of property\"); }\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n };\n }\n other[kind] = true;\n};\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp$5.parseExpression = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n if (this.type === types$1.comma) {\n var node = this.startNodeAt(startPos, startLoc);\n node.expressions = [expr];\n while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n};\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) { return this.parseYield(forInit) }\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else { this.exprAllowed = false; }\n }\n\n var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n oldTrailingComma = refDestructuringErrors.trailingComma;\n oldDoubleProto = refDestructuringErrors.doubleProto;\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n } else {\n refDestructuringErrors = new DestructuringErrors;\n ownDestructuringErrors = true;\n }\n\n var startPos = this.start, startLoc = this.startLoc;\n if (this.type === types$1.parenL || this.type === types$1.name) {\n this.potentialArrowAt = this.start;\n this.potentialArrowInForAwait = forInit === \"await\";\n }\n var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }\n if (this.type.isAssign) {\n var node = this.startNodeAt(startPos, startLoc);\n node.operator = this.value;\n if (this.type === types$1.eq)\n { left = this.toAssignable(left, false, refDestructuringErrors); }\n if (!ownDestructuringErrors) {\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n }\n if (refDestructuringErrors.shorthandAssign >= left.start)\n { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly\n if (this.type === types$1.eq)\n { this.checkLValPattern(left); }\n else\n { this.checkLValSimple(left); }\n node.left = left;\n this.next();\n node.right = this.parseMaybeAssign(forInit);\n if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }\n }\n if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }\n if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }\n return left\n};\n\n// Parse a ternary conditional (`?:`) operator.\n\npp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprOps(forInit, refDestructuringErrors);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n if (this.eat(types$1.question)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssign();\n this.expect(types$1.colon);\n node.alternate = this.parseMaybeAssign(forInit);\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n};\n\n// Start the precedence parser.\n\npp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n};\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n var prec = this.type.binop;\n if (prec != null && (!forInit || this.type !== types$1._in)) {\n if (prec > minPrec) {\n var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n var coalesce = this.type === types$1.coalesce;\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = types$1.logicalAND.binop;\n }\n var op = this.value;\n this.next();\n var startPos = this.start, startLoc = this.startLoc;\n var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n }\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n }\n }\n return left\n};\n\npp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n if (right.type === \"PrivateIdentifier\") { this.raise(right.start, \"Private identifier can only be left side of binary expression\"); }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.operator = op;\n node.right = right;\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n};\n\n// Parse unary operators, both prefix and postfix.\n\npp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n var startPos = this.start, startLoc = this.startLoc, expr;\n if (this.isContextual(\"await\") && this.canAwait) {\n expr = this.parseAwait(forInit);\n sawUnary = true;\n } else if (this.type.prefix) {\n var node = this.startNode(), update = this.type === types$1.incDec;\n node.operator = this.value;\n node.prefix = true;\n this.next();\n node.argument = this.parseMaybeUnary(null, true, update, forInit);\n this.checkExpressionErrors(refDestructuringErrors, true);\n if (update) { this.checkLValSimple(node.argument); }\n else if (this.strict && node.operator === \"delete\" && isLocalVariableAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\"); }\n else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Private fields can not be deleted\"); }\n else { sawUnary = true; }\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n } else if (!sawUnary && this.type === types$1.privateId) {\n if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }\n expr = this.parsePrivateIdent();\n // only could be private fields in 'in', such as #x in obj\n if (this.type !== types$1._in) { this.unexpected(); }\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n while (this.type.postfix && !this.canInsertSemicolon()) {\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.operator = this.value;\n node$1.prefix = false;\n node$1.argument = expr;\n this.checkLValSimple(expr);\n this.next();\n expr = this.finishNode(node$1, \"UpdateExpression\");\n }\n }\n\n if (!incDec && this.eat(types$1.starstar)) {\n if (sawUnary)\n { this.unexpected(this.lastTokStart); }\n else\n { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false) }\n } else {\n return expr\n }\n};\n\nfunction isLocalVariableAccess(node) {\n return (\n node.type === \"Identifier\" ||\n node.type === \"ParenthesizedExpression\" && isLocalVariableAccess(node.expression)\n )\n}\n\nfunction isPrivateFieldAccess(node) {\n return (\n node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression) ||\n node.type === \"ParenthesizedExpression\" && isPrivateFieldAccess(node.expression)\n )\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\")\n { return expr }\n var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }\n if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }\n if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }\n }\n return result\n};\n\npp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n this.potentialArrowAt === base.start;\n var optionalChained = false;\n\n while (true) {\n var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n\n if (element.optional) { optionalChained = true; }\n if (element === base || element.type === \"ArrowFunctionExpression\") {\n if (optionalChained) {\n var chainNode = this.startNodeAt(startPos, startLoc);\n chainNode.expression = element;\n element = this.finishNode(chainNode, \"ChainExpression\");\n }\n return element\n }\n\n base = element;\n }\n};\n\npp$5.shouldParseAsyncArrow = function() {\n return !this.canInsertSemicolon() && this.eat(types$1.arrow)\n};\n\npp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n};\n\npp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n var optionalSupported = this.options.ecmaVersion >= 11;\n var optional = optionalSupported && this.eat(types$1.questionDot);\n if (noCalls && optional) { this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\"); }\n\n var computed = this.eat(types$1.bracketL);\n if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.object = base;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(types$1.bracketR);\n } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n node.property = this.parsePrivateIdent();\n } else {\n node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n }\n node.computed = !!computed;\n if (optionalSupported) {\n node.optional = optional;\n }\n base = this.finishNode(node, \"MemberExpression\");\n } else if (!noCalls && this.eat(types$1.parenL)) {\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n if (this.awaitIdentPos > 0)\n { this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\"); }\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)\n }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.callee = base;\n node$1.arguments = exprList;\n if (optionalSupported) {\n node$1.optional = optional;\n }\n base = this.finishNode(node$1, \"CallExpression\");\n } else if (this.type === types$1.backQuote) {\n if (optional || optionalChained) {\n this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n }\n var node$2 = this.startNodeAt(startPos, startLoc);\n node$2.tag = base;\n node$2.quasi = this.parseTemplate({isTagged: true});\n base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n }\n return base\n};\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === types$1.slash) { this.readRegexp(); }\n\n var node, canBeArrow = this.potentialArrowAt === this.start;\n switch (this.type) {\n case types$1._super:\n if (!this.allowSuper)\n { this.raise(this.start, \"'super' keyword outside a method\"); }\n node = this.startNode();\n this.next();\n if (this.type === types$1.parenL && !this.allowDirectSuper)\n { this.raise(node.start, \"super() call outside constructor of a subclass\"); }\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super ( Arguments )\n if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)\n { this.unexpected(); }\n return this.finishNode(node, \"Super\")\n\n case types$1._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\")\n\n case types$1.name:\n var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;\n var id = this.parseIdent(false);\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n this.overrideContext(types.f_expr);\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n }\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(types$1.arrow))\n { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n id = this.parseIdent(false);\n if (this.canInsertSemicolon() || !this.eat(types$1.arrow))\n { this.unexpected(); }\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n }\n }\n return id\n\n case types$1.regexp:\n var value = this.value;\n node = this.parseLiteral(value.value);\n node.regex = {pattern: value.pattern, flags: value.flags};\n return node\n\n case types$1.num: case types$1.string:\n return this.parseLiteral(this.value)\n\n case types$1._null: case types$1._true: case types$1._false:\n node = this.startNode();\n node.value = this.type === types$1._null ? null : this.type === types$1._true;\n node.raw = this.type.keyword;\n this.next();\n return this.finishNode(node, \"Literal\")\n\n case types$1.parenL:\n var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n { refDestructuringErrors.parenthesizedAssign = start; }\n if (refDestructuringErrors.parenthesizedBind < 0)\n { refDestructuringErrors.parenthesizedBind = start; }\n }\n return expr\n\n case types$1.bracketL:\n node = this.startNode();\n this.next();\n node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n return this.finishNode(node, \"ArrayExpression\")\n\n case types$1.braceL:\n this.overrideContext(types.b_expr);\n return this.parseObj(false, refDestructuringErrors)\n\n case types$1._function:\n node = this.startNode();\n this.next();\n return this.parseFunction(node, 0)\n\n case types$1._class:\n return this.parseClass(this.startNode(), false)\n\n case types$1._new:\n return this.parseNew()\n\n case types$1.backQuote:\n return this.parseTemplate()\n\n case types$1._import:\n if (this.options.ecmaVersion >= 11) {\n return this.parseExprImport(forNew)\n } else {\n return this.unexpected()\n }\n\n default:\n return this.parseExprAtomDefault()\n }\n};\n\npp$5.parseExprAtomDefault = function() {\n this.unexpected();\n};\n\npp$5.parseExprImport = function(forNew) {\n var node = this.startNode();\n\n // Consume `import` as an identifier for `import.meta`.\n // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword import\"); }\n this.next();\n\n if (this.type === types$1.parenL && !forNew) {\n return this.parseDynamicImport(node)\n } else if (this.type === types$1.dot) {\n var meta = this.startNodeAt(node.start, node.loc && node.loc.start);\n meta.name = \"import\";\n node.meta = this.finishNode(meta, \"Identifier\");\n return this.parseImportMeta(node)\n } else {\n this.unexpected();\n }\n};\n\npp$5.parseDynamicImport = function(node) {\n this.next(); // skip `(`\n\n // Parse node.source.\n node.source = this.parseMaybeAssign();\n\n if (this.options.ecmaVersion >= 16) {\n if (!this.eat(types$1.parenR)) {\n this.expect(types$1.comma);\n if (!this.afterTrailingComma(types$1.parenR)) {\n node.options = this.parseMaybeAssign();\n if (!this.eat(types$1.parenR)) {\n this.expect(types$1.comma);\n if (!this.afterTrailingComma(types$1.parenR)) {\n this.unexpected();\n }\n }\n } else {\n node.options = null;\n }\n } else {\n node.options = null;\n }\n } else {\n // Verify ending.\n if (!this.eat(types$1.parenR)) {\n var errorPos = this.start;\n if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n } else {\n this.unexpected(errorPos);\n }\n }\n }\n\n return this.finishNode(node, \"ImportExpression\")\n};\n\npp$5.parseImportMeta = function(node) {\n this.next(); // skip `.`\n\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n\n if (node.property.name !== \"meta\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\"); }\n if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere)\n { this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\"); }\n\n return this.finishNode(node, \"MetaProperty\")\n};\n\npp$5.parseLiteral = function(value) {\n var node = this.startNode();\n node.value = value;\n node.raw = this.input.slice(this.start, this.end);\n if (node.raw.charCodeAt(node.raw.length - 1) === 110)\n { node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, \"\"); }\n this.next();\n return this.finishNode(node, \"Literal\")\n};\n\npp$5.parseParenExpression = function() {\n this.expect(types$1.parenL);\n var val = this.parseExpression();\n this.expect(types$1.parenR);\n return val\n};\n\npp$5.shouldParseArrow = function(exprList) {\n return !this.canInsertSemicolon()\n};\n\npp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;\n if (this.options.ecmaVersion >= 6) {\n this.next();\n\n var innerStartPos = this.start, innerStartLoc = this.startLoc;\n var exprList = [], first = true, lastIsComma = false;\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;\n this.yieldPos = 0;\n this.awaitPos = 0;\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== types$1.parenR) {\n first ? first = false : this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n lastIsComma = true;\n break\n } else if (this.type === types$1.ellipsis) {\n spreadStart = this.start;\n exprList.push(this.parseParenItem(this.parseRestBinding()));\n if (this.type === types$1.comma) {\n this.raiseRecoverable(\n this.start,\n \"Comma is not permitted after the rest element\"\n );\n }\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n }\n }\n var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;\n this.expect(types$1.parenR);\n\n if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n }\n\n if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }\n if (spreadStart) { this.unexpected(spreadStart); }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc);\n val.expressions = exprList;\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n val = exprList[0];\n }\n } else {\n val = this.parseParenExpression();\n }\n\n if (this.options.preserveParens) {\n var par = this.startNodeAt(startPos, startLoc);\n par.expression = val;\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n};\n\npp$5.parseParenItem = function(item) {\n return item\n};\n\npp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n};\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nvar empty = [];\n\npp$5.parseNew = function() {\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword new\"); }\n var node = this.startNode();\n this.next();\n if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {\n var meta = this.startNodeAt(node.start, node.loc && node.loc.start);\n meta.name = \"new\";\n node.meta = this.finishNode(meta, \"Identifier\");\n this.next();\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n if (node.property.name !== \"target\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\"); }\n if (!this.allowNewDotTarget)\n { this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\"); }\n return this.finishNode(node, \"MetaProperty\")\n }\n var startPos = this.start, startLoc = this.startLoc;\n node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);\n if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }\n else { node.arguments = empty; }\n return this.finishNode(node, \"NewExpression\")\n};\n\n// Parse template expression.\n\npp$5.parseTemplateElement = function(ref) {\n var isTagged = ref.isTagged;\n\n var elem = this.startNode();\n if (this.type === types$1.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n }\n elem.value = {\n raw: this.value.replace(/\\r\\n?/g, \"\\n\"),\n cooked: null\n };\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n };\n }\n this.next();\n elem.tail = this.type === types$1.backQuote;\n return this.finishNode(elem, \"TemplateElement\")\n};\n\npp$5.parseTemplate = function(ref) {\n if ( ref === void 0 ) ref = {};\n var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;\n\n var node = this.startNode();\n this.next();\n node.expressions = [];\n var curElt = this.parseTemplateElement({isTagged: isTagged});\n node.quasis = [curElt];\n while (!curElt.tail) {\n if (this.type === types$1.eof) { this.raise(this.pos, \"Unterminated template literal\"); }\n this.expect(types$1.dollarBraceL);\n node.expressions.push(this.parseExpression());\n this.expect(types$1.braceR);\n node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));\n }\n this.next();\n return this.finishNode(node, \"TemplateLiteral\")\n};\n\npp$5.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\n// Parse an object literal or binding pattern.\n\npp$5.parseObj = function(isPattern, refDestructuringErrors) {\n var node = this.startNode(), first = true, propHash = {};\n node.properties = [];\n this.next();\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var prop = this.parseProperty(isPattern, refDestructuringErrors);\n if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }\n node.properties.push(prop);\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n};\n\npp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;\n if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false);\n if (this.type === types$1.comma) {\n this.raiseRecoverable(this.start, \"Comma is not permitted after the rest element\");\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start;\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false;\n prop.shorthand = false;\n if (isPattern || refDestructuringErrors) {\n startPos = this.start;\n startLoc = this.startLoc;\n }\n if (!isPattern)\n { isGenerator = this.eat(types$1.star); }\n }\n var containsEsc = this.containsEsc;\n this.parsePropertyName(prop);\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true;\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n this.parsePropertyName(prop);\n } else {\n isAsync = false;\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n return this.finishNode(prop, \"Property\")\n};\n\npp$5.parseGetterSetter = function(prop) {\n var kind = prop.key.name;\n this.parsePropertyName(prop);\n prop.value = this.parseMethod(false);\n prop.kind = kind;\n var paramCount = prop.kind === \"get\" ? 0 : 1;\n if (prop.value.params.length !== paramCount) {\n var start = prop.value.start;\n if (prop.kind === \"get\")\n { this.raiseRecoverable(start, \"getter should have no params\"); }\n else\n { this.raiseRecoverable(start, \"setter should have exactly one param\"); }\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\"); }\n }\n};\n\npp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === types$1.colon)\n { this.unexpected(); }\n\n if (this.eat(types$1.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n prop.kind = \"init\";\n } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n if (isPattern) { this.unexpected(); }\n prop.method = true;\n prop.value = this.parseMethod(isGenerator, isAsync);\n prop.kind = \"init\";\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.parseGetterSetter(prop);\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.checkUnreserved(prop.key);\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = startPos; }\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else if (this.type === types$1.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n { refDestructuringErrors.shorthandAssign = this.start; }\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else {\n prop.value = this.copyNode(prop.key);\n }\n prop.kind = \"init\";\n prop.shorthand = true;\n } else { this.unexpected(); }\n};\n\npp$5.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(types$1.bracketL)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssign();\n this.expect(types$1.bracketR);\n return prop.key\n } else {\n prop.computed = false;\n }\n }\n return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n};\n\n// Initialize empty function node.\n\npp$5.initFunction = function(node) {\n node.id = null;\n if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }\n if (this.options.ecmaVersion >= 8) { node.async = false; }\n};\n\n// Parse object or class method.\n\npp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.initFunction(node);\n if (this.options.ecmaVersion >= 6)\n { node.generator = isGenerator; }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n this.parseFunctionBody(node, false, true, false);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"FunctionExpression\")\n};\n\n// Parse arrow function expression with given parameters.\n\npp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n this.initFunction(node);\n if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n\n node.params = this.toAssignableList(params, true);\n this.parseFunctionBody(node, true, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"ArrowFunctionExpression\")\n};\n\n// Parse function body and check parameters.\n\npp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n var isExpression = isArrowFunction && this.type !== types$1.braceL;\n var oldStrict = this.strict, useStrict = false;\n\n if (isExpression) {\n node.body = this.parseMaybeAssign(forInit);\n node.expression = true;\n this.checkParams(node, false);\n } else {\n var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end);\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n { this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\"); }\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n var oldLabels = this.labels;\n this.labels = [];\n if (useStrict) { this.strict = true; }\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }\n node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n node.expression = false;\n this.adaptDirectivePrologue(node.body.body);\n this.labels = oldLabels;\n }\n this.exitScope();\n};\n\npp$5.isSimpleParamList = function(params) {\n for (var i = 0, list = params; i < list.length; i += 1)\n {\n var param = list[i];\n\n if (param.type !== \"Identifier\") { return false\n } }\n return true\n};\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp$5.checkParams = function(node, allowDuplicates) {\n var nameHash = Object.create(null);\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n }\n};\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (!first) {\n this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(close)) { break }\n } else { first = false; }\n\n var elt = (void 0);\n if (allowEmpty && this.type === types$1.comma)\n { elt = null; }\n else if (this.type === types$1.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors);\n if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)\n { refDestructuringErrors.trailingComma = this.start; }\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors);\n }\n elts.push(elt);\n }\n return elts\n};\n\npp$5.checkUnreserved = function(ref) {\n var start = ref.start;\n var end = ref.end;\n var name = ref.name;\n\n if (this.inGenerator && name === \"yield\")\n { this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\"); }\n if (this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\"); }\n if (!(this.currentThisScope().flags & SCOPE_VAR) && name === \"arguments\")\n { this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\"); }\n if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\"))\n { this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\")); }\n if (this.keywords.test(name))\n { this.raise(start, (\"Unexpected keyword '\" + name + \"'\")); }\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) { return }\n var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\"); }\n this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n }\n};\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp$5.parseIdent = function(liberal) {\n var node = this.parseIdentNode();\n this.next(!!liberal);\n this.finishNode(node, \"Identifier\");\n if (!liberal) {\n this.checkUnreserved(node);\n if (node.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = node.start; }\n }\n return node\n};\n\npp$5.parseIdentNode = function() {\n var node = this.startNode();\n if (this.type === types$1.name) {\n node.name = this.value;\n } else if (this.type.keyword) {\n node.name = this.type.keyword;\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop();\n }\n this.type = types$1.name;\n } else {\n this.unexpected();\n }\n return node\n};\n\npp$5.parsePrivateIdent = function() {\n var node = this.startNode();\n if (this.type === types$1.privateId) {\n node.name = this.value;\n } else {\n this.unexpected();\n }\n this.next();\n this.finishNode(node, \"PrivateIdentifier\");\n\n // For validating existence\n if (this.options.checkPrivateFields) {\n if (this.privateNameStack.length === 0) {\n this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n } else {\n this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n }\n }\n\n return node\n};\n\n// Parses yield expression inside generator.\n\npp$5.parseYield = function(forInit) {\n if (!this.yieldPos) { this.yieldPos = this.start; }\n\n var node = this.startNode();\n this.next();\n if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n node.delegate = false;\n node.argument = null;\n } else {\n node.delegate = this.eat(types$1.star);\n node.argument = this.parseMaybeAssign(forInit);\n }\n return this.finishNode(node, \"YieldExpression\")\n};\n\npp$5.parseAwait = function(forInit) {\n if (!this.awaitPos) { this.awaitPos = this.start; }\n\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeUnary(null, true, false, forInit);\n return this.finishNode(node, \"AwaitExpression\")\n};\n\nvar pp$4 = Parser.prototype;\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp$4.raise = function(pos, message) {\n var loc = getLineInfo(this.input, pos);\n message += \" (\" + loc.line + \":\" + loc.column + \")\";\n if (this.sourceFile) {\n message += \" in \" + this.sourceFile;\n }\n var err = new SyntaxError(message);\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos;\n throw err\n};\n\npp$4.raiseRecoverable = pp$4.raise;\n\npp$4.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n};\n\nvar pp$3 = Parser.prototype;\n\nvar Scope = function Scope(flags) {\n this.flags = flags;\n // A list of var-declared names in the current lexical scope\n this.var = [];\n // A list of lexically-declared names in the current lexical scope\n this.lexical = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = [];\n};\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp$3.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags));\n};\n\npp$3.exitScope = function() {\n this.scopeStack.pop();\n};\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp$3.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n};\n\npp$3.declareName = function(name, bindingType, pos) {\n var redeclared = false;\n if (bindingType === BIND_LEXICAL) {\n var scope = this.currentScope();\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n scope.lexical.push(name);\n if (this.inModule && (scope.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n var scope$1 = this.currentScope();\n scope$1.lexical.push(name);\n } else if (bindingType === BIND_FUNCTION) {\n var scope$2 = this.currentScope();\n if (this.treatFunctionsAsVar)\n { redeclared = scope$2.lexical.indexOf(name) > -1; }\n else\n { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }\n scope$2.functions.push(name);\n } else {\n for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n var scope$3 = this.scopeStack[i];\n if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n redeclared = true;\n break\n }\n scope$3.var.push(name);\n if (this.inModule && (scope$3.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n if (scope$3.flags & SCOPE_VAR) { break }\n }\n }\n if (redeclared) { this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\")); }\n};\n\npp$3.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id;\n }\n};\n\npp$3.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n};\n\npp$3.currentVarScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }\n }\n};\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp$3.currentThisScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&\n !(scope.flags & SCOPE_ARROW)) { return scope }\n }\n};\n\nvar Node = function Node(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n if (parser.options.locations)\n { this.loc = new SourceLocation(parser, loc); }\n if (parser.options.directSourceFile)\n { this.sourceFile = parser.options.directSourceFile; }\n if (parser.options.ranges)\n { this.range = [pos, 0]; }\n};\n\n// Start an AST node, attaching a start offset.\n\nvar pp$2 = Parser.prototype;\n\npp$2.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n};\n\npp$2.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n};\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n}\n\npp$2.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n};\n\n// Finish node at given position\n\npp$2.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n};\n\npp$2.copyNode = function(node) {\n var newNode = new Node(this, node.start, this.startLoc);\n for (var prop in node) { newNode[prop] = node[prop]; }\n return newNode\n};\n\n// This file was generated by \"bin/generate-unicode-script-values.js\". Do not modify manually!\nvar scriptValuesAddedInUnicode = \"Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz\";\n\n// This file contains Unicode properties extracted from the ECMAScript specification.\n// The lists are extracted like so:\n// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n// #table-binary-unicode-properties\nvar ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\nvar ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\nvar ecma11BinaryProperties = ecma10BinaryProperties;\nvar ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\nvar ecma13BinaryProperties = ecma12BinaryProperties;\nvar ecma14BinaryProperties = ecma13BinaryProperties;\n\nvar unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma10BinaryProperties,\n 11: ecma11BinaryProperties,\n 12: ecma12BinaryProperties,\n 13: ecma13BinaryProperties,\n 14: ecma14BinaryProperties\n};\n\n// #table-binary-unicode-properties-of-strings\nvar ecma14BinaryPropertiesOfStrings = \"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji\";\n\nvar unicodeBinaryPropertiesOfStrings = {\n 9: \"\",\n 10: \"\",\n 11: \"\",\n 12: \"\",\n 13: \"\",\n 14: ecma14BinaryPropertiesOfStrings\n};\n\n// #table-unicode-general-category-values\nvar unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n\n// #table-unicode-script-values\nvar ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\nvar ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\nvar ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\nvar ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\nvar ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\nvar ecma14ScriptValues = ecma13ScriptValues + \" \" + scriptValuesAddedInUnicode;\n\nvar unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma10ScriptValues,\n 11: ecma11ScriptValues,\n 12: ecma12ScriptValues,\n 13: ecma13ScriptValues,\n 14: ecma14ScriptValues\n};\n\nvar data = {};\nfunction buildUnicodeData(ecmaVersion) {\n var d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n };\n d.nonBinary.Script_Extensions = d.nonBinary.Script;\n\n d.nonBinary.gc = d.nonBinary.General_Category;\n d.nonBinary.sc = d.nonBinary.Script;\n d.nonBinary.scx = d.nonBinary.Script_Extensions;\n}\n\nfor (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {\n var ecmaVersion = list[i];\n\n buildUnicodeData(ecmaVersion);\n}\n\nvar pp$1 = Parser.prototype;\n\n// Track disjunction structure to determine whether a duplicate\n// capture group name is allowed because it is in a separate branch.\nvar BranchID = function BranchID(parent, base) {\n // Parent disjunction branch\n this.parent = parent;\n // Identifies this set of sibling branches\n this.base = base || this;\n};\n\nBranchID.prototype.separatedFrom = function separatedFrom (alt) {\n // A branch is separate from another branch if they or any of\n // their parents are siblings in a given disjunction\n for (var self = this; self; self = self.parent) {\n for (var other = alt; other; other = other.parent) {\n if (self.base === other.base && self !== other) { return true }\n }\n }\n return false\n};\n\nBranchID.prototype.sibling = function sibling () {\n return new BranchID(this.parent, this.base)\n};\n\nvar RegExpValidationState = function RegExpValidationState(parser) {\n this.parser = parser;\n this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\") + (parser.options.ecmaVersion >= 15 ? \"v\" : \"\");\n this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];\n this.source = \"\";\n this.flags = \"\";\n this.start = 0;\n this.switchU = false;\n this.switchV = false;\n this.switchN = false;\n this.pos = 0;\n this.lastIntValue = 0;\n this.lastStringValue = \"\";\n this.lastAssertionIsQuantifiable = false;\n this.numCapturingParens = 0;\n this.maxBackReference = 0;\n this.groupNames = Object.create(null);\n this.backReferenceNames = [];\n this.branchID = null;\n};\n\nRegExpValidationState.prototype.reset = function reset (start, pattern, flags) {\n var unicodeSets = flags.indexOf(\"v\") !== -1;\n var unicode = flags.indexOf(\"u\") !== -1;\n this.start = start | 0;\n this.source = pattern + \"\";\n this.flags = flags;\n if (unicodeSets && this.parser.options.ecmaVersion >= 15) {\n this.switchU = true;\n this.switchV = true;\n this.switchN = true;\n } else {\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n this.switchV = false;\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n }\n};\n\nRegExpValidationState.prototype.raise = function raise (message) {\n this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n};\n\n// If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\nRegExpValidationState.prototype.at = function at (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return -1\n }\n var c = s.charCodeAt(i);\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n var next = s.charCodeAt(i + 1);\n return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n};\n\nRegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return l\n }\n var c = s.charCodeAt(i), next;\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n return i + 1\n }\n return i + 2\n};\n\nRegExpValidationState.prototype.current = function current (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.pos, forceU)\n};\n\nRegExpValidationState.prototype.lookahead = function lookahead (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.nextIndex(this.pos, forceU), forceU)\n};\n\nRegExpValidationState.prototype.advance = function advance (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n this.pos = this.nextIndex(this.pos, forceU);\n};\n\nRegExpValidationState.prototype.eat = function eat (ch, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n if (this.current(forceU) === ch) {\n this.advance(forceU);\n return true\n }\n return false\n};\n\nRegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var pos = this.pos;\n for (var i = 0, list = chs; i < list.length; i += 1) {\n var ch = list[i];\n\n var current = this.at(pos, forceU);\n if (current === -1 || current !== ch) {\n return false\n }\n pos = this.nextIndex(pos, forceU);\n }\n this.pos = pos;\n return true\n};\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpFlags = function(state) {\n var validFlags = state.validFlags;\n var flags = state.flags;\n\n var u = false;\n var v = false;\n\n for (var i = 0; i < flags.length; i++) {\n var flag = flags.charAt(i);\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\");\n }\n if (flag === \"u\") { u = true; }\n if (flag === \"v\") { v = true; }\n }\n if (this.options.ecmaVersion >= 15 && u && v) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n};\n\nfunction hasProp(obj) {\n for (var _ in obj) { return true }\n return false\n}\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpPattern = function(state) {\n this.regexp_pattern(state);\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {\n state.switchN = true;\n this.regexp_pattern(state);\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp$1.regexp_pattern = function(state) {\n state.pos = 0;\n state.lastIntValue = 0;\n state.lastStringValue = \"\";\n state.lastAssertionIsQuantifiable = false;\n state.numCapturingParens = 0;\n state.maxBackReference = 0;\n state.groupNames = Object.create(null);\n state.backReferenceNames.length = 0;\n state.branchID = null;\n\n this.regexp_disjunction(state);\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\");\n }\n if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\");\n }\n for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n var name = list[i];\n\n if (!state.groupNames[name]) {\n state.raise(\"Invalid named capture referenced\");\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp$1.regexp_disjunction = function(state) {\n var trackDisjunction = this.options.ecmaVersion >= 16;\n if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }\n this.regexp_alternative(state);\n while (state.eat(0x7C /* | */)) {\n if (trackDisjunction) { state.branchID = state.branchID.sibling(); }\n this.regexp_alternative(state);\n }\n if (trackDisjunction) { state.branchID = state.branchID.parent; }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp$1.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp$1.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\");\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state);\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp$1.regexp_eatAssertion = function(state) {\n var start = state.pos;\n state.lastAssertionIsQuantifiable = false;\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start;\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n var lookbehind = false;\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */);\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state);\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\");\n }\n state.lastAssertionIsQuantifiable = !lookbehind;\n return true\n }\n }\n\n state.pos = start;\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp$1.regexp_eatQuantifier = function(state, noError) {\n if ( noError === void 0 ) noError = false;\n\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */);\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n};\npp$1.regexp_eatBracedQuantifier = function(state, noError) {\n var start = state.pos;\n if (state.eat(0x7B /* { */)) {\n var min = 0, max = -1;\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue;\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue;\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\");\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp$1.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n};\npp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatUncapturingGroup = function(state) {\n var start = state.pos;\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */)) {\n if (this.options.ecmaVersion >= 16) {\n var addModifiers = this.regexp_eatModifiers(state);\n var hasHyphen = state.eat(0x2D /* - */);\n if (addModifiers || hasHyphen) {\n for (var i = 0; i < addModifiers.length; i++) {\n var modifier = addModifiers.charAt(i);\n if (addModifiers.indexOf(modifier, i + 1) > -1) {\n state.raise(\"Duplicate regular expression modifiers\");\n }\n }\n if (hasHyphen) {\n var removeModifiers = this.regexp_eatModifiers(state);\n if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {\n state.raise(\"Invalid regular expression modifiers\");\n }\n for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {\n var modifier$1 = removeModifiers.charAt(i$1);\n if (\n removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||\n addModifiers.indexOf(modifier$1) > -1\n ) {\n state.raise(\"Duplicate regular expression modifiers\");\n }\n }\n }\n }\n }\n if (state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\");\n }\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state);\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\");\n }\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1;\n return true\n }\n state.raise(\"Unterminated group\");\n }\n return false\n};\n// RegularExpressionModifiers ::\n// [empty]\n// RegularExpressionModifiers RegularExpressionModifier\npp$1.regexp_eatModifiers = function(state) {\n var modifiers = \"\";\n var ch = 0;\n while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {\n modifiers += codePointToString(ch);\n state.advance();\n }\n return modifiers\n};\n// RegularExpressionModifier :: one of\n// `i` `m` `s`\nfunction isRegularExpressionModifier(ch) {\n return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp$1.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp$1.regexp_eatSyntaxCharacter = function(state) {\n var ch = state.current();\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n};\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp$1.regexp_eatPatternCharacters = function(state) {\n var start = state.pos;\n var ch = 0;\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance();\n }\n return state.pos !== start\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp$1.regexp_eatExtendedPatternCharacter = function(state) {\n var ch = state.current();\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance();\n return true\n }\n return false\n};\n\n// GroupSpecifier ::\n// [empty]\n// `?` GroupName\npp$1.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (!this.regexp_eatGroupName(state)) { state.raise(\"Invalid group\"); }\n var trackDisjunction = this.options.ecmaVersion >= 16;\n var known = state.groupNames[state.lastStringValue];\n if (known) {\n if (trackDisjunction) {\n for (var i = 0, list = known; i < list.length; i += 1) {\n var altID = list[i];\n\n if (!altID.separatedFrom(state.branchID))\n { state.raise(\"Duplicate capture group name\"); }\n }\n } else {\n state.raise(\"Duplicate capture group name\");\n }\n }\n if (trackDisjunction) {\n (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);\n } else {\n state.groupNames[state.lastStringValue] = true;\n }\n }\n};\n\n// GroupName ::\n// `<` RegExpIdentifierName `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\";\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\");\n }\n return false\n};\n\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierPart\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\";\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n }\n return true\n }\n return false\n};\n\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\npp$1.regexp_eatRegExpIdentifierStart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\n// <ZWNJ>\n// <ZWJ>\npp$1.regexp_eatRegExpIdentifierPart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp$1.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\");\n }\n state.raise(\"Invalid escape\");\n }\n return false\n};\npp$1.regexp_eatBackReference = function(state) {\n var start = state.pos;\n if (this.regexp_eatDecimalEscape(state)) {\n var n = state.lastIntValue;\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n;\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue);\n return true\n }\n state.raise(\"Invalid named reference\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp$1.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n};\npp$1.regexp_eatCControlLetter = function(state) {\n var start = state.pos;\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp$1.regexp_eatControlEscape = function(state) {\n var ch = state.current();\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09; /* \\t */\n state.advance();\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A; /* \\n */\n state.advance();\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B; /* \\v */\n state.advance();\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C; /* \\f */\n state.advance();\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D; /* \\r */\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp$1.regexp_eatControlLetter = function(state) {\n var ch = state.current();\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var start = state.pos;\n var switchU = forceU || state.switchU;\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n var lead = state.lastIntValue;\n if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n var leadSurrogateEnd = state.pos;\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n var trail = state.lastIntValue;\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n return true\n }\n }\n state.pos = leadSurrogateEnd;\n state.lastIntValue = lead;\n }\n return true\n }\n if (\n switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (switchU) {\n state.raise(\"Invalid unicode escape\");\n }\n state.pos = start;\n }\n\n return false\n};\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp$1.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F; /* / */\n return true\n }\n return false\n }\n\n var ch = state.current();\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp$1.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0;\n var ch = state.current();\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n};\n\n// Return values used by character set parsing methods, needed to\n// forbid negation of sets that can match strings.\nvar CharSetNone = 0; // Nothing parsed\nvar CharSetOk = 1; // Construct parsed, cannot contain strings\nvar CharSetString = 2; // Construct parsed, can contain strings\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp$1.regexp_eatCharacterClassEscape = function(state) {\n var ch = state.current();\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1;\n state.advance();\n return CharSetOk\n }\n\n var negate = false;\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1;\n state.advance();\n var result;\n if (\n state.eat(0x7B /* { */) &&\n (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&\n state.eat(0x7D /* } */)\n ) {\n if (negate && result === CharSetString) { state.raise(\"Invalid property name\"); }\n return result\n }\n state.raise(\"Invalid property name\");\n }\n\n return CharSetNone\n};\n\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n var start = state.pos;\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n var name = state.lastStringValue;\n if (this.regexp_eatUnicodePropertyValue(state)) {\n var value = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n return CharSetOk\n }\n }\n state.pos = start;\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n var nameOrValue = state.lastStringValue;\n return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n }\n return CharSetNone\n};\n\npp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!hasOwn(state.unicodeProperties.nonBinary, name))\n { state.raise(\"Invalid property name\"); }\n if (!state.unicodeProperties.nonBinary[name].test(value))\n { state.raise(\"Invalid property value\"); }\n};\n\npp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }\n if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }\n state.raise(\"Invalid property name\");\n};\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp$1.regexp_eatUnicodePropertyName = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\n\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatUnicodePropertyValue = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp$1.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n var negate = state.eat(0x5E /* ^ */);\n var result = this.regexp_classContents(state);\n if (!state.eat(0x5D /* ] */))\n { state.raise(\"Unterminated character class\"); }\n if (negate && result === CharSetString)\n { state.raise(\"Negated character class may contain strings\"); }\n return true\n }\n return false\n};\n\n// https://tc39.es/ecma262/#prod-ClassContents\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\npp$1.regexp_classContents = function(state) {\n if (state.current() === 0x5D /* ] */) { return CharSetOk }\n if (state.switchV) { return this.regexp_classSetExpression(state) }\n this.regexp_nonEmptyClassRanges(state);\n return CharSetOk\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp$1.regexp_nonEmptyClassRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n var right = state.lastIntValue;\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\");\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp$1.regexp_eatClassAtom = function(state) {\n var start = state.pos;\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n var ch$1 = state.current();\n if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n state.raise(\"Invalid class escape\");\n }\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n\n var ch = state.current();\n if (ch !== 0x5D /* ] */) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp$1.regexp_eatClassEscape = function(state) {\n var start = state.pos;\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* <BS> */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D; /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetExpression\n// https://tc39.es/ecma262/#prod-ClassUnion\n// https://tc39.es/ecma262/#prod-ClassIntersection\n// https://tc39.es/ecma262/#prod-ClassSubtraction\npp$1.regexp_classSetExpression = function(state) {\n var result = CharSetOk, subResult;\n if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {\n if (subResult === CharSetString) { result = CharSetString; }\n // https://tc39.es/ecma262/#prod-ClassIntersection\n var start = state.pos;\n while (state.eatChars([0x26, 0x26] /* && */)) {\n if (\n state.current() !== 0x26 /* & */ &&\n (subResult = this.regexp_eatClassSetOperand(state))\n ) {\n if (subResult !== CharSetString) { result = CharSetOk; }\n continue\n }\n state.raise(\"Invalid character in character class\");\n }\n if (start !== state.pos) { return result }\n // https://tc39.es/ecma262/#prod-ClassSubtraction\n while (state.eatChars([0x2D, 0x2D] /* -- */)) {\n if (this.regexp_eatClassSetOperand(state)) { continue }\n state.raise(\"Invalid character in character class\");\n }\n if (start !== state.pos) { return result }\n } else {\n state.raise(\"Invalid character in character class\");\n }\n // https://tc39.es/ecma262/#prod-ClassUnion\n for (;;) {\n if (this.regexp_eatClassSetRange(state)) { continue }\n subResult = this.regexp_eatClassSetOperand(state);\n if (!subResult) { return result }\n if (subResult === CharSetString) { result = CharSetString; }\n }\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetRange\npp$1.regexp_eatClassSetRange = function(state) {\n var start = state.pos;\n if (this.regexp_eatClassSetCharacter(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {\n var right = state.lastIntValue;\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n return true\n }\n state.pos = start;\n }\n return false\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetOperand\npp$1.regexp_eatClassSetOperand = function(state) {\n if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }\n return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)\n};\n\n// https://tc39.es/ecma262/#prod-NestedClass\npp$1.regexp_eatNestedClass = function(state) {\n var start = state.pos;\n if (state.eat(0x5B /* [ */)) {\n var negate = state.eat(0x5E /* ^ */);\n var result = this.regexp_classContents(state);\n if (state.eat(0x5D /* ] */)) {\n if (negate && result === CharSetString) {\n state.raise(\"Negated character class may contain strings\");\n }\n return result\n }\n state.pos = start;\n }\n if (state.eat(0x5C /* \\ */)) {\n var result$1 = this.regexp_eatCharacterClassEscape(state);\n if (result$1) {\n return result$1\n }\n state.pos = start;\n }\n return null\n};\n\n// https://tc39.es/ecma262/#prod-ClassStringDisjunction\npp$1.regexp_eatClassStringDisjunction = function(state) {\n var start = state.pos;\n if (state.eatChars([0x5C, 0x71] /* \\q */)) {\n if (state.eat(0x7B /* { */)) {\n var result = this.regexp_classStringDisjunctionContents(state);\n if (state.eat(0x7D /* } */)) {\n return result\n }\n } else {\n // Make the same message as V8.\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return null\n};\n\n// https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents\npp$1.regexp_classStringDisjunctionContents = function(state) {\n var result = this.regexp_classString(state);\n while (state.eat(0x7C /* | */)) {\n if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }\n }\n return result\n};\n\n// https://tc39.es/ecma262/#prod-ClassString\n// https://tc39.es/ecma262/#prod-NonEmptyClassString\npp$1.regexp_classString = function(state) {\n var count = 0;\n while (this.regexp_eatClassSetCharacter(state)) { count++; }\n return count === 1 ? CharSetOk : CharSetString\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetCharacter\npp$1.regexp_eatClassSetCharacter = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (\n this.regexp_eatCharacterEscape(state) ||\n this.regexp_eatClassSetReservedPunctuator(state)\n ) {\n return true\n }\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* <BS> */\n return true\n }\n state.pos = start;\n return false\n }\n var ch = state.current();\n if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }\n if (isClassSetSyntaxCharacter(ch)) { return false }\n state.advance();\n state.lastIntValue = ch;\n return true\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator\nfunction isClassSetReservedDoublePunctuatorCharacter(ch) {\n return (\n ch === 0x21 /* ! */ ||\n ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||\n ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||\n ch === 0x2E /* . */ ||\n ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||\n ch === 0x5E /* ^ */ ||\n ch === 0x60 /* ` */ ||\n ch === 0x7E /* ~ */\n )\n}\n\n// https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter\nfunction isClassSetSyntaxCharacter(ch) {\n return (\n ch === 0x28 /* ( */ ||\n ch === 0x29 /* ) */ ||\n ch === 0x2D /* - */ ||\n ch === 0x2F /* / */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator\npp$1.regexp_eatClassSetReservedPunctuator = function(state) {\n var ch = state.current();\n if (isClassSetReservedPunctuator(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n};\n\n// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator\nfunction isClassSetReservedPunctuator(ch) {\n return (\n ch === 0x21 /* ! */ ||\n ch === 0x23 /* # */ ||\n ch === 0x25 /* % */ ||\n ch === 0x26 /* & */ ||\n ch === 0x2C /* , */ ||\n ch === 0x2D /* - */ ||\n ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||\n ch === 0x40 /* @ */ ||\n ch === 0x60 /* ` */ ||\n ch === 0x7E /* ~ */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp$1.regexp_eatClassControlLetter = function(state) {\n var ch = state.current();\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatHexEscapeSequence = function(state) {\n var start = state.pos;\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp$1.regexp_eatDecimalDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp$1.regexp_eatHexDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n var n1 = state.lastIntValue;\n if (this.regexp_eatOctalDigit(state)) {\n var n2 = state.lastIntValue;\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n } else {\n state.lastIntValue = n1 * 8 + n2;\n }\n } else {\n state.lastIntValue = n1;\n }\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp$1.regexp_eatOctalDigit = function(state) {\n var ch = state.current();\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30; /* 0 */\n state.advance();\n return true\n }\n state.lastIntValue = 0;\n return false\n};\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatFixedHexDigits = function(state, length) {\n var start = state.pos;\n state.lastIntValue = 0;\n for (var i = 0; i < length; ++i) {\n var ch = state.current();\n if (!isHexDigit(ch)) {\n state.pos = start;\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return true\n};\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nvar Token = function Token(p) {\n this.type = p.type;\n this.value = p.value;\n this.start = p.start;\n this.end = p.end;\n if (p.options.locations)\n { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }\n if (p.options.ranges)\n { this.range = [p.start, p.end]; }\n};\n\n// ## Tokenizer\n\nvar pp = Parser.prototype;\n\n// Move to the next token\n\npp.next = function(ignoreEscapeSequenceInKeyword) {\n if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)\n { this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword); }\n if (this.options.onToken)\n { this.options.onToken(new Token(this)); }\n\n this.lastTokEnd = this.end;\n this.lastTokStart = this.start;\n this.lastTokEndLoc = this.endLoc;\n this.lastTokStartLoc = this.startLoc;\n this.nextToken();\n};\n\npp.getToken = function() {\n this.next();\n return new Token(this)\n};\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n { pp[Symbol.iterator] = function() {\n var this$1$1 = this;\n\n return {\n next: function () {\n var token = this$1$1.getToken();\n return {\n done: token.type === types$1.eof,\n value: token\n }\n }\n }\n }; }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n var curContext = this.curContext();\n if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }\n\n this.start = this.pos;\n if (this.options.locations) { this.startLoc = this.curPosition(); }\n if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }\n\n if (curContext.override) { return curContext.override(this) }\n else { this.readToken(this.fullCharCodeAtPos()); }\n};\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n { return this.readWord() }\n\n return this.getTokenFromCode(code)\n};\n\npp.fullCharCodeAt = function(pos) {\n var code = this.input.charCodeAt(pos);\n if (code <= 0xd7ff || code >= 0xdc00) { return code }\n var next = this.input.charCodeAt(pos + 1);\n return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n};\n\npp.fullCharCodeAtPos = function() {\n return this.fullCharCodeAt(this.pos)\n};\n\npp.skipBlockComment = function() {\n var startLoc = this.options.onComment && this.curPosition();\n var start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2);\n if (end === -1) { this.raise(this.pos - 2, \"Unterminated comment\"); }\n this.pos = end + 2;\n if (this.options.locations) {\n for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n ++this.curLine;\n pos = this.lineStart = nextBreak;\n }\n }\n if (this.options.onComment)\n { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\npp.skipLineComment = function(startSkip) {\n var start = this.pos;\n var startLoc = this.options.onComment && this.curPosition();\n var ch = this.input.charCodeAt(this.pos += startSkip);\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos);\n }\n if (this.options.onComment)\n { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n var ch = this.input.charCodeAt(this.pos);\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos;\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos;\n }\n case 10: case 8232: case 8233:\n ++this.pos;\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment();\n break\n case 47:\n this.skipLineComment(2);\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos;\n } else {\n break loop\n }\n }\n }\n};\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos;\n if (this.options.locations) { this.endLoc = this.curPosition(); }\n var prevType = this.type;\n this.type = type;\n this.value = val;\n\n this.updateContext(prevType);\n};\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next >= 48 && next <= 57) { return this.readNumber(true) }\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3;\n return this.finishToken(types$1.ellipsis)\n } else {\n ++this.pos;\n return this.finishToken(types$1.dot)\n }\n};\n\npp.readToken_slash = function() { // '/'\n var next = this.input.charCodeAt(this.pos + 1);\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.slash, 1)\n};\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n var tokentype = code === 42 ? types$1.star : types$1.modulo;\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size;\n tokentype = types$1.starstar;\n next = this.input.charCodeAt(this.pos + 2);\n }\n\n if (next === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(tokentype, size)\n};\n\npp.readToken_pipe_amp = function(code) { // '|&'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (this.options.ecmaVersion >= 12) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n};\n\npp.readToken_caret = function() { // '^'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.bitwiseXOR, 1)\n};\n\npp.readToken_plus_min = function(code) { // '+-'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types$1.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.plusMin, 1)\n};\n\npp.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(types$1.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `<!--`, an XML-style comment that should be interpreted as a line comment\n this.skipLineComment(4);\n this.skipSpace();\n return this.nextToken()\n }\n if (next === 61) { size = 2; }\n return this.finishOp(types$1.relational, size)\n};\n\npp.readToken_eq_excl = function(code) { // '=!'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }\n if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'\n this.pos += 2;\n return this.finishToken(types$1.arrow)\n }\n return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)\n};\n\npp.readToken_question = function() { // '?'\n var ecmaVersion = this.options.ecmaVersion;\n if (ecmaVersion >= 11) {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 46) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }\n }\n if (next === 63) {\n if (ecmaVersion >= 12) {\n var next2$1 = this.input.charCodeAt(this.pos + 2);\n if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(types$1.coalesce, 2)\n }\n }\n return this.finishOp(types$1.question, 1)\n};\n\npp.readToken_numberSign = function() { // '#'\n var ecmaVersion = this.options.ecmaVersion;\n var code = 35; // '#'\n if (ecmaVersion >= 13) {\n ++this.pos;\n code = this.fullCharCodeAtPos();\n if (isIdentifierStart(code, true) || code === 92 /* '\\' */) {\n return this.finishToken(types$1.privateId, this.readWord1())\n }\n }\n\n this.raise(this.pos, \"Unexpected character '\" + codePointToString(code) + \"'\");\n};\n\npp.getTokenFromCode = function(code) {\n switch (code) {\n // The interpretation of a dot depends on whether it is followed\n // by a digit or another two dots.\n case 46: // '.'\n return this.readToken_dot()\n\n // Punctuation tokens.\n case 40: ++this.pos; return this.finishToken(types$1.parenL)\n case 41: ++this.pos; return this.finishToken(types$1.parenR)\n case 59: ++this.pos; return this.finishToken(types$1.semi)\n case 44: ++this.pos; return this.finishToken(types$1.comma)\n case 91: ++this.pos; return this.finishToken(types$1.bracketL)\n case 93: ++this.pos; return this.finishToken(types$1.bracketR)\n case 123: ++this.pos; return this.finishToken(types$1.braceL)\n case 125: ++this.pos; return this.finishToken(types$1.braceR)\n case 58: ++this.pos; return this.finishToken(types$1.colon)\n\n case 96: // '`'\n if (this.options.ecmaVersion < 6) { break }\n ++this.pos;\n return this.finishToken(types$1.backQuote)\n\n case 48: // '0'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number\n if (this.options.ecmaVersion >= 6) {\n if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number\n if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number\n }\n\n // Anything else beginning with a digit is an integer, octal\n // number, or float.\n case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9\n return this.readNumber(false)\n\n // Quotes produce strings.\n case 34: case 39: // '\"', \"'\"\n return this.readString(code)\n\n // Operators are parsed inline in tiny state machines. '=' (61) is\n // often referred to. `finishOp` simply skips the amount of\n // characters it is given as second argument, and returns a token\n // of the type given by its first argument.\n case 47: // '/'\n return this.readToken_slash()\n\n case 37: case 42: // '%*'\n return this.readToken_mult_modulo_exp(code)\n\n case 124: case 38: // '|&'\n return this.readToken_pipe_amp(code)\n\n case 94: // '^'\n return this.readToken_caret()\n\n case 43: case 45: // '+-'\n return this.readToken_plus_min(code)\n\n case 60: case 62: // '<>'\n return this.readToken_lt_gt(code)\n\n case 61: case 33: // '=!'\n return this.readToken_eq_excl(code)\n\n case 63: // '?'\n return this.readToken_question()\n\n case 126: // '~'\n return this.finishOp(types$1.prefix, 1)\n\n case 35: // '#'\n return this.readToken_numberSign()\n }\n\n this.raise(this.pos, \"Unexpected character '\" + codePointToString(code) + \"'\");\n};\n\npp.finishOp = function(type, size) {\n var str = this.input.slice(this.pos, this.pos + size);\n this.pos += size;\n return this.finishToken(type, str)\n};\n\npp.readRegexp = function() {\n var escaped, inClass, start = this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(start, \"Unterminated regular expression\"); }\n var ch = this.input.charAt(this.pos);\n if (lineBreak.test(ch)) { this.raise(start, \"Unterminated regular expression\"); }\n if (!escaped) {\n if (ch === \"[\") { inClass = true; }\n else if (ch === \"]\" && inClass) { inClass = false; }\n else if (ch === \"/\" && !inClass) { break }\n escaped = ch === \"\\\\\";\n } else { escaped = false; }\n ++this.pos;\n }\n var pattern = this.input.slice(start, this.pos);\n ++this.pos;\n var flagsStart = this.pos;\n var flags = this.readWord1();\n if (this.containsEsc) { this.unexpected(flagsStart); }\n\n // Validate pattern\n var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));\n state.reset(start, pattern, flags);\n this.validateRegExpFlags(state);\n this.validateRegExpPattern(state);\n\n // Create Literal#value property value.\n var value = null;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n // ESTree requires null if it failed to instantiate RegExp object.\n // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral\n }\n\n return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})\n};\n\n// Read an integer in the given radix. Return null if zero digits\n// were read, the integer value otherwise. When `len` is given, this\n// will return `null` unless the integer has exactly `len` digits.\n\npp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {\n // `len` is used for character escape sequences. In that case, disallow separators.\n var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;\n\n // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)\n // and isn't fraction part nor exponent part. In that case, if the first digit\n // is zero then disallow separators.\n var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;\n\n var start = this.pos, total = 0, lastCode = 0;\n for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {\n var code = this.input.charCodeAt(this.pos), val = (void 0);\n\n if (allowSeparators && code === 95) {\n if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, \"Numeric separator is not allowed in legacy octal numeric literals\"); }\n if (lastCode === 95) { this.raiseRecoverable(this.pos, \"Numeric separator must be exactly one underscore\"); }\n if (i === 0) { this.raiseRecoverable(this.pos, \"Numeric separator is not allowed at the first of digits\"); }\n lastCode = code;\n continue\n }\n\n if (code >= 97) { val = code - 97 + 10; } // a\n else if (code >= 65) { val = code - 65 + 10; } // A\n else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9\n else { val = Infinity; }\n if (val >= radix) { break }\n lastCode = code;\n total = total * radix + val;\n }\n\n if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, \"Numeric separator is not allowed at the last of digits\"); }\n if (this.pos === start || len != null && this.pos - start !== len) { return null }\n\n return total\n};\n\nfunction stringToNumber(str, isLegacyOctalNumericLiteral) {\n if (isLegacyOctalNumericLiteral) {\n return parseInt(str, 8)\n }\n\n // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.\n return parseFloat(str.replace(/_/g, \"\"))\n}\n\nfunction stringToBigInt(str) {\n if (typeof BigInt !== \"function\") {\n return null\n }\n\n // `BigInt(value)` throws syntax error if the string contains numeric separators.\n return BigInt(str.replace(/_/g, \"\"))\n}\n\npp.readRadixNumber = function(radix) {\n var start = this.pos;\n this.pos += 2; // 0x\n var val = this.readInt(radix);\n if (val == null) { this.raise(this.start + 2, \"Expected number in radix \" + radix); }\n if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {\n val = stringToBigInt(this.input.slice(start, this.pos));\n ++this.pos;\n } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n return this.finishToken(types$1.num, val)\n};\n\n// Read an integer, octal integer, or floating-point number.\n\npp.readNumber = function(startsWithDot) {\n var start = this.pos;\n if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, \"Invalid number\"); }\n var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;\n if (octal && this.strict) { this.raise(start, \"Invalid number\"); }\n var next = this.input.charCodeAt(this.pos);\n if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {\n var val$1 = stringToBigInt(this.input.slice(start, this.pos));\n ++this.pos;\n if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n return this.finishToken(types$1.num, val$1)\n }\n if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }\n if (next === 46 && !octal) { // '.'\n ++this.pos;\n this.readInt(10);\n next = this.input.charCodeAt(this.pos);\n }\n if ((next === 69 || next === 101) && !octal) { // 'eE'\n next = this.input.charCodeAt(++this.pos);\n if (next === 43 || next === 45) { ++this.pos; } // '+-'\n if (this.readInt(10) === null) { this.raise(start, \"Invalid number\"); }\n }\n if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n\n var val = stringToNumber(this.input.slice(start, this.pos), octal);\n return this.finishToken(types$1.num, val)\n};\n\n// Read a string value, interpreting backslash-escapes.\n\npp.readCodePoint = function() {\n var ch = this.input.charCodeAt(this.pos), code;\n\n if (ch === 123) { // '{'\n if (this.options.ecmaVersion < 6) { this.unexpected(); }\n var codePos = ++this.pos;\n code = this.readHexChar(this.input.indexOf(\"}\", this.pos) - this.pos);\n ++this.pos;\n if (code > 0x10FFFF) { this.invalidStringToken(codePos, \"Code point out of bounds\"); }\n } else {\n code = this.readHexChar(4);\n }\n return code\n};\n\npp.readString = function(quote) {\n var out = \"\", chunkStart = ++this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(this.start, \"Unterminated string constant\"); }\n var ch = this.input.charCodeAt(this.pos);\n if (ch === quote) { break }\n if (ch === 92) { // '\\'\n out += this.input.slice(chunkStart, this.pos);\n out += this.readEscapedChar(false);\n chunkStart = this.pos;\n } else if (ch === 0x2028 || ch === 0x2029) {\n if (this.options.ecmaVersion < 10) { this.raise(this.start, \"Unterminated string constant\"); }\n ++this.pos;\n if (this.options.locations) {\n this.curLine++;\n this.lineStart = this.pos;\n }\n } else {\n if (isNewLine(ch)) { this.raise(this.start, \"Unterminated string constant\"); }\n ++this.pos;\n }\n }\n out += this.input.slice(chunkStart, this.pos++);\n return this.finishToken(types$1.string, out)\n};\n\n// Reads template string tokens.\n\nvar INVALID_TEMPLATE_ESCAPE_ERROR = {};\n\npp.tryReadTemplateToken = function() {\n this.inTemplateElement = true;\n try {\n this.readTmplToken();\n } catch (err) {\n if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {\n this.readInvalidTemplateToken();\n } else {\n throw err\n }\n }\n\n this.inTemplateElement = false;\n};\n\npp.invalidStringToken = function(position, message) {\n if (this.inTemplateElement && this.options.ecmaVersion >= 9) {\n throw INVALID_TEMPLATE_ESCAPE_ERROR\n } else {\n this.raise(position, message);\n }\n};\n\npp.readTmplToken = function() {\n var out = \"\", chunkStart = this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(this.start, \"Unterminated template\"); }\n var ch = this.input.charCodeAt(this.pos);\n if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'\n if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {\n if (ch === 36) {\n this.pos += 2;\n return this.finishToken(types$1.dollarBraceL)\n } else {\n ++this.pos;\n return this.finishToken(types$1.backQuote)\n }\n }\n out += this.input.slice(chunkStart, this.pos);\n return this.finishToken(types$1.template, out)\n }\n if (ch === 92) { // '\\'\n out += this.input.slice(chunkStart, this.pos);\n out += this.readEscapedChar(true);\n chunkStart = this.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.pos);\n ++this.pos;\n switch (ch) {\n case 13:\n if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }\n case 10:\n out += \"\\n\";\n break\n default:\n out += String.fromCharCode(ch);\n break\n }\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n chunkStart = this.pos;\n } else {\n ++this.pos;\n }\n }\n};\n\n// Reads a template token to search for the end, without validating any escape sequences\npp.readInvalidTemplateToken = function() {\n for (; this.pos < this.input.length; this.pos++) {\n switch (this.input[this.pos]) {\n case \"\\\\\":\n ++this.pos;\n break\n\n case \"$\":\n if (this.input[this.pos + 1] !== \"{\") { break }\n // fall through\n case \"`\":\n return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))\n\n case \"\\r\":\n if (this.input[this.pos + 1] === \"\\n\") { ++this.pos; }\n // fall through\n case \"\\n\": case \"\\u2028\": case \"\\u2029\":\n ++this.curLine;\n this.lineStart = this.pos + 1;\n break\n }\n }\n this.raise(this.start, \"Unterminated template\");\n};\n\n// Used to read escaped characters\n\npp.readEscapedChar = function(inTemplate) {\n var ch = this.input.charCodeAt(++this.pos);\n ++this.pos;\n switch (ch) {\n case 110: return \"\\n\" // 'n' -> '\\n'\n case 114: return \"\\r\" // 'r' -> '\\r'\n case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'\n case 117: return codePointToString(this.readCodePoint()) // 'u'\n case 116: return \"\\t\" // 't' -> '\\t'\n case 98: return \"\\b\" // 'b' -> '\\b'\n case 118: return \"\\u000b\" // 'v' -> '\\u000b'\n case 102: return \"\\f\" // 'f' -> '\\f'\n case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\\r\\n'\n case 10: // ' \\n'\n if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }\n return \"\"\n case 56:\n case 57:\n if (this.strict) {\n this.invalidStringToken(\n this.pos - 1,\n \"Invalid escape sequence\"\n );\n }\n if (inTemplate) {\n var codePos = this.pos - 1;\n\n this.invalidStringToken(\n codePos,\n \"Invalid escape sequence in template string\"\n );\n }\n default:\n if (ch >= 48 && ch <= 55) {\n var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];\n var octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n this.pos += octalStr.length - 1;\n ch = this.input.charCodeAt(this.pos);\n if ((octalStr !== \"0\" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {\n this.invalidStringToken(\n this.pos - 1 - octalStr.length,\n inTemplate\n ? \"Octal literal in template string\"\n : \"Octal literal in strict mode\"\n );\n }\n return String.fromCharCode(octal)\n }\n if (isNewLine(ch)) {\n // Unicode new line characters after \\ get removed from output in both\n // template literals and strings\n if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }\n return \"\"\n }\n return String.fromCharCode(ch)\n }\n};\n\n// Used to read character escape sequences ('\\x', '\\u', '\\U').\n\npp.readHexChar = function(len) {\n var codePos = this.pos;\n var n = this.readInt(16, len);\n if (n === null) { this.invalidStringToken(codePos, \"Bad character escape sequence\"); }\n return n\n};\n\n// Read an identifier, and return it as a string. Sets `this.containsEsc`\n// to whether the word contained a '\\u' escape.\n//\n// Incrementally adds only escaped chars, adding other chunks as-is\n// as a micro-optimization.\n\npp.readWord1 = function() {\n this.containsEsc = false;\n var word = \"\", first = true, chunkStart = this.pos;\n var astral = this.options.ecmaVersion >= 6;\n while (this.pos < this.input.length) {\n var ch = this.fullCharCodeAtPos();\n if (isIdentifierChar(ch, astral)) {\n this.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === 92) { // \"\\\"\n this.containsEsc = true;\n word += this.input.slice(chunkStart, this.pos);\n var escStart = this.pos;\n if (this.input.charCodeAt(++this.pos) !== 117) // \"u\"\n { this.invalidStringToken(this.pos, \"Expecting Unicode escape sequence \\\\uXXXX\"); }\n ++this.pos;\n var esc = this.readCodePoint();\n if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))\n { this.invalidStringToken(escStart, \"Invalid Unicode escape\"); }\n word += codePointToString(esc);\n chunkStart = this.pos;\n } else {\n break\n }\n first = false;\n }\n return word + this.input.slice(chunkStart, this.pos)\n};\n\n// Read an identifier or keyword token. Will check for reserved\n// words when necessary.\n\npp.readWord = function() {\n var word = this.readWord1();\n var type = types$1.name;\n if (this.keywords.test(word)) {\n type = keywords[word];\n }\n return this.finishToken(type, word)\n};\n\n// Acorn is a tiny, fast JavaScript parser written in JavaScript.\n//\n// Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and\n// various contributors and released under an MIT license.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/acornjs/acorn.git\n//\n// Please use the [github bug tracker][ghbt] to report issues.\n//\n// [ghbt]: https://github.com/acornjs/acorn/issues\n\n\nvar version = \"8.16.0\";\n\nParser.acorn = {\n Parser: Parser,\n version: version,\n defaultOptions: defaultOptions,\n Position: Position,\n SourceLocation: SourceLocation,\n getLineInfo: getLineInfo,\n Node: Node,\n TokenType: TokenType,\n tokTypes: types$1,\n keywordTypes: keywords,\n TokContext: TokContext,\n tokContexts: types,\n isIdentifierChar: isIdentifierChar,\n isIdentifierStart: isIdentifierStart,\n Token: Token,\n isNewLine: isNewLine,\n lineBreak: lineBreak,\n lineBreakG: lineBreakG,\n nonASCIIwhitespace: nonASCIIwhitespace\n};\n\n// The main exported interface (under `self.acorn` when in the\n// browser) is a `parse` function that takes a code string and returns\n// an abstract syntax tree as specified by the [ESTree spec][estree].\n//\n// [estree]: https://github.com/estree/estree\n\nfunction parse(input, options) {\n return Parser.parse(input, options)\n}\n\n// This function tries to parse a single expression at a given\n// offset in a string. Useful for parsing mixed-language formats\n// that embed JavaScript expressions.\n\nfunction parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}\n\n// Acorn is organized as a tokenizer and a recursive-descent parser.\n// The `tokenizer` export provides an interface to the tokenizer.\n\nfunction tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}\n\nexport { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types as tokContexts, types$1 as tokTypes, tokenizer, version };\n","module.exports = {\n quot: '\\u0022',\n amp: '&',\n apos: '\\u0027',\n lt: '<',\n gt: '>',\n nbsp: '\\u00A0',\n iexcl: '\\u00A1',\n cent: '\\u00A2',\n pound: '\\u00A3',\n curren: '\\u00A4',\n yen: '\\u00A5',\n brvbar: '\\u00A6',\n sect: '\\u00A7',\n uml: '\\u00A8',\n copy: '\\u00A9',\n ordf: '\\u00AA',\n laquo: '\\u00AB',\n not: '\\u00AC',\n shy: '\\u00AD',\n reg: '\\u00AE',\n macr: '\\u00AF',\n deg: '\\u00B0',\n plusmn: '\\u00B1',\n sup2: '\\u00B2',\n sup3: '\\u00B3',\n acute: '\\u00B4',\n micro: '\\u00B5',\n para: '\\u00B6',\n middot: '\\u00B7',\n cedil: '\\u00B8',\n sup1: '\\u00B9',\n ordm: '\\u00BA',\n raquo: '\\u00BB',\n frac14: '\\u00BC',\n frac12: '\\u00BD',\n frac34: '\\u00BE',\n iquest: '\\u00BF',\n Agrave: '\\u00C0',\n Aacute: '\\u00C1',\n Acirc: '\\u00C2',\n Atilde: '\\u00C3',\n Auml: '\\u00C4',\n Aring: '\\u00C5',\n AElig: '\\u00C6',\n Ccedil: '\\u00C7',\n Egrave: '\\u00C8',\n Eacute: '\\u00C9',\n Ecirc: '\\u00CA',\n Euml: '\\u00CB',\n Igrave: '\\u00CC',\n Iacute: '\\u00CD',\n Icirc: '\\u00CE',\n Iuml: '\\u00CF',\n ETH: '\\u00D0',\n Ntilde: '\\u00D1',\n Ograve: '\\u00D2',\n Oacute: '\\u00D3',\n Ocirc: '\\u00D4',\n Otilde: '\\u00D5',\n Ouml: '\\u00D6',\n times: '\\u00D7',\n Oslash: '\\u00D8',\n Ugrave: '\\u00D9',\n Uacute: '\\u00DA',\n Ucirc: '\\u00DB',\n Uuml: '\\u00DC',\n Yacute: '\\u00DD',\n THORN: '\\u00DE',\n szlig: '\\u00DF',\n agrave: '\\u00E0',\n aacute: '\\u00E1',\n acirc: '\\u00E2',\n atilde: '\\u00E3',\n auml: '\\u00E4',\n aring: '\\u00E5',\n aelig: '\\u00E6',\n ccedil: '\\u00E7',\n egrave: '\\u00E8',\n eacute: '\\u00E9',\n ecirc: '\\u00EA',\n euml: '\\u00EB',\n igrave: '\\u00EC',\n iacute: '\\u00ED',\n icirc: '\\u00EE',\n iuml: '\\u00EF',\n eth: '\\u00F0',\n ntilde: '\\u00F1',\n ograve: '\\u00F2',\n oacute: '\\u00F3',\n ocirc: '\\u00F4',\n otilde: '\\u00F5',\n ouml: '\\u00F6',\n divide: '\\u00F7',\n oslash: '\\u00F8',\n ugrave: '\\u00F9',\n uacute: '\\u00FA',\n ucirc: '\\u00FB',\n uuml: '\\u00FC',\n yacute: '\\u00FD',\n thorn: '\\u00FE',\n yuml: '\\u00FF',\n OElig: '\\u0152',\n oelig: '\\u0153',\n Scaron: '\\u0160',\n scaron: '\\u0161',\n Yuml: '\\u0178',\n fnof: '\\u0192',\n circ: '\\u02C6',\n tilde: '\\u02DC',\n Alpha: '\\u0391',\n Beta: '\\u0392',\n Gamma: '\\u0393',\n Delta: '\\u0394',\n Epsilon: '\\u0395',\n Zeta: '\\u0396',\n Eta: '\\u0397',\n Theta: '\\u0398',\n Iota: '\\u0399',\n Kappa: '\\u039A',\n Lambda: '\\u039B',\n Mu: '\\u039C',\n Nu: '\\u039D',\n Xi: '\\u039E',\n Omicron: '\\u039F',\n Pi: '\\u03A0',\n Rho: '\\u03A1',\n Sigma: '\\u03A3',\n Tau: '\\u03A4',\n Upsilon: '\\u03A5',\n Phi: '\\u03A6',\n Chi: '\\u03A7',\n Psi: '\\u03A8',\n Omega: '\\u03A9',\n alpha: '\\u03B1',\n beta: '\\u03B2',\n gamma: '\\u03B3',\n delta: '\\u03B4',\n epsilon: '\\u03B5',\n zeta: '\\u03B6',\n eta: '\\u03B7',\n theta: '\\u03B8',\n iota: '\\u03B9',\n kappa: '\\u03BA',\n lambda: '\\u03BB',\n mu: '\\u03BC',\n nu: '\\u03BD',\n xi: '\\u03BE',\n omicron: '\\u03BF',\n pi: '\\u03C0',\n rho: '\\u03C1',\n sigmaf: '\\u03C2',\n sigma: '\\u03C3',\n tau: '\\u03C4',\n upsilon: '\\u03C5',\n phi: '\\u03C6',\n chi: '\\u03C7',\n psi: '\\u03C8',\n omega: '\\u03C9',\n thetasym: '\\u03D1',\n upsih: '\\u03D2',\n piv: '\\u03D6',\n ensp: '\\u2002',\n emsp: '\\u2003',\n thinsp: '\\u2009',\n zwnj: '\\u200C',\n zwj: '\\u200D',\n lrm: '\\u200E',\n rlm: '\\u200F',\n ndash: '\\u2013',\n mdash: '\\u2014',\n lsquo: '\\u2018',\n rsquo: '\\u2019',\n sbquo: '\\u201A',\n ldquo: '\\u201C',\n rdquo: '\\u201D',\n bdquo: '\\u201E',\n dagger: '\\u2020',\n Dagger: '\\u2021',\n bull: '\\u2022',\n hellip: '\\u2026',\n permil: '\\u2030',\n prime: '\\u2032',\n Prime: '\\u2033',\n lsaquo: '\\u2039',\n rsaquo: '\\u203A',\n oline: '\\u203E',\n frasl: '\\u2044',\n euro: '\\u20AC',\n image: '\\u2111',\n weierp: '\\u2118',\n real: '\\u211C',\n trade: '\\u2122',\n alefsym: '\\u2135',\n larr: '\\u2190',\n uarr: '\\u2191',\n rarr: '\\u2192',\n darr: '\\u2193',\n harr: '\\u2194',\n crarr: '\\u21B5',\n lArr: '\\u21D0',\n uArr: '\\u21D1',\n rArr: '\\u21D2',\n dArr: '\\u21D3',\n hArr: '\\u21D4',\n forall: '\\u2200',\n part: '\\u2202',\n exist: '\\u2203',\n empty: '\\u2205',\n nabla: '\\u2207',\n isin: '\\u2208',\n notin: '\\u2209',\n ni: '\\u220B',\n prod: '\\u220F',\n sum: '\\u2211',\n minus: '\\u2212',\n lowast: '\\u2217',\n radic: '\\u221A',\n prop: '\\u221D',\n infin: '\\u221E',\n ang: '\\u2220',\n and: '\\u2227',\n or: '\\u2228',\n cap: '\\u2229',\n cup: '\\u222A',\n 'int': '\\u222B',\n there4: '\\u2234',\n sim: '\\u223C',\n cong: '\\u2245',\n asymp: '\\u2248',\n ne: '\\u2260',\n equiv: '\\u2261',\n le: '\\u2264',\n ge: '\\u2265',\n sub: '\\u2282',\n sup: '\\u2283',\n nsub: '\\u2284',\n sube: '\\u2286',\n supe: '\\u2287',\n oplus: '\\u2295',\n otimes: '\\u2297',\n perp: '\\u22A5',\n sdot: '\\u22C5',\n lceil: '\\u2308',\n rceil: '\\u2309',\n lfloor: '\\u230A',\n rfloor: '\\u230B',\n lang: '\\u2329',\n rang: '\\u232A',\n loz: '\\u25CA',\n spades: '\\u2660',\n clubs: '\\u2663',\n hearts: '\\u2665',\n diams: '\\u2666'\n};\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {}));\n})(this, (function (exports) { 'use strict';\n\n // This file was generated. Do not modify manually!\n var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\n // This file was generated. Do not modify manually!\n var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];\n\n // This file was generated. Do not modify manually!\n var nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\n // This file was generated. Do not modify manually!\n var nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u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u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n\n // These are a run-length and offset encoded representation of the\n // >0xffff code points that are a valid part of identifiers. The\n // offset starts at 0x10000, and each pair of numbers represents an\n // offset to the next range, and then a size of the range.\n\n // Reserved word lists for various dialects of the language\n\n var reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n };\n\n // And the keywords\n\n var ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n\n var keywords$1 = {\n 5: ecma5AndLessKeywords,\n \"5module\": ecma5AndLessKeywords + \" export import\",\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n };\n\n var keywordRelationalOperator = /^in(stanceof)?$/;\n\n // ## Character categories\n\n var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\n // This has a complexity linear to the value of the code. The\n // assumption is that looking up astral identifier characters is\n // rare.\n function isInAstralSet(code, set) {\n var pos = 0x10000;\n for (var i = 0; i < set.length; i += 2) {\n pos += set[i];\n if (pos > code) { return false }\n pos += set[i + 1];\n if (pos >= code) { return true }\n }\n return false\n }\n\n // Test whether a given character code starts an identifier.\n\n function isIdentifierStart(code, astral) {\n if (code < 65) { return code === 36 }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes)\n }\n\n // Test whether a given character is part of an identifier.\n\n function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }\n\n // ## Token types\n\n // The assignment of fine-grained, information-carrying type objects\n // allows the tokenizer to store the information it has about a\n // token in a way that is very cheap for the parser to look up.\n\n // All token type variables start with an underscore, to make them\n // easy to recognize.\n\n // The `beforeExpr` property is used to disambiguate between regular\n // expressions and divisions. It is set on all token types that can\n // be followed by an expression (thus, a slash after them would be a\n // regular expression).\n //\n // The `startsExpr` property is used to check if the token ends a\n // `yield` expression. It is set on all token types that either can\n // directly start an expression (like a quotation mark) or can\n // continue an expression (like the body of a string).\n //\n // `isLoop` marks a keyword as starting a loop, which is important\n // to know when parsing a label, in order to allow or disallow\n // continue jumps to that label.\n\n var TokenType = function TokenType(label, conf) {\n if ( conf === void 0 ) conf = {};\n\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop || null;\n this.updateContext = null;\n };\n\n function binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n }\n var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};\n\n // Map keyword names to token types.\n\n var keywords = {};\n\n // Succinct definitions of keyword token types\n function kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name;\n return keywords[name] = new TokenType(name, options)\n }\n\n var types$1 = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n privateId: new TokenType(\"privateId\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"</>/<=/>=\", 7),\n bitShift: binop(\"<</>>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n coalesce: binop(\"??\", 1),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\", startsExpr),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n };\n\n // Matches a whole line break (where CRLF is considered a single\n // line break). Used to count lines.\n\n var lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\n var lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n function isNewLine(code) {\n return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n }\n\n function nextLineBreak(code, from, end) {\n if ( end === void 0 ) end = code.length;\n\n for (var i = from; i < end; i++) {\n var next = code.charCodeAt(i);\n if (isNewLine(next))\n { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }\n }\n return -1\n }\n\n var nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n\n var skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\n var ref = Object.prototype;\n var hasOwnProperty = ref.hasOwnProperty;\n var toString = ref.toString;\n\n var hasOwn = Object.hasOwn || (function (obj, propName) { return (\n hasOwnProperty.call(obj, propName)\n ); });\n\n var isArray = Array.isArray || (function (obj) { return (\n toString.call(obj) === \"[object Array]\"\n ); });\n\n var regexpCache = Object.create(null);\n\n function wordsRegexp(words) {\n return regexpCache[words] || (regexpCache[words] = new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\"))\n }\n\n function codePointToString(code) {\n // UTF-16 Decoding\n if (code <= 0xFFFF) { return String.fromCharCode(code) }\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n }\n\n var loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n\n // These are used when `options.locations` is on, for the\n // `startLoc` and `endLoc` properties.\n\n var Position = function Position(line, col) {\n this.line = line;\n this.column = col;\n };\n\n Position.prototype.offset = function offset (n) {\n return new Position(this.line, this.column + n)\n };\n\n var SourceLocation = function SourceLocation(p, start, end) {\n this.start = start;\n this.end = end;\n if (p.sourceFile !== null) { this.source = p.sourceFile; }\n };\n\n // The `getLineInfo` function is mostly useful when the\n // `locations` option is off (for performance reasons) and you\n // want to find the line/column position for a given character\n // offset. `input` should be the code string that the offset refers\n // into.\n\n function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n }\n\n // A second argument must be given to configure the parser process.\n // These options are recognized (only `ecmaVersion` is required):\n\n var defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `\"latest\"`\n // (the latest version the library supports). This influences\n // support for strict mode, the set of reserved words, and support\n // for new syntax features.\n ecmaVersion: null,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"`, `\"module\"` or `\"commonjs\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called when\n // a semicolon is automatically inserted. It will be passed the\n // position of the inserted semicolon as an offset, and if\n // `locations` is enabled, it is given the location as a `{line,\n // column}` object as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program, and an import.meta expression\n // in a script isn't considered an error.\n allowImportExportEverywhere: false,\n // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: null,\n // When enabled, super identifiers are not constrained to\n // appearing in methods and do not raise an error when they appear elsewhere.\n allowSuperOutsideMethod: null,\n // When enabled, hashbang directive in the beginning of file is\n // allowed and treated as a line comment. Enabled by default when\n // `ecmaVersion` >= 2023.\n allowHashBang: false,\n // By default, the parser will verify that private properties are\n // only used in places where they are valid and have been declared.\n // Set this to false to turn such checks off.\n checkPrivateFields: true,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n // When this option has an array as value, objects representing the\n // comments are pushed to it.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n };\n\n // Interpret and default an options object\n\n var warnedAboutEcmaVersion = false;\n\n function getOptions(opts) {\n var options = {};\n\n for (var opt in defaultOptions)\n { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }\n\n if (options.ecmaVersion === \"latest\") {\n options.ecmaVersion = 1e8;\n } else if (options.ecmaVersion == null) {\n if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n warnedAboutEcmaVersion = true;\n console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n }\n options.ecmaVersion = 11;\n } else if (options.ecmaVersion >= 2015) {\n options.ecmaVersion -= 2009;\n }\n\n if (options.allowReserved == null)\n { options.allowReserved = options.ecmaVersion < 5; }\n\n if (!opts || opts.allowHashBang == null)\n { options.allowHashBang = options.ecmaVersion >= 14; }\n\n if (isArray(options.onToken)) {\n var tokens = options.onToken;\n options.onToken = function (token) { return tokens.push(token); };\n }\n if (isArray(options.onComment))\n { options.onComment = pushComment(options, options.onComment); }\n\n if (options.sourceType === \"commonjs\" && options.allowAwaitOutsideFunction)\n { throw new Error(\"Cannot use allowAwaitOutsideFunction with sourceType: commonjs\") }\n\n return options\n }\n\n function pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n var comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n };\n if (options.locations)\n { comment.loc = new SourceLocation(this, startLoc, endLoc); }\n if (options.ranges)\n { comment.range = [start, end]; }\n array.push(comment);\n }\n }\n\n // Each scope gets a bitset that may contain these flags\n var\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128,\n SCOPE_CLASS_STATIC_BLOCK = 256,\n SCOPE_CLASS_FIELD_INIT = 512,\n SCOPE_SWITCH = 1024,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n\n function functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n }\n\n // Used in checkLVal* and declareName to determine the type of a binding\n var\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n\n var Parser = function Parser(options, input, startPos) {\n this.options = options = getOptions(options);\n this.sourceFile = options.sourceFile;\n this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n var reserved = \"\";\n if (options.allowReserved !== true) {\n reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n if (options.sourceType === \"module\") { reserved += \" await\"; }\n }\n this.reservedWords = wordsRegexp(reserved);\n var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n this.reservedWordsStrict = wordsRegexp(reservedStrict);\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n this.input = String(input);\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false;\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos;\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n } else {\n this.pos = this.lineStart = 0;\n this.curLine = 1;\n }\n\n // Properties of the current token:\n // Its type\n this.type = types$1.eof;\n // For tokens that include more information than their type, the value\n this.value = null;\n // Its start and end offset\n this.start = this.end = this.pos;\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition();\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null;\n this.lastTokStart = this.lastTokEnd = this.pos;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext();\n this.exprAllowed = true;\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\";\n this.strict = this.inModule || this.strictDirective(this.pos);\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1;\n this.potentialArrowInForAwait = false;\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n // Labels in scope.\n this.labels = [];\n // Thus-far undefined exports.\n this.undefinedExports = Object.create(null);\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n { this.skipLineComment(2); }\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = [];\n this.enterScope(\n this.options.sourceType === \"commonjs\"\n // In commonjs, the top-level scope behaves like a function scope\n ? SCOPE_FUNCTION\n : SCOPE_TOP\n );\n\n // For RegExp validation\n this.regexpState = null;\n\n // The stack of private names.\n // Each element has two properties: 'declared' and 'used'.\n // When it exited from the outermost class definition, all used private names must be declared.\n this.privateNameStack = [];\n };\n\n var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };\n\n Parser.prototype.parse = function parse () {\n var node = this.options.program || this.startNode();\n this.nextToken();\n return this.parseTopLevel(node)\n };\n\n prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };\n\n prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };\n\n prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };\n\n prototypeAccessors.canAwait.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var ref = this.scopeStack[i];\n var flags = ref.flags;\n if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }\n if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }\n }\n return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n };\n\n prototypeAccessors.allowReturn.get = function () {\n if (this.inFunction) { return true }\n if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }\n return false\n };\n\n prototypeAccessors.allowSuper.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod\n };\n\n prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };\n\n prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };\n\n prototypeAccessors.allowNewDotTarget.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var ref = this.scopeStack[i];\n var flags = ref.flags;\n if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||\n ((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }\n }\n return false\n };\n\n prototypeAccessors.allowUsing.get = function () {\n var ref = this.currentScope();\n var flags = ref.flags;\n if (flags & SCOPE_SWITCH) { return false }\n if (!this.inModule && flags & SCOPE_TOP) { return false }\n return true\n };\n\n prototypeAccessors.inClassStaticBlock.get = function () {\n return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n };\n\n Parser.extend = function extend () {\n var plugins = [], len = arguments.length;\n while ( len-- ) plugins[ len ] = arguments[ len ];\n\n var cls = this;\n for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }\n return cls\n };\n\n Parser.parse = function parse (input, options) {\n return new this(options, input).parse()\n };\n\n Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {\n var parser = new this(options, input, pos);\n parser.nextToken();\n return parser.parseExpression()\n };\n\n Parser.tokenizer = function tokenizer (input, options) {\n return new this(options, input)\n };\n\n Object.defineProperties( Parser.prototype, prototypeAccessors );\n\n var pp$9 = Parser.prototype;\n\n // ## Parser utilities\n\n var literal = /^(?:'((?:\\\\[^]|[^'\\\\])*?)'|\"((?:\\\\[^]|[^\"\\\\])*?)\")/;\n pp$9.strictDirective = function(start) {\n if (this.options.ecmaVersion < 5) { return false }\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n var match = literal.exec(this.input.slice(start));\n if (!match) { return false }\n if ((match[1] || match[2]) === \"use strict\") {\n skipWhiteSpace.lastIndex = start + match[0].length;\n var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;\n var next = this.input.charAt(end);\n return next === \";\" || next === \"}\" ||\n (lineBreak.test(spaceAfter[0]) &&\n !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n }\n start += match[0].length;\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n if (this.input[start] === \";\")\n { start++; }\n }\n };\n\n // Predicate that tests whether the next token is of the given\n // type, and if yes, consumes it as a side effect.\n\n pp$9.eat = function(type) {\n if (this.type === type) {\n this.next();\n return true\n } else {\n return false\n }\n };\n\n // Tests whether parsed token is a contextual keyword.\n\n pp$9.isContextual = function(name) {\n return this.type === types$1.name && this.value === name && !this.containsEsc\n };\n\n // Consumes contextual keyword if possible.\n\n pp$9.eatContextual = function(name) {\n if (!this.isContextual(name)) { return false }\n this.next();\n return true\n };\n\n // Asserts that following token is given contextual keyword.\n\n pp$9.expectContextual = function(name) {\n if (!this.eatContextual(name)) { this.unexpected(); }\n };\n\n // Test whether a semicolon can be inserted at the current position.\n\n pp$9.canInsertSemicolon = function() {\n return this.type === types$1.eof ||\n this.type === types$1.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n };\n\n pp$9.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }\n return true\n }\n };\n\n // Consume a semicolon, or, failing that, see if we are allowed to\n // pretend that there is a semicolon at this position.\n\n pp$9.semicolon = function() {\n if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }\n };\n\n pp$9.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }\n if (!notNext)\n { this.next(); }\n return true\n }\n };\n\n // Expect a token of a given type. If found, consume it, otherwise,\n // raise an unexpected token error.\n\n pp$9.expect = function(type) {\n this.eat(type) || this.unexpected();\n };\n\n // Raise an unexpected token error.\n\n pp$9.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n };\n\n var DestructuringErrors = function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1;\n };\n\n pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) { return }\n if (refDestructuringErrors.trailingComma > -1)\n { this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\"); }\n var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n if (parens > -1) { this.raiseRecoverable(parens, isAssign ? \"Assigning to rvalue\" : \"Parenthesized pattern\"); }\n };\n\n pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) { return false }\n var shorthandAssign = refDestructuringErrors.shorthandAssign;\n var doubleProto = refDestructuringErrors.doubleProto;\n if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }\n if (shorthandAssign >= 0)\n { this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\"); }\n if (doubleProto >= 0)\n { this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\"); }\n };\n\n pp$9.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n { this.raise(this.yieldPos, \"Yield expression cannot be a default value\"); }\n if (this.awaitPos)\n { this.raise(this.awaitPos, \"Await expression cannot be a default value\"); }\n };\n\n pp$9.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n { return this.isSimpleAssignTarget(expr.expression) }\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n };\n\n var pp$8 = Parser.prototype;\n\n // ### Statement parsing\n\n // Parse a program. Initializes the parser, reads any number of\n // statements, and wraps them in a Program node. Optionally takes a\n // `program` argument. If present, the statements will be appended\n // to its body instead of creating a new node.\n\n pp$8.parseTopLevel = function(node) {\n var exports = Object.create(null);\n if (!node.body) { node.body = []; }\n while (this.type !== types$1.eof) {\n var stmt = this.parseStatement(null, true, exports);\n node.body.push(stmt);\n }\n if (this.inModule)\n { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)\n {\n var name = list[i];\n\n this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n } }\n this.adaptDirectivePrologue(node.body);\n this.next();\n node.sourceType = this.options.sourceType === \"commonjs\" ? \"script\" : this.options.sourceType;\n return this.finishNode(node, \"Program\")\n };\n\n var loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"};\n\n pp$8.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) { return false }\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91 || nextCh === 92) { return true } // '[', '\\'\n if (context) { return false }\n\n if (nextCh === 123) { return true } // '{'\n if (isIdentifierStart(nextCh)) {\n var start = next;\n do { next += nextCh <= 0xffff ? 1 : 2; }\n while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))\n if (nextCh === 92) { return true }\n var ident = this.input.slice(start, next);\n if (!keywordRelationalOperator.test(ident)) { return true }\n }\n return false\n };\n\n // check 'async [no LineTerminator here] function'\n // - 'async /*foo*/ function' is OK.\n // - 'async /*\\n*/ function' is invalid.\n pp$8.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, after;\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length ||\n !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\\' */))\n };\n\n pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {\n if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? \"await\" : \"using\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length;\n\n if (lineBreak.test(this.input.slice(this.pos, next))) { return false }\n\n if (isAwaitUsing) {\n var usingEndPos = next + 5 /* using */, after;\n if (this.input.slice(next, usingEndPos) !== \"using\" ||\n usingEndPos === this.input.length ||\n isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||\n after === 92 /* '\\' */\n ) { return false }\n\n skipWhiteSpace.lastIndex = usingEndPos;\n var skipAfterUsing = skipWhiteSpace.exec(this.input);\n next = usingEndPos + skipAfterUsing[0].length;\n if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }\n }\n\n var ch = this.fullCharCodeAt(next);\n if (!isIdentifierStart(ch) && ch !== 92 /* '\\' */) { return false }\n var idStart = next;\n do { next += ch <= 0xffff ? 1 : 2; }\n while (isIdentifierChar(ch = this.fullCharCodeAt(next)))\n if (ch === 92) { return true }\n var id = this.input.slice(idStart, next);\n if (keywordRelationalOperator.test(id) || isFor && id === \"of\") { return false }\n return true\n };\n\n pp$8.isAwaitUsing = function(isFor) {\n return this.isUsingKeyword(true, isFor)\n };\n\n pp$8.isUsing = function(isFor) {\n return this.isUsingKeyword(false, isFor)\n };\n\n // Parse a single statement.\n //\n // If expecting a statement and finding a slash operator, parse a\n // regular expression literal. This is to handle cases like\n // `if (foo) /blah/.exec(foo)`, where looking at the previous token\n // does not help.\n\n pp$8.parseStatement = function(context, topLevel, exports) {\n var starttype = this.type, node = this.startNode(), kind;\n\n if (this.isLet(context)) {\n starttype = types$1._var;\n kind = \"let\";\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case types$1._debugger: return this.parseDebuggerStatement(node)\n case types$1._do: return this.parseDoStatement(node)\n case types$1._for: return this.parseForStatement(node)\n case types$1._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) { this.unexpected(); }\n return this.parseFunctionStatement(node, false, !context)\n case types$1._class:\n if (context) { this.unexpected(); }\n return this.parseClass(node, true)\n case types$1._if: return this.parseIfStatement(node)\n case types$1._return: return this.parseReturnStatement(node)\n case types$1._switch: return this.parseSwitchStatement(node)\n case types$1._throw: return this.parseThrowStatement(node)\n case types$1._try: return this.parseTryStatement(node)\n case types$1._const: case types$1._var:\n kind = kind || this.value;\n if (context && kind !== \"var\") { this.unexpected(); }\n return this.parseVarStatement(node, kind)\n case types$1._while: return this.parseWhileStatement(node)\n case types$1._with: return this.parseWithStatement(node)\n case types$1.braceL: return this.parseBlock(true, node)\n case types$1.semi: return this.parseEmptyStatement(node)\n case types$1._export:\n case types$1._import:\n if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n if (nextCh === 40 || nextCh === 46) // '(' or '.'\n { return this.parseExpressionStatement(node, this.parseExpression()) }\n }\n\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n { this.raise(this.start, \"'import' and 'export' may only appear at the top level\"); }\n if (!this.inModule)\n { this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\"); }\n }\n return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) { this.unexpected(); }\n this.next();\n return this.parseFunctionStatement(node, true, !context)\n }\n\n var usingKind = this.isAwaitUsing(false) ? \"await using\" : this.isUsing(false) ? \"using\" : null;\n if (usingKind) {\n if (!this.allowUsing) {\n this.raise(this.start, \"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement\");\n }\n if (usingKind === \"await using\") {\n if (!this.canAwait) {\n this.raise(this.start, \"Await using cannot appear outside of async function\");\n }\n this.next();\n }\n this.next();\n this.parseVar(node, false, usingKind);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n }\n\n var maybeName = this.value, expr = this.parseExpression();\n if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon))\n { return this.parseLabeledStatement(node, maybeName, expr, context) }\n else { return this.parseExpressionStatement(node, expr) }\n }\n };\n\n pp$8.parseBreakContinueStatement = function(node, keyword) {\n var isBreak = keyword === \"break\";\n this.next();\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }\n else if (this.type !== types$1.name) { this.unexpected(); }\n else {\n node.label = this.parseIdent();\n this.semicolon();\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n var i = 0;\n for (; i < this.labels.length; ++i) {\n var lab = this.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) { break }\n if (node.label && isBreak) { break }\n }\n }\n if (i === this.labels.length) { this.raise(node.start, \"Unsyntactic \" + keyword); }\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n };\n\n pp$8.parseDebuggerStatement = function(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\")\n };\n\n pp$8.parseDoStatement = function(node) {\n this.next();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"do\");\n this.labels.pop();\n this.expect(types$1._while);\n node.test = this.parseParenExpression();\n if (this.options.ecmaVersion >= 6)\n { this.eat(types$1.semi); }\n else\n { this.semicolon(); }\n return this.finishNode(node, \"DoWhileStatement\")\n };\n\n // Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n // loop is non-trivial. Basically, we have to parse the init `var`\n // statement or expression, disallowing the `in` operator (see\n // the second parameter to `parseExpression`), and then check\n // whether the next token is `in` or `of`. When there is no init\n // part (semicolon immediately after the opening parenthesis), it\n // is a regular `for` loop.\n\n pp$8.parseForStatement = function(node) {\n this.next();\n var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n this.labels.push(loopLabel);\n this.enterScope(0);\n this.expect(types$1.parenL);\n if (this.type === types$1.semi) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, null)\n }\n var isLet = this.isLet();\n if (this.type === types$1._var || this.type === types$1._const || isLet) {\n var init$1 = this.startNode(), kind = isLet ? \"let\" : this.value;\n this.next();\n this.parseVar(init$1, true, kind);\n this.finishNode(init$1, \"VariableDeclaration\");\n return this.parseForAfterInit(node, init$1, awaitAt)\n }\n var startsWithLet = this.isContextual(\"let\"), isForOf = false;\n\n var usingKind = this.isUsing(true) ? \"using\" : this.isAwaitUsing(true) ? \"await using\" : null;\n if (usingKind) {\n var init$2 = this.startNode();\n this.next();\n if (usingKind === \"await using\") {\n if (!this.canAwait) {\n this.raise(this.start, \"Await using cannot appear outside of async function\");\n }\n this.next();\n }\n this.parseVar(init$2, true, usingKind);\n this.finishNode(init$2, \"VariableDeclaration\");\n return this.parseForAfterInit(node, init$2, awaitAt)\n }\n var containsEsc = this.containsEsc;\n var refDestructuringErrors = new DestructuringErrors;\n var initPos = this.start;\n var init = awaitAt > -1\n ? this.parseExprSubscripts(refDestructuringErrors, \"await\")\n : this.parseExpression(true, refDestructuringErrors);\n if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)\n if (this.type === types$1._in) { this.unexpected(awaitAt); }\n node.await = true;\n } else if (isForOf && this.options.ecmaVersion >= 8) {\n if (init.start === initPos && !containsEsc && init.type === \"Identifier\" && init.name === \"async\") { this.unexpected(); }\n else if (this.options.ecmaVersion >= 9) { node.await = false; }\n }\n if (startsWithLet && isForOf) { this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\"); }\n this.toAssignable(init, false, refDestructuringErrors);\n this.checkLValPattern(init);\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true);\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n };\n\n // Helper method to parse for loop after variable initialization\n pp$8.parseForAfterInit = function(node, init, awaitAt) {\n if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n };\n\n pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next();\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n };\n\n pp$8.parseIfStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\");\n node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n return this.finishNode(node, \"IfStatement\")\n };\n\n pp$8.parseReturnStatement = function(node) {\n if (!this.allowReturn)\n { this.raise(this.start, \"'return' outside of function\"); }\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }\n else { node.argument = this.parseExpression(); this.semicolon(); }\n return this.finishNode(node, \"ReturnStatement\")\n };\n\n pp$8.parseSwitchStatement = function(node) {\n this.next();\n node.discriminant = this.parseParenExpression();\n node.cases = [];\n this.expect(types$1.braceL);\n this.labels.push(switchLabel);\n this.enterScope(SCOPE_SWITCH);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n var cur;\n for (var sawDefault = false; this.type !== types$1.braceR;) {\n if (this.type === types$1._case || this.type === types$1._default) {\n var isCase = this.type === types$1._case;\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n node.cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) { this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\"); }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(types$1.colon);\n } else {\n if (!cur) { this.unexpected(); }\n cur.consequent.push(this.parseStatement(null));\n }\n }\n this.exitScope();\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n this.next(); // Closing brace\n this.labels.pop();\n return this.finishNode(node, \"SwitchStatement\")\n };\n\n pp$8.parseThrowStatement = function(node) {\n this.next();\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n { this.raise(this.lastTokEnd, \"Illegal newline after throw\"); }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\")\n };\n\n // Reused empty array added for node fields that are always empty.\n\n var empty$1 = [];\n\n pp$8.parseCatchClauseParam = function() {\n var param = this.parseBindingAtom();\n var simple = param.type === \"Identifier\";\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n this.expect(types$1.parenR);\n\n return param\n };\n\n pp$8.parseTryStatement = function(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.type === types$1._catch) {\n var clause = this.startNode();\n this.next();\n if (this.eat(types$1.parenL)) {\n clause.param = this.parseCatchClauseParam();\n } else {\n if (this.options.ecmaVersion < 10) { this.unexpected(); }\n clause.param = null;\n this.enterScope(0);\n }\n clause.body = this.parseBlock(false);\n this.exitScope();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer)\n { this.raise(node.start, \"Missing catch or finally clause\"); }\n return this.finishNode(node, \"TryStatement\")\n };\n\n pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n };\n\n pp$8.parseWhileStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"while\");\n this.labels.pop();\n return this.finishNode(node, \"WhileStatement\")\n };\n\n pp$8.parseWithStatement = function(node) {\n if (this.strict) { this.raise(this.start, \"'with' in strict mode\"); }\n this.next();\n node.object = this.parseParenExpression();\n node.body = this.parseStatement(\"with\");\n return this.finishNode(node, \"WithStatement\")\n };\n\n pp$8.parseEmptyStatement = function(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\")\n };\n\n pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)\n {\n var label = list[i$1];\n\n if (label.name === maybeName)\n { this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n } }\n var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n for (var i = this.labels.length - 1; i >= 0; i--) {\n var label$1 = this.labels[i];\n if (label$1.statementStart === node.start) {\n // Update information about previous labels on this node\n label$1.statementStart = this.start;\n label$1.kind = kind;\n } else { break }\n }\n this.labels.push({name: maybeName, kind: kind, statementStart: this.start});\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n this.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\")\n };\n\n pp$8.parseExpressionStatement = function(node, expr) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\")\n };\n\n // Parse a semicolon-enclosed block of statements, handling `\"use\n // strict\"` declarations when `allowStrict` is true (used for\n // function bodies).\n\n pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;\n if ( node === void 0 ) node = this.startNode();\n\n node.body = [];\n this.expect(types$1.braceL);\n if (createNewLexicalScope) { this.enterScope(0); }\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n if (exitStrict) { this.strict = false; }\n this.next();\n if (createNewLexicalScope) { this.exitScope(); }\n return this.finishNode(node, \"BlockStatement\")\n };\n\n // Parse a regular `for` loop. The disambiguation code in\n // `parseStatement` will already have parsed the init statement or\n // expression.\n\n pp$8.parseFor = function(node, init) {\n node.init = init;\n this.expect(types$1.semi);\n node.test = this.type === types$1.semi ? null : this.parseExpression();\n this.expect(types$1.semi);\n node.update = this.type === types$1.parenR ? null : this.parseExpression();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, \"ForStatement\")\n };\n\n // Parse a `for`/`in` and `for`/`of` loop, which are almost\n // same from parser's perspective.\n\n pp$8.parseForIn = function(node, init) {\n var isForIn = this.type === types$1._in;\n this.next();\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (\n !isForIn ||\n this.options.ecmaVersion < 8 ||\n this.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\"\n )\n ) {\n this.raise(\n init.start,\n ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n );\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n };\n\n // Parse a list of variable declarations.\n\n pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = this.startNode();\n this.parseVarId(decl, kind);\n if (this.eat(types$1.eq)) {\n decl.init = this.parseMaybeAssign(isFor);\n } else if (!allowMissingInitializer && kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected();\n } else if (!allowMissingInitializer && (kind === \"using\" || kind === \"await using\") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual(\"of\")) {\n this.raise(this.lastTokEnd, (\"Missing initializer in \" + kind + \" declaration\"));\n } else if (!allowMissingInitializer && decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n } else {\n decl.init = null;\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types$1.comma)) { break }\n }\n return node\n };\n\n pp$8.parseVarId = function(decl, kind) {\n decl.id = kind === \"using\" || kind === \"await using\"\n ? this.parseIdent()\n : this.parseBindingAtom();\n\n this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n };\n\n var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;\n\n // Parse a function declaration or literal (depending on the\n // `statement & FUNC_STATEMENT`).\n\n // Remove `allowExpressionBody` for 7.0.0, as it is only called with false\n pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n this.initFunction(node);\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))\n { this.unexpected(); }\n node.generator = this.eat(types$1.star);\n }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }\n }\n\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(node.async, node.generator));\n\n if (!(statement & FUNC_STATEMENT))\n { node.id = this.type === types$1.name ? this.parseIdent() : null; }\n\n this.parseFunctionParams(node);\n this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n };\n\n pp$8.parseFunctionParams = function(node) {\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n };\n\n // Parse a class declaration or literal (depending on the\n // `isStatement` parameter).\n\n pp$8.parseClass = function(node, isStatement) {\n this.next();\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n var oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement);\n this.parseClassSuper(node);\n var privateNameMap = this.enterClassBody();\n var classBody = this.startNode();\n var hadConstructor = false;\n classBody.body = [];\n this.expect(types$1.braceL);\n while (this.type !== types$1.braceR) {\n var element = this.parseClassElement(node.superClass !== null);\n if (element) {\n classBody.body.push(element);\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) { this.raiseRecoverable(element.start, \"Duplicate constructor in the same class\"); }\n hadConstructor = true;\n } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n }\n }\n }\n this.strict = oldStrict;\n this.next();\n node.body = this.finishNode(classBody, \"ClassBody\");\n this.exitClassBody();\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n };\n\n pp$8.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(types$1.semi)) { return null }\n\n var ecmaVersion = this.options.ecmaVersion;\n var node = this.startNode();\n var keyName = \"\";\n var isGenerator = false;\n var isAsync = false;\n var kind = \"method\";\n var isStatic = false;\n\n if (this.eatContextual(\"static\")) {\n // Parse static init block\n if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n this.parseClassStaticBlock(node);\n return node\n }\n if (this.isClassElementNameStart() || this.type === types$1.star) {\n isStatic = true;\n } else {\n keyName = \"static\";\n }\n }\n node.static = isStatic;\n if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n isAsync = true;\n } else {\n keyName = \"async\";\n }\n }\n if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n isGenerator = true;\n }\n if (!keyName && !isAsync && !isGenerator) {\n var lastValue = this.value;\n if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n if (this.isClassElementNameStart()) {\n kind = lastValue;\n } else {\n keyName = lastValue;\n }\n }\n }\n\n // Parse element name\n if (keyName) {\n // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n // The last token is any of those. Make it the element name.\n node.computed = false;\n node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n node.key.name = keyName;\n this.finishNode(node.key, \"Identifier\");\n } else {\n this.parseClassElementName(node);\n }\n\n // Parse element value\n if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n if (isConstructor && kind !== \"method\") { this.raise(node.key.start, \"Constructor can't have get/set modifier\"); }\n node.kind = isConstructor ? \"constructor\" : kind;\n this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n } else {\n this.parseClassField(node);\n }\n\n return node\n };\n\n pp$8.isClassElementNameStart = function() {\n return (\n this.type === types$1.name ||\n this.type === types$1.privateId ||\n this.type === types$1.num ||\n this.type === types$1.string ||\n this.type === types$1.bracketL ||\n this.type.keyword\n )\n };\n\n pp$8.parseClassElementName = function(element) {\n if (this.type === types$1.privateId) {\n if (this.value === \"constructor\") {\n this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n }\n element.computed = false;\n element.key = this.parsePrivateIdent();\n } else {\n this.parsePropertyName(element);\n }\n };\n\n pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n // Check key and flags\n var key = method.key;\n if (method.kind === \"constructor\") {\n if (isGenerator) { this.raise(key.start, \"Constructor can't be a generator\"); }\n if (isAsync) { this.raise(key.start, \"Constructor can't be an async method\"); }\n } else if (method.static && checkKeyName(method, \"prototype\")) {\n this.raise(key.start, \"Classes may not have a static property named prototype\");\n }\n\n // Parse value\n var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n\n // Check value\n if (method.kind === \"get\" && value.params.length !== 0)\n { this.raiseRecoverable(value.start, \"getter should have no params\"); }\n if (method.kind === \"set\" && value.params.length !== 1)\n { this.raiseRecoverable(value.start, \"setter should have exactly one param\"); }\n if (method.kind === \"set\" && value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\"); }\n\n return this.finishNode(method, \"MethodDefinition\")\n };\n\n pp$8.parseClassField = function(field) {\n if (checkKeyName(field, \"constructor\")) {\n this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n } else if (field.static && checkKeyName(field, \"prototype\")) {\n this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n }\n\n if (this.eat(types$1.eq)) {\n // To raise SyntaxError if 'arguments' exists in the initializer.\n this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);\n field.value = this.parseMaybeAssign();\n this.exitScope();\n } else {\n field.value = null;\n }\n this.semicolon();\n\n return this.finishNode(field, \"PropertyDefinition\")\n };\n\n pp$8.parseClassStaticBlock = function(node) {\n node.body = [];\n\n var oldLabels = this.labels;\n this.labels = [];\n this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n this.next();\n this.exitScope();\n this.labels = oldLabels;\n\n return this.finishNode(node, \"StaticBlock\")\n };\n\n pp$8.parseClassId = function(node, isStatement) {\n if (this.type === types$1.name) {\n node.id = this.parseIdent();\n if (isStatement)\n { this.checkLValSimple(node.id, BIND_LEXICAL, false); }\n } else {\n if (isStatement === true)\n { this.unexpected(); }\n node.id = null;\n }\n };\n\n pp$8.parseClassSuper = function(node) {\n node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;\n };\n\n pp$8.enterClassBody = function() {\n var element = {declared: Object.create(null), used: []};\n this.privateNameStack.push(element);\n return element.declared\n };\n\n pp$8.exitClassBody = function() {\n var ref = this.privateNameStack.pop();\n var declared = ref.declared;\n var used = ref.used;\n if (!this.options.checkPrivateFields) { return }\n var len = this.privateNameStack.length;\n var parent = len === 0 ? null : this.privateNameStack[len - 1];\n for (var i = 0; i < used.length; ++i) {\n var id = used[i];\n if (!hasOwn(declared, id.name)) {\n if (parent) {\n parent.used.push(id);\n } else {\n this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n }\n }\n }\n };\n\n function isPrivateNameConflicted(privateNameMap, element) {\n var name = element.key.name;\n var curr = privateNameMap[name];\n\n var next = \"true\";\n if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n next = (element.static ? \"s\" : \"i\") + element.kind;\n }\n\n // `class { get #a(){}; static set #a(_){} }` is also conflict.\n if (\n curr === \"iget\" && next === \"iset\" ||\n curr === \"iset\" && next === \"iget\" ||\n curr === \"sget\" && next === \"sset\" ||\n curr === \"sset\" && next === \"sget\"\n ) {\n privateNameMap[name] = \"true\";\n return false\n } else if (!curr) {\n privateNameMap[name] = next;\n return false\n } else {\n return true\n }\n }\n\n function checkKeyName(node, name) {\n var computed = node.computed;\n var key = node.key;\n return !computed && (\n key.type === \"Identifier\" && key.name === name ||\n key.type === \"Literal\" && key.value === name\n )\n }\n\n // Parses module export declaration.\n\n pp$8.parseExportAllDeclaration = function(node, exports) {\n if (this.options.ecmaVersion >= 11) {\n if (this.eatContextual(\"as\")) {\n node.exported = this.parseModuleExportName();\n this.checkExport(exports, node.exported, this.lastTokStart);\n } else {\n node.exported = null;\n }\n }\n this.expectContextual(\"from\");\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n this.semicolon();\n return this.finishNode(node, \"ExportAllDeclaration\")\n };\n\n pp$8.parseExport = function(node, exports) {\n this.next();\n // export * from '...'\n if (this.eat(types$1.star)) {\n return this.parseExportAllDeclaration(node, exports)\n }\n if (this.eat(types$1._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart);\n node.declaration = this.parseExportDefaultDeclaration();\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseExportDeclaration(node);\n if (node.declaration.type === \"VariableDeclaration\")\n { this.checkVariableExport(exports, node.declaration.declarations); }\n else\n { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }\n node.specifiers = [];\n node.source = null;\n if (this.options.ecmaVersion >= 16)\n { node.attributes = []; }\n } else { // export { x, y as z } [from '...']\n node.declaration = null;\n node.specifiers = this.parseExportSpecifiers(exports);\n if (this.eatContextual(\"from\")) {\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n } else {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n // check for keywords used as local names\n var spec = list[i];\n\n this.checkUnreserved(spec.local);\n // check if export is defined\n this.checkLocalExport(spec.local);\n\n if (spec.local.type === \"Literal\") {\n this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n }\n }\n\n node.source = null;\n if (this.options.ecmaVersion >= 16)\n { node.attributes = []; }\n }\n this.semicolon();\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n };\n\n pp$8.parseExportDeclaration = function(node) {\n return this.parseStatement(null)\n };\n\n pp$8.parseExportDefaultDeclaration = function() {\n var isAsync;\n if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n var fNode = this.startNode();\n this.next();\n if (isAsync) { this.next(); }\n return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)\n } else if (this.type === types$1._class) {\n var cNode = this.startNode();\n return this.parseClass(cNode, \"nullableID\")\n } else {\n var declaration = this.parseMaybeAssign();\n this.semicolon();\n return declaration\n }\n };\n\n pp$8.checkExport = function(exports, name, pos) {\n if (!exports) { return }\n if (typeof name !== \"string\")\n { name = name.type === \"Identifier\" ? name.name : name.value; }\n if (hasOwn(exports, name))\n { this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\"); }\n exports[name] = true;\n };\n\n pp$8.checkPatternExport = function(exports, pat) {\n var type = pat.type;\n if (type === \"Identifier\")\n { this.checkExport(exports, pat, pat.start); }\n else if (type === \"ObjectPattern\")\n { for (var i = 0, list = pat.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n this.checkPatternExport(exports, prop);\n } }\n else if (type === \"ArrayPattern\")\n { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n var elt = list$1[i$1];\n\n if (elt) { this.checkPatternExport(exports, elt); }\n } }\n else if (type === \"Property\")\n { this.checkPatternExport(exports, pat.value); }\n else if (type === \"AssignmentPattern\")\n { this.checkPatternExport(exports, pat.left); }\n else if (type === \"RestElement\")\n { this.checkPatternExport(exports, pat.argument); }\n };\n\n pp$8.checkVariableExport = function(exports, decls) {\n if (!exports) { return }\n for (var i = 0, list = decls; i < list.length; i += 1)\n {\n var decl = list[i];\n\n this.checkPatternExport(exports, decl.id);\n }\n };\n\n pp$8.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n };\n\n // Parses a comma-separated list of module exports.\n\n pp$8.parseExportSpecifier = function(exports) {\n var node = this.startNode();\n node.local = this.parseModuleExportName();\n\n node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n this.checkExport(\n exports,\n node.exported,\n node.exported.start\n );\n\n return this.finishNode(node, \"ExportSpecifier\")\n };\n\n pp$8.parseExportSpecifiers = function(exports) {\n var nodes = [], first = true;\n // export { x, y as z } [from '...']\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n nodes.push(this.parseExportSpecifier(exports));\n }\n return nodes\n };\n\n // Parses import declaration.\n\n pp$8.parseImport = function(node) {\n this.next();\n\n // import '...'\n if (this.type === types$1.string) {\n node.specifiers = empty$1;\n node.source = this.parseExprAtom();\n } else {\n node.specifiers = this.parseImportSpecifiers();\n this.expectContextual(\"from\");\n node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n }\n if (this.options.ecmaVersion >= 16)\n { node.attributes = this.parseWithClause(); }\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\")\n };\n\n // Parses a comma-separated list of module imports.\n\n pp$8.parseImportSpecifier = function() {\n var node = this.startNode();\n node.imported = this.parseModuleExportName();\n\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent();\n } else {\n this.checkUnreserved(node.imported);\n node.local = node.imported;\n }\n this.checkLValSimple(node.local, BIND_LEXICAL);\n\n return this.finishNode(node, \"ImportSpecifier\")\n };\n\n pp$8.parseImportDefaultSpecifier = function() {\n // import defaultObj, { x, y as z } from '...'\n var node = this.startNode();\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n return this.finishNode(node, \"ImportDefaultSpecifier\")\n };\n\n pp$8.parseImportNamespaceSpecifier = function() {\n var node = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n return this.finishNode(node, \"ImportNamespaceSpecifier\")\n };\n\n pp$8.parseImportSpecifiers = function() {\n var nodes = [], first = true;\n if (this.type === types$1.name) {\n nodes.push(this.parseImportDefaultSpecifier());\n if (!this.eat(types$1.comma)) { return nodes }\n }\n if (this.type === types$1.star) {\n nodes.push(this.parseImportNamespaceSpecifier());\n return nodes\n }\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n nodes.push(this.parseImportSpecifier());\n }\n return nodes\n };\n\n pp$8.parseWithClause = function() {\n var nodes = [];\n if (!this.eat(types$1._with)) {\n return nodes\n }\n this.expect(types$1.braceL);\n var attributeKeys = {};\n var first = true;\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var attr = this.parseImportAttribute();\n var keyName = attr.key.type === \"Identifier\" ? attr.key.name : attr.key.value;\n if (hasOwn(attributeKeys, keyName))\n { this.raiseRecoverable(attr.key.start, \"Duplicate attribute key '\" + keyName + \"'\"); }\n attributeKeys[keyName] = true;\n nodes.push(attr);\n }\n return nodes\n };\n\n pp$8.parseImportAttribute = function() {\n var node = this.startNode();\n node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\");\n this.expect(types$1.colon);\n if (this.type !== types$1.string) {\n this.unexpected();\n }\n node.value = this.parseExprAtom();\n return this.finishNode(node, \"ImportAttribute\")\n };\n\n pp$8.parseModuleExportName = function() {\n if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n var stringLiteral = this.parseLiteral(this.value);\n if (loneSurrogate.test(stringLiteral.value)) {\n this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n }\n return stringLiteral\n }\n return this.parseIdent(true)\n };\n\n // Set `ExpressionStatement#directive` property for directive prologues.\n pp$8.adaptDirectivePrologue = function(statements) {\n for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1);\n }\n };\n pp$8.isDirectiveCandidate = function(statement) {\n return (\n this.options.ecmaVersion >= 5 &&\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n };\n\n var pp$7 = Parser.prototype;\n\n // Convert existing expression atom to assignable pattern\n // if possible.\n\n pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n { this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\"); }\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.toAssignable(prop, isBinding);\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\");\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") { this.raise(node.key.start, \"Object pattern can't contain getter or setter\"); }\n this.toAssignable(node.value, isBinding);\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n this.toAssignableList(node.elements, isBinding);\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\";\n this.toAssignable(node.argument, isBinding);\n if (node.argument.type === \"AssignmentPattern\")\n { this.raise(node.argument.start, \"Rest elements cannot have a default value\"); }\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") { this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\"); }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isBinding);\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (!isBinding) { break }\n\n default:\n this.raise(node.start, \"Assigning to rvalue\");\n }\n } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n return node\n };\n\n // Convert list of expression atoms to binding list.\n\n pp$7.toAssignableList = function(exprList, isBinding) {\n var end = exprList.length;\n for (var i = 0; i < end; i++) {\n var elt = exprList[i];\n if (elt) { this.toAssignable(elt, isBinding); }\n }\n if (end) {\n var last = exprList[end - 1];\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n { this.unexpected(last.argument.start); }\n }\n return exprList\n };\n\n // Parses spread element.\n\n pp$7.parseSpread = function(refDestructuringErrors) {\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n return this.finishNode(node, \"SpreadElement\")\n };\n\n pp$7.parseRestBinding = function() {\n var node = this.startNode();\n this.next();\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== types$1.name)\n { this.unexpected(); }\n\n node.argument = this.parseBindingAtom();\n\n return this.finishNode(node, \"RestElement\")\n };\n\n // Parses lvalue (assignable) atom.\n\n pp$7.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case types$1.bracketL:\n var node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(types$1.bracketR, true, true);\n return this.finishNode(node, \"ArrayPattern\")\n\n case types$1.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n };\n\n pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (first) { first = false; }\n else { this.expect(types$1.comma); }\n if (allowEmpty && this.type === types$1.comma) {\n elts.push(null);\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === types$1.ellipsis) {\n var rest = this.parseRestBinding();\n this.parseBindingListItem(rest);\n elts.push(rest);\n if (this.type === types$1.comma) { this.raiseRecoverable(this.start, \"Comma is not permitted after the rest element\"); }\n this.expect(close);\n break\n } else {\n elts.push(this.parseAssignableListItem(allowModifiers));\n }\n }\n return elts\n };\n\n pp$7.parseAssignableListItem = function(allowModifiers) {\n var elem = this.parseMaybeDefault(this.start, this.startLoc);\n this.parseBindingListItem(elem);\n return elem\n };\n\n pp$7.parseBindingListItem = function(param) {\n return param\n };\n\n // Parses assignment pattern around given atom if possible.\n\n pp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom();\n if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.right = this.parseMaybeAssign();\n return this.finishNode(node, \"AssignmentPattern\")\n };\n\n // The following three functions all verify that a node is an lvalue —\n // something that can be bound, or assigned to. In order to do so, they perform\n // a variety of checks:\n //\n // - Check that none of the bound/assigned-to identifiers are reserved words.\n // - Record name declarations for bindings in the appropriate scope.\n // - Check duplicate argument names, if checkClashes is set.\n //\n // If a complex binding pattern is encountered (e.g., object and array\n // destructuring), the entire pattern is recursively checked.\n //\n // There are three versions of checkLVal*() appropriate for different\n // circumstances:\n //\n // - checkLValSimple() shall be used if the syntactic construct supports\n // nothing other than identifiers and member expressions. Parenthesized\n // expressions are also correctly handled. This is generally appropriate for\n // constructs for which the spec says\n //\n // > It is a Syntax Error if AssignmentTargetType of [the production] is not\n // > simple.\n //\n // It is also appropriate for checking if an identifier is valid and not\n // defined elsewhere, like import declarations or function/class identifiers.\n //\n // Examples where this is used include:\n // a += …;\n // import a from '…';\n // where a is the node to be checked.\n //\n // - checkLValPattern() shall be used if the syntactic construct supports\n // anything checkLValSimple() supports, as well as object and array\n // destructuring patterns. This is generally appropriate for constructs for\n // which the spec says\n //\n // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n // > an ArrayLiteral and AssignmentTargetType of [the production] is not\n // > simple.\n //\n // Examples where this is used include:\n // (a = …);\n // const a = …;\n // try { … } catch (a) { … }\n // where a is the node to be checked.\n //\n // - checkLValInnerPattern() shall be used if the syntactic construct supports\n // anything checkLValPattern() supports, as well as default assignment\n // patterns, rest elements, and other constructs that may appear within an\n // object or array destructuring pattern.\n //\n // As a special case, function parameters also use checkLValInnerPattern(),\n // as they also support defaults and rest constructs.\n //\n // These functions deliberately support both assignment and binding constructs,\n // as the logic for both is exceedingly similar. If the node is the target of\n // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n // should be set to the appropriate BIND_* constant, like BIND_VAR or\n // BIND_LEXICAL.\n //\n // If the function is called with a non-BIND_NONE bindingType, then\n // additionally a checkClashes object may be specified to allow checking for\n // duplicate argument names. checkClashes is ignored if the provided construct\n // is an assignment (i.e., bindingType is BIND_NONE).\n\n pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n var isBind = bindingType !== BIND_NONE;\n\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n { this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\"); }\n if (isBind) {\n if (bindingType === BIND_LEXICAL && expr.name === \"let\")\n { this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\"); }\n if (checkClashes) {\n if (hasOwn(checkClashes, expr.name))\n { this.raiseRecoverable(expr.start, \"Argument name clash\"); }\n checkClashes[expr.name] = true;\n }\n if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }\n }\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding member expression\"); }\n break\n\n case \"ParenthesizedExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding parenthesized expression\"); }\n return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n\n default:\n this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n }\n };\n\n pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"ObjectPattern\":\n for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.checkLValInnerPattern(prop, bindingType, checkClashes);\n }\n break\n\n case \"ArrayPattern\":\n for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n var elem = list$1[i$1];\n\n if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }\n }\n break\n\n default:\n this.checkLValSimple(expr, bindingType, checkClashes);\n }\n };\n\n pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n break\n\n case \"AssignmentPattern\":\n this.checkLValPattern(expr.left, bindingType, checkClashes);\n break\n\n case \"RestElement\":\n this.checkLValPattern(expr.argument, bindingType, checkClashes);\n break\n\n default:\n this.checkLValPattern(expr, bindingType, checkClashes);\n }\n };\n\n // The algorithm used to determine whether a regexp can appear at a\n // given point in the program is loosely based on sweet.js' approach.\n // See https://github.com/mozilla/sweet.js/wiki/design\n\n\n var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n this.generator = !!generator;\n };\n\n var types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, function (p) { return p.tryReadTemplateToken(); }),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n };\n\n var pp$6 = Parser.prototype;\n\n pp$6.initialContext = function() {\n return [types.b_stat]\n };\n\n pp$6.curContext = function() {\n return this.context[this.context.length - 1]\n };\n\n pp$6.braceIsBlock = function(prevType) {\n var parent = this.curContext();\n if (parent === types.f_expr || parent === types.f_stat)\n { return true }\n if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))\n { return !parent.isExpr }\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)\n { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }\n if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)\n { return true }\n if (prevType === types$1.braceL)\n { return parent === types.b_stat }\n if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)\n { return false }\n return !this.exprAllowed\n };\n\n pp$6.inGeneratorContext = function() {\n for (var i = this.context.length - 1; i >= 1; i--) {\n var context = this.context[i];\n if (context.token === \"function\")\n { return context.generator }\n }\n return false\n };\n\n pp$6.updateContext = function(prevType) {\n var update, type = this.type;\n if (type.keyword && prevType === types$1.dot)\n { this.exprAllowed = false; }\n else if (update = type.updateContext)\n { update.call(this, prevType); }\n else\n { this.exprAllowed = type.beforeExpr; }\n };\n\n // Used to handle edge cases when token context could not be inferred correctly during tokenization phase\n\n pp$6.overrideContext = function(tokenCtx) {\n if (this.curContext() !== tokenCtx) {\n this.context[this.context.length - 1] = tokenCtx;\n }\n };\n\n // Token-specific context update code\n\n types$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true;\n return\n }\n var out = this.context.pop();\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop();\n }\n this.exprAllowed = !out.isExpr;\n };\n\n types$1.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n this.exprAllowed = true;\n };\n\n types$1.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl);\n this.exprAllowed = true;\n };\n\n types$1.parenL.updateContext = function(prevType) {\n var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n this.context.push(statementParens ? types.p_stat : types.p_expr);\n this.exprAllowed = true;\n };\n\n types$1.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n };\n\n types$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== types$1._else &&\n !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))\n { this.context.push(types.f_expr); }\n else\n { this.context.push(types.f_stat); }\n this.exprAllowed = false;\n };\n\n types$1.colon.updateContext = function() {\n if (this.curContext().token === \"function\") { this.context.pop(); }\n this.exprAllowed = true;\n };\n\n types$1.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n { this.context.pop(); }\n else\n { this.context.push(types.q_tmpl); }\n this.exprAllowed = false;\n };\n\n types$1.star.updateContext = function(prevType) {\n if (prevType === types$1._function) {\n var index = this.context.length - 1;\n if (this.context[index] === types.f_expr)\n { this.context[index] = types.f_expr_gen; }\n else\n { this.context[index] = types.f_gen; }\n }\n this.exprAllowed = true;\n };\n\n types$1.name.updateContext = function(prevType) {\n var allowed = false;\n if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n { allowed = true; }\n }\n this.exprAllowed = allowed;\n };\n\n // A recursive descent parser operates by defining functions for all\n // syntactic elements, and recursively calling those, each function\n // advancing the input stream and returning an AST node. Precedence\n // of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n // instead of `(!x)[1]` is handled by the fact that the parser\n // function that parses unary prefix operators is called first, and\n // in turn calls the function that parses `[]` subscripts — that\n // way, it'll receive the node for `x[1]` already parsed, and wraps\n // *that* in the unary operator node.\n //\n // Acorn uses an [operator precedence parser][opp] to handle binary\n // operator precedence, because it is much more compact than using\n // the technique outlined above, which uses different, nesting\n // functions to specify precedence, for all of the ten binary\n // precedence levels that JavaScript defines.\n //\n // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\n\n var pp$5 = Parser.prototype;\n\n // Check if property name clashes with already added.\n // Object/class getters and setters are not allowed to clash —\n // either with each other or with an init property — and in\n // strict mode, init properties are also not allowed to be repeated.\n\n pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n { return }\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n { return }\n var key = prop.key;\n var name;\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n var kind = prop.kind;\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors) {\n if (refDestructuringErrors.doubleProto < 0) {\n refDestructuringErrors.doubleProto = key.start;\n }\n } else {\n this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n }\n propHash.proto = true;\n }\n return\n }\n name = \"$\" + name;\n var other = propHash[name];\n if (other) {\n var redefinition;\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set;\n } else {\n redefinition = other.init || other[kind];\n }\n if (redefinition)\n { this.raiseRecoverable(key.start, \"Redefinition of property\"); }\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n };\n }\n other[kind] = true;\n };\n\n // ### Expression parsing\n\n // These nest, from the most general expression type at the top to\n // 'atomic', nondivisible expression types at the bottom. Most of\n // the functions will simply let the function(s) below them parse,\n // and, *if* the syntactic construct they handle is present, wrap\n // the AST node that the inner parser gave them in another node.\n\n // Parse a full expression. The optional arguments are used to\n // forbid the `in` operator (in for loops initalization expressions)\n // and provide reference for storing '=' operator inside shorthand\n // property assignment in contexts where both object expression\n // and object pattern might appear (so it's possible to raise\n // delayed syntax error at correct position).\n\n pp$5.parseExpression = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n if (this.type === types$1.comma) {\n var node = this.startNodeAt(startPos, startLoc);\n node.expressions = [expr];\n while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n };\n\n // Parse an assignment expression. This includes applications of\n // operators like `+=`.\n\n pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) { return this.parseYield(forInit) }\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else { this.exprAllowed = false; }\n }\n\n var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n oldTrailingComma = refDestructuringErrors.trailingComma;\n oldDoubleProto = refDestructuringErrors.doubleProto;\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n } else {\n refDestructuringErrors = new DestructuringErrors;\n ownDestructuringErrors = true;\n }\n\n var startPos = this.start, startLoc = this.startLoc;\n if (this.type === types$1.parenL || this.type === types$1.name) {\n this.potentialArrowAt = this.start;\n this.potentialArrowInForAwait = forInit === \"await\";\n }\n var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }\n if (this.type.isAssign) {\n var node = this.startNodeAt(startPos, startLoc);\n node.operator = this.value;\n if (this.type === types$1.eq)\n { left = this.toAssignable(left, false, refDestructuringErrors); }\n if (!ownDestructuringErrors) {\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n }\n if (refDestructuringErrors.shorthandAssign >= left.start)\n { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly\n if (this.type === types$1.eq)\n { this.checkLValPattern(left); }\n else\n { this.checkLValSimple(left); }\n node.left = left;\n this.next();\n node.right = this.parseMaybeAssign(forInit);\n if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }\n }\n if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }\n if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }\n return left\n };\n\n // Parse a ternary conditional (`?:`) operator.\n\n pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprOps(forInit, refDestructuringErrors);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n if (this.eat(types$1.question)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssign();\n this.expect(types$1.colon);\n node.alternate = this.parseMaybeAssign(forInit);\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n };\n\n // Start the precedence parser.\n\n pp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n };\n\n // Parse binary operators with the operator precedence parsing\n // algorithm. `left` is the left-hand side of the operator.\n // `minPrec` provides context that allows the function to stop and\n // defer further parser to one of its callers when it encounters an\n // operator that has a lower precedence than the set it is parsing.\n\n pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n var prec = this.type.binop;\n if (prec != null && (!forInit || this.type !== types$1._in)) {\n if (prec > minPrec) {\n var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n var coalesce = this.type === types$1.coalesce;\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = types$1.logicalAND.binop;\n }\n var op = this.value;\n this.next();\n var startPos = this.start, startLoc = this.startLoc;\n var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n }\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n }\n }\n return left\n };\n\n pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n if (right.type === \"PrivateIdentifier\") { this.raise(right.start, \"Private identifier can only be left side of binary expression\"); }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.operator = op;\n node.right = right;\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n };\n\n // Parse unary operators, both prefix and postfix.\n\n pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n var startPos = this.start, startLoc = this.startLoc, expr;\n if (this.isContextual(\"await\") && this.canAwait) {\n expr = this.parseAwait(forInit);\n sawUnary = true;\n } else if (this.type.prefix) {\n var node = this.startNode(), update = this.type === types$1.incDec;\n node.operator = this.value;\n node.prefix = true;\n this.next();\n node.argument = this.parseMaybeUnary(null, true, update, forInit);\n this.checkExpressionErrors(refDestructuringErrors, true);\n if (update) { this.checkLValSimple(node.argument); }\n else if (this.strict && node.operator === \"delete\" && isLocalVariableAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\"); }\n else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Private fields can not be deleted\"); }\n else { sawUnary = true; }\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n } else if (!sawUnary && this.type === types$1.privateId) {\n if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }\n expr = this.parsePrivateIdent();\n // only could be private fields in 'in', such as #x in obj\n if (this.type !== types$1._in) { this.unexpected(); }\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n while (this.type.postfix && !this.canInsertSemicolon()) {\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.operator = this.value;\n node$1.prefix = false;\n node$1.argument = expr;\n this.checkLValSimple(expr);\n this.next();\n expr = this.finishNode(node$1, \"UpdateExpression\");\n }\n }\n\n if (!incDec && this.eat(types$1.starstar)) {\n if (sawUnary)\n { this.unexpected(this.lastTokStart); }\n else\n { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false) }\n } else {\n return expr\n }\n };\n\n function isLocalVariableAccess(node) {\n return (\n node.type === \"Identifier\" ||\n node.type === \"ParenthesizedExpression\" && isLocalVariableAccess(node.expression)\n )\n }\n\n function isPrivateFieldAccess(node) {\n return (\n node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression) ||\n node.type === \"ParenthesizedExpression\" && isPrivateFieldAccess(node.expression)\n )\n }\n\n // Parse call, dot, and `[]`-subscript expressions.\n\n pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\")\n { return expr }\n var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }\n if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }\n if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }\n }\n return result\n };\n\n pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n this.potentialArrowAt === base.start;\n var optionalChained = false;\n\n while (true) {\n var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n\n if (element.optional) { optionalChained = true; }\n if (element === base || element.type === \"ArrowFunctionExpression\") {\n if (optionalChained) {\n var chainNode = this.startNodeAt(startPos, startLoc);\n chainNode.expression = element;\n element = this.finishNode(chainNode, \"ChainExpression\");\n }\n return element\n }\n\n base = element;\n }\n };\n\n pp$5.shouldParseAsyncArrow = function() {\n return !this.canInsertSemicolon() && this.eat(types$1.arrow)\n };\n\n pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n };\n\n pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n var optionalSupported = this.options.ecmaVersion >= 11;\n var optional = optionalSupported && this.eat(types$1.questionDot);\n if (noCalls && optional) { this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\"); }\n\n var computed = this.eat(types$1.bracketL);\n if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.object = base;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(types$1.bracketR);\n } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n node.property = this.parsePrivateIdent();\n } else {\n node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n }\n node.computed = !!computed;\n if (optionalSupported) {\n node.optional = optional;\n }\n base = this.finishNode(node, \"MemberExpression\");\n } else if (!noCalls && this.eat(types$1.parenL)) {\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n if (this.awaitIdentPos > 0)\n { this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\"); }\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)\n }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.callee = base;\n node$1.arguments = exprList;\n if (optionalSupported) {\n node$1.optional = optional;\n }\n base = this.finishNode(node$1, \"CallExpression\");\n } else if (this.type === types$1.backQuote) {\n if (optional || optionalChained) {\n this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n }\n var node$2 = this.startNodeAt(startPos, startLoc);\n node$2.tag = base;\n node$2.quasi = this.parseTemplate({isTagged: true});\n base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n }\n return base\n };\n\n // Parse an atomic expression — either a single token that is an\n // expression, an expression started by a keyword like `function` or\n // `new`, or an expression wrapped in punctuation like `()`, `[]`,\n // or `{}`.\n\n pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === types$1.slash) { this.readRegexp(); }\n\n var node, canBeArrow = this.potentialArrowAt === this.start;\n switch (this.type) {\n case types$1._super:\n if (!this.allowSuper)\n { this.raise(this.start, \"'super' keyword outside a method\"); }\n node = this.startNode();\n this.next();\n if (this.type === types$1.parenL && !this.allowDirectSuper)\n { this.raise(node.start, \"super() call outside constructor of a subclass\"); }\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super ( Arguments )\n if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)\n { this.unexpected(); }\n return this.finishNode(node, \"Super\")\n\n case types$1._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\")\n\n case types$1.name:\n var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;\n var id = this.parseIdent(false);\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n this.overrideContext(types.f_expr);\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n }\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(types$1.arrow))\n { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n id = this.parseIdent(false);\n if (this.canInsertSemicolon() || !this.eat(types$1.arrow))\n { this.unexpected(); }\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n }\n }\n return id\n\n case types$1.regexp:\n var value = this.value;\n node = this.parseLiteral(value.value);\n node.regex = {pattern: value.pattern, flags: value.flags};\n return node\n\n case types$1.num: case types$1.string:\n return this.parseLiteral(this.value)\n\n case types$1._null: case types$1._true: case types$1._false:\n node = this.startNode();\n node.value = this.type === types$1._null ? null : this.type === types$1._true;\n node.raw = this.type.keyword;\n this.next();\n return this.finishNode(node, \"Literal\")\n\n case types$1.parenL:\n var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n { refDestructuringErrors.parenthesizedAssign = start; }\n if (refDestructuringErrors.parenthesizedBind < 0)\n { refDestructuringErrors.parenthesizedBind = start; }\n }\n return expr\n\n case types$1.bracketL:\n node = this.startNode();\n this.next();\n node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n return this.finishNode(node, \"ArrayExpression\")\n\n case types$1.braceL:\n this.overrideContext(types.b_expr);\n return this.parseObj(false, refDestructuringErrors)\n\n case types$1._function:\n node = this.startNode();\n this.next();\n return this.parseFunction(node, 0)\n\n case types$1._class:\n return this.parseClass(this.startNode(), false)\n\n case types$1._new:\n return this.parseNew()\n\n case types$1.backQuote:\n return this.parseTemplate()\n\n case types$1._import:\n if (this.options.ecmaVersion >= 11) {\n return this.parseExprImport(forNew)\n } else {\n return this.unexpected()\n }\n\n default:\n return this.parseExprAtomDefault()\n }\n };\n\n pp$5.parseExprAtomDefault = function() {\n this.unexpected();\n };\n\n pp$5.parseExprImport = function(forNew) {\n var node = this.startNode();\n\n // Consume `import` as an identifier for `import.meta`.\n // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword import\"); }\n this.next();\n\n if (this.type === types$1.parenL && !forNew) {\n return this.parseDynamicImport(node)\n } else if (this.type === types$1.dot) {\n var meta = this.startNodeAt(node.start, node.loc && node.loc.start);\n meta.name = \"import\";\n node.meta = this.finishNode(meta, \"Identifier\");\n return this.parseImportMeta(node)\n } else {\n this.unexpected();\n }\n };\n\n pp$5.parseDynamicImport = function(node) {\n this.next(); // skip `(`\n\n // Parse node.source.\n node.source = this.parseMaybeAssign();\n\n if (this.options.ecmaVersion >= 16) {\n if (!this.eat(types$1.parenR)) {\n this.expect(types$1.comma);\n if (!this.afterTrailingComma(types$1.parenR)) {\n node.options = this.parseMaybeAssign();\n if (!this.eat(types$1.parenR)) {\n this.expect(types$1.comma);\n if (!this.afterTrailingComma(types$1.parenR)) {\n this.unexpected();\n }\n }\n } else {\n node.options = null;\n }\n } else {\n node.options = null;\n }\n } else {\n // Verify ending.\n if (!this.eat(types$1.parenR)) {\n var errorPos = this.start;\n if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n } else {\n this.unexpected(errorPos);\n }\n }\n }\n\n return this.finishNode(node, \"ImportExpression\")\n };\n\n pp$5.parseImportMeta = function(node) {\n this.next(); // skip `.`\n\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n\n if (node.property.name !== \"meta\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\"); }\n if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere)\n { this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\"); }\n\n return this.finishNode(node, \"MetaProperty\")\n };\n\n pp$5.parseLiteral = function(value) {\n var node = this.startNode();\n node.value = value;\n node.raw = this.input.slice(this.start, this.end);\n if (node.raw.charCodeAt(node.raw.length - 1) === 110)\n { node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, \"\"); }\n this.next();\n return this.finishNode(node, \"Literal\")\n };\n\n pp$5.parseParenExpression = function() {\n this.expect(types$1.parenL);\n var val = this.parseExpression();\n this.expect(types$1.parenR);\n return val\n };\n\n pp$5.shouldParseArrow = function(exprList) {\n return !this.canInsertSemicolon()\n };\n\n pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;\n if (this.options.ecmaVersion >= 6) {\n this.next();\n\n var innerStartPos = this.start, innerStartLoc = this.startLoc;\n var exprList = [], first = true, lastIsComma = false;\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;\n this.yieldPos = 0;\n this.awaitPos = 0;\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== types$1.parenR) {\n first ? first = false : this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n lastIsComma = true;\n break\n } else if (this.type === types$1.ellipsis) {\n spreadStart = this.start;\n exprList.push(this.parseParenItem(this.parseRestBinding()));\n if (this.type === types$1.comma) {\n this.raiseRecoverable(\n this.start,\n \"Comma is not permitted after the rest element\"\n );\n }\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n }\n }\n var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;\n this.expect(types$1.parenR);\n\n if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n }\n\n if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }\n if (spreadStart) { this.unexpected(spreadStart); }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc);\n val.expressions = exprList;\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n val = exprList[0];\n }\n } else {\n val = this.parseParenExpression();\n }\n\n if (this.options.preserveParens) {\n var par = this.startNodeAt(startPos, startLoc);\n par.expression = val;\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n };\n\n pp$5.parseParenItem = function(item) {\n return item\n };\n\n pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n };\n\n // New's precedence is slightly tricky. It must allow its argument to\n // be a `[]` or dot subscript expression, but not a call — at least,\n // not without wrapping it in parentheses. Thus, it uses the noCalls\n // argument to parseSubscripts to prevent it from consuming the\n // argument list.\n\n var empty = [];\n\n pp$5.parseNew = function() {\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword new\"); }\n var node = this.startNode();\n this.next();\n if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {\n var meta = this.startNodeAt(node.start, node.loc && node.loc.start);\n meta.name = \"new\";\n node.meta = this.finishNode(meta, \"Identifier\");\n this.next();\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n if (node.property.name !== \"target\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\"); }\n if (!this.allowNewDotTarget)\n { this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\"); }\n return this.finishNode(node, \"MetaProperty\")\n }\n var startPos = this.start, startLoc = this.startLoc;\n node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);\n if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }\n else { node.arguments = empty; }\n return this.finishNode(node, \"NewExpression\")\n };\n\n // Parse template expression.\n\n pp$5.parseTemplateElement = function(ref) {\n var isTagged = ref.isTagged;\n\n var elem = this.startNode();\n if (this.type === types$1.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n }\n elem.value = {\n raw: this.value.replace(/\\r\\n?/g, \"\\n\"),\n cooked: null\n };\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n };\n }\n this.next();\n elem.tail = this.type === types$1.backQuote;\n return this.finishNode(elem, \"TemplateElement\")\n };\n\n pp$5.parseTemplate = function(ref) {\n if ( ref === void 0 ) ref = {};\n var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;\n\n var node = this.startNode();\n this.next();\n node.expressions = [];\n var curElt = this.parseTemplateElement({isTagged: isTagged});\n node.quasis = [curElt];\n while (!curElt.tail) {\n if (this.type === types$1.eof) { this.raise(this.pos, \"Unterminated template literal\"); }\n this.expect(types$1.dollarBraceL);\n node.expressions.push(this.parseExpression());\n this.expect(types$1.braceR);\n node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));\n }\n this.next();\n return this.finishNode(node, \"TemplateLiteral\")\n };\n\n pp$5.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n };\n\n // Parse an object literal or binding pattern.\n\n pp$5.parseObj = function(isPattern, refDestructuringErrors) {\n var node = this.startNode(), first = true, propHash = {};\n node.properties = [];\n this.next();\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var prop = this.parseProperty(isPattern, refDestructuringErrors);\n if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }\n node.properties.push(prop);\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n };\n\n pp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;\n if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false);\n if (this.type === types$1.comma) {\n this.raiseRecoverable(this.start, \"Comma is not permitted after the rest element\");\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start;\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false;\n prop.shorthand = false;\n if (isPattern || refDestructuringErrors) {\n startPos = this.start;\n startLoc = this.startLoc;\n }\n if (!isPattern)\n { isGenerator = this.eat(types$1.star); }\n }\n var containsEsc = this.containsEsc;\n this.parsePropertyName(prop);\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true;\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n this.parsePropertyName(prop);\n } else {\n isAsync = false;\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n return this.finishNode(prop, \"Property\")\n };\n\n pp$5.parseGetterSetter = function(prop) {\n var kind = prop.key.name;\n this.parsePropertyName(prop);\n prop.value = this.parseMethod(false);\n prop.kind = kind;\n var paramCount = prop.kind === \"get\" ? 0 : 1;\n if (prop.value.params.length !== paramCount) {\n var start = prop.value.start;\n if (prop.kind === \"get\")\n { this.raiseRecoverable(start, \"getter should have no params\"); }\n else\n { this.raiseRecoverable(start, \"setter should have exactly one param\"); }\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\"); }\n }\n };\n\n pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === types$1.colon)\n { this.unexpected(); }\n\n if (this.eat(types$1.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n prop.kind = \"init\";\n } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n if (isPattern) { this.unexpected(); }\n prop.method = true;\n prop.value = this.parseMethod(isGenerator, isAsync);\n prop.kind = \"init\";\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.parseGetterSetter(prop);\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.checkUnreserved(prop.key);\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = startPos; }\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else if (this.type === types$1.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n { refDestructuringErrors.shorthandAssign = this.start; }\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else {\n prop.value = this.copyNode(prop.key);\n }\n prop.kind = \"init\";\n prop.shorthand = true;\n } else { this.unexpected(); }\n };\n\n pp$5.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(types$1.bracketL)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssign();\n this.expect(types$1.bracketR);\n return prop.key\n } else {\n prop.computed = false;\n }\n }\n return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n };\n\n // Initialize empty function node.\n\n pp$5.initFunction = function(node) {\n node.id = null;\n if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }\n if (this.options.ecmaVersion >= 8) { node.async = false; }\n };\n\n // Parse object or class method.\n\n pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.initFunction(node);\n if (this.options.ecmaVersion >= 6)\n { node.generator = isGenerator; }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n this.parseFunctionBody(node, false, true, false);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"FunctionExpression\")\n };\n\n // Parse arrow function expression with given parameters.\n\n pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n this.initFunction(node);\n if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n\n node.params = this.toAssignableList(params, true);\n this.parseFunctionBody(node, true, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"ArrowFunctionExpression\")\n };\n\n // Parse function body and check parameters.\n\n pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n var isExpression = isArrowFunction && this.type !== types$1.braceL;\n var oldStrict = this.strict, useStrict = false;\n\n if (isExpression) {\n node.body = this.parseMaybeAssign(forInit);\n node.expression = true;\n this.checkParams(node, false);\n } else {\n var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end);\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n { this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\"); }\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n var oldLabels = this.labels;\n this.labels = [];\n if (useStrict) { this.strict = true; }\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }\n node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n node.expression = false;\n this.adaptDirectivePrologue(node.body.body);\n this.labels = oldLabels;\n }\n this.exitScope();\n };\n\n pp$5.isSimpleParamList = function(params) {\n for (var i = 0, list = params; i < list.length; i += 1)\n {\n var param = list[i];\n\n if (param.type !== \"Identifier\") { return false\n } }\n return true\n };\n\n // Checks function params for various disallowed patterns such as using \"eval\"\n // or \"arguments\" and duplicate parameters.\n\n pp$5.checkParams = function(node, allowDuplicates) {\n var nameHash = Object.create(null);\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n }\n };\n\n // Parses a comma-separated list of expressions, and returns them as\n // an array. `close` is the token type that ends the list, and\n // `allowEmpty` can be turned on to allow subsequent commas with\n // nothing in between them to be parsed as `null` (which is needed\n // for array literals).\n\n pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (!first) {\n this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(close)) { break }\n } else { first = false; }\n\n var elt = (void 0);\n if (allowEmpty && this.type === types$1.comma)\n { elt = null; }\n else if (this.type === types$1.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors);\n if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)\n { refDestructuringErrors.trailingComma = this.start; }\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors);\n }\n elts.push(elt);\n }\n return elts\n };\n\n pp$5.checkUnreserved = function(ref) {\n var start = ref.start;\n var end = ref.end;\n var name = ref.name;\n\n if (this.inGenerator && name === \"yield\")\n { this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\"); }\n if (this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\"); }\n if (!(this.currentThisScope().flags & SCOPE_VAR) && name === \"arguments\")\n { this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\"); }\n if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\"))\n { this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\")); }\n if (this.keywords.test(name))\n { this.raise(start, (\"Unexpected keyword '\" + name + \"'\")); }\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) { return }\n var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\"); }\n this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n }\n };\n\n // Parse the next token as an identifier. If `liberal` is true (used\n // when parsing properties), it will also convert keywords into\n // identifiers.\n\n pp$5.parseIdent = function(liberal) {\n var node = this.parseIdentNode();\n this.next(!!liberal);\n this.finishNode(node, \"Identifier\");\n if (!liberal) {\n this.checkUnreserved(node);\n if (node.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = node.start; }\n }\n return node\n };\n\n pp$5.parseIdentNode = function() {\n var node = this.startNode();\n if (this.type === types$1.name) {\n node.name = this.value;\n } else if (this.type.keyword) {\n node.name = this.type.keyword;\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop();\n }\n this.type = types$1.name;\n } else {\n this.unexpected();\n }\n return node\n };\n\n pp$5.parsePrivateIdent = function() {\n var node = this.startNode();\n if (this.type === types$1.privateId) {\n node.name = this.value;\n } else {\n this.unexpected();\n }\n this.next();\n this.finishNode(node, \"PrivateIdentifier\");\n\n // For validating existence\n if (this.options.checkPrivateFields) {\n if (this.privateNameStack.length === 0) {\n this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n } else {\n this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n }\n }\n\n return node\n };\n\n // Parses yield expression inside generator.\n\n pp$5.parseYield = function(forInit) {\n if (!this.yieldPos) { this.yieldPos = this.start; }\n\n var node = this.startNode();\n this.next();\n if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n node.delegate = false;\n node.argument = null;\n } else {\n node.delegate = this.eat(types$1.star);\n node.argument = this.parseMaybeAssign(forInit);\n }\n return this.finishNode(node, \"YieldExpression\")\n };\n\n pp$5.parseAwait = function(forInit) {\n if (!this.awaitPos) { this.awaitPos = this.start; }\n\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeUnary(null, true, false, forInit);\n return this.finishNode(node, \"AwaitExpression\")\n };\n\n var pp$4 = Parser.prototype;\n\n // This function is used to raise exceptions on parse errors. It\n // takes an offset integer (into the current `input`) to indicate\n // the location of the error, attaches the position to the end\n // of the error message, and then raises a `SyntaxError` with that\n // message.\n\n pp$4.raise = function(pos, message) {\n var loc = getLineInfo(this.input, pos);\n message += \" (\" + loc.line + \":\" + loc.column + \")\";\n if (this.sourceFile) {\n message += \" in \" + this.sourceFile;\n }\n var err = new SyntaxError(message);\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos;\n throw err\n };\n\n pp$4.raiseRecoverable = pp$4.raise;\n\n pp$4.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n };\n\n var pp$3 = Parser.prototype;\n\n var Scope = function Scope(flags) {\n this.flags = flags;\n // A list of var-declared names in the current lexical scope\n this.var = [];\n // A list of lexically-declared names in the current lexical scope\n this.lexical = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = [];\n };\n\n // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\n pp$3.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags));\n };\n\n pp$3.exitScope = function() {\n this.scopeStack.pop();\n };\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n pp$3.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n };\n\n pp$3.declareName = function(name, bindingType, pos) {\n var redeclared = false;\n if (bindingType === BIND_LEXICAL) {\n var scope = this.currentScope();\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n scope.lexical.push(name);\n if (this.inModule && (scope.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n var scope$1 = this.currentScope();\n scope$1.lexical.push(name);\n } else if (bindingType === BIND_FUNCTION) {\n var scope$2 = this.currentScope();\n if (this.treatFunctionsAsVar)\n { redeclared = scope$2.lexical.indexOf(name) > -1; }\n else\n { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }\n scope$2.functions.push(name);\n } else {\n for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n var scope$3 = this.scopeStack[i];\n if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n redeclared = true;\n break\n }\n scope$3.var.push(name);\n if (this.inModule && (scope$3.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n if (scope$3.flags & SCOPE_VAR) { break }\n }\n }\n if (redeclared) { this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\")); }\n };\n\n pp$3.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id;\n }\n };\n\n pp$3.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n };\n\n pp$3.currentVarScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }\n }\n };\n\n // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n pp$3.currentThisScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&\n !(scope.flags & SCOPE_ARROW)) { return scope }\n }\n };\n\n var Node = function Node(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n if (parser.options.locations)\n { this.loc = new SourceLocation(parser, loc); }\n if (parser.options.directSourceFile)\n { this.sourceFile = parser.options.directSourceFile; }\n if (parser.options.ranges)\n { this.range = [pos, 0]; }\n };\n\n // Start an AST node, attaching a start offset.\n\n var pp$2 = Parser.prototype;\n\n pp$2.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n };\n\n pp$2.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n };\n\n // Finish an AST node, adding `type` and `end` properties.\n\n function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }\n\n pp$2.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n };\n\n // Finish node at given position\n\n pp$2.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n };\n\n pp$2.copyNode = function(node) {\n var newNode = new Node(this, node.start, this.startLoc);\n for (var prop in node) { newNode[prop] = node[prop]; }\n return newNode\n };\n\n // This file was generated by \"bin/generate-unicode-script-values.js\". Do not modify manually!\n var scriptValuesAddedInUnicode = \"Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz\";\n\n // This file contains Unicode properties extracted from the ECMAScript specification.\n // The lists are extracted like so:\n // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n // #table-binary-unicode-properties\n var ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\n var ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\n var ecma11BinaryProperties = ecma10BinaryProperties;\n var ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\n var ecma13BinaryProperties = ecma12BinaryProperties;\n var ecma14BinaryProperties = ecma13BinaryProperties;\n\n var unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma10BinaryProperties,\n 11: ecma11BinaryProperties,\n 12: ecma12BinaryProperties,\n 13: ecma13BinaryProperties,\n 14: ecma14BinaryProperties\n };\n\n // #table-binary-unicode-properties-of-strings\n var ecma14BinaryPropertiesOfStrings = \"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji\";\n\n var unicodeBinaryPropertiesOfStrings = {\n 9: \"\",\n 10: \"\",\n 11: \"\",\n 12: \"\",\n 13: \"\",\n 14: ecma14BinaryPropertiesOfStrings\n };\n\n // #table-unicode-general-category-values\n var unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n\n // #table-unicode-script-values\n var ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\n var ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\n var ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\n var ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\n var ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\n var ecma14ScriptValues = ecma13ScriptValues + \" \" + scriptValuesAddedInUnicode;\n\n var unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma10ScriptValues,\n 11: ecma11ScriptValues,\n 12: ecma12ScriptValues,\n 13: ecma13ScriptValues,\n 14: ecma14ScriptValues\n };\n\n var data = {};\n function buildUnicodeData(ecmaVersion) {\n var d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n };\n d.nonBinary.Script_Extensions = d.nonBinary.Script;\n\n d.nonBinary.gc = d.nonBinary.General_Category;\n d.nonBinary.sc = d.nonBinary.Script;\n d.nonBinary.scx = d.nonBinary.Script_Extensions;\n }\n\n for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {\n var ecmaVersion = list[i];\n\n buildUnicodeData(ecmaVersion);\n }\n\n var pp$1 = Parser.prototype;\n\n // Track disjunction structure to determine whether a duplicate\n // capture group name is allowed because it is in a separate branch.\n var BranchID = function BranchID(parent, base) {\n // Parent disjunction branch\n this.parent = parent;\n // Identifies this set of sibling branches\n this.base = base || this;\n };\n\n BranchID.prototype.separatedFrom = function separatedFrom (alt) {\n // A branch is separate from another branch if they or any of\n // their parents are siblings in a given disjunction\n for (var self = this; self; self = self.parent) {\n for (var other = alt; other; other = other.parent) {\n if (self.base === other.base && self !== other) { return true }\n }\n }\n return false\n };\n\n BranchID.prototype.sibling = function sibling () {\n return new BranchID(this.parent, this.base)\n };\n\n var RegExpValidationState = function RegExpValidationState(parser) {\n this.parser = parser;\n this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\") + (parser.options.ecmaVersion >= 15 ? \"v\" : \"\");\n this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];\n this.source = \"\";\n this.flags = \"\";\n this.start = 0;\n this.switchU = false;\n this.switchV = false;\n this.switchN = false;\n this.pos = 0;\n this.lastIntValue = 0;\n this.lastStringValue = \"\";\n this.lastAssertionIsQuantifiable = false;\n this.numCapturingParens = 0;\n this.maxBackReference = 0;\n this.groupNames = Object.create(null);\n this.backReferenceNames = [];\n this.branchID = null;\n };\n\n RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {\n var unicodeSets = flags.indexOf(\"v\") !== -1;\n var unicode = flags.indexOf(\"u\") !== -1;\n this.start = start | 0;\n this.source = pattern + \"\";\n this.flags = flags;\n if (unicodeSets && this.parser.options.ecmaVersion >= 15) {\n this.switchU = true;\n this.switchV = true;\n this.switchN = true;\n } else {\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n this.switchV = false;\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n }\n };\n\n RegExpValidationState.prototype.raise = function raise (message) {\n this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n };\n\n // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n RegExpValidationState.prototype.at = function at (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return -1\n }\n var c = s.charCodeAt(i);\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n var next = s.charCodeAt(i + 1);\n return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n };\n\n RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return l\n }\n var c = s.charCodeAt(i), next;\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n return i + 1\n }\n return i + 2\n };\n\n RegExpValidationState.prototype.current = function current (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.pos, forceU)\n };\n\n RegExpValidationState.prototype.lookahead = function lookahead (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.nextIndex(this.pos, forceU), forceU)\n };\n\n RegExpValidationState.prototype.advance = function advance (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n this.pos = this.nextIndex(this.pos, forceU);\n };\n\n RegExpValidationState.prototype.eat = function eat (ch, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n if (this.current(forceU) === ch) {\n this.advance(forceU);\n return true\n }\n return false\n };\n\n RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var pos = this.pos;\n for (var i = 0, list = chs; i < list.length; i += 1) {\n var ch = list[i];\n\n var current = this.at(pos, forceU);\n if (current === -1 || current !== ch) {\n return false\n }\n pos = this.nextIndex(pos, forceU);\n }\n this.pos = pos;\n return true\n };\n\n /**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\n pp$1.validateRegExpFlags = function(state) {\n var validFlags = state.validFlags;\n var flags = state.flags;\n\n var u = false;\n var v = false;\n\n for (var i = 0; i < flags.length; i++) {\n var flag = flags.charAt(i);\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\");\n }\n if (flag === \"u\") { u = true; }\n if (flag === \"v\") { v = true; }\n }\n if (this.options.ecmaVersion >= 15 && u && v) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n };\n\n function hasProp(obj) {\n for (var _ in obj) { return true }\n return false\n }\n\n /**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\n pp$1.validateRegExpPattern = function(state) {\n this.regexp_pattern(state);\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {\n state.switchN = true;\n this.regexp_pattern(state);\n }\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\n pp$1.regexp_pattern = function(state) {\n state.pos = 0;\n state.lastIntValue = 0;\n state.lastStringValue = \"\";\n state.lastAssertionIsQuantifiable = false;\n state.numCapturingParens = 0;\n state.maxBackReference = 0;\n state.groupNames = Object.create(null);\n state.backReferenceNames.length = 0;\n state.branchID = null;\n\n this.regexp_disjunction(state);\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\");\n }\n if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\");\n }\n for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n var name = list[i];\n\n if (!state.groupNames[name]) {\n state.raise(\"Invalid named capture referenced\");\n }\n }\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\n pp$1.regexp_disjunction = function(state) {\n var trackDisjunction = this.options.ecmaVersion >= 16;\n if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }\n this.regexp_alternative(state);\n while (state.eat(0x7C /* | */)) {\n if (trackDisjunction) { state.branchID = state.branchID.sibling(); }\n this.regexp_alternative(state);\n }\n if (trackDisjunction) { state.branchID = state.branchID.parent; }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\n pp$1.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\n pp$1.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\");\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state);\n return true\n }\n\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\n pp$1.regexp_eatAssertion = function(state) {\n var start = state.pos;\n state.lastAssertionIsQuantifiable = false;\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start;\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n var lookbehind = false;\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */);\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state);\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\");\n }\n state.lastAssertionIsQuantifiable = !lookbehind;\n return true\n }\n }\n\n state.pos = start;\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\n pp$1.regexp_eatQuantifier = function(state, noError) {\n if ( noError === void 0 ) noError = false;\n\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */);\n return true\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\n pp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n };\n pp$1.regexp_eatBracedQuantifier = function(state, noError) {\n var start = state.pos;\n if (state.eat(0x7B /* { */)) {\n var min = 0, max = -1;\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue;\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue;\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\");\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\");\n }\n state.pos = start;\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\n pp$1.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n };\n pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n };\n pp$1.regexp_eatUncapturingGroup = function(state) {\n var start = state.pos;\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */)) {\n if (this.options.ecmaVersion >= 16) {\n var addModifiers = this.regexp_eatModifiers(state);\n var hasHyphen = state.eat(0x2D /* - */);\n if (addModifiers || hasHyphen) {\n for (var i = 0; i < addModifiers.length; i++) {\n var modifier = addModifiers.charAt(i);\n if (addModifiers.indexOf(modifier, i + 1) > -1) {\n state.raise(\"Duplicate regular expression modifiers\");\n }\n }\n if (hasHyphen) {\n var removeModifiers = this.regexp_eatModifiers(state);\n if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {\n state.raise(\"Invalid regular expression modifiers\");\n }\n for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {\n var modifier$1 = removeModifiers.charAt(i$1);\n if (\n removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||\n addModifiers.indexOf(modifier$1) > -1\n ) {\n state.raise(\"Duplicate regular expression modifiers\");\n }\n }\n }\n }\n }\n if (state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\");\n }\n }\n state.pos = start;\n }\n return false\n };\n pp$1.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state);\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\");\n }\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1;\n return true\n }\n state.raise(\"Unterminated group\");\n }\n return false\n };\n // RegularExpressionModifiers ::\n // [empty]\n // RegularExpressionModifiers RegularExpressionModifier\n pp$1.regexp_eatModifiers = function(state) {\n var modifiers = \"\";\n var ch = 0;\n while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {\n modifiers += codePointToString(ch);\n state.advance();\n }\n return modifiers\n };\n // RegularExpressionModifier :: one of\n // `i` `m` `s`\n function isRegularExpressionModifier(ch) {\n return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\n pp$1.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\n pp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\n pp$1.regexp_eatSyntaxCharacter = function(state) {\n var ch = state.current();\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n };\n function isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n // But eat eager.\n pp$1.regexp_eatPatternCharacters = function(state) {\n var start = state.pos;\n var ch = 0;\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance();\n }\n return state.pos !== start\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\n pp$1.regexp_eatExtendedPatternCharacter = function(state) {\n var ch = state.current();\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance();\n return true\n }\n return false\n };\n\n // GroupSpecifier ::\n // [empty]\n // `?` GroupName\n pp$1.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (!this.regexp_eatGroupName(state)) { state.raise(\"Invalid group\"); }\n var trackDisjunction = this.options.ecmaVersion >= 16;\n var known = state.groupNames[state.lastStringValue];\n if (known) {\n if (trackDisjunction) {\n for (var i = 0, list = known; i < list.length; i += 1) {\n var altID = list[i];\n\n if (!altID.separatedFrom(state.branchID))\n { state.raise(\"Duplicate capture group name\"); }\n }\n } else {\n state.raise(\"Duplicate capture group name\");\n }\n }\n if (trackDisjunction) {\n (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);\n } else {\n state.groupNames[state.lastStringValue] = true;\n }\n }\n };\n\n // GroupName ::\n // `<` RegExpIdentifierName `>`\n // Note: this updates `state.lastStringValue` property with the eaten name.\n pp$1.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\";\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\");\n }\n return false\n };\n\n // RegExpIdentifierName ::\n // RegExpIdentifierStart\n // RegExpIdentifierName RegExpIdentifierPart\n // Note: this updates `state.lastStringValue` property with the eaten name.\n pp$1.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\";\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n }\n return true\n }\n return false\n };\n\n // RegExpIdentifierStart ::\n // UnicodeIDStart\n // `$`\n // `_`\n // `\\` RegExpUnicodeEscapeSequence[+U]\n pp$1.regexp_eatRegExpIdentifierStart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n };\n function isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n }\n\n // RegExpIdentifierPart ::\n // UnicodeIDContinue\n // `$`\n // `_`\n // `\\` RegExpUnicodeEscapeSequence[+U]\n // <ZWNJ>\n // <ZWJ>\n pp$1.regexp_eatRegExpIdentifierPart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n };\n function isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\n pp$1.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\");\n }\n state.raise(\"Invalid escape\");\n }\n return false\n };\n pp$1.regexp_eatBackReference = function(state) {\n var start = state.pos;\n if (this.regexp_eatDecimalEscape(state)) {\n var n = state.lastIntValue;\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n;\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start;\n }\n return false\n };\n pp$1.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue);\n return true\n }\n state.raise(\"Invalid named reference\");\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\n pp$1.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n };\n pp$1.regexp_eatCControlLetter = function(state) {\n var start = state.pos;\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n };\n pp$1.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0;\n state.advance();\n return true\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\n pp$1.regexp_eatControlEscape = function(state) {\n var ch = state.current();\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09; /* \\t */\n state.advance();\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A; /* \\n */\n state.advance();\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B; /* \\v */\n state.advance();\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C; /* \\f */\n state.advance();\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D; /* \\r */\n state.advance();\n return true\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\n pp$1.regexp_eatControlLetter = function(state) {\n var ch = state.current();\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n };\n function isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\n pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var start = state.pos;\n var switchU = forceU || state.switchU;\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n var lead = state.lastIntValue;\n if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n var leadSurrogateEnd = state.pos;\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n var trail = state.lastIntValue;\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n return true\n }\n }\n state.pos = leadSurrogateEnd;\n state.lastIntValue = lead;\n }\n return true\n }\n if (\n switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (switchU) {\n state.raise(\"Invalid unicode escape\");\n }\n state.pos = start;\n }\n\n return false\n };\n function isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\n pp$1.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F; /* / */\n return true\n }\n return false\n }\n\n var ch = state.current();\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\n pp$1.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0;\n var ch = state.current();\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n };\n\n // Return values used by character set parsing methods, needed to\n // forbid negation of sets that can match strings.\n var CharSetNone = 0; // Nothing parsed\n var CharSetOk = 1; // Construct parsed, cannot contain strings\n var CharSetString = 2; // Construct parsed, can contain strings\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\n pp$1.regexp_eatCharacterClassEscape = function(state) {\n var ch = state.current();\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1;\n state.advance();\n return CharSetOk\n }\n\n var negate = false;\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1;\n state.advance();\n var result;\n if (\n state.eat(0x7B /* { */) &&\n (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&\n state.eat(0x7D /* } */)\n ) {\n if (negate && result === CharSetString) { state.raise(\"Invalid property name\"); }\n return result\n }\n state.raise(\"Invalid property name\");\n }\n\n return CharSetNone\n };\n\n function isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n }\n\n // UnicodePropertyValueExpression ::\n // UnicodePropertyName `=` UnicodePropertyValue\n // LoneUnicodePropertyNameOrValue\n pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n var start = state.pos;\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n var name = state.lastStringValue;\n if (this.regexp_eatUnicodePropertyValue(state)) {\n var value = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n return CharSetOk\n }\n }\n state.pos = start;\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n var nameOrValue = state.lastStringValue;\n return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n }\n return CharSetNone\n };\n\n pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!hasOwn(state.unicodeProperties.nonBinary, name))\n { state.raise(\"Invalid property name\"); }\n if (!state.unicodeProperties.nonBinary[name].test(value))\n { state.raise(\"Invalid property value\"); }\n };\n\n pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }\n if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }\n state.raise(\"Invalid property name\");\n };\n\n // UnicodePropertyName ::\n // UnicodePropertyNameCharacters\n pp$1.regexp_eatUnicodePropertyName = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n };\n\n function isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n }\n\n // UnicodePropertyValue ::\n // UnicodePropertyValueCharacters\n pp$1.regexp_eatUnicodePropertyValue = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n };\n function isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n }\n\n // LoneUnicodePropertyNameOrValue ::\n // UnicodePropertyValueCharacters\n pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\n pp$1.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n var negate = state.eat(0x5E /* ^ */);\n var result = this.regexp_classContents(state);\n if (!state.eat(0x5D /* ] */))\n { state.raise(\"Unterminated character class\"); }\n if (negate && result === CharSetString)\n { state.raise(\"Negated character class may contain strings\"); }\n return true\n }\n return false\n };\n\n // https://tc39.es/ecma262/#prod-ClassContents\n // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n pp$1.regexp_classContents = function(state) {\n if (state.current() === 0x5D /* ] */) { return CharSetOk }\n if (state.switchV) { return this.regexp_classSetExpression(state) }\n this.regexp_nonEmptyClassRanges(state);\n return CharSetOk\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\n pp$1.regexp_nonEmptyClassRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n var right = state.lastIntValue;\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\");\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n }\n }\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\n pp$1.regexp_eatClassAtom = function(state) {\n var start = state.pos;\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n var ch$1 = state.current();\n if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n state.raise(\"Invalid class escape\");\n }\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n\n var ch = state.current();\n if (ch !== 0x5D /* ] */) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\n pp$1.regexp_eatClassEscape = function(state) {\n var start = state.pos;\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* <BS> */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D; /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetExpression\n // https://tc39.es/ecma262/#prod-ClassUnion\n // https://tc39.es/ecma262/#prod-ClassIntersection\n // https://tc39.es/ecma262/#prod-ClassSubtraction\n pp$1.regexp_classSetExpression = function(state) {\n var result = CharSetOk, subResult;\n if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {\n if (subResult === CharSetString) { result = CharSetString; }\n // https://tc39.es/ecma262/#prod-ClassIntersection\n var start = state.pos;\n while (state.eatChars([0x26, 0x26] /* && */)) {\n if (\n state.current() !== 0x26 /* & */ &&\n (subResult = this.regexp_eatClassSetOperand(state))\n ) {\n if (subResult !== CharSetString) { result = CharSetOk; }\n continue\n }\n state.raise(\"Invalid character in character class\");\n }\n if (start !== state.pos) { return result }\n // https://tc39.es/ecma262/#prod-ClassSubtraction\n while (state.eatChars([0x2D, 0x2D] /* -- */)) {\n if (this.regexp_eatClassSetOperand(state)) { continue }\n state.raise(\"Invalid character in character class\");\n }\n if (start !== state.pos) { return result }\n } else {\n state.raise(\"Invalid character in character class\");\n }\n // https://tc39.es/ecma262/#prod-ClassUnion\n for (;;) {\n if (this.regexp_eatClassSetRange(state)) { continue }\n subResult = this.regexp_eatClassSetOperand(state);\n if (!subResult) { return result }\n if (subResult === CharSetString) { result = CharSetString; }\n }\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetRange\n pp$1.regexp_eatClassSetRange = function(state) {\n var start = state.pos;\n if (this.regexp_eatClassSetCharacter(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {\n var right = state.lastIntValue;\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n return true\n }\n state.pos = start;\n }\n return false\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetOperand\n pp$1.regexp_eatClassSetOperand = function(state) {\n if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }\n return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)\n };\n\n // https://tc39.es/ecma262/#prod-NestedClass\n pp$1.regexp_eatNestedClass = function(state) {\n var start = state.pos;\n if (state.eat(0x5B /* [ */)) {\n var negate = state.eat(0x5E /* ^ */);\n var result = this.regexp_classContents(state);\n if (state.eat(0x5D /* ] */)) {\n if (negate && result === CharSetString) {\n state.raise(\"Negated character class may contain strings\");\n }\n return result\n }\n state.pos = start;\n }\n if (state.eat(0x5C /* \\ */)) {\n var result$1 = this.regexp_eatCharacterClassEscape(state);\n if (result$1) {\n return result$1\n }\n state.pos = start;\n }\n return null\n };\n\n // https://tc39.es/ecma262/#prod-ClassStringDisjunction\n pp$1.regexp_eatClassStringDisjunction = function(state) {\n var start = state.pos;\n if (state.eatChars([0x5C, 0x71] /* \\q */)) {\n if (state.eat(0x7B /* { */)) {\n var result = this.regexp_classStringDisjunctionContents(state);\n if (state.eat(0x7D /* } */)) {\n return result\n }\n } else {\n // Make the same message as V8.\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return null\n };\n\n // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents\n pp$1.regexp_classStringDisjunctionContents = function(state) {\n var result = this.regexp_classString(state);\n while (state.eat(0x7C /* | */)) {\n if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }\n }\n return result\n };\n\n // https://tc39.es/ecma262/#prod-ClassString\n // https://tc39.es/ecma262/#prod-NonEmptyClassString\n pp$1.regexp_classString = function(state) {\n var count = 0;\n while (this.regexp_eatClassSetCharacter(state)) { count++; }\n return count === 1 ? CharSetOk : CharSetString\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetCharacter\n pp$1.regexp_eatClassSetCharacter = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (\n this.regexp_eatCharacterEscape(state) ||\n this.regexp_eatClassSetReservedPunctuator(state)\n ) {\n return true\n }\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* <BS> */\n return true\n }\n state.pos = start;\n return false\n }\n var ch = state.current();\n if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }\n if (isClassSetSyntaxCharacter(ch)) { return false }\n state.advance();\n state.lastIntValue = ch;\n return true\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator\n function isClassSetReservedDoublePunctuatorCharacter(ch) {\n return (\n ch === 0x21 /* ! */ ||\n ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||\n ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||\n ch === 0x2E /* . */ ||\n ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||\n ch === 0x5E /* ^ */ ||\n ch === 0x60 /* ` */ ||\n ch === 0x7E /* ~ */\n )\n }\n\n // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter\n function isClassSetSyntaxCharacter(ch) {\n return (\n ch === 0x28 /* ( */ ||\n ch === 0x29 /* ) */ ||\n ch === 0x2D /* - */ ||\n ch === 0x2F /* / */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n }\n\n // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator\n pp$1.regexp_eatClassSetReservedPunctuator = function(state) {\n var ch = state.current();\n if (isClassSetReservedPunctuator(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n };\n\n // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator\n function isClassSetReservedPunctuator(ch) {\n return (\n ch === 0x21 /* ! */ ||\n ch === 0x23 /* # */ ||\n ch === 0x25 /* % */ ||\n ch === 0x26 /* & */ ||\n ch === 0x2C /* , */ ||\n ch === 0x2D /* - */ ||\n ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||\n ch === 0x40 /* @ */ ||\n ch === 0x60 /* ` */ ||\n ch === 0x7E /* ~ */\n )\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\n pp$1.regexp_eatClassControlLetter = function(state) {\n var ch = state.current();\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n pp$1.regexp_eatHexEscapeSequence = function(state) {\n var start = state.pos;\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\n pp$1.regexp_eatDecimalDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n }\n return state.pos !== start\n };\n function isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\n pp$1.regexp_eatHexDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return state.pos !== start\n };\n function isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n }\n function hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n // Allows only 0-377(octal) i.e. 0-255(decimal).\n pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n var n1 = state.lastIntValue;\n if (this.regexp_eatOctalDigit(state)) {\n var n2 = state.lastIntValue;\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n } else {\n state.lastIntValue = n1 * 8 + n2;\n }\n } else {\n state.lastIntValue = n1;\n }\n return true\n }\n return false\n };\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\n pp$1.regexp_eatOctalDigit = function(state) {\n var ch = state.current();\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30; /* 0 */\n state.advance();\n return true\n }\n state.lastIntValue = 0;\n return false\n };\n function isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n }\n\n // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n pp$1.regexp_eatFixedHexDigits = function(state, length) {\n var start = state.pos;\n state.lastIntValue = 0;\n for (var i = 0; i < length; ++i) {\n var ch = state.current();\n if (!isHexDigit(ch)) {\n state.pos = start;\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return true\n };\n\n // Object type used to represent tokens. Note that normally, tokens\n // simply exist as properties on the parser object. This is only\n // used for the onToken callback and the external tokenizer.\n\n var Token = function Token(p) {\n this.type = p.type;\n this.value = p.value;\n this.start = p.start;\n this.end = p.end;\n if (p.options.locations)\n { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }\n if (p.options.ranges)\n { this.range = [p.start, p.end]; }\n };\n\n // ## Tokenizer\n\n var pp = Parser.prototype;\n\n // Move to the next token\n\n pp.next = function(ignoreEscapeSequenceInKeyword) {\n if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)\n { this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword); }\n if (this.options.onToken)\n { this.options.onToken(new Token(this)); }\n\n this.lastTokEnd = this.end;\n this.lastTokStart = this.start;\n this.lastTokEndLoc = this.endLoc;\n this.lastTokStartLoc = this.startLoc;\n this.nextToken();\n };\n\n pp.getToken = function() {\n this.next();\n return new Token(this)\n };\n\n // If we're in an ES6 environment, make parsers iterable\n if (typeof Symbol !== \"undefined\")\n { pp[Symbol.iterator] = function() {\n var this$1$1 = this;\n\n return {\n next: function () {\n var token = this$1$1.getToken();\n return {\n done: token.type === types$1.eof,\n value: token\n }\n }\n }\n }; }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n pp.nextToken = function() {\n var curContext = this.curContext();\n if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }\n\n this.start = this.pos;\n if (this.options.locations) { this.startLoc = this.curPosition(); }\n if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }\n\n if (curContext.override) { return curContext.override(this) }\n else { this.readToken(this.fullCharCodeAtPos()); }\n };\n\n pp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n { return this.readWord() }\n\n return this.getTokenFromCode(code)\n };\n\n pp.fullCharCodeAt = function(pos) {\n var code = this.input.charCodeAt(pos);\n if (code <= 0xd7ff || code >= 0xdc00) { return code }\n var next = this.input.charCodeAt(pos + 1);\n return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n };\n\n pp.fullCharCodeAtPos = function() {\n return this.fullCharCodeAt(this.pos)\n };\n\n pp.skipBlockComment = function() {\n var startLoc = this.options.onComment && this.curPosition();\n var start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2);\n if (end === -1) { this.raise(this.pos - 2, \"Unterminated comment\"); }\n this.pos = end + 2;\n if (this.options.locations) {\n for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n ++this.curLine;\n pos = this.lineStart = nextBreak;\n }\n }\n if (this.options.onComment)\n { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition()); }\n };\n\n pp.skipLineComment = function(startSkip) {\n var start = this.pos;\n var startLoc = this.options.onComment && this.curPosition();\n var ch = this.input.charCodeAt(this.pos += startSkip);\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos);\n }\n if (this.options.onComment)\n { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition()); }\n };\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n pp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n var ch = this.input.charCodeAt(this.pos);\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos;\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos;\n }\n case 10: case 8232: case 8233:\n ++this.pos;\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment();\n break\n case 47:\n this.skipLineComment(2);\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos;\n } else {\n break loop\n }\n }\n }\n };\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `exprAllowed`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n pp.finishToken = function(type, val) {\n this.end = this.pos;\n if (this.options.locations) { this.endLoc = this.curPosition(); }\n var prevType = this.type;\n this.type = type;\n this.value = val;\n\n this.updateContext(prevType);\n };\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n //\n pp.readToken_dot = function() {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next >= 48 && next <= 57) { return this.readNumber(true) }\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3;\n return this.finishToken(types$1.ellipsis)\n } else {\n ++this.pos;\n return this.finishToken(types$1.dot)\n }\n };\n\n pp.readToken_slash = function() { // '/'\n var next = this.input.charCodeAt(this.pos + 1);\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.slash, 1)\n };\n\n pp.readToken_mult_modulo_exp = function(code) { // '%*'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n var tokentype = code === 42 ? types$1.star : types$1.modulo;\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size;\n tokentype = types$1.starstar;\n next = this.input.charCodeAt(this.pos + 2);\n }\n\n if (next === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(tokentype, size)\n };\n\n pp.readToken_pipe_amp = function(code) { // '|&'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (this.options.ecmaVersion >= 12) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n };\n\n pp.readToken_caret = function() { // '^'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.bitwiseXOR, 1)\n };\n\n pp.readToken_plus_min = function(code) { // '+-'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types$1.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.plusMin, 1)\n };\n\n pp.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(types$1.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `<!--`, an XML-style comment that should be interpreted as a line comment\n this.skipLineComment(4);\n this.skipSpace();\n return this.nextToken()\n }\n if (next === 61) { size = 2; }\n return this.finishOp(types$1.relational, size)\n };\n\n pp.readToken_eq_excl = function(code) { // '=!'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }\n if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'\n this.pos += 2;\n return this.finishToken(types$1.arrow)\n }\n return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)\n };\n\n pp.readToken_question = function() { // '?'\n var ecmaVersion = this.options.ecmaVersion;\n if (ecmaVersion >= 11) {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 46) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }\n }\n if (next === 63) {\n if (ecmaVersion >= 12) {\n var next2$1 = this.input.charCodeAt(this.pos + 2);\n if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(types$1.coalesce, 2)\n }\n }\n return this.finishOp(types$1.question, 1)\n };\n\n pp.readToken_numberSign = function() { // '#'\n var ecmaVersion = this.options.ecmaVersion;\n var code = 35; // '#'\n if (ecmaVersion >= 13) {\n ++this.pos;\n code = this.fullCharCodeAtPos();\n if (isIdentifierStart(code, true) || code === 92 /* '\\' */) {\n return this.finishToken(types$1.privateId, this.readWord1())\n }\n }\n\n this.raise(this.pos, \"Unexpected character '\" + codePointToString(code) + \"'\");\n };\n\n pp.getTokenFromCode = function(code) {\n switch (code) {\n // The interpretation of a dot depends on whether it is followed\n // by a digit or another two dots.\n case 46: // '.'\n return this.readToken_dot()\n\n // Punctuation tokens.\n case 40: ++this.pos; return this.finishToken(types$1.parenL)\n case 41: ++this.pos; return this.finishToken(types$1.parenR)\n case 59: ++this.pos; return this.finishToken(types$1.semi)\n case 44: ++this.pos; return this.finishToken(types$1.comma)\n case 91: ++this.pos; return this.finishToken(types$1.bracketL)\n case 93: ++this.pos; return this.finishToken(types$1.bracketR)\n case 123: ++this.pos; return this.finishToken(types$1.braceL)\n case 125: ++this.pos; return this.finishToken(types$1.braceR)\n case 58: ++this.pos; return this.finishToken(types$1.colon)\n\n case 96: // '`'\n if (this.options.ecmaVersion < 6) { break }\n ++this.pos;\n return this.finishToken(types$1.backQuote)\n\n case 48: // '0'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number\n if (this.options.ecmaVersion >= 6) {\n if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number\n if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number\n }\n\n // Anything else beginning with a digit is an integer, octal\n // number, or float.\n case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9\n return this.readNumber(false)\n\n // Quotes produce strings.\n case 34: case 39: // '\"', \"'\"\n return this.readString(code)\n\n // Operators are parsed inline in tiny state machines. '=' (61) is\n // often referred to. `finishOp` simply skips the amount of\n // characters it is given as second argument, and returns a token\n // of the type given by its first argument.\n case 47: // '/'\n return this.readToken_slash()\n\n case 37: case 42: // '%*'\n return this.readToken_mult_modulo_exp(code)\n\n case 124: case 38: // '|&'\n return this.readToken_pipe_amp(code)\n\n case 94: // '^'\n return this.readToken_caret()\n\n case 43: case 45: // '+-'\n return this.readToken_plus_min(code)\n\n case 60: case 62: // '<>'\n return this.readToken_lt_gt(code)\n\n case 61: case 33: // '=!'\n return this.readToken_eq_excl(code)\n\n case 63: // '?'\n return this.readToken_question()\n\n case 126: // '~'\n return this.finishOp(types$1.prefix, 1)\n\n case 35: // '#'\n return this.readToken_numberSign()\n }\n\n this.raise(this.pos, \"Unexpected character '\" + codePointToString(code) + \"'\");\n };\n\n pp.finishOp = function(type, size) {\n var str = this.input.slice(this.pos, this.pos + size);\n this.pos += size;\n return this.finishToken(type, str)\n };\n\n pp.readRegexp = function() {\n var escaped, inClass, start = this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(start, \"Unterminated regular expression\"); }\n var ch = this.input.charAt(this.pos);\n if (lineBreak.test(ch)) { this.raise(start, \"Unterminated regular expression\"); }\n if (!escaped) {\n if (ch === \"[\") { inClass = true; }\n else if (ch === \"]\" && inClass) { inClass = false; }\n else if (ch === \"/\" && !inClass) { break }\n escaped = ch === \"\\\\\";\n } else { escaped = false; }\n ++this.pos;\n }\n var pattern = this.input.slice(start, this.pos);\n ++this.pos;\n var flagsStart = this.pos;\n var flags = this.readWord1();\n if (this.containsEsc) { this.unexpected(flagsStart); }\n\n // Validate pattern\n var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));\n state.reset(start, pattern, flags);\n this.validateRegExpFlags(state);\n this.validateRegExpPattern(state);\n\n // Create Literal#value property value.\n var value = null;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n // ESTree requires null if it failed to instantiate RegExp object.\n // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral\n }\n\n return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})\n };\n\n // Read an integer in the given radix. Return null if zero digits\n // were read, the integer value otherwise. When `len` is given, this\n // will return `null` unless the integer has exactly `len` digits.\n\n pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {\n // `len` is used for character escape sequences. In that case, disallow separators.\n var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;\n\n // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)\n // and isn't fraction part nor exponent part. In that case, if the first digit\n // is zero then disallow separators.\n var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;\n\n var start = this.pos, total = 0, lastCode = 0;\n for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {\n var code = this.input.charCodeAt(this.pos), val = (void 0);\n\n if (allowSeparators && code === 95) {\n if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, \"Numeric separator is not allowed in legacy octal numeric literals\"); }\n if (lastCode === 95) { this.raiseRecoverable(this.pos, \"Numeric separator must be exactly one underscore\"); }\n if (i === 0) { this.raiseRecoverable(this.pos, \"Numeric separator is not allowed at the first of digits\"); }\n lastCode = code;\n continue\n }\n\n if (code >= 97) { val = code - 97 + 10; } // a\n else if (code >= 65) { val = code - 65 + 10; } // A\n else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9\n else { val = Infinity; }\n if (val >= radix) { break }\n lastCode = code;\n total = total * radix + val;\n }\n\n if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, \"Numeric separator is not allowed at the last of digits\"); }\n if (this.pos === start || len != null && this.pos - start !== len) { return null }\n\n return total\n };\n\n function stringToNumber(str, isLegacyOctalNumericLiteral) {\n if (isLegacyOctalNumericLiteral) {\n return parseInt(str, 8)\n }\n\n // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.\n return parseFloat(str.replace(/_/g, \"\"))\n }\n\n function stringToBigInt(str) {\n if (typeof BigInt !== \"function\") {\n return null\n }\n\n // `BigInt(value)` throws syntax error if the string contains numeric separators.\n return BigInt(str.replace(/_/g, \"\"))\n }\n\n pp.readRadixNumber = function(radix) {\n var start = this.pos;\n this.pos += 2; // 0x\n var val = this.readInt(radix);\n if (val == null) { this.raise(this.start + 2, \"Expected number in radix \" + radix); }\n if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {\n val = stringToBigInt(this.input.slice(start, this.pos));\n ++this.pos;\n } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n return this.finishToken(types$1.num, val)\n };\n\n // Read an integer, octal integer, or floating-point number.\n\n pp.readNumber = function(startsWithDot) {\n var start = this.pos;\n if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, \"Invalid number\"); }\n var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;\n if (octal && this.strict) { this.raise(start, \"Invalid number\"); }\n var next = this.input.charCodeAt(this.pos);\n if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {\n var val$1 = stringToBigInt(this.input.slice(start, this.pos));\n ++this.pos;\n if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n return this.finishToken(types$1.num, val$1)\n }\n if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }\n if (next === 46 && !octal) { // '.'\n ++this.pos;\n this.readInt(10);\n next = this.input.charCodeAt(this.pos);\n }\n if ((next === 69 || next === 101) && !octal) { // 'eE'\n next = this.input.charCodeAt(++this.pos);\n if (next === 43 || next === 45) { ++this.pos; } // '+-'\n if (this.readInt(10) === null) { this.raise(start, \"Invalid number\"); }\n }\n if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, \"Identifier directly after number\"); }\n\n var val = stringToNumber(this.input.slice(start, this.pos), octal);\n return this.finishToken(types$1.num, val)\n };\n\n // Read a string value, interpreting backslash-escapes.\n\n pp.readCodePoint = function() {\n var ch = this.input.charCodeAt(this.pos), code;\n\n if (ch === 123) { // '{'\n if (this.options.ecmaVersion < 6) { this.unexpected(); }\n var codePos = ++this.pos;\n code = this.readHexChar(this.input.indexOf(\"}\", this.pos) - this.pos);\n ++this.pos;\n if (code > 0x10FFFF) { this.invalidStringToken(codePos, \"Code point out of bounds\"); }\n } else {\n code = this.readHexChar(4);\n }\n return code\n };\n\n pp.readString = function(quote) {\n var out = \"\", chunkStart = ++this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(this.start, \"Unterminated string constant\"); }\n var ch = this.input.charCodeAt(this.pos);\n if (ch === quote) { break }\n if (ch === 92) { // '\\'\n out += this.input.slice(chunkStart, this.pos);\n out += this.readEscapedChar(false);\n chunkStart = this.pos;\n } else if (ch === 0x2028 || ch === 0x2029) {\n if (this.options.ecmaVersion < 10) { this.raise(this.start, \"Unterminated string constant\"); }\n ++this.pos;\n if (this.options.locations) {\n this.curLine++;\n this.lineStart = this.pos;\n }\n } else {\n if (isNewLine(ch)) { this.raise(this.start, \"Unterminated string constant\"); }\n ++this.pos;\n }\n }\n out += this.input.slice(chunkStart, this.pos++);\n return this.finishToken(types$1.string, out)\n };\n\n // Reads template string tokens.\n\n var INVALID_TEMPLATE_ESCAPE_ERROR = {};\n\n pp.tryReadTemplateToken = function() {\n this.inTemplateElement = true;\n try {\n this.readTmplToken();\n } catch (err) {\n if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {\n this.readInvalidTemplateToken();\n } else {\n throw err\n }\n }\n\n this.inTemplateElement = false;\n };\n\n pp.invalidStringToken = function(position, message) {\n if (this.inTemplateElement && this.options.ecmaVersion >= 9) {\n throw INVALID_TEMPLATE_ESCAPE_ERROR\n } else {\n this.raise(position, message);\n }\n };\n\n pp.readTmplToken = function() {\n var out = \"\", chunkStart = this.pos;\n for (;;) {\n if (this.pos >= this.input.length) { this.raise(this.start, \"Unterminated template\"); }\n var ch = this.input.charCodeAt(this.pos);\n if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'\n if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {\n if (ch === 36) {\n this.pos += 2;\n return this.finishToken(types$1.dollarBraceL)\n } else {\n ++this.pos;\n return this.finishToken(types$1.backQuote)\n }\n }\n out += this.input.slice(chunkStart, this.pos);\n return this.finishToken(types$1.template, out)\n }\n if (ch === 92) { // '\\'\n out += this.input.slice(chunkStart, this.pos);\n out += this.readEscapedChar(true);\n chunkStart = this.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.pos);\n ++this.pos;\n switch (ch) {\n case 13:\n if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }\n case 10:\n out += \"\\n\";\n break\n default:\n out += String.fromCharCode(ch);\n break\n }\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n chunkStart = this.pos;\n } else {\n ++this.pos;\n }\n }\n };\n\n // Reads a template token to search for the end, without validating any escape sequences\n pp.readInvalidTemplateToken = function() {\n for (; this.pos < this.input.length; this.pos++) {\n switch (this.input[this.pos]) {\n case \"\\\\\":\n ++this.pos;\n break\n\n case \"$\":\n if (this.input[this.pos + 1] !== \"{\") { break }\n // fall through\n case \"`\":\n return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))\n\n case \"\\r\":\n if (this.input[this.pos + 1] === \"\\n\") { ++this.pos; }\n // fall through\n case \"\\n\": case \"\\u2028\": case \"\\u2029\":\n ++this.curLine;\n this.lineStart = this.pos + 1;\n break\n }\n }\n this.raise(this.start, \"Unterminated template\");\n };\n\n // Used to read escaped characters\n\n pp.readEscapedChar = function(inTemplate) {\n var ch = this.input.charCodeAt(++this.pos);\n ++this.pos;\n switch (ch) {\n case 110: return \"\\n\" // 'n' -> '\\n'\n case 114: return \"\\r\" // 'r' -> '\\r'\n case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'\n case 117: return codePointToString(this.readCodePoint()) // 'u'\n case 116: return \"\\t\" // 't' -> '\\t'\n case 98: return \"\\b\" // 'b' -> '\\b'\n case 118: return \"\\u000b\" // 'v' -> '\\u000b'\n case 102: return \"\\f\" // 'f' -> '\\f'\n case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\\r\\n'\n case 10: // ' \\n'\n if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }\n return \"\"\n case 56:\n case 57:\n if (this.strict) {\n this.invalidStringToken(\n this.pos - 1,\n \"Invalid escape sequence\"\n );\n }\n if (inTemplate) {\n var codePos = this.pos - 1;\n\n this.invalidStringToken(\n codePos,\n \"Invalid escape sequence in template string\"\n );\n }\n default:\n if (ch >= 48 && ch <= 55) {\n var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];\n var octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n this.pos += octalStr.length - 1;\n ch = this.input.charCodeAt(this.pos);\n if ((octalStr !== \"0\" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {\n this.invalidStringToken(\n this.pos - 1 - octalStr.length,\n inTemplate\n ? \"Octal literal in template string\"\n : \"Octal literal in strict mode\"\n );\n }\n return String.fromCharCode(octal)\n }\n if (isNewLine(ch)) {\n // Unicode new line characters after \\ get removed from output in both\n // template literals and strings\n if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }\n return \"\"\n }\n return String.fromCharCode(ch)\n }\n };\n\n // Used to read character escape sequences ('\\x', '\\u', '\\U').\n\n pp.readHexChar = function(len) {\n var codePos = this.pos;\n var n = this.readInt(16, len);\n if (n === null) { this.invalidStringToken(codePos, \"Bad character escape sequence\"); }\n return n\n };\n\n // Read an identifier, and return it as a string. Sets `this.containsEsc`\n // to whether the word contained a '\\u' escape.\n //\n // Incrementally adds only escaped chars, adding other chunks as-is\n // as a micro-optimization.\n\n pp.readWord1 = function() {\n this.containsEsc = false;\n var word = \"\", first = true, chunkStart = this.pos;\n var astral = this.options.ecmaVersion >= 6;\n while (this.pos < this.input.length) {\n var ch = this.fullCharCodeAtPos();\n if (isIdentifierChar(ch, astral)) {\n this.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === 92) { // \"\\\"\n this.containsEsc = true;\n word += this.input.slice(chunkStart, this.pos);\n var escStart = this.pos;\n if (this.input.charCodeAt(++this.pos) !== 117) // \"u\"\n { this.invalidStringToken(this.pos, \"Expecting Unicode escape sequence \\\\uXXXX\"); }\n ++this.pos;\n var esc = this.readCodePoint();\n if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))\n { this.invalidStringToken(escStart, \"Invalid Unicode escape\"); }\n word += codePointToString(esc);\n chunkStart = this.pos;\n } else {\n break\n }\n first = false;\n }\n return word + this.input.slice(chunkStart, this.pos)\n };\n\n // Read an identifier or keyword token. Will check for reserved\n // words when necessary.\n\n pp.readWord = function() {\n var word = this.readWord1();\n var type = types$1.name;\n if (this.keywords.test(word)) {\n type = keywords[word];\n }\n return this.finishToken(type, word)\n };\n\n // Acorn is a tiny, fast JavaScript parser written in JavaScript.\n //\n // Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and\n // various contributors and released under an MIT license.\n //\n // Git repositories for Acorn are available at\n //\n // http://marijnhaverbeke.nl/git/acorn\n // https://github.com/acornjs/acorn.git\n //\n // Please use the [github bug tracker][ghbt] to report issues.\n //\n // [ghbt]: https://github.com/acornjs/acorn/issues\n\n\n var version = \"8.16.0\";\n\n Parser.acorn = {\n Parser: Parser,\n version: version,\n defaultOptions: defaultOptions,\n Position: Position,\n SourceLocation: SourceLocation,\n getLineInfo: getLineInfo,\n Node: Node,\n TokenType: TokenType,\n tokTypes: types$1,\n keywordTypes: keywords,\n TokContext: TokContext,\n tokContexts: types,\n isIdentifierChar: isIdentifierChar,\n isIdentifierStart: isIdentifierStart,\n Token: Token,\n isNewLine: isNewLine,\n lineBreak: lineBreak,\n lineBreakG: lineBreakG,\n nonASCIIwhitespace: nonASCIIwhitespace\n };\n\n // The main exported interface (under `self.acorn` when in the\n // browser) is a `parse` function that takes a code string and returns\n // an abstract syntax tree as specified by the [ESTree spec][estree].\n //\n // [estree]: https://github.com/estree/estree\n\n function parse(input, options) {\n return Parser.parse(input, options)\n }\n\n // This function tries to parse a single expression at a given\n // offset in a string. Useful for parsing mixed-language formats\n // that embed JavaScript expressions.\n\n function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n }\n\n // Acorn is organized as a tokenizer and a recursive-descent parser.\n // The `tokenizer` export provides an interface to the tokenizer.\n\n function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }\n\n exports.Node = Node;\n exports.Parser = Parser;\n exports.Position = Position;\n exports.SourceLocation = SourceLocation;\n exports.TokContext = TokContext;\n exports.Token = Token;\n exports.TokenType = TokenType;\n exports.defaultOptions = defaultOptions;\n exports.getLineInfo = getLineInfo;\n exports.isIdentifierChar = isIdentifierChar;\n exports.isIdentifierStart = isIdentifierStart;\n exports.isNewLine = isNewLine;\n exports.keywordTypes = keywords;\n exports.lineBreak = lineBreak;\n exports.lineBreakG = lineBreakG;\n exports.nonASCIIwhitespace = nonASCIIwhitespace;\n exports.parse = parse;\n exports.parseExpressionAt = parseExpressionAt;\n exports.tokContexts = types;\n exports.tokTypes = types$1;\n exports.tokenizer = tokenizer;\n exports.version = version;\n\n}));\n","'use strict';\n\nconst XHTMLEntities = require('./xhtml');\n\nconst hexNumber = /^[\\da-fA-F]+$/;\nconst decimalNumber = /^\\d+$/;\n\n// The map to `acorn-jsx` tokens from `acorn` namespace objects.\nconst acornJsxMap = new WeakMap();\n\n// Get the original tokens for the given `acorn` namespace object.\nfunction getJsxTokens(acorn) {\n acorn = acorn.Parser.acorn || acorn;\n let acornJsx = acornJsxMap.get(acorn);\n if (!acornJsx) {\n const tt = acorn.tokTypes;\n const TokContext = acorn.TokContext;\n const TokenType = acorn.TokenType;\n const tc_oTag = new TokContext('<tag', false);\n const tc_cTag = new TokContext('</tag', false);\n const tc_expr = new TokContext('<tag>...</tag>', true, true);\n const tokContexts = {\n tc_oTag: tc_oTag,\n tc_cTag: tc_cTag,\n tc_expr: tc_expr\n };\n const tokTypes = {\n jsxName: new TokenType('jsxName'),\n jsxText: new TokenType('jsxText', {beforeExpr: true}),\n jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),\n jsxTagEnd: new TokenType('jsxTagEnd')\n };\n\n tokTypes.jsxTagStart.updateContext = function() {\n this.context.push(tc_expr); // treat as beginning of JSX expression\n this.context.push(tc_oTag); // start opening tag context\n this.exprAllowed = false;\n };\n tokTypes.jsxTagEnd.updateContext = function(prevType) {\n let out = this.context.pop();\n if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {\n this.context.pop();\n this.exprAllowed = this.curContext() === tc_expr;\n } else {\n this.exprAllowed = true;\n }\n };\n\n acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };\n acornJsxMap.set(acorn, acornJsx);\n }\n\n return acornJsx;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(object) {\n if (!object)\n return object;\n\n if (object.type === 'JSXIdentifier')\n return object.name;\n\n if (object.type === 'JSXNamespacedName')\n return object.namespace.name + ':' + object.name.name;\n\n if (object.type === 'JSXMemberExpression')\n return getQualifiedJSXName(object.object) + '.' +\n getQualifiedJSXName(object.property);\n}\n\nmodule.exports = function(options) {\n options = options || {};\n return function(Parser) {\n return plugin({\n allowNamespaces: options.allowNamespaces !== false,\n allowNamespacedObjects: !!options.allowNamespacedObjects\n }, Parser);\n };\n};\n\n// This is `tokTypes` of the peer dep.\n// This can be different instances from the actual `tokTypes` this plugin uses.\nObject.defineProperty(module.exports, \"tokTypes\", {\n get: function get_tokTypes() {\n return getJsxTokens(require(\"acorn\")).tokTypes;\n },\n configurable: true,\n enumerable: true\n});\n\nfunction plugin(options, Parser) {\n const acorn = Parser.acorn || require(\"acorn\");\n const acornJsx = getJsxTokens(acorn);\n const tt = acorn.tokTypes;\n const tok = acornJsx.tokTypes;\n const tokContexts = acorn.tokContexts;\n const tc_oTag = acornJsx.tokContexts.tc_oTag;\n const tc_cTag = acornJsx.tokContexts.tc_cTag;\n const tc_expr = acornJsx.tokContexts.tc_expr;\n const isNewLine = acorn.isNewLine;\n const isIdentifierStart = acorn.isIdentifierStart;\n const isIdentifierChar = acorn.isIdentifierChar;\n\n return class extends Parser {\n // Expose actual `tokTypes` and `tokContexts` to other plugins.\n static get acornJsx() {\n return acornJsx;\n }\n\n // Reads inline JSX contents token.\n jsx_readToken() {\n let out = '', chunkStart = this.pos;\n for (;;) {\n if (this.pos >= this.input.length)\n this.raise(this.start, 'Unterminated JSX contents');\n let ch = this.input.charCodeAt(this.pos);\n\n switch (ch) {\n case 60: // '<'\n case 123: // '{'\n if (this.pos === this.start) {\n if (ch === 60 && this.exprAllowed) {\n ++this.pos;\n return this.finishToken(tok.jsxTagStart);\n }\n return this.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.pos);\n return this.finishToken(tok.jsxText, out);\n\n case 38: // '&'\n out += this.input.slice(chunkStart, this.pos);\n out += this.jsx_readEntity();\n chunkStart = this.pos;\n break;\n\n case 62: // '>'\n case 125: // '}'\n this.raise(\n this.pos,\n \"Unexpected token `\" + this.input[this.pos] + \"`. Did you mean `\" +\n (ch === 62 ? \">\" : \"}\") + \"` or \" + \"`{\\\"\" + this.input[this.pos] + \"\\\"}\" + \"`?\"\n );\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.pos);\n out += this.jsx_readNewLine(true);\n chunkStart = this.pos;\n } else {\n ++this.pos;\n }\n }\n }\n }\n\n jsx_readNewLine(normalizeCRLF) {\n let ch = this.input.charCodeAt(this.pos);\n let out;\n ++this.pos;\n if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {\n ++this.pos;\n out = normalizeCRLF ? '\\n' : '\\r\\n';\n } else {\n out = String.fromCharCode(ch);\n }\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n\n return out;\n }\n\n jsx_readString(quote) {\n let out = '', chunkStart = ++this.pos;\n for (;;) {\n if (this.pos >= this.input.length)\n this.raise(this.start, 'Unterminated string constant');\n let ch = this.input.charCodeAt(this.pos);\n if (ch === quote) break;\n if (ch === 38) { // '&'\n out += this.input.slice(chunkStart, this.pos);\n out += this.jsx_readEntity();\n chunkStart = this.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.pos);\n out += this.jsx_readNewLine(false);\n chunkStart = this.pos;\n } else {\n ++this.pos;\n }\n }\n out += this.input.slice(chunkStart, this.pos++);\n return this.finishToken(tt.string, out);\n }\n\n jsx_readEntity() {\n let str = '', count = 0, entity;\n let ch = this.input[this.pos];\n if (ch !== '&')\n this.raise(this.pos, 'Entity must start with an ampersand');\n let startPos = ++this.pos;\n while (this.pos < this.input.length && count++ < 10) {\n ch = this.input[this.pos++];\n if (ch === ';') {\n if (str[0] === '#') {\n if (str[1] === 'x') {\n str = str.substr(2);\n if (hexNumber.test(str))\n entity = String.fromCharCode(parseInt(str, 16));\n } else {\n str = str.substr(1);\n if (decimalNumber.test(str))\n entity = String.fromCharCode(parseInt(str, 10));\n }\n } else {\n entity = XHTMLEntities[str];\n }\n break;\n }\n str += ch;\n }\n if (!entity) {\n this.pos = startPos;\n return '&';\n }\n return entity;\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can't contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsx_readWord() {\n let ch, start = this.pos;\n do {\n ch = this.input.charCodeAt(++this.pos);\n } while (isIdentifierChar(ch) || ch === 45); // '-'\n return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));\n }\n\n // Parse next token as JSX identifier\n\n jsx_parseIdentifier() {\n let node = this.startNode();\n if (this.type === tok.jsxName)\n node.name = this.value;\n else if (this.type.keyword)\n node.name = this.type.keyword;\n else\n this.unexpected();\n this.next();\n return this.finishNode(node, 'JSXIdentifier');\n }\n\n // Parse namespaced identifier.\n\n jsx_parseNamespacedName() {\n let startPos = this.start, startLoc = this.startLoc;\n let name = this.jsx_parseIdentifier();\n if (!options.allowNamespaces || !this.eat(tt.colon)) return name;\n var node = this.startNodeAt(startPos, startLoc);\n node.namespace = name;\n node.name = this.jsx_parseIdentifier();\n return this.finishNode(node, 'JSXNamespacedName');\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsx_parseElementName() {\n if (this.type === tok.jsxTagEnd) return '';\n let startPos = this.start, startLoc = this.startLoc;\n let node = this.jsx_parseNamespacedName();\n if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {\n this.unexpected();\n }\n while (this.eat(tt.dot)) {\n let newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsx_parseIdentifier();\n node = this.finishNode(newNode, 'JSXMemberExpression');\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsx_parseAttributeValue() {\n switch (this.type) {\n case tt.braceL:\n let node = this.jsx_parseExpressionContainer();\n if (node.expression.type === 'JSXEmptyExpression')\n this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');\n return node;\n\n case tok.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsx_parseEmptyExpression() {\n let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);\n return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsx_parseExpressionContainer() {\n let node = this.startNode();\n this.next();\n node.expression = this.type === tt.braceR\n ? this.jsx_parseEmptyExpression()\n : this.parseExpression();\n this.expect(tt.braceR);\n return this.finishNode(node, 'JSXExpressionContainer');\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsx_parseAttribute() {\n let node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssign();\n this.expect(tt.braceR);\n return this.finishNode(node, 'JSXSpreadAttribute');\n }\n node.name = this.jsx_parseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;\n return this.finishNode(node, 'JSXAttribute');\n }\n\n // Parses JSX opening tag starting after '<'.\n\n jsx_parseOpeningElementAt(startPos, startLoc) {\n let node = this.startNodeAt(startPos, startLoc);\n node.attributes = [];\n let nodeName = this.jsx_parseElementName();\n if (nodeName) node.name = nodeName;\n while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)\n node.attributes.push(this.jsx_parseAttribute());\n node.selfClosing = this.eat(tt.slash);\n this.expect(tok.jsxTagEnd);\n return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');\n }\n\n // Parses JSX closing tag starting after '</'.\n\n jsx_parseClosingElementAt(startPos, startLoc) {\n let node = this.startNodeAt(startPos, startLoc);\n let nodeName = this.jsx_parseElementName();\n if (nodeName) node.name = nodeName;\n this.expect(tok.jsxTagEnd);\n return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');\n }\n\n // Parses entire JSX element, including it's opening tag\n // (starting after '<'), attributes, contents and closing tag.\n\n jsx_parseElementAt(startPos, startLoc) {\n let node = this.startNodeAt(startPos, startLoc);\n let children = [];\n let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.type) {\n case tok.jsxTagStart:\n startPos = this.start; startLoc = this.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);\n break contents;\n }\n children.push(this.jsx_parseElementAt(startPos, startLoc));\n break;\n\n case tok.jsxText:\n children.push(this.parseExprAtom());\n break;\n\n case tt.braceL:\n children.push(this.jsx_parseExpressionContainer());\n break;\n\n default:\n this.unexpected();\n }\n }\n if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {\n this.raise(\n closingElement.start,\n 'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');\n }\n }\n let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';\n\n node['opening' + fragmentOrElement] = openingElement;\n node['closing' + fragmentOrElement] = closingElement;\n node.children = children;\n if (this.type === tt.relational && this.value === \"<\") {\n this.raise(this.start, \"Adjacent JSX elements must be wrapped in an enclosing tag\");\n }\n return this.finishNode(node, 'JSX' + fragmentOrElement);\n }\n\n // Parse JSX text\n\n jsx_parseText() {\n let node = this.parseLiteral(this.value);\n node.type = \"JSXText\";\n return node;\n }\n\n // Parses entire JSX element from current position.\n\n jsx_parseElement() {\n let startPos = this.start, startLoc = this.startLoc;\n this.next();\n return this.jsx_parseElementAt(startPos, startLoc);\n }\n\n parseExprAtom(refShortHandDefaultPos) {\n if (this.type === tok.jsxText)\n return this.jsx_parseText();\n else if (this.type === tok.jsxTagStart)\n return this.jsx_parseElement();\n else\n return super.parseExprAtom(refShortHandDefaultPos);\n }\n\n readToken(code) {\n let context = this.curContext();\n\n if (context === tc_expr) return this.jsx_readToken();\n\n if (context === tc_oTag || context === tc_cTag) {\n if (isIdentifierStart(code)) return this.jsx_readWord();\n\n if (code == 62) {\n ++this.pos;\n return this.finishToken(tok.jsxTagEnd);\n }\n\n if ((code === 34 || code === 39) && context == tc_oTag)\n return this.jsx_readString(code);\n }\n\n if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {\n ++this.pos;\n return this.finishToken(tok.jsxTagStart);\n }\n return super.readToken(code);\n }\n\n updateContext(prevType) {\n if (this.type == tt.braceL) {\n var curContext = this.curContext();\n if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);\n else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);\n else super.updateContext(prevType);\n this.exprAllowed = true;\n } else if (this.type === tt.slash && prevType === tok.jsxTagStart) {\n this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore\n this.context.push(tc_cTag); // reconsider as closing tag context\n this.exprAllowed = false;\n } else {\n return super.updateContext(prevType);\n }\n }\n };\n}\n","/**\n * AST-based directive detection for 'use cache', 'use dynamic',\n * 'use client', and 'use server'.\n *\n * Uses acorn to parse source code and detect directives properly,\n * avoiding false positives from regex matching inside string literals,\n * comments, or template expressions.\n *\n * @module\n */\n\nimport { Parser } from 'acorn';\nimport acornJsx from 'acorn-jsx';\n\n// acorn parser with JSX support\nconst jsxParser = Parser.extend(acornJsx());\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface FileDirective {\n /** The directive value, e.g. 'use client', 'use server' */\n directive: string;\n /** 1-based line number where the directive appears */\n line: number;\n}\n\nexport interface FunctionWithDirective {\n /** Function name (or 'default' for anonymous default exports) */\n name: string;\n /** The directive found in the function body */\n directive: string;\n /** 1-based line number of the directive */\n directiveLine: number;\n /** Start offset of the function in the source */\n start: number;\n /** End offset of the function in the source */\n end: number;\n /** Start offset of the function body block (after the '{') */\n bodyStart: number;\n /** End offset of the function body block (the '}') */\n bodyEnd: number;\n /** Content between { and } of the function body */\n bodyContent: string;\n /** 'export ', 'export default ', or '' */\n prefix: string;\n /** Whether this is an arrow function */\n isArrow: boolean;\n /** The function signature (everything before the body '{') */\n declaration: string;\n}\n\n// ---------------------------------------------------------------------------\n// File-level directive detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect a file-level directive ('use client', 'use server', etc.).\n *\n * Per the ECMAScript spec, directives are string literal expression\n * statements at the start of a program body (before any non-directive\n * statements). This function checks the AST `Program.body` for\n * `ExpressionStatement` nodes whose expression is a `Literal` string\n * matching a known directive.\n *\n * Returns the first matching directive, or null if none found.\n */\nexport function detectFileDirective(\n code: string,\n directives: string[] = ['use client', 'use server']\n): FileDirective | null {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ast: any;\n try {\n ast = jsxParser.parse(code, {\n ecmaVersion: 'latest',\n sourceType: 'module',\n locations: true,\n });\n } catch {\n // If the file fails to parse (e.g. TypeScript syntax), fall back to\n // a safe line-by-line check that only considers lines before any\n // non-comment, non-whitespace, non-directive content.\n return detectFileDirectiveFallback(code, directives);\n }\n\n for (const node of ast.body) {\n if (\n node.type === 'ExpressionStatement' &&\n node.expression.type === 'Literal' &&\n typeof node.expression.value === 'string'\n ) {\n if (directives.includes(node.expression.value)) {\n return {\n directive: node.expression.value,\n line: node.loc.start.line,\n };\n }\n } else {\n // Directives must appear before any non-directive statements\n break;\n }\n }\n\n return null;\n}\n\n/**\n * Fallback for TypeScript files that acorn cannot parse.\n *\n * Scans lines from the top of the file. Skips blank lines and comments.\n * Checks if the first real statement is a directive string literal.\n */\nfunction detectFileDirectiveFallback(code: string, directives: string[]): FileDirective | null {\n const lines = code.split('\\n');\n let inBlockComment = false;\n\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i].trim();\n\n // Handle block comments\n if (inBlockComment) {\n const endIdx = line.indexOf('*/');\n if (endIdx === -1) continue;\n line = line.slice(endIdx + 2).trim();\n inBlockComment = false;\n if (!line) continue;\n }\n\n // Skip blank lines\n if (!line) continue;\n\n // Skip line comments\n if (line.startsWith('//')) continue;\n\n // Skip block comment start\n if (line.startsWith('/*')) {\n const endIdx = line.indexOf('*/', 2);\n if (endIdx === -1) {\n inBlockComment = true;\n continue;\n }\n line = line.slice(endIdx + 2).trim();\n if (!line) continue;\n }\n\n // Check for directive\n for (const dir of directives) {\n // Match 'directive' or \"directive\" optionally followed by ;\n if (\n line === `'${dir}'` ||\n line === `'${dir}';` ||\n line === `\"${dir}\"` ||\n line === `\"${dir}\";`\n ) {\n return { directive: dir, line: i + 1 };\n }\n }\n\n // First non-comment, non-blank line is not a directive — stop\n break;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Function-body directive detection\n// ---------------------------------------------------------------------------\n\n/**\n * Find all functions in the source code that contain a directive\n * (e.g. 'use cache', 'use dynamic') as their first body statement.\n *\n * Parses the source with acorn and walks the AST looking for function\n * declarations and arrow function expressions whose body is a\n * BlockStatement with a directive prologue.\n *\n * Returns an array of function info objects, sorted by position\n * (descending) for safe end-to-start replacement.\n */\nexport function findFunctionsWithDirective(\n code: string,\n directive: string\n): FunctionWithDirective[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ast: any;\n try {\n ast = jsxParser.parse(code, {\n ecmaVersion: 'latest',\n sourceType: 'module',\n locations: true,\n });\n } catch {\n // TypeScript fallback: return empty — callers should use the quick\n // regex check first and skip non-matching files anyway\n return findFunctionsWithDirectiveFallback(code, directive);\n }\n\n const results: FunctionWithDirective[] = [];\n walkAst(ast, code, directive, results, []);\n\n // Sort descending by start position for safe end-to-start replacement\n results.sort((a, b) => b.start - a.start);\n return results;\n}\n\n/**\n * Recursive AST walker that finds functions with a directive in their body.\n */\nfunction walkAst(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: any,\n code: string,\n directive: string,\n results: FunctionWithDirective[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ancestors: any[]\n): void {\n if (!node || typeof node !== 'object') return;\n\n if (Array.isArray(node)) {\n for (const child of node) {\n walkAst(child, code, directive, results, ancestors);\n }\n return;\n }\n\n if (!node.type) return;\n\n // Check function declarations and expressions\n if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') {\n checkFunctionBody(node, code, directive, results, ancestors);\n }\n\n // Check arrow functions with block bodies\n if (node.type === 'ArrowFunctionExpression' && node.body && node.body.type === 'BlockStatement') {\n checkFunctionBody(node, code, directive, results, ancestors);\n }\n\n // Walk children\n const newAncestors = [...ancestors, node];\n for (const key of Object.keys(node)) {\n if (key === 'type' || key === 'loc' || key === 'start' || key === 'end') continue;\n const child = node[key];\n if (child && typeof child === 'object') {\n walkAst(child, code, directive, results, newAncestors);\n }\n }\n}\n\n/**\n * Check if a function's body starts with the target directive.\n */\nfunction checkFunctionBody(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: any,\n code: string,\n directive: string,\n results: FunctionWithDirective[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ancestors: any[]\n): void {\n const body = node.type === 'ArrowFunctionExpression' ? node.body : node.body;\n if (!body || body.type !== 'BlockStatement' || body.body.length === 0) return;\n\n // Check the first statement for a directive\n const firstStmt = body.body[0];\n if (\n firstStmt.type !== 'ExpressionStatement' ||\n firstStmt.expression.type !== 'Literal' ||\n firstStmt.expression.value !== directive\n ) {\n return;\n }\n\n // Determine function metadata from AST context\n const parent = ancestors[ancestors.length - 1];\n const grandparent = ancestors.length >= 2 ? ancestors[ancestors.length - 2] : null;\n\n let name = '';\n let prefix = '';\n const isArrow = node.type === 'ArrowFunctionExpression';\n let funcStart = node.start;\n let funcEnd = node.end;\n\n if (node.type === 'FunctionDeclaration') {\n name = node.id?.name || 'default';\n\n // Check for export\n if (parent?.type === 'ExportNamedDeclaration') {\n prefix = 'export ';\n funcStart = parent.start;\n funcEnd = parent.end;\n } else if (parent?.type === 'ExportDefaultDeclaration') {\n prefix = 'export default ';\n funcStart = parent.start;\n funcEnd = parent.end;\n }\n } else if (node.type === 'ArrowFunctionExpression') {\n // Arrow in variable declaration: const name = async () => {}\n if (parent?.type === 'VariableDeclarator' && parent.id?.name) {\n name = parent.id.name;\n // Include the full variable declaration\n if (grandparent?.type === 'VariableDeclaration') {\n funcStart = grandparent.start;\n funcEnd = grandparent.end;\n }\n }\n } else if (node.type === 'FunctionExpression') {\n // Function expression in variable: const name = async function() {}\n name = node.id?.name || '';\n if (parent?.type === 'VariableDeclarator' && parent.id?.name) {\n name = parent.id.name;\n if (grandparent?.type === 'VariableDeclaration') {\n funcStart = grandparent.start;\n funcEnd = grandparent.end;\n }\n }\n }\n\n if (!name) return; // Skip anonymous functions we can't name\n\n // Extract the body content (between the braces)\n const bodyStart = body.start + 1; // after '{'\n const bodyEnd = body.end - 1; // before '}'\n const bodyContent = code.slice(bodyStart, bodyEnd);\n\n // Extract declaration (everything before the body '{')\n const declaration = code.slice(funcStart, body.start).trim();\n\n results.push({\n name,\n directive,\n directiveLine: firstStmt.loc.start.line,\n start: funcStart,\n end: funcEnd,\n bodyStart,\n bodyEnd,\n bodyContent,\n prefix,\n isArrow,\n declaration,\n });\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript fallback for function-body directives\n// ---------------------------------------------------------------------------\n\n/**\n * Fallback that uses regex to find functions with directives when acorn\n * cannot parse the file (TypeScript with type annotations).\n *\n * This is less precise but handles common patterns. The regex approach\n * is only used as a fallback — pure JS/JSX files always use the AST path.\n */\nfunction findFunctionsWithDirectiveFallback(\n code: string,\n directive: string\n): FunctionWithDirective[] {\n const results: FunctionWithDirective[] = [];\n const directivePattern = new RegExp(`['\"]${escapeRegex(directive)}['\"]`);\n\n // Quick bail-out\n if (!directivePattern.test(code)) return results;\n\n // Pattern 1: function declarations\n const fnDeclPattern =\n /(?:(export\\s+default\\s+|export\\s+))?async\\s+function\\s+(\\w+)\\s*\\([^)]*\\)\\s*\\{/g;\n let match: RegExpExecArray | null;\n\n while ((match = fnDeclPattern.exec(code)) !== null) {\n const prefix = match[1]?.trim() || '';\n const name = match[2];\n const bodyStart = match.index + match[0].length;\n const bodyEnd = findMatchingBraceFallback(code, bodyStart - 1);\n if (bodyEnd === -1) continue;\n\n const bodyContent = code.slice(bodyStart, bodyEnd);\n // Check that the directive is the first meaningful statement\n const trimmedBody = bodyContent.trimStart();\n if (!trimmedBody.startsWith(`'${directive}'`) && !trimmedBody.startsWith(`\"${directive}\"`))\n continue;\n\n const directiveLine =\n code.slice(0, bodyStart).split('\\n').length +\n bodyContent.slice(0, bodyContent.indexOf(directive)).split('\\n').length -\n 1;\n\n results.push({\n name,\n directive,\n directiveLine,\n start: match.index,\n end: bodyEnd + 1,\n bodyStart,\n bodyEnd,\n bodyContent,\n prefix: prefix ? prefix + ' ' : '',\n isArrow: false,\n declaration: code.slice(match.index, bodyStart - 1).trimEnd(),\n });\n }\n\n // Pattern 2: arrow functions\n const arrowPattern = /(?:const|let|var)\\s+(\\w+)\\s*=\\s*async\\s*(\\([^)]*\\)|[^=]*?)\\s*=>\\s*\\{/g;\n while ((match = arrowPattern.exec(code)) !== null) {\n const name = match[1];\n const bodyStart = match.index + match[0].length;\n const bodyEnd = findMatchingBraceFallback(code, bodyStart - 1);\n if (bodyEnd === -1) continue;\n\n const bodyContent = code.slice(bodyStart, bodyEnd);\n const trimmedBody = bodyContent.trimStart();\n if (!trimmedBody.startsWith(`'${directive}'`) && !trimmedBody.startsWith(`\"${directive}\"`))\n continue;\n\n const directiveLine =\n code.slice(0, bodyStart).split('\\n').length +\n bodyContent.slice(0, bodyContent.indexOf(directive)).split('\\n').length -\n 1;\n\n results.push({\n name,\n directive,\n directiveLine,\n start: match.index,\n end: bodyEnd + 1,\n bodyStart,\n bodyEnd,\n bodyContent,\n prefix: '',\n isArrow: true,\n declaration: code.slice(match.index, bodyStart - 1).trimEnd(),\n });\n }\n\n results.sort((a, b) => b.start - a.start);\n return results;\n}\n\nfunction escapeRegex(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/**\n * Find matching closing brace — same algorithm as cache-transform.ts\n * but kept here for the fallback path only.\n */\nfunction findMatchingBraceFallback(code: string, openPos: number): number {\n let depth = 1;\n let i = openPos + 1;\n\n while (i < code.length && depth > 0) {\n const ch = code[i];\n\n if (ch === \"'\" || ch === '\"') {\n i = skipStringFallback(code, i);\n continue;\n }\n if (ch === '`') {\n i = skipTemplateFallback(code, i);\n continue;\n }\n if (ch === '/' && code[i + 1] === '/') {\n i = code.indexOf('\\n', i);\n if (i === -1) return -1;\n i++;\n continue;\n }\n if (ch === '/' && code[i + 1] === '*') {\n i = code.indexOf('*/', i + 2);\n if (i === -1) return -1;\n i += 2;\n continue;\n }\n\n if (ch === '{') depth++;\n else if (ch === '}') depth--;\n i++;\n }\n\n return depth === 0 ? i - 1 : -1;\n}\n\nfunction skipStringFallback(code: string, start: number): number {\n const quote = code[start];\n let i = start + 1;\n while (i < code.length) {\n if (code[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (code[i] === quote) return i + 1;\n i++;\n }\n return i;\n}\n\nfunction skipTemplateFallback(code: string, start: number): number {\n let i = start + 1;\n while (i < code.length) {\n if (code[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (code[i] === '`') return i + 1;\n if (code[i] === '$' && code[i + 1] === '{') {\n i = findMatchingBraceFallback(code, i + 1) + 1;\n continue;\n }\n i++;\n }\n return i;\n}\n\n// ---------------------------------------------------------------------------\n// Convenience: quick regex check (for fast bail-out before AST parsing)\n// ---------------------------------------------------------------------------\n\n/**\n * Quick regex check for whether code contains a directive string.\n * Use as a fast bail-out before calling the AST-based functions.\n */\nexport function containsDirective(code: string, directive: string): boolean {\n return code.includes(directive);\n}\n","import type { Plugin } from 'vite';\nimport { findFunctionsWithDirective, containsDirective } from '#/utils/directive-parser.js';\n\n/**\n * Parse a cacheLife duration string to seconds.\n * Supports: '30s', '5m', '1h', '2d', '1w', or a plain number (seconds).\n */\nexport function parseCacheLife(value: string | number): number {\n if (typeof value === 'number') return value;\n\n const match = value.match(/^(\\d+)(s|m|h|d|w)$/);\n if (!match) {\n throw new Error(\n `Invalid cacheLife value: \"${value}\". Expected format: \"30s\", \"5m\", \"1h\", \"2d\", \"1w\", or a number.`\n );\n }\n\n const amount = parseInt(match[1], 10);\n const unit = match[2];\n const multipliers: Record<string, number> = { s: 1, m: 60, h: 3600, d: 86400, w: 604800 };\n return amount * multipliers[unit];\n}\n\n// Default TTL when no cacheLife() is specified (Infinity means cache until explicit invalidation).\nconst DEFAULT_TTL = Infinity;\n\nexport interface CacheTransformWarning {\n message: string;\n functionName: string;\n}\n\ninterface TransformResult {\n code: string;\n map?: null;\n warnings?: CacheTransformWarning[];\n}\n\n/**\n * Match cacheLife() calls: cacheLife('1h'), cacheLife(\"5m\"), cacheLife(300)\n */\nconst CACHE_LIFE_PATTERN = /cacheLife\\(\\s*(?:'([^']+)'|\"([^\"]+)\"|(\\d+))\\s*\\)/;\n\n/**\n * Strip the 'use cache' directive and cacheLife() call from a function body.\n * Returns the cleaned body and the extracted TTL.\n */\nfunction extractCacheDirectives(body: string): { cleanBody: string; ttl: number } {\n let ttl = DEFAULT_TTL;\n\n // Remove 'use cache' / \"use cache\" directive (including optional semicolon and newline)\n let cleanBody = body.replace(/\\s*['\"]use cache['\"];?\\s*\\n?/, '\\n');\n\n // Extract and remove cacheLife() calls\n const lifeMatch = cleanBody.match(CACHE_LIFE_PATTERN);\n if (lifeMatch) {\n const value = lifeMatch[1] || lifeMatch[2] || parseInt(lifeMatch[3], 10);\n ttl = parseCacheLife(value);\n cleanBody = cleanBody.replace(/\\s*cacheLife\\([^)]*\\);?\\s*\\n?/, '\\n');\n }\n\n return { cleanBody, ttl };\n}\n\n/**\n * Determine if a function name is a React component (PascalCase).\n */\nfunction isComponentName(name: string): boolean {\n return /^[A-Z]/.test(name);\n}\n\n/**\n * Pattern matching page/layout file conventions in a dynamic route segment.\n * Matches paths like: app/[slug]/page.tsx, app/[id]/layout.ts, etc.\n */\nconst DYNAMIC_ROUTE_PAGE_PATTERN = /\\/\\[[^\\]]+\\].*\\/(page|layout)\\.[jt]sx?$/;\n\n/**\n * Detect if a function declaration has Promise-typed parameters.\n *\n * Checks for common patterns:\n * - `params: Promise<...>`\n * - `{ params }: { params: Promise<...> }`\n * - `props: { params: Promise<...> }`\n */\nconst PROMISE_PARAMS_PATTERN = /params\\s*(?::|.*?:)\\s*Promise\\s*</;\n\n/**\n * Check if a 'use cache' function in a dynamic route page/layout receives\n * Promise-typed params, which are not serializable as cache keys.\n */\nexport function detectPromiseParamsWarning(\n declaration: string,\n functionName: string,\n fileId: string\n): CacheTransformWarning | null {\n if (!DYNAMIC_ROUTE_PAGE_PATTERN.test(fileId)) return null;\n if (!PROMISE_PARAMS_PATTERN.test(declaration)) return null;\n\n return {\n message:\n `'use cache' on \"${functionName}\" in \"${fileId}\" receives Promise params. ` +\n `Promise is not serializable as a cache key and will cause runtime errors. ` +\n `Either remove 'use cache' or await the params before using them in a separate cached function.`,\n functionName,\n };\n}\n\n/**\n * Transform source code containing 'use cache' directives into\n * registerCachedFunction() calls.\n *\n * Returns null if no transformations were made.\n */\nexport function transformUseCache(code: string, fileId: string): TransformResult | null {\n if (!containsDirective(code, 'use cache')) return null;\n\n const functions = findFunctionsWithDirective(code, 'use cache');\n if (functions.length === 0) return null;\n\n let result = code;\n let needsImport = false;\n const warnings: CacheTransformWarning[] = [];\n\n // Process functions from end to start (sorted descending by start position)\n for (const fn of functions) {\n // Warn if function receives Promise params in a dynamic route page/layout\n const promiseWarning = detectPromiseParamsWarning(fn.declaration, fn.name, fileId);\n if (promiseWarning) warnings.push(promiseWarning);\n const { cleanBody, ttl } = extractCacheDirectives(fn.bodyContent);\n const stableId = `${fileId}#${fn.name}`;\n const isComponent = isComponentName(fn.name);\n\n // Build the options object\n const optsParts = [`ttl: ${ttl === Infinity ? 'Infinity' : ttl}`];\n optsParts.push(`id: '${stableId}'`);\n if (isComponent) {\n optsParts.push('isComponent: true');\n }\n const optsStr = `{ ${optsParts.join(', ')} }`;\n\n // Build the replacement\n let replacement: string;\n if (fn.isArrow) {\n // const Name = async (...) => { body } → const Name = registerCachedFunction(async (...) => { body }, opts)\n const arrowSig = fn.declaration.replace(/^(?:const|let|var)\\s+\\w+\\s*=\\s*/, '');\n replacement = `const ${fn.name} = registerCachedFunction(${arrowSig} {${cleanBody}}, ${optsStr})`;\n } else {\n // async function Name(...) { body } → const Name = registerCachedFunction(async function Name(...) { body }, opts)\n const fnDecl = fn.declaration.replace(/^(?:export\\s+default\\s+|export\\s+)?/, '');\n const exportPrefix = fn.prefix.includes('default')\n ? 'export default '\n : fn.prefix.includes('export')\n ? 'export '\n : '';\n\n replacement = `${exportPrefix}const ${fn.name} = registerCachedFunction(${fnDecl} {${cleanBody}}, ${optsStr})`;\n }\n\n result = result.slice(0, fn.start) + replacement + result.slice(fn.end);\n needsImport = true;\n }\n\n if (needsImport) {\n // Add the import at the top of the file\n result = `import { registerCachedFunction } from '@timber-js/app/cache';\\n` + result;\n }\n\n return { code: result, map: null, warnings: warnings.length > 0 ? warnings : undefined };\n}\n\n/**\n * Vite plugin: timber-cache\n *\n * Transforms 'use cache' directives into registerCachedFunction() calls.\n * Only runs in the RSC environment.\n */\nexport function cacheTransformPlugin(): Plugin {\n return {\n name: 'timber-cache',\n\n transform(code, id) {\n // Only transform in RSC environment\n // Skip node_modules and non-JS/TS files\n if (id.includes('node_modules')) return null;\n if (!/\\.[jt]sx?$/.test(id)) return null;\n\n // Quick bail-out: no 'use cache' directive in this file\n if (!containsDirective(code, 'use cache')) return null;\n\n const result = transformUseCache(code, id);\n if (result?.warnings) {\n for (const w of result.warnings) {\n this.warn(`[timber] ${w.message}`);\n }\n }\n return result;\n },\n };\n}\n","/**\n * timber-content — Vite sub-plugin for content collections.\n *\n * Wraps @content-collections/vite to provide content collection support.\n * Activates only when a content-collections.ts config file exists at the\n * project root.\n *\n * Design doc: 20-content-collections.md §\"Content Collections\"\n */\n\nimport type { Plugin } from 'vite';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { PluginContext } from '#/index.js';\n\nconst CONFIG_FILE_NAMES = [\n 'content-collections.ts',\n 'content-collections.js',\n 'content-collections.mts',\n 'content-collections.mjs',\n];\n\n/**\n * Find the content-collections config file at the project root.\n * Returns the filename (not full path) if found, otherwise undefined.\n */\nfunction findConfigFile(root: string): string | undefined {\n for (const name of CONFIG_FILE_NAMES) {\n if (existsSync(join(root, name))) return name;\n }\n return undefined;\n}\n\n/**\n * Create the timber-content Vite plugin.\n *\n * Delegates all content scanning, validation, code generation, and file watching\n * to @content-collections/vite. This plugin only handles detection and activation.\n */\nexport function timberContent(ctx: PluginContext): Plugin {\n let innerPlugin: Plugin | null = null;\n\n async function activate(root: string): Promise<void> {\n if (innerPlugin !== null) return;\n\n const configFile = findConfigFile(root);\n if (!configFile) return;\n\n let createPlugin: ((options?: { configPath?: string }) => Plugin) | undefined;\n try {\n const mod = await import('@content-collections/vite');\n createPlugin = (mod.default ?? mod) as typeof createPlugin;\n } catch {\n throw new Error(\n [\n '[timber] Content collections are enabled but @content-collections/vite is not installed.',\n '',\n 'Install content-collections:',\n ' pnpm add -D @content-collections/core @content-collections/vite',\n '',\n 'For MDX content, also install:',\n ' pnpm add -D @content-collections/mdx',\n '',\n 'Content collections are activated because a content-collections.ts file exists.',\n ].join('\\n')\n );\n }\n\n if (createPlugin) {\n innerPlugin = createPlugin({ configPath: configFile });\n }\n }\n\n return {\n name: 'timber-content',\n\n async config(config, env) {\n const root = config.root ?? ctx.root;\n ctx.timer.start('content-activate');\n await activate(root);\n ctx.timer.end('content-activate');\n if (!innerPlugin) return;\n if (typeof innerPlugin.config === 'function') {\n return innerPlugin.config.call(this, config, env);\n }\n },\n\n async configResolved(config) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.configResolved === 'function') {\n await (innerPlugin.configResolved as (...args: unknown[]) => unknown).call(this, config);\n }\n },\n\n async buildStart(options) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.buildStart === 'function') {\n await (innerPlugin.buildStart as (...args: unknown[]) => unknown).call(this, options);\n }\n },\n\n async resolveId(source: string, importer: string | undefined, options: unknown) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.resolveId === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.resolveId as any).call(this, source, importer, options);\n }\n return null;\n },\n\n async load(id: string) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.load === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.load as any).call(this, id);\n }\n return null;\n },\n\n async transform(code: string, id: string) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.transform === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.transform as any).call(this, code, id);\n }\n return null;\n },\n\n async configureServer(server) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.configureServer === 'function') {\n await (innerPlugin.configureServer as (...args: unknown[]) => unknown).call(this, server);\n }\n },\n };\n}\n","/**\n * Dev error overlay — formats and sends errors to Vite's browser overlay and stderr.\n *\n * Integrates with Vite's built-in error overlay (`server.ssrFixStacktrace` +\n * `server.hot.send`) rather than implementing a custom overlay.\n *\n * Design doc: 21-dev-server.md §\"Error Overlay\"\n */\n\nimport type { ViteDevServer } from 'vite';\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\n/** The phase of the pipeline where the error occurred. */\nexport type ErrorPhase =\n | 'module-transform'\n | 'proxy'\n | 'middleware'\n | 'access'\n | 'render'\n | 'handler';\n\n/** Labels for terminal output. */\nconst PHASE_LABELS: Record<ErrorPhase, string> = {\n 'module-transform': 'Module Transform',\n 'proxy': 'Proxy',\n 'middleware': 'Middleware',\n 'access': 'Access Check',\n 'render': 'RSC Render',\n 'handler': 'Route Handler',\n};\n\n// ─── Frame Classification ───────────────────────────────────────────────────\n\nexport type FrameType = 'app' | 'framework' | 'internal';\n\n/**\n * Classify a stack frame line by origin.\n *\n * - 'app': user application code (in project root, not node_modules)\n * - 'framework': timber-app internal code\n * - 'internal': node_modules, Node.js internals\n */\nexport function classifyFrame(frameLine: string, projectRoot: string): FrameType {\n // Strip leading whitespace and \"at \"\n const trimmed = frameLine.trim();\n\n if (trimmed.includes('packages/timber-app/')) return 'framework';\n if (trimmed.includes('node_modules/')) return 'internal';\n if (trimmed.startsWith('at node:') || trimmed.includes('(node:')) return 'internal';\n if (trimmed.includes(projectRoot)) return 'app';\n\n return 'internal';\n}\n\n// ─── Component Stack Extraction ─────────────────────────────────────────────\n\n/**\n * Extract the React component stack from an error, if present.\n * React attaches this as `componentStack` during renderToReadableStream errors.\n */\nexport function extractComponentStack(error: unknown): string | null {\n if (\n error &&\n typeof error === 'object' &&\n 'componentStack' in error &&\n typeof (error as Record<string, unknown>).componentStack === 'string'\n ) {\n return (error as Record<string, unknown>).componentStack as string;\n }\n return null;\n}\n\n// ─── First App Frame Parsing ────────────────────────────────────────────────\n\ninterface SourceLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/**\n * Parse the first application frame from a stack trace.\n * Returns file/line/column for the overlay's `loc` field.\n */\nexport function parseFirstAppFrame(stack: string, projectRoot: string): SourceLocation | null {\n const lines = stack.split('\\n');\n // Match patterns like:\n // at functionName (/absolute/path:line:column)\n // at /absolute/path:line:column\n const parenRegex = /\\(([^)]+):(\\d+):(\\d+)\\)/;\n const bareRegex = /at (\\/[^:]+):(\\d+):(\\d+)/;\n\n for (const line of lines) {\n if (classifyFrame(line, projectRoot) !== 'app') continue;\n\n const match = parenRegex.exec(line) ?? bareRegex.exec(line);\n if (!match) continue;\n\n const [, file, lineNum, col] = match;\n if (file && lineNum && col) {\n return { file, line: parseInt(lineNum, 10), column: parseInt(col, 10) };\n }\n }\n\n return null;\n}\n\n// ─── Error Phase Classification ─────────────────────────────────────────────\n\n/**\n * Classify the error phase by inspecting the error's stack trace.\n * Falls back to 'render' if no specific phase can be determined.\n */\nexport function classifyErrorPhase(error: Error, projectRoot: string): ErrorPhase {\n const stack = error.stack ?? '';\n\n // Check for React component stack (render error)\n if (extractComponentStack(error)) return 'render';\n\n // Check for specific file patterns in app frames\n const appRoot = projectRoot.replace(/\\/$/, '');\n if (stack.includes(`${appRoot}/app/`) || stack.includes('/app/')) {\n if (stack.includes('/middleware.ts') || stack.includes('/middleware.js')) return 'middleware';\n if (stack.includes('/access.ts') || stack.includes('/access.js')) return 'access';\n if (stack.includes('/route.ts') || stack.includes('/route.js')) return 'handler';\n }\n\n return 'render';\n}\n\n// ─── Terminal Formatting ────────────────────────────────────────────────────\n\n// ANSI codes\nconst RED = '\\x1b[31m';\nconst DIM = '\\x1b[2m';\nconst RESET = '\\x1b[0m';\nconst BOLD = '\\x1b[1m';\n\n/**\n * Format an error for terminal output.\n *\n * - Red for the error message and phase label\n * - Dim for framework-internal frames\n * - Normal for application frames\n * - Separate section for component stack (if present)\n */\nexport function formatTerminalError(error: Error, phase: ErrorPhase, projectRoot: string): string {\n const lines: string[] = [];\n\n // Phase header + error message\n lines.push(`${RED}${BOLD}[timber] ${PHASE_LABELS[phase]} Error${RESET}`);\n lines.push(`${RED}${error.message}${RESET}`);\n lines.push('');\n\n // Component stack (if present)\n const componentStack = extractComponentStack(error);\n if (componentStack) {\n lines.push(`${BOLD}Component Stack:${RESET}`);\n for (const csLine of componentStack.trim().split('\\n')) {\n lines.push(` ${csLine.trim()}`);\n }\n lines.push('');\n }\n\n // Stack trace with frame dimming\n if (error.stack) {\n lines.push(`${BOLD}Stack Trace:${RESET}`);\n const stackLines = error.stack.split('\\n').slice(1); // Skip the first line (message)\n for (const stackLine of stackLines) {\n const frameType = classifyFrame(stackLine, projectRoot);\n if (frameType === 'app') {\n lines.push(stackLine);\n } else {\n lines.push(`${DIM}${stackLine}${RESET}`);\n }\n }\n }\n\n return lines.join('\\n');\n}\n\n// ─── Overlay Integration ────────────────────────────────────────────────────\n\n/**\n * Send an error to Vite's browser overlay and log it to stderr.\n *\n * Uses `server.ssrFixStacktrace()` to map stack traces back to source,\n * then sends the error via `server.hot.send()` for the browser overlay.\n *\n * The dev server remains running — errors are handled, not fatal.\n */\nexport function sendErrorToOverlay(\n server: ViteDevServer,\n error: Error,\n phase: ErrorPhase,\n projectRoot: string\n): void {\n // Fix stack trace to use source-mapped positions\n server.ssrFixStacktrace(error);\n\n // Log to stderr with frame dimming\n const formatted = formatTerminalError(error, phase, projectRoot);\n process.stderr.write(`${formatted}\\n`);\n\n // Build overlay payload\n const loc = parseFirstAppFrame(error.stack ?? '', projectRoot);\n const componentStack = extractComponentStack(error);\n\n let message = error.message;\n if (componentStack) {\n message = `${error.message}\\n\\nComponent Stack:\\n${componentStack.trim()}`;\n }\n\n // Send to browser via Vite's error overlay protocol\n try {\n server.hot.send({\n type: 'error',\n err: {\n message,\n stack: error.stack ?? '',\n id: loc?.file,\n plugin: `timber (${PHASE_LABELS[phase]})`,\n loc: loc ? { file: loc.file, line: loc.line, column: loc.column } : undefined,\n },\n });\n } catch {\n // Overlay send must never crash the dev server\n }\n}\n","// Response compression for self-hosted deployments (dev server, Nitro preview).\n//\n// Uses CompressionStream (Web Platform API) for gzip. Brotli is intentionally\n// left to CDNs and reverse proxies — at streaming-friendly quality levels its\n// ratio advantage is marginal, and node:zlib's brotli transform buffers output\n// internally, breaking streaming. Cloudflare Workers auto-compress at the edge —\n// this module is only used on Node.js/Bun.\n//\n// See design/25-production-deployments.md.\n\n// ─── Constants ────────────────────────────────────────────────────────────\n\n/**\n * MIME types that benefit from compression.\n * text/* is handled via prefix matching; these are the specific\n * application/* and image/* types that are compressible.\n */\nexport const COMPRESSIBLE_TYPES = new Set([\n 'text/html',\n 'text/css',\n 'text/plain',\n 'text/xml',\n 'text/javascript',\n 'text/x-component',\n 'application/json',\n 'application/javascript',\n 'application/xml',\n 'application/xhtml+xml',\n 'application/rss+xml',\n 'application/atom+xml',\n 'image/svg+xml',\n]);\n\n/**\n * Status codes that should never be compressed (no body or special semantics).\n */\nconst NO_COMPRESS_STATUSES = new Set([204, 304]);\n\n// ─── Encoding Negotiation ─────────────────────────────────────────────────\n\n/**\n * Parse Accept-Encoding and return the best supported encoding.\n * Returns 'gzip' if the client accepts it, null otherwise.\n *\n * Brotli (br) is intentionally not handled at the application level.\n * At the streaming-friendly quality levels (0–4), brotli's compression\n * ratio advantage over gzip is marginal, and node:zlib's brotli transform\n * buffers output internally — turning smooth streaming responses into\n * large infrequent bursts. Brotli's real wins come from offline/static\n * compression at higher quality levels (5–11), which CDNs and reverse\n * proxies (Cloudflare, nginx, Caddy) apply on cached responses.\n *\n * See design/25-production-deployments.md.\n */\nexport function negotiateEncoding(acceptEncoding: string): 'gzip' | null {\n if (!acceptEncoding) return null;\n\n // Parse tokens with quality values from the Accept-Encoding header.\n // Per RFC 9110 §12.5.3, q=0 means \"not acceptable\" — the client explicitly\n // rejects that encoding. Tokens without a q-value default to q=1.\n // e.g. \"gzip;q=1.0, br;q=0\" → gzip is acceptable, br is rejected.\n const parts = acceptEncoding.split(',');\n for (const part of parts) {\n const [token, ...params] = part.split(';');\n const name = token.trim().toLowerCase();\n if (name !== 'gzip') continue;\n\n // Check for q=0 (explicitly disabled)\n let qValue = 1; // default quality is 1\n for (const param of params) {\n const trimmed = param.trim().toLowerCase();\n if (trimmed.startsWith('q=')) {\n qValue = parseFloat(trimmed.slice(2));\n if (Number.isNaN(qValue)) qValue = 1;\n break;\n }\n }\n\n if (qValue > 0) return 'gzip';\n }\n\n return null;\n}\n\n// ─── Compressibility Check ────────────────────────────────────────────────\n\n/**\n * Determine if a response should be compressed.\n *\n * Returns false for:\n * - Responses without a body (204, 304, null body)\n * - Already-encoded responses (Content-Encoding set)\n * - Non-compressible content types (images, binary)\n * - SSE streams (text/event-stream — must not be buffered)\n */\nexport function shouldCompress(response: Response): boolean {\n // No body to compress\n if (!response.body) return false;\n if (NO_COMPRESS_STATUSES.has(response.status)) return false;\n\n // Already compressed\n if (response.headers.has('Content-Encoding')) return false;\n\n // Check content type\n const contentType = response.headers.get('Content-Type');\n if (!contentType) return false;\n\n // Extract the MIME type (strip charset and other parameters)\n const mimeType = contentType.split(';')[0].trim().toLowerCase();\n\n // SSE must not be compressed — it relies on chunk-by-chunk delivery\n if (mimeType === 'text/event-stream') return false;\n\n return COMPRESSIBLE_TYPES.has(mimeType);\n}\n\n// ─── Compression ──────────────────────────────────────────────────────────\n\n/**\n * Compress a Web Response if the client supports it and the content is compressible.\n *\n * Returns the original response unchanged if compression is not applicable.\n * Returns a new Response with the compressed body, Content-Encoding, and Vary headers.\n *\n * The body is piped through a compression stream — no buffering of the full response.\n * This preserves streaming behavior for HTML shell + deferred Suspense chunks.\n */\nexport function compressResponse(request: Request, response: Response): Response {\n // Check if response is compressible\n if (!shouldCompress(response)) return response;\n\n // Negotiate encoding with the client\n const acceptEncoding = request.headers.get('Accept-Encoding') ?? '';\n const encoding = negotiateEncoding(acceptEncoding);\n if (!encoding) return response;\n\n // Compress the body stream with gzip via the Web Platform CompressionStream API.\n const compressedBody = compressWithGzip(response.body!);\n\n // Build new headers: copy originals, add compression headers, remove Content-Length\n // (compressed size is unknown until streaming completes).\n const headers = new Headers(response.headers);\n headers.set('Content-Encoding', encoding);\n headers.delete('Content-Length');\n\n // Append to Vary header (preserve existing Vary values)\n const existingVary = headers.get('Vary');\n if (existingVary) {\n if (!existingVary.toLowerCase().includes('accept-encoding')) {\n headers.set('Vary', `${existingVary}, Accept-Encoding`);\n }\n } else {\n headers.set('Vary', 'Accept-Encoding');\n }\n\n return new Response(compressedBody, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n}\n\n// ─── Gzip (CompressionStream API) ────────────────────────────────────────\n\n/**\n * Compress a ReadableStream with gzip using the Web Platform CompressionStream API.\n * Available in Node 18+, Bun, and Deno — no npm dependency needed.\n */\nfunction compressWithGzip(body: ReadableStream<Uint8Array>): ReadableStream<Uint8Array> {\n const compressionStream = new CompressionStream('gzip');\n // Cast needed: CompressionStream's WritableStream<BufferSource> type is wider\n // than ReadableStream's Uint8Array, but Uint8Array is a valid BufferSource.\n return body.pipeThrough(compressionStream as unknown as TransformStream<Uint8Array, Uint8Array>);\n}\n","/**\n * timber-dev-server — Vite sub-plugin for dev server request handling.\n *\n * Registers a configureServer middleware that intercepts requests and\n * routes them through the timber pipeline:\n * proxy.ts → canonicalize → route match → middleware → access → render → flush\n *\n * The RSC entry module is loaded via Vite's ssrLoadModule, which uses\n * Vite's dev module graph instead of built bundles. The full pipeline\n * (including proxy.ts) runs on every request.\n *\n * Design docs: 18-build-system.md §\"Dev Server\", 02-rendering-pipeline.md\n */\n\nimport type { Plugin, ViteDevServer, DevEnvironment } from 'vite';\nimport type { IncomingMessage, ServerResponse } from 'node:http';\nimport { join } from 'node:path';\nimport type { PluginContext } from '#/index.js';\nimport { setViteServer } from '#/server/dev-warnings.js';\nimport { sendErrorToOverlay, classifyErrorPhase, parseFirstAppFrame } from './dev-error-overlay.js';\nimport { compressResponse } from '#/server/compress.js';\n\n// ─── Constants ────────────────────────────────────────────────────────────\n\nconst RSC_ENTRY_ID = 'virtual:timber-rsc-entry';\n\n/**\n * Config file names that trigger a full dev server restart when changed.\n * See 21-dev-server.md §HMR Wiring — config is loaded once at startup.\n */\nconst CONFIG_FILE_NAMES = ['timber.config.ts', 'timber.config.js', 'timber.config.mjs'];\n\n/**\n * URL prefixes that are Vite-internal and should never be intercepted.\n * These are passed through to Vite's built-in middleware.\n */\nconst VITE_INTERNAL_PREFIXES = [\n '/@', // /@vite/client, /@fs/, /@id/\n '/__vite', // /__vite_hmr, /__vite_ping\n '/node_modules/',\n];\n\n/**\n * File extensions that indicate static asset requests.\n * These are passed through to Vite's static file serving.\n */\nconst ASSET_EXTENSIONS =\n /\\.(?:js|ts|tsx|jsx|css|map|json|svg|png|jpg|jpeg|gif|webp|avif|ico|woff|woff2|ttf|eot|mp4|webm|ogg|mp3|wav)(?:\\?.*)?$/;\n\n// ─── Plugin ───────────────────────────────────────────────────────────────\n\n/**\n * Create the timber-dev-server Vite plugin.\n *\n * Hook: configureServer (returns post-hook to register after Vite's middleware)\n */\nexport function timberDevServer(ctx: PluginContext): Plugin {\n return {\n name: 'timber-dev-server',\n\n // Only active in dev mode (command === 'serve'), not during build.\n // See 21-dev-server.md §Plugin Registration.\n apply: 'serve',\n\n /**\n * Register the dev server middleware and config file watcher.\n *\n * Registers as a pre-hook (no return value) so our middleware runs\n * before Vite's built-in SPA fallback / historyApiFallback. This\n * ensures we see the original URL (e.g. /blog) rather than a\n * rewritten /index.html. Vite-internal and asset requests are\n * filtered out explicitly and passed through to Vite.\n */\n configureServer(server: ViteDevServer) {\n // Watch config files for full restart.\n // timber.config.ts is loaded once at startup — any change requires\n // a full dev server restart. See 21-dev-server.md §HMR Wiring.\n const configPaths = CONFIG_FILE_NAMES.map((name) => join(ctx.root, name));\n\n server.watcher.on('change', (filePath: string) => {\n if (configPaths.includes(filePath)) {\n server.restart();\n }\n });\n\n // Register Vite server for browser console warning forwarding.\n // See 21-dev-server.md §Dev-Mode Warnings.\n setViteServer(server);\n\n // Listen for client-side errors forwarded from the browser.\n // The browser entry sends 'timber:client-error' events via HMR\n // for uncaught errors and unhandled rejections. We echo them back\n // as Vite's '{ type: \"error\" }' payload to trigger the overlay.\n listenForClientErrors(server, ctx.root);\n\n // Pre-hook — registers middleware before Vite's internals\n server.middlewares.use(createTimberMiddleware(server, ctx.root));\n\n // Log startup timing summary. configureServer runs on all plugins\n // before the server listens, so this captures the full cold start.\n ctx.timer.end('dev-server-setup');\n const summary = ctx.timer.formatSummary();\n if (summary) {\n console.log(summary);\n }\n },\n };\n}\n\n// ─── Middleware ────────────────────────────────────────────────────────────\n\n/**\n * Create the Connect middleware that routes requests through the timber pipeline.\n *\n * For route requests (HTML pages, API endpoints), the middleware:\n * 1. Loads the RSC entry via ssrLoadModule\n * 2. Converts the Node request to a Web Request\n * 3. Passes it through the RSC handler (which runs the full pipeline)\n * 4. Converts the Web Response back to a Node response\n *\n * For non-route requests (assets, Vite internals, HMR), the middleware\n * calls next() to let Vite handle them.\n */\nfunction createTimberMiddleware(server: ViteDevServer, projectRoot: string) {\n return async (req: IncomingMessage, res: ServerResponse, next: () => void): Promise<void> => {\n const url = req.url;\n if (!url) {\n next();\n return;\n }\n\n // Pass through Vite-internal requests\n if (isViteInternal(url)) {\n next();\n return;\n }\n\n // Pass through static asset requests\n if (isAssetRequest(url)) {\n next();\n return;\n }\n\n // Step 1: Load the RSC entry module from the RSC environment.\n // The RSC entry runs in the 'rsc' Vite environment (separate module\n // graph with react-server conditions). In dev mode, this uses the\n // environment's module runner for HMR-aware loading.\n let handler: (req: Request) => Promise<Response>;\n try {\n const rscEnv = server.environments.rsc as DevEnvironment & {\n runner?: { import: (id: string) => Promise<any> };\n };\n // Duck-type check instead of isRunnableDevEnvironment() — the vite\n // import-based check fails across pnpm link boundaries where the\n // linked package resolves a different vite module instance.\n if (!rscEnv?.runner?.import) {\n throw new Error('[timber] RSC environment is not runnable');\n }\n const rscModule = await rscEnv.runner.import(RSC_ENTRY_ID);\n handler = rscModule.default as (req: Request) => Promise<Response>;\n\n // Wire pipeline errors into the browser error overlay.\n // setDevPipelineErrorHandler is only defined in dev (rsc-entry.ts exports it).\n const setHandler = rscModule.setDevPipelineErrorHandler as\n | ((fn: (error: Error, phase: string) => void) => void)\n | undefined;\n if (typeof setHandler === 'function') {\n setHandler((error) => {\n sendErrorToOverlay(server, error, classifyErrorPhase(error, projectRoot), projectRoot);\n });\n }\n } catch (error) {\n // Module transform error — syntax error, missing import, etc.\n // Vite may already show its own overlay for these, but we still\n // log to stderr with frame dimming for the terminal.\n if (error instanceof Error) {\n sendErrorToOverlay(server, error, 'module-transform', projectRoot);\n }\n respond500(res, error);\n return;\n }\n\n if (typeof handler !== 'function') {\n console.error('[timber] RSC entry module does not export a default function');\n next();\n return;\n }\n\n // Step 2: Run the pipeline.\n try {\n // Convert Node IncomingMessage → Web Request\n const webRequest = toWebRequest(req);\n\n // Run the full pipeline\n const webResponse = await handler(webRequest);\n\n // Compress the response if the client supports it.\n // In dev mode, compression is always enabled for parity with production.\n // See design/25-production-deployments.md.\n const finalResponse = compressResponse(webRequest, webResponse);\n\n // Convert Web Response → Node ServerResponse\n await sendWebResponse(res, finalResponse);\n } catch (error) {\n // Pipeline error — classify the phase, send to overlay, respond 500.\n // The dev server remains running for recovery on file fix + HMR.\n if (error instanceof Error) {\n const phase = classifyErrorPhase(error, projectRoot);\n sendErrorToOverlay(server, error, phase, projectRoot);\n } else {\n process.stderr.write(`\\x1b[31m[timber] Dev server error:\\x1b[0m ${String(error)}\\n`);\n }\n respond500(res, error);\n }\n };\n}\n\n/**\n * Send a 500 response without crashing the dev server.\n */\nfunction respond500(res: ServerResponse, error: unknown): void {\n if (!res.headersSent) {\n res.statusCode = 500;\n res.setHeader('content-type', 'text/plain');\n res.end(\n `[timber] Internal server error\\n\\n${error instanceof Error ? (error.stack ?? error.message) : String(error)}`\n );\n }\n}\n\n// ─── Request/Response Conversion ──────────────────────────────────────────\n\n/**\n * Convert a Node IncomingMessage to a Web Request.\n *\n * Constructs the full URL from the Host header and request URL,\n * and forwards the method, headers, and body.\n */\nfunction toWebRequest(nodeReq: IncomingMessage): Request {\n const protocol = 'http';\n const host = nodeReq.headers.host ?? 'localhost';\n const url = `${protocol}://${host}${nodeReq.url}`;\n\n const headers = new Headers();\n for (const [key, value] of Object.entries(nodeReq.headers)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n for (const v of value) {\n headers.append(key, v);\n }\n } else {\n headers.set(key, value);\n }\n }\n\n const method = nodeReq.method ?? 'GET';\n const hasBody = method !== 'GET' && method !== 'HEAD';\n\n return new Request(url, {\n method,\n headers,\n body: hasBody ? nodeReadableToWebStream(nodeReq) : undefined,\n // @ts-expect-error — duplex is required for streaming request bodies\n duplex: hasBody ? 'half' : undefined,\n });\n}\n\n/**\n * Convert a Node Readable stream to a Web ReadableStream.\n */\nfunction nodeReadableToWebStream(nodeStream: IncomingMessage): ReadableStream<Uint8Array> {\n return new ReadableStream({\n start(controller) {\n nodeStream.on('data', (chunk: Buffer) => {\n controller.enqueue(new Uint8Array(chunk));\n });\n nodeStream.on('end', () => {\n controller.close();\n });\n nodeStream.on('error', (err) => {\n controller.error(err);\n });\n },\n });\n}\n\n/**\n * Write a Web Response to a Node ServerResponse.\n *\n * Copies status code, headers, and streams the body.\n */\nasync function sendWebResponse(nodeRes: ServerResponse, webResponse: Response): Promise<void> {\n nodeRes.statusCode = webResponse.status;\n\n // Copy headers. Set-Cookie needs special handling: Headers.forEach()\n // joins multiple Set-Cookie values with \", \" into one entry, but each\n // cookie must be its own header per RFC 6265 §4.1. Use getSetCookie()\n // to preserve individual Set-Cookie headers.\n webResponse.headers.forEach((value, key) => {\n if (key.toLowerCase() !== 'set-cookie') {\n nodeRes.setHeader(key, value);\n }\n });\n const setCookies = webResponse.headers.getSetCookie();\n if (setCookies.length > 0) {\n nodeRes.setHeader('Set-Cookie', setCookies);\n }\n\n // Stream the body\n if (!webResponse.body) {\n nodeRes.end();\n return;\n }\n\n // Flush headers immediately so the client can start processing\n // the response (critical for SSE and other streaming responses).\n nodeRes.flushHeaders();\n\n const reader = webResponse.body.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n // write() returns false when the kernel buffer is full, but we\n // don't need back-pressure here — just keep pushing chunks.\n nodeRes.write(value);\n }\n } finally {\n reader.releaseLock();\n nodeRes.end();\n }\n}\n\n// ─── URL Classification ──────────────────────────────────────────────────\n\n/**\n * Check if a URL is a Vite-internal request that should be passed through.\n */\nfunction isViteInternal(url: string): boolean {\n return VITE_INTERNAL_PREFIXES.some((prefix) => url.startsWith(prefix));\n}\n\n/**\n * Check if a URL looks like a static asset request.\n */\nfunction isAssetRequest(url: string): boolean {\n return ASSET_EXTENSIONS.test(url);\n}\n\n// ─── Client Error Listener ─────────────────────────────────────────────\n\ninterface ClientErrorPayload {\n message: string;\n stack: string;\n componentStack: string | null;\n}\n\n/**\n * Listen for client-side errors forwarded from the browser via HMR.\n *\n * The browser entry catches uncaught errors and unhandled rejections,\n * then sends them as 'timber:client-error' custom events. We parse\n * the first app frame for the overlay's loc field and forward the\n * error to Vite's overlay protocol.\n */\nfunction listenForClientErrors(server: ViteDevServer, projectRoot: string): void {\n server.hot.on('timber:client-error', (data: ClientErrorPayload) => {\n const loc = parseFirstAppFrame(data.stack, projectRoot);\n\n let message = data.message;\n if (data.componentStack) {\n message = `${data.message}\\n\\nComponent Stack:\\n${data.componentStack.trim()}`;\n }\n\n // Log to stderr\n const RED = '\\x1b[31m';\n const BOLD = '\\x1b[1m';\n const RESET = '\\x1b[0m';\n process.stderr.write(\n `${RED}${BOLD}[timber] Client Error${RESET}\\n${RED}${data.message}${RESET}\\n\\n`\n );\n\n // Forward to Vite's overlay\n try {\n server.hot.send({\n type: 'error',\n err: {\n message,\n stack: data.stack,\n id: loc?.file,\n plugin: 'timber (Client)',\n loc: loc ? { file: loc.file, line: loc.line, column: loc.column } : undefined,\n },\n });\n } catch {\n // Overlay send must never crash the dev server\n }\n });\n}\n","/**\n * timber-entries — Vite sub-plugin for entry virtual module resolution.\n *\n * Resolves virtual:timber-rsc-entry, virtual:timber-ssr-entry,\n * virtual:timber-browser-entry to real TypeScript files, and generates\n * virtual:timber-config as serialized runtime config.\n *\n * Entry modules are real .ts files — NOT codegen strings. The only\n * generated code is virtual:timber-config (serialized runtime config).\n *\n * Design docs: 18-build-system.md §\"Entry Generation\", §\"Virtual Modules\"\n */\n\nimport type { Plugin } from 'vite';\nimport { resolve, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { existsSync } from 'node:fs';\nimport type { PluginContext } from '#/index.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// In workspace dev, __dirname is src/plugins/ and src/ is the parent.\n// In published package, entries.ts is bundled into dist/index.js so\n// __dirname is dist/ and src/ is a sibling directory.\nconst SRC_DIR = existsSync(resolve(__dirname, '..', 'server', 'rsc-entry', 'index.ts'))\n ? resolve(__dirname, '..')\n : resolve(__dirname, '..', 'src');\n\n// ─── Virtual Module IDs ──────────────────────────────────────────────────\n\nconst VIRTUAL_IDS = {\n rscEntry: 'virtual:timber-rsc-entry',\n ssrEntry: 'virtual:timber-ssr-entry',\n browserEntry: 'virtual:timber-browser-entry',\n config: 'virtual:timber-config',\n instrumentation: 'virtual:timber-instrumentation',\n} as const;\n\n/**\n * Map from virtual module IDs to their resolved file paths.\n *\n * These point to .ts source files that Vite transpiles at runtime.\n * They import virtual modules (virtual:timber-config, etc.) so they\n * cannot be pre-compiled — they must be processed by Vite's pipeline\n * with timber's plugin active. The .ts files are included in the\n * published package via the `files` field.\n */\nconst ENTRY_FILE_MAP: Record<string, string> = {\n [VIRTUAL_IDS.rscEntry]: resolve(SRC_DIR, 'server', 'rsc-entry', 'index.ts'),\n [VIRTUAL_IDS.ssrEntry]: resolve(SRC_DIR, 'server', 'ssr-entry.ts'),\n [VIRTUAL_IDS.browserEntry]: resolve(SRC_DIR, 'client', 'browser-entry.ts'),\n};\n\n/** The \\0-prefixed resolved ID for virtual:timber-config */\nconst RESOLVED_CONFIG_ID = `\\0${VIRTUAL_IDS.config}`;\n\n/** The \\0-prefixed resolved ID for virtual:timber-instrumentation */\nconst RESOLVED_INSTRUMENTATION_ID = `\\0${VIRTUAL_IDS.instrumentation}`;\n\n/**\n * Strip the \\0 prefix from a module ID.\n *\n * The RSC plugin generates browser entry imports using already-resolved\n * \\0-prefixed IDs. Vite's import-analysis cannot resolve these.\n * See 18-build-system.md §\"Resolution Quirks\".\n */\nfunction stripNullPrefix(id: string): string {\n return id.startsWith('\\0') ? id.slice(1) : id;\n}\n\n/**\n * Strip a root directory prefix from a module ID.\n *\n * Vite prefixes virtual module IDs with the project root when resolving\n * SSR build entries. We need to handle both `virtual:timber-rsc-entry`\n * and `<root>/virtual:timber-rsc-entry`.\n * See 18-build-system.md §\"Resolution Quirks\".\n */\nfunction stripRootPrefix(id: string, root: string): string {\n if (id.startsWith(root)) {\n // Remove root + path separator\n const stripped = id.slice(root.length);\n // Handle both /virtual:... and \\virtual:... (Windows)\n if (stripped.startsWith('/') || stripped.startsWith('\\\\')) {\n return stripped.slice(1);\n }\n return stripped;\n }\n return id;\n}\n\n/**\n * Generate the virtual:timber-config module source.\n *\n * Serializes output mode and feature flags for runtime consumption.\n */\nfunction generateConfigModule(ctx: PluginContext): string {\n // Resolve cookie secrets: `secret` shorthand expands to `secrets: [secret]`\n const cookieSecrets =\n ctx.config.cookies?.secrets ??\n (ctx.config.cookies?.secret ? [ctx.config.cookies.secret] : undefined);\n\n const runtimeConfig = {\n output: ctx.config.output ?? 'server',\n csrf: ctx.config.csrf ?? true,\n allowedOrigins: ctx.config.allowedOrigins,\n clientJavascript: ctx.clientJavascript,\n dev: ctx.dev ?? false,\n slowPhaseMs: ctx.config.dev?.slowPhaseMs ?? 200,\n slowRequestMs: ctx.config.slowRequestMs ?? 3000,\n cookieSecrets,\n topLoader: ctx.config.topLoader,\n debug: ctx.config.debug ?? false,\n serverTiming: ctx.config.serverTiming,\n };\n\n return [\n '// Auto-generated runtime config — do not edit.',\n '// Generated by timber-entries plugin.',\n '',\n `const config = ${JSON.stringify(runtimeConfig, null, 2)};`,\n '',\n 'export default config;',\n ].join('\\n');\n}\n\n/**\n * Detect the user's instrumentation.ts file at the project root.\n *\n * Checks for instrumentation.ts, .js, and .mjs — matching the same\n * extensions as timber.config.ts detection.\n */\nexport function detectInstrumentationFile(root: string): string | null {\n const extensions = ['.ts', '.js', '.mjs'];\n const dirs = [root, resolve(root, 'src')];\n for (const dir of dirs) {\n for (const ext of extensions) {\n const candidate = resolve(dir, `instrumentation${ext}`);\n if (existsSync(candidate)) return candidate;\n }\n }\n return null;\n}\n\n/**\n * Generate the virtual:timber-instrumentation module source.\n *\n * When the user's instrumentation.ts exists, generates a module that\n * dynamically imports it. When it doesn't exist, generates a module\n * that returns null. The RSC entry calls this loader at startup time.\n *\n * See design/17-logging.md §\"instrumentation.ts — The Entry Point\"\n */\nexport function generateInstrumentationModule(instrumentationPath: string | null): string {\n if (instrumentationPath) {\n // Use the absolute path so the bundler can resolve and include it.\n // The dynamic import ensures the file is loaded lazily and errors\n // in the user's code don't prevent the module from being parsed.\n return [\n '// Auto-generated instrumentation loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '',\n `export default async function loadUserInstrumentation() {`,\n ` return import(${JSON.stringify(instrumentationPath)});`,\n `}`,\n ].join('\\n');\n }\n\n return [\n '// Auto-generated instrumentation loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '// No instrumentation.ts found at project root.',\n '',\n `export default async function loadUserInstrumentation() {`,\n ` return null;`,\n `}`,\n ].join('\\n');\n}\n\n/**\n * Create the timber-entries Vite plugin.\n *\n * Hooks: resolveId, load\n */\nexport function timberEntries(ctx: PluginContext): Plugin {\n return {\n name: 'timber-entries',\n\n /**\n * Resolve virtual entry and config module IDs.\n *\n * Handles:\n * - virtual:timber-rsc-entry → real file path\n * - virtual:timber-ssr-entry → real file path\n * - virtual:timber-browser-entry → real file path\n * - virtual:timber-config → \\0-prefixed virtual ID\n * - \\0 prefix stripping (RSC plugin re-imports)\n * - Root prefix stripping (SSR build entries)\n */\n resolveId(id: string) {\n // Step 1: Strip \\0 prefix if present\n let cleanId = stripNullPrefix(id);\n\n // Step 2: Strip root prefix if present\n cleanId = stripRootPrefix(cleanId, ctx.root);\n\n // Check entry file map (real files)\n if (cleanId in ENTRY_FILE_MAP) {\n return ENTRY_FILE_MAP[cleanId];\n }\n\n // Check config virtual module\n if (cleanId === VIRTUAL_IDS.config) {\n return RESOLVED_CONFIG_ID;\n }\n\n // Check instrumentation virtual module\n if (cleanId === VIRTUAL_IDS.instrumentation) {\n return RESOLVED_INSTRUMENTATION_ID;\n }\n\n return null;\n },\n\n /**\n * Load virtual modules: virtual:timber-config and virtual:timber-instrumentation.\n *\n * Entry files (rsc/ssr/browser) are real TypeScript files that Vite\n * processes normally. Only config and instrumentation need generated code.\n */\n load(id: string) {\n if (id === RESOLVED_CONFIG_ID) {\n return generateConfigModule(ctx);\n }\n if (id === RESOLVED_INSTRUMENTATION_ID) {\n const instrumentationPath = detectInstrumentationFile(ctx.root);\n return generateInstrumentationModule(instrumentationPath);\n }\n return null;\n },\n\n /**\n * Rename \"rsc-entry\" chunks in the client build to \"rsc-client-entry\".\n *\n * The RSC plugin creates client reference facades named after the RSC\n * entry (virtual:timber-rsc-entry), producing chunks like \"rsc-entry-XYZ.js\"\n * in the client output. This is confusing since those chunks contain client\n * components, not server code. Renaming clarifies their purpose.\n */\n // Note: chunk renaming (rsc-entry → rsc-client-entry) was previously done\n // in generateBundle by mutating the bundle object. Rolldown does not support\n // bundle mutation in generateBundle — assignments are silently ignored, which\n // causes the renamed file to never be emitted while code references are\n // updated, breaking client hydration. The rename is purely cosmetic and has\n // been removed. The chunks keep their original \"rsc-entry\" names.\n };\n}\n","/**\n * timber-mdx — Vite sub-plugin for MDX page rendering.\n *\n * Wires @mdx-js/rollup into the Vite pipeline when MDX is activated.\n * MDX is activated when pageExtensions includes 'mdx' or 'md', or\n * when a content/ directory exists at the project root.\n *\n * Design doc: 20-content-collections.md §\"The timber-mdx Plugin\"\n */\n\nimport type { Plugin } from 'vite';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { PluginContext } from '#/index.js';\n\nconst MDX_EXTENSIONS = ['mdx', 'md'];\n\n/**\n * Check if mdx-components.tsx (or .ts, .jsx, .js) exists at the project root\n * or in src/. Root takes precedence, matching Next.js behavior.\n * Returns the absolute path if found, otherwise undefined.\n */\nexport function findMdxComponents(root: string): string | undefined {\n const candidates = [\n 'mdx-components.tsx',\n 'mdx-components.ts',\n 'mdx-components.jsx',\n 'mdx-components.js',\n ];\n const dirs = [root, join(root, 'src')];\n for (const dir of dirs) {\n for (const name of candidates) {\n const p = join(dir, name);\n if (existsSync(p)) return p;\n }\n }\n return undefined;\n}\n\n/**\n * Determine if MDX should be activated based on config and project structure.\n */\nfunction shouldActivate(ctx: PluginContext): boolean {\n const exts = ctx.config.pageExtensions;\n if (exts && exts.some((ext) => MDX_EXTENSIONS.includes(ext))) {\n return true;\n }\n\n if (existsSync(join(ctx.root, 'content'))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Try to dynamically import a module by name. Returns the default export\n * or the module itself, or undefined if the module is not installed.\n */\nasync function tryImport(name: string): Promise<unknown | undefined> {\n try {\n const mod = await import(name);\n return mod.default ?? mod;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Create the timber-mdx Vite plugin.\n *\n * Uses the transform and resolveId hooks to delegate MDX compilation\n * to @mdx-js/rollup. The inner plugin is loaded lazily on first activation.\n *\n * Hooks: buildStart (loads @mdx-js/rollup), resolveId, load, transform\n */\nexport function timberMdx(ctx: PluginContext): Plugin {\n let innerPlugin: Plugin | null = null;\n\n async function activate(): Promise<void> {\n if (innerPlugin !== null || !shouldActivate(ctx)) return;\n\n const createMdxPlugin = (await tryImport('@mdx-js/rollup')) as\n | ((options?: Record<string, unknown>) => Plugin)\n | undefined;\n\n if (!createMdxPlugin) {\n throw new Error(\n [\n '[timber] MDX is enabled but @mdx-js/rollup is not installed.',\n '',\n 'Install it:',\n ' pnpm add -D @mdx-js/rollup remark-frontmatter remark-mdx-frontmatter',\n '',\n 'MDX is activated because pageExtensions includes \"mdx\"/\"md\" or a content/ directory exists.',\n ].join('\\n')\n );\n }\n\n const mdxConfig = ctx.config.mdx ?? {};\n\n // Auto-register frontmatter plugins\n const remarkPlugins: unknown[] = [];\n const remarkFrontmatter = await tryImport('remark-frontmatter');\n const remarkMdxFrontmatter = await tryImport('remark-mdx-frontmatter');\n if (remarkFrontmatter) remarkPlugins.push(remarkFrontmatter);\n if (remarkMdxFrontmatter) remarkPlugins.push(remarkMdxFrontmatter);\n\n if (mdxConfig.remarkPlugins) {\n remarkPlugins.push(...mdxConfig.remarkPlugins);\n }\n\n const mdxOptions: Record<string, unknown> = {\n remarkPlugins,\n rehypePlugins: mdxConfig.rehypePlugins ?? [],\n recmaPlugins: mdxConfig.recmaPlugins ?? [],\n remarkRehypeOptions: mdxConfig.remarkRehypeOptions,\n };\n\n const mdxComponentsPath = findMdxComponents(ctx.root);\n if (mdxComponentsPath) {\n mdxOptions.providerImportSource = mdxComponentsPath;\n }\n\n innerPlugin = createMdxPlugin(mdxOptions);\n }\n\n return {\n name: 'timber-mdx',\n // Must run before @vitejs/plugin-rsc (rsc:use-client) which tries to parse\n // all files as JS. MDX files must be compiled to JS first.\n enforce: 'pre',\n\n async buildStart(options) {\n ctx.timer.start('mdx-activate');\n await activate();\n ctx.timer.end('mdx-activate');\n if (!innerPlugin) return;\n if (typeof innerPlugin.buildStart === 'function') {\n await (innerPlugin.buildStart as (options: unknown) => void | Promise<void>).call(\n this,\n options\n );\n }\n },\n\n async resolveId(source, importer, options) {\n if (!innerPlugin) return null;\n // MDX pages are server components — only compile in the RSC environment.\n // This prevents server-only deps (e.g. bright via mdx-components) from\n // being pulled into SSR or client bundles.\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.resolveId === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.resolveId as any).call(this, source, importer, options);\n }\n return null;\n },\n\n async load(id) {\n if (!innerPlugin) return null;\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.load === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.load as any).call(this, id);\n }\n return null;\n },\n\n async transform(code, id) {\n if (!innerPlugin) return null;\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.transform === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.transform as any).call(this, code, id);\n }\n return null;\n },\n };\n}\n","/**\n * Lint status files and error.tsx for missing 'use client' directive.\n *\n * Status files (error.tsx, 404.tsx, 4xx.tsx, 5xx.tsx, NNN.tsx) and legacy\n * compat files (not-found.tsx, forbidden.tsx, unauthorized.tsx) are passed\n * as fallbackComponent to TimberErrorBoundary — a 'use client' component.\n * RSC forbids passing server component functions as props to client\n * components, causing a hard-to-debug runtime error.\n *\n * This module provides a build/dev-time check that warns when these files\n * are missing the 'use client' directive.\n *\n * See design/10-error-handling.md §\"Status-Code Files\".\n */\n\nimport { readFileSync } from 'node:fs';\nimport type { RouteTree, SegmentNode } from './types.js';\nimport { detectFileDirective } from '#/utils/directive-parser.js';\n\n/** Extensions that require 'use client' (component files, not MDX/JSON). */\nconst CLIENT_REQUIRED_EXTENSIONS = new Set(['tsx', 'jsx', 'ts', 'js']);\n\nexport interface StatusFileLintWarning {\n filePath: string;\n fileType: string;\n}\n\n/**\n * Walk the route tree and check all status files and error files for\n * the 'use client' directive. Returns an array of warnings for files\n * that are missing it.\n *\n * MDX and JSON status files are excluded — MDX files are server components\n * by design, and JSON files are data, not components.\n */\nexport function lintStatusFileDirectives(tree: RouteTree): StatusFileLintWarning[] {\n const warnings: StatusFileLintWarning[] = [];\n walkNode(tree.root, warnings);\n return warnings;\n}\n\nfunction walkNode(node: SegmentNode, warnings: StatusFileLintWarning[]): void {\n // Check error.tsx\n if (node.error) {\n checkFile(node.error.filePath, node.error.extension, 'error', warnings);\n }\n\n // Check status-code files (404.tsx, 4xx.tsx, 5xx.tsx, etc.)\n if (node.statusFiles) {\n for (const [code, file] of node.statusFiles) {\n checkFile(file.filePath, file.extension, code, warnings);\n }\n }\n\n // Check legacy compat files (not-found.tsx, forbidden.tsx, unauthorized.tsx)\n if (node.legacyStatusFiles) {\n for (const [name, file] of node.legacyStatusFiles) {\n checkFile(file.filePath, file.extension, name, warnings);\n }\n }\n\n // Recurse into children and slots\n for (const child of node.children) {\n walkNode(child, warnings);\n }\n for (const [, slotNode] of node.slots) {\n walkNode(slotNode, warnings);\n }\n}\n\nfunction checkFile(\n filePath: string,\n extension: string,\n fileType: string,\n warnings: StatusFileLintWarning[]\n): void {\n if (!CLIENT_REQUIRED_EXTENSIONS.has(extension)) return;\n\n let code: string;\n try {\n code = readFileSync(filePath, 'utf-8');\n } catch {\n return; // File unreadable — skip silently\n }\n\n const directive = detectFileDirective(code, ['use client']);\n if (!directive) {\n warnings.push({ filePath, fileType });\n }\n}\n\n/**\n * Format warnings into human-readable console output.\n */\nexport function formatStatusFileLintWarnings(warnings: StatusFileLintWarning[]): string {\n const lines = [\n `[timber] ${warnings.length} status/error file${warnings.length > 1 ? 's' : ''} missing 'use client' directive:`,\n '',\n ];\n\n for (const w of warnings) {\n lines.push(` ${w.filePath}`);\n }\n\n lines.push('');\n lines.push(\n \" Status files and error.tsx are rendered inside TimberErrorBoundary (a 'use client' component).\"\n );\n lines.push(\" Add 'use client' as the first line of each file to avoid a runtime error.\");\n\n return lines.join('\\n');\n}\n","/**\n * timber-routing — Vite sub-plugin for route manifest generation.\n *\n * Bridges the route scanner with Vite's module graph. Scans app/ at startup,\n * watches for file changes in dev, and serves the virtual:timber-route-manifest\n * module that entry files consume.\n *\n * Design docs: 18-build-system.md §\"Virtual Modules\", 07-routing.md\n */\n\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { writeFile, mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { scanRoutes } from '#/routing/scanner.js';\nimport { generateRouteMap } from '#/routing/codegen.js';\nimport { collectInterceptionRewrites } from '#/routing/interception.js';\nimport {\n lintStatusFileDirectives,\n formatStatusFileLintWarnings,\n} from '#/routing/status-file-lint.js';\nimport type { RouteTree, SegmentNode, RouteFile } from '#/routing/types.js';\nimport type { PluginContext } from '#/index.js';\n\nconst VIRTUAL_MODULE_ID = 'virtual:timber-route-manifest';\nconst RESOLVED_VIRTUAL_ID = `\\0${VIRTUAL_MODULE_ID}`;\n\n/**\n * File convention names we track for changes that require manifest regeneration.\n */\nconst ROUTE_FILE_PATTERNS =\n /\\/(page|layout|middleware|access|route|error|default|denied|search-params|\\d{3}|[45]xx|not-found|forbidden|unauthorized|sitemap|robots|manifest|favicon|icon|opengraph-image|twitter-image|apple-icon)\\./;\n\n/**\n * Create the timber-routing Vite plugin.\n *\n * Hooks: resolveId, load, buildStart, configureServer\n */\n/** Absolute path to the generated route map declaration file. */\nconst CODEGEN_OUTPUT = '.timber/timber-routes.d.ts';\n\n/**\n * Content of the timber-env.d.ts file written to the project root.\n *\n * Uses a triple-slash reference so TypeScript auto-discovers the generated\n * route map without the user needing to edit tsconfig.json — same pattern\n * as Next.js's next-env.d.ts.\n */\nconst TIMBER_ENV_DTS = [\n '// This file is auto-generated by timber.js. Do not edit.',\n '// It ensures TypeScript picks up the generated route types.',\n '// eslint-disable-next-line @typescript-eslint/triple-slash-reference',\n '/// <reference path=\".timber/timber-routes.d.ts\" />',\n '',\n].join('\\n');\n\n/**\n * Write the generated route map and the timber-env.d.ts reference file.\n *\n * Fire-and-forget — never awaited to avoid blocking the hot path.\n * Errors are swallowed; a missing .d.ts is a developer UX issue, not a runtime failure.\n */\nfunction writeCodegen(ctx: PluginContext): void {\n if (!ctx.routeTree) return;\n const timberDir = join(ctx.root, '.timber');\n const content = generateRouteMap(ctx.routeTree, { appDir: ctx.appDir, outputDir: timberDir });\n const routesPath = join(ctx.root, CODEGEN_OUTPUT);\n const envPath = join(ctx.root, 'timber-env.d.ts');\n mkdir(timberDir, { recursive: true })\n .then(() =>\n Promise.all([\n writeFile(routesPath, content, 'utf-8'),\n writeFile(envPath, TIMBER_ENV_DTS, 'utf-8'),\n ])\n )\n .catch((err) => {\n // Non-fatal — types are a dev convenience, but log so issues are visible\n console.warn('[timber] Failed to write codegen output:', err);\n });\n}\n\nexport function timberRouting(ctx: PluginContext): Plugin {\n /** Track warned files to avoid repeating warnings on rescan. */\n const warnedFiles = new Set<string>();\n\n function rescan(): void {\n ctx.timer.start('route-scan');\n ctx.routeTree = scanRoutes(ctx.appDir, {\n pageExtensions: ctx.config.pageExtensions,\n });\n ctx.timer.end('route-scan');\n writeCodegen(ctx);\n\n // Lint status files for missing 'use client' directive\n const warnings = lintStatusFileDirectives(ctx.routeTree);\n const newWarnings = warnings.filter((w) => !warnedFiles.has(w.filePath));\n if (newWarnings.length > 0) {\n for (const w of newWarnings) warnedFiles.add(w.filePath);\n console.warn(formatStatusFileLintWarnings(newWarnings));\n }\n }\n\n return {\n name: 'timber-routing',\n\n /**\n * Resolve the virtual module ID.\n *\n * Handles:\n * - virtual:timber-route-manifest\n * - <root>/virtual:timber-route-manifest (Vite SSR build root prefix)\n * - \\0virtual:timber-route-manifest (RSC plugin re-imports)\n */\n resolveId(id: string) {\n // Strip \\0 prefix if present (RSC plugin generates these)\n const cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n\n if (cleanId === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n // Handle root-prefixed resolution in SSR build\n if (cleanId.endsWith(`/${VIRTUAL_MODULE_ID}`)) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n return null;\n },\n\n /**\n * Generate the route manifest module.\n *\n * The manifest exports the route tree as a serialized data structure\n * with absolute import paths for all file references.\n */\n load(id: string) {\n if (id !== RESOLVED_VIRTUAL_ID) return null;\n\n // If routeTree hasn't been built yet (shouldn't happen), scan now\n if (!ctx.routeTree) {\n rescan();\n }\n\n return generateManifestModule(ctx.routeTree!);\n },\n\n /**\n * Scan routes at build start.\n *\n * In dev mode, skip — configureServer runs after buildStart and will\n * do its own scan. Avoids a redundant FS traversal on cold start.\n */\n buildStart() {\n if (ctx.dev) return;\n rescan();\n },\n\n /**\n * Set up file watcher in dev mode.\n *\n * Watches app/ for file additions/deletions/renames that affect\n * the route tree, regenerates the manifest, and invalidates\n * dependent modules via HMR.\n */\n configureServer(devServer: ViteDevServer) {\n // Initial scan (only scan point in dev — buildStart is skipped)\n rescan();\n\n // Watch the app directory\n devServer.watcher.add(ctx.appDir);\n\n const handleFileChange = (filePath: string) => {\n // Only react to route-significant files in the app directory\n if (!filePath.startsWith(ctx.appDir)) return;\n if (!ROUTE_FILE_PATTERNS.test(filePath)) return;\n\n // Rescan the route tree\n rescan();\n\n // Invalidate the virtual module in all environments\n invalidateManifest(devServer);\n };\n\n devServer.watcher.on('add', handleFileChange);\n devServer.watcher.on('unlink', handleFileChange);\n // Also watch renames (which are add+unlink) — handled by the above\n },\n };\n}\n\n/**\n * Invalidate the virtual route manifest module across all Vite environments.\n *\n * When the route tree changes, any environment that has imported the manifest\n * needs to be invalidated so the next request/transform picks up the new tree.\n */\nfunction invalidateManifest(server: ViteDevServer): void {\n for (const envName of Object.keys(server.environments)) {\n const env = server.environments[envName];\n if (!env?.moduleGraph) continue;\n\n const mod = env.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);\n if (mod) {\n env.moduleGraph.invalidateModule(mod);\n }\n }\n\n // Trigger HMR full reload — route changes are structural\n server.hot.send({ type: 'full-reload' });\n}\n\n/**\n * Generate the virtual module source code for the route manifest.\n *\n * The output is a default-exported object containing the serialized route tree.\n * All file references use absolute paths (required for virtual modules).\n */\nfunction generateManifestModule(tree: RouteTree): string {\n const imports: string[] = [];\n let importIndex = 0;\n\n /**\n * Create a lazy import expression for a route file.\n * Returns the import variable name.\n */\n function addImport(file: RouteFile): string {\n const varName = `_route${importIndex++}`;\n imports.push(`const ${varName} = () => import(\"${file.filePath}\");`);\n return varName;\n }\n\n /**\n * Serialize a segment node to a JS object literal.\n */\n function serializeNode(node: SegmentNode, indent: string): string {\n const nextIndent = indent + ' ';\n const parts: string[] = [];\n\n parts.push(`${nextIndent}segmentName: ${JSON.stringify(node.segmentName)},`);\n parts.push(`${nextIndent}segmentType: ${JSON.stringify(node.segmentType)},`);\n parts.push(`${nextIndent}urlPath: ${JSON.stringify(node.urlPath)},`);\n\n if (node.paramName) {\n parts.push(`${nextIndent}paramName: ${JSON.stringify(node.paramName)},`);\n }\n\n if (node.interceptionMarker) {\n parts.push(`${nextIndent}interceptionMarker: ${JSON.stringify(node.interceptionMarker)},`);\n }\n if (node.interceptedSegmentName) {\n parts.push(\n `${nextIndent}interceptedSegmentName: ${JSON.stringify(node.interceptedSegmentName)},`\n );\n }\n\n // File conventions — absolute paths as lazy imports\n if (node.page) {\n const v = addImport(node.page);\n parts.push(\n `${nextIndent}page: { load: ${v}, filePath: ${JSON.stringify(node.page.filePath)} },`\n );\n }\n if (node.layout) {\n const v = addImport(node.layout);\n parts.push(\n `${nextIndent}layout: { load: ${v}, filePath: ${JSON.stringify(node.layout.filePath)} },`\n );\n }\n if (node.middleware) {\n const v = addImport(node.middleware);\n parts.push(\n `${nextIndent}middleware: { load: ${v}, filePath: ${JSON.stringify(node.middleware.filePath)} },`\n );\n }\n if (node.access) {\n const v = addImport(node.access);\n parts.push(\n `${nextIndent}access: { load: ${v}, filePath: ${JSON.stringify(node.access.filePath)} },`\n );\n }\n if (node.route) {\n const v = addImport(node.route);\n parts.push(\n `${nextIndent}route: { load: ${v}, filePath: ${JSON.stringify(node.route.filePath)} },`\n );\n }\n if (node.error) {\n const v = addImport(node.error);\n parts.push(\n `${nextIndent}error: { load: ${v}, filePath: ${JSON.stringify(node.error.filePath)} },`\n );\n }\n if (node.default) {\n const v = addImport(node.default);\n parts.push(\n `${nextIndent}default: { load: ${v}, filePath: ${JSON.stringify(node.default.filePath)} },`\n );\n }\n if (node.denied) {\n const v = addImport(node.denied);\n parts.push(\n `${nextIndent}denied: { load: ${v}, filePath: ${JSON.stringify(node.denied.filePath)} },`\n );\n }\n if (node.searchParams) {\n const v = addImport(node.searchParams);\n parts.push(\n `${nextIndent}searchParams: { load: ${v}, filePath: ${JSON.stringify(node.searchParams.filePath)} },`\n );\n }\n\n // Status-code files\n if (node.statusFiles && node.statusFiles.size > 0) {\n const statusEntries: string[] = [];\n for (const [code, file] of node.statusFiles) {\n const v = addImport(file);\n statusEntries.push(\n `${nextIndent} ${JSON.stringify(code)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`\n );\n }\n parts.push(`${nextIndent}statusFiles: {\\n${statusEntries.join(',\\n')}\\n${nextIndent}},`);\n }\n\n // JSON status-code files\n if (node.jsonStatusFiles && node.jsonStatusFiles.size > 0) {\n const jsonEntries: string[] = [];\n for (const [code, file] of node.jsonStatusFiles) {\n const v = addImport(file);\n jsonEntries.push(\n `${nextIndent} ${JSON.stringify(code)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`\n );\n }\n parts.push(`${nextIndent}jsonStatusFiles: {\\n${jsonEntries.join(',\\n')}\\n${nextIndent}},`);\n }\n\n // Legacy status files\n if (node.legacyStatusFiles && node.legacyStatusFiles.size > 0) {\n const legacyEntries: string[] = [];\n for (const [name, file] of node.legacyStatusFiles) {\n const v = addImport(file);\n legacyEntries.push(\n `${nextIndent} ${JSON.stringify(name)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`\n );\n }\n parts.push(\n `${nextIndent}legacyStatusFiles: {\\n${legacyEntries.join(',\\n')}\\n${nextIndent}},`\n );\n }\n\n // Metadata route files (sitemap.ts, robots.ts, icon.tsx, etc.)\n if (node.metadataRoutes && node.metadataRoutes.size > 0) {\n const metaEntries: string[] = [];\n for (const [name, file] of node.metadataRoutes) {\n const v = addImport(file);\n metaEntries.push(\n `${nextIndent} ${JSON.stringify(name)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`\n );\n }\n parts.push(`${nextIndent}metadataRoutes: {\\n${metaEntries.join(',\\n')}\\n${nextIndent}},`);\n }\n\n // Children\n if (node.children.length > 0) {\n const childNodes = node.children.map((c) => serializeNode(c, nextIndent));\n parts.push(`${nextIndent}children: [\\n${childNodes.join(',\\n')}\\n${nextIndent}],`);\n } else {\n parts.push(`${nextIndent}children: [],`);\n }\n\n // Parallel slots\n if (node.slots.size > 0) {\n const slotEntries: string[] = [];\n for (const [slotName, slotNode] of node.slots) {\n slotEntries.push(\n `${nextIndent} ${JSON.stringify(slotName)}: ${serializeNode(slotNode, nextIndent + ' ')}`\n );\n }\n parts.push(`${nextIndent}slots: {\\n${slotEntries.join(',\\n')}\\n${nextIndent}},`);\n } else {\n parts.push(`${nextIndent}slots: {},`);\n }\n\n return `${indent}{\\n${parts.join('\\n')}\\n${indent}}`;\n }\n\n const rootSerialized = serializeNode(tree.root, ' ');\n\n // Proxy file\n let proxyLine = '';\n if (tree.proxy) {\n const v = addImport(tree.proxy);\n proxyLine = ` proxy: { load: ${v}, filePath: ${JSON.stringify(tree.proxy.filePath)} },`;\n }\n\n // Interception rewrites — computed at build time from the route tree.\n // Only interceptedPattern and interceptingPrefix are needed at runtime.\n const rewrites = collectInterceptionRewrites(tree.root);\n const rewritesLine =\n rewrites.length > 0\n ? ` interceptionRewrites: ${JSON.stringify(rewrites.map((r) => ({ interceptedPattern: r.interceptedPattern, interceptingPrefix: r.interceptingPrefix })))},`\n : '';\n\n const code = [\n '// Auto-generated route manifest — do not edit.',\n '// Generated by timber-routing plugin.',\n '',\n ...imports,\n '',\n 'const manifest = {',\n proxyLine,\n rewritesLine,\n ` root: ${rootSerialized},`,\n '};',\n '',\n 'export default manifest;',\n ]\n .filter((line) => line !== undefined && line !== '')\n .join('\\n');\n\n return code;\n}\n","/**\n * timber-shims — Vite sub-plugin for next/* → timber shim resolution.\n *\n * Intercepts imports of next/* modules and redirects them to timber.js\n * shim implementations. This enables Next.js-compatible libraries\n * (nuqs, next-intl, etc.) to work unmodified.\n *\n * NOTE: This plugin does NOT resolve @timber-js/app/* subpath imports.\n * Those are handled by Vite's native package.json `exports` resolution,\n * which maps them to dist/ files. This ensures a single module instance\n * for shared modules like request-context (ALS singleton).\n *\n * Design doc: 18-build-system.md §\"Shim Map\"\n */\n\nimport type { Plugin } from 'vite';\nimport { resolve, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { PluginContext } from '#/index.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n// Detect whether we're running from source (src/plugins/) or dist (dist/).\n// From src/plugins/: go up 2 levels to package root.\n// From dist/: go up 1 level to package root.\n// When Rollup bundles into dist/index.js, __dirname is dist/, not src/plugins/.\nconst PKG_ROOT = __dirname.endsWith('plugins')\n ? resolve(__dirname, '..', '..')\n : resolve(__dirname, '..');\nconst SHIMS_DIR = resolve(PKG_ROOT, 'src', 'shims');\n\n/**\n * Virtual module IDs for server-only and client-only poison pills.\n *\n * These packages cause build errors when imported in the wrong environment:\n * - `server-only` errors when imported in a client component\n * - `client-only` errors when imported in a server component\n */\nconst SERVER_ONLY_VIRTUAL = '\\0timber:server-only';\nconst CLIENT_ONLY_VIRTUAL = '\\0timber:client-only';\n\n/**\n * Map from next/* import specifiers to shim file paths.\n *\n * The shim map is a separate data structure (not embedded in the plugin)\n * per the task's approach constraints.\n */\nconst SHIM_MAP: Record<string, string> = {\n 'next/link': resolve(SHIMS_DIR, 'link.ts'),\n 'next/image': resolve(SHIMS_DIR, 'image.ts'),\n 'next/navigation': resolve(SHIMS_DIR, 'navigation.ts'),\n 'next/headers': resolve(SHIMS_DIR, 'headers.ts'),\n // next/font/* redirects to the timber-fonts virtual modules.\n // The fonts plugin's load hook serves the actual module code.\n 'next/font/google': '\\0@timber/fonts/google',\n 'next/font/local': '\\0@timber/fonts/local',\n};\n\n/**\n * Strip .js extension from an import specifier.\n *\n * Libraries like nuqs import `next/navigation.js` with an explicit\n * extension. We strip it before matching against the shim map.\n */\nfunction stripJsExtension(id: string): string {\n return id.endsWith('.js') ? id.slice(0, -3) : id;\n}\n\n/**\n * Create the timber-shims Vite plugin.\n *\n * Hooks: resolveId, load\n */\nexport function timberShims(_ctx: PluginContext): Plugin {\n return {\n name: 'timber-shims',\n // Must run before Vite's built-in resolution so that server-only/client-only\n // poison pills are intercepted even when imported from node_modules deps\n // (e.g. bright, next-intl). Without this, the dep optimizer resolves to the\n // real CJS package which throws at runtime in the SSR environment.\n enforce: 'pre',\n\n /**\n * Resolve next/* imports to shim files.\n *\n * Resolution order:\n * 1. Check server-only / client-only poison pill packages\n * 2. Strip .js extension from the import specifier\n * 3. Check next/* shim map\n * 4. Return null (pass through) for everything else\n *\n * @timber-js/app/server is resolved to src/ so it shares the same module\n * instance as framework internals (which import via #/). This ensures\n * a single requestContextAls and _getRscFallback variable.\n *\n * @timber-js/app/client is resolved to src/ in the SSR environment so\n * client hooks share the same module instance as ssr-entry.ts internals.\n * In RSC it resolves to dist/ (via package.json exports) where 'use client'\n * is preserved on the entry for client boundary detection.\n */\n resolveId(id: string) {\n // Poison pill packages — resolve to virtual modules handled by load()\n if (id === 'server-only') return SERVER_ONLY_VIRTUAL;\n if (id === 'client-only') return CLIENT_ONLY_VIRTUAL;\n\n const cleanId = stripJsExtension(id);\n\n // Check next/* shim map.\n // In the client (browser) environment, next/navigation resolves to\n // navigation-client.ts which only re-exports client hooks — not server\n // functions like redirect() and deny(). This prevents server/primitives.ts\n // from being pulled into the browser bundle.\n if (cleanId in SHIM_MAP) {\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName === 'client' && cleanId === 'next/navigation') {\n return resolve(SHIMS_DIR, 'navigation-client.ts');\n }\n return SHIM_MAP[cleanId];\n }\n\n // @timber-js/app/server → src/ in server environments so user code\n // shares the same module instance as framework internals (single ALS).\n // In the client environment, return a virtual empty module — server\n // code must never be bundled into the browser.\n if (cleanId === '@timber-js/app/server') {\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName === 'client') {\n return '\\0timber:server-empty';\n }\n return resolve(PKG_ROOT, 'src', 'server', 'index.ts');\n }\n\n // @timber-js/app/client → src/ in the SSR environment so client hooks\n // (useParams, usePathname, etc.) share the same module instance as\n // ssr-entry.ts's internal imports (via #/client/...).\n //\n // Without this remap, @timber-js/app/client resolves to dist/ (via\n // package.json exports), creating a module instance split: ssr-entry.ts\n // registers the ALS-backed SSR data provider on the src/ instance of\n // ssr-data.ts, but client component hooks read getSsrData() from the\n // dist/ instance — which has no provider. Result: hooks like useParams()\n // return empty defaults during SSR.\n //\n // This remap is SSR-only. The RSC environment still resolves to dist/\n // where 'use client' is preserved on the entry (needed for client\n // boundary detection). The client (browser) environment uses dist/\n // for bundling.\n if (cleanId === '@timber-js/app/client') {\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName === 'ssr') {\n return resolve(PKG_ROOT, 'src', 'client', 'index.ts');\n }\n }\n\n return null;\n },\n\n /**\n * Serve virtual modules for server-only / client-only poison pills.\n *\n * In the correct environment, the module is a no-op (empty export).\n * In the wrong environment, it throws a build-time error message that\n * clearly identifies the boundary violation.\n */\n load(id: string) {\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n const isClient = envName === 'client';\n\n if (id === SERVER_ONLY_VIRTUAL) {\n if (isClient) {\n return `throw new Error(\n \"This module cannot be imported from a Client Component module. \" +\n \"It should only be used from a Server Component.\"\n);`;\n }\n // No-op in server environments (rsc, ssr)\n return 'export {};';\n }\n\n if (id === CLIENT_ONLY_VIRTUAL) {\n if (!isClient) {\n return `throw new Error(\n \"This module cannot be imported from a Server Component module. \" +\n \"It should only be used from a Client Component.\"\n);`;\n }\n // No-op in client environment\n return 'export {};';\n }\n\n // Error module for @timber-js/app/server in client environment.\n // Server modules must never be bundled into the browser — if this\n // module is reached, there is a broken import chain that needs fixing.\n if (id === '\\0timber:server-empty') {\n // Export named stubs instead of throwing at evaluation time.\n // Throwing at eval breaks the module system — the browser can't\n // resolve named imports like `import { notFound } from '...'`.\n // Instead, each stub throws at call time with a clear message.\n return `\nconst msg = \"[timber] @timber-js/app/server was imported from client code. \" +\n \"Server modules (headers, cookies, redirect, deny, etc.) cannot be used in client components. \" +\n \"If you need these APIs, move the import to a server component or middleware.\";\nfunction stub() { throw new Error(msg); }\nexport const headers = stub;\nexport const cookies = stub;\nexport const searchParams = stub;\nexport const deny = stub;\nexport const notFound = stub;\nexport const redirect = stub;\nexport const permanentRedirect = stub;\nexport const redirectExternal = stub;\nexport const waitUntil = stub;\nexport const RenderError = stub;\nexport const RedirectType = {};\nexport const DenySignal = stub;\nexport const RedirectSignal = stub;\nexport const createPipeline = stub;\nexport const revalidatePath = stub;\nexport const revalidateTag = stub;\nexport const createActionClient = stub;\nexport const ActionError = stub;\nexport const validated = stub;\nexport const getFormFlash = stub;\nexport const parseFormData = stub;\nexport const coerce = stub;\n`;\n }\n },\n };\n}\n","/**\n * @font-face CSS generation.\n *\n * Generates CSS strings from font face descriptors. Used by both\n * Google and local font providers.\n *\n * Design doc: 24-fonts.md §\"Step 3: @font-face Generation\"\n */\n\nimport type { FontFaceDescriptor } from './types.js';\n\n/**\n * Generate a single `@font-face` CSS rule from a descriptor.\n */\nexport function generateFontFace(desc: FontFaceDescriptor): string {\n const lines: string[] = [];\n lines.push('@font-face {');\n lines.push(` font-family: '${desc.family}';`);\n lines.push(` src: ${desc.src};`);\n if (desc.weight) lines.push(` font-weight: ${desc.weight};`);\n if (desc.style) lines.push(` font-style: ${desc.style};`);\n if (desc.display) lines.push(` font-display: ${desc.display};`);\n if (desc.unicodeRange) lines.push(` unicode-range: ${desc.unicodeRange};`);\n lines.push('}');\n return lines.join('\\n');\n}\n\n/**\n * Generate multiple `@font-face` rules from an array of descriptors.\n */\nexport function generateFontFaces(descriptors: FontFaceDescriptor[]): string {\n return descriptors.map(generateFontFace).join('\\n\\n');\n}\n\n/**\n * Generate a scoped CSS class that sets a CSS custom property for the font.\n *\n * Example output:\n * ```css\n * .timber-font-inter {\n * --font-sans: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * font-family: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * }\n * ```\n */\nexport function generateVariableClass(\n className: string,\n variable: string,\n fontFamily: string\n): string {\n return `.${className} {\\n ${variable}: ${fontFamily};\\n font-family: ${fontFamily};\\n}`;\n}\n\n/**\n * Generate a scoped CSS class that applies font-family directly.\n *\n * Used when no `variable` is specified — the className applies\n * the font-family inline instead of through a CSS custom property.\n *\n * Example output:\n * ```css\n * .timber-font-inter {\n * font-family: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * }\n * ```\n */\nexport function generateFontFamilyClass(className: string, fontFamily: string): string {\n return `.${className} {\\n font-family: ${fontFamily};\\n}`;\n}\n","/**\n * Size-adjusted fallback font generation.\n *\n * Generates `@font-face` declarations for fallback fonts with\n * `size-adjust`, `ascent-override`, `descent-override`, and\n * `line-gap-override` to match custom font metrics and eliminate CLS.\n *\n * Design doc: 24-fonts.md §\"Step 4: Size-Adjusted Fallbacks\"\n */\n\nimport type { FontFaceDescriptor } from './types.js';\n\n/**\n * Font metrics for size-adjusted fallback calculation.\n *\n * Values are percentages used in CSS override descriptors.\n */\ninterface FallbackMetrics {\n /** The local() system font to use as base. */\n fallbackFont: string;\n /** size-adjust percentage (e.g. 107.64). */\n sizeAdjust: number;\n /** ascent-override percentage (e.g. 90.49). */\n ascentOverride: number;\n /** descent-override percentage (e.g. 22.48). */\n descentOverride: number;\n /** line-gap-override percentage (e.g. 0). */\n lineGapOverride: number;\n}\n\n/**\n * Lookup table for commonly used Google Fonts.\n *\n * Metrics sourced from fontaine / @capsizecss/metrics.\n * Keyed by lowercase font family name.\n */\nconst FALLBACK_METRICS: Record<string, FallbackMetrics> = {\n 'inter': {\n fallbackFont: 'Arial',\n sizeAdjust: 107.64,\n ascentOverride: 90.49,\n descentOverride: 22.48,\n lineGapOverride: 0,\n },\n 'roboto': {\n fallbackFont: 'Arial',\n sizeAdjust: 100.3,\n ascentOverride: 92.77,\n descentOverride: 24.41,\n lineGapOverride: 0,\n },\n 'open sans': {\n fallbackFont: 'Arial',\n sizeAdjust: 105.48,\n ascentOverride: 101.03,\n descentOverride: 27.47,\n lineGapOverride: 0,\n },\n 'lato': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.5,\n ascentOverride: 100.22,\n descentOverride: 21.16,\n lineGapOverride: 0,\n },\n 'montserrat': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.17,\n ascentOverride: 85.13,\n descentOverride: 22.07,\n lineGapOverride: 0,\n },\n 'poppins': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.76,\n ascentOverride: 96.31,\n descentOverride: 32.1,\n lineGapOverride: 0,\n },\n 'roboto mono': {\n fallbackFont: 'Courier New',\n sizeAdjust: 109.29,\n ascentOverride: 87.79,\n descentOverride: 23.1,\n lineGapOverride: 0,\n },\n 'jetbrains mono': {\n fallbackFont: 'Courier New',\n sizeAdjust: 112.7,\n ascentOverride: 89.53,\n descentOverride: 24.21,\n lineGapOverride: 0,\n },\n 'source code pro': {\n fallbackFont: 'Courier New',\n sizeAdjust: 106.13,\n ascentOverride: 93.47,\n descentOverride: 26.01,\n lineGapOverride: 0,\n },\n 'fira code': {\n fallbackFont: 'Courier New',\n sizeAdjust: 112.96,\n ascentOverride: 86.87,\n descentOverride: 26.34,\n lineGapOverride: 0,\n },\n 'nunito': {\n fallbackFont: 'Arial',\n sizeAdjust: 103.62,\n ascentOverride: 99.45,\n descentOverride: 34.8,\n lineGapOverride: 0,\n },\n 'playfair display': {\n fallbackFont: 'Georgia',\n sizeAdjust: 110.72,\n ascentOverride: 84.44,\n descentOverride: 23.56,\n lineGapOverride: 0,\n },\n 'merriweather': {\n fallbackFont: 'Georgia',\n sizeAdjust: 107.66,\n ascentOverride: 91.93,\n descentOverride: 27.6,\n lineGapOverride: 0,\n },\n 'raleway': {\n fallbackFont: 'Arial',\n sizeAdjust: 107.74,\n ascentOverride: 94.19,\n descentOverride: 26.76,\n lineGapOverride: 0,\n },\n};\n\n/**\n * Known serif font families (lowercase).\n * Used for generic family detection when the name doesn't contain \"serif\".\n */\nconst SERIF_FAMILIES = new Set([\n 'playfair display',\n 'merriweather',\n 'lora',\n 'georgia',\n 'garamond',\n 'eb garamond',\n 'crimson text',\n 'libre baskerville',\n 'source serif pro',\n 'source serif 4',\n 'dm serif display',\n 'dm serif text',\n 'noto serif',\n 'pt serif',\n 'bitter',\n 'domine',\n 'cormorant',\n 'cormorant garamond',\n]);\n\nexport function getGenericFamily(family: string): string {\n const lc = family.toLowerCase();\n if (lc.includes('mono') || lc.includes('code')) return 'monospace';\n if ((lc.includes('serif') && !lc.includes('sans')) || SERIF_FAMILIES.has(lc)) {\n return 'serif';\n }\n return 'sans-serif';\n}\n\n/**\n * Generate a size-adjusted fallback @font-face for a given font family.\n *\n * Returns null if no metrics are available (unknown font — no fallback generated).\n */\nexport function generateFallbackFontFace(family: string): FontFaceDescriptor | null {\n const metrics = FALLBACK_METRICS[family.toLowerCase()];\n if (!metrics) return null;\n\n const fallbackFamily = `${family} Fallback`;\n\n return {\n family: fallbackFamily,\n src: `local('${metrics.fallbackFont}')`,\n // Encode the metrics into a CSS descriptor string.\n // We abuse the 'style' field to carry the override properties\n // since FontFaceDescriptor doesn't have dedicated fields.\n // The generateFallbackCss function handles this specially.\n };\n}\n\n/**\n * Generate the full CSS for a size-adjusted fallback font.\n *\n * This produces a complete @font-face block with override descriptors\n * that FontFaceDescriptor doesn't natively support.\n */\nexport function generateFallbackCss(family: string): string | null {\n const metrics = FALLBACK_METRICS[family.toLowerCase()];\n if (!metrics) return null;\n\n const fallbackFamily = `${family} Fallback`;\n\n const lines = [\n '@font-face {',\n ` font-family: '${fallbackFamily}';`,\n ` src: local('${metrics.fallbackFont}');`,\n ` size-adjust: ${metrics.sizeAdjust}%;`,\n ` ascent-override: ${metrics.ascentOverride}%;`,\n ` descent-override: ${metrics.descentOverride}%;`,\n ` line-gap-override: ${metrics.lineGapOverride}%;`,\n '}',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Check whether fallback metrics are available for a font family.\n */\nexport function hasFallbackMetrics(family: string): boolean {\n return family.toLowerCase() in FALLBACK_METRICS;\n}\n\n/**\n * Build the full font stack string for a font, including its\n * size-adjusted fallback and a generic family.\n *\n * Example: `'Inter', 'Inter Fallback', system-ui, sans-serif`\n */\nexport function buildFontStack(family: string): string {\n const generic = getGenericFamily(family);\n const hasMetrics = hasFallbackMetrics(family);\n\n const parts = [`'${family}'`];\n if (hasMetrics) parts.push(`'${family} Fallback'`);\n\n // Add system-ui for sans-serif fonts, ui-monospace for mono\n if (generic === 'monospace') {\n parts.push('ui-monospace');\n } else if (generic === 'sans-serif') {\n parts.push('system-ui');\n }\n parts.push(generic);\n\n return parts.join(', ');\n}\n","/**\n * Acorn-based AST utilities for extracting static font configs from source code.\n *\n * Replaces the fragile regex-based extraction in fonts.ts and local.ts.\n * Uses acorn (already a Vite dependency) for robust parsing that handles\n * comments, trailing commas, multi-line configs, and other edge cases\n * the regex approach missed.\n *\n * Design doc: 24-fonts.md §\"Step 1: Static Analysis\"\n */\n\nimport { parse } from 'acorn';\nimport type { GoogleFontConfig } from './types.js';\nimport type { LocalFontConfig, LocalFontSrc } from './types.js';\n\n// ── AST node types (minimal subset of estree) ────────────────────────────────\n\ninterface AstNode {\n type: string;\n [key: string]: unknown;\n}\n\ninterface LiteralNode extends AstNode {\n type: 'Literal';\n value: string | number | boolean | null;\n}\n\ninterface ArrayExpressionNode extends AstNode {\n type: 'ArrayExpression';\n elements: AstNode[];\n}\n\ninterface ObjectExpressionNode extends AstNode {\n type: 'ObjectExpression';\n properties: PropertyNode[];\n}\n\ninterface PropertyNode extends AstNode {\n type: 'Property';\n key: AstNode & { name?: string; value?: string | number };\n value: AstNode;\n}\n\ninterface IdentifierNode extends AstNode {\n type: 'Identifier';\n name: string;\n}\n\n// ── Core AST extraction helpers ──────────────────────────────────────────────\n\n/**\n * Parse a JavaScript expression string into an AST node.\n *\n * Wraps the expression in parens so acorn treats it as an expression statement.\n * Returns null if parsing fails.\n */\nfunction parseExpression(source: string): AstNode | null {\n try {\n const ast = parse(`(${source})`, {\n ecmaVersion: 'latest',\n sourceType: 'module',\n }) as unknown as { body: Array<{ expression: AstNode }> };\n return ast.body[0]?.expression ?? null;\n } catch {\n return null;\n }\n}\n\n/**\n * Extract a static string value from an AST node.\n * Returns undefined if the node is not a string literal.\n */\nfunction extractString(node: AstNode): string | undefined {\n if (node.type === 'Literal' && typeof (node as LiteralNode).value === 'string') {\n return (node as LiteralNode).value as string;\n }\n return undefined;\n}\n\n/**\n * Extract a static boolean value from an AST node.\n * Returns undefined if the node is not a boolean literal.\n */\nfunction extractBoolean(node: AstNode): boolean | undefined {\n if (node.type === 'Literal' && typeof (node as LiteralNode).value === 'boolean') {\n return (node as LiteralNode).value as boolean;\n }\n return undefined;\n}\n\n/**\n * Extract a string array from an AST ArrayExpression node.\n * Returns undefined if any element is not a string literal.\n */\nfunction extractStringArray(node: AstNode): string[] | undefined {\n if (node.type !== 'ArrayExpression') return undefined;\n const arr = node as ArrayExpressionNode;\n const result: string[] = [];\n for (const elem of arr.elements) {\n const s = extractString(elem);\n if (s === undefined) return undefined;\n result.push(s);\n }\n return result;\n}\n\n/**\n * Get the key name from a Property node.\n */\nfunction getPropertyKey(prop: PropertyNode): string | undefined {\n if (prop.key.type === 'Identifier') {\n return (prop.key as IdentifierNode).name;\n }\n if (prop.key.type === 'Literal' && typeof prop.key.value === 'string') {\n return prop.key.value;\n }\n return undefined;\n}\n\n/**\n * Build a map of property name → value node from an ObjectExpression.\n */\nfunction objectProperties(node: ObjectExpressionNode): Map<string, AstNode> {\n const map = new Map<string, AstNode>();\n for (const prop of node.properties) {\n // Skip spread elements or computed keys\n if (prop.type !== 'Property') continue;\n const key = getPropertyKey(prop);\n if (key) map.set(key, prop.value);\n }\n return map;\n}\n\n// ── Google font config extraction ────────────────────────────────────────────\n\n/**\n * Extract a GoogleFontConfig from the source text of a font function call's\n * object argument.\n *\n * The `callSource` should be the text of the call's argument list including\n * parens, e.g. `({ subsets: ['latin'], weight: '400' })`.\n *\n * Returns null if parsing or extraction fails.\n */\nexport function extractFontConfigAst(callSource: string): GoogleFontConfig | null {\n const node = parseExpression(callSource);\n if (!node || node.type !== 'ObjectExpression') return null;\n\n const props = objectProperties(node as ObjectExpressionNode);\n const config: GoogleFontConfig = {};\n\n // subsets: string[]\n const subsetsNode = props.get('subsets');\n if (subsetsNode) {\n const arr = extractStringArray(subsetsNode);\n if (arr) config.subsets = arr;\n }\n\n // weight: string | string[]\n const weightNode = props.get('weight');\n if (weightNode) {\n const arr = extractStringArray(weightNode);\n if (arr) {\n config.weight = arr;\n } else {\n const s = extractString(weightNode);\n if (s !== undefined) config.weight = s;\n }\n }\n\n // display: string\n const displayNode = props.get('display');\n if (displayNode) {\n const s = extractString(displayNode);\n if (s !== undefined) config.display = s as GoogleFontConfig['display'];\n }\n\n // variable: string\n const variableNode = props.get('variable');\n if (variableNode) {\n const s = extractString(variableNode);\n if (s !== undefined) config.variable = s;\n }\n\n // style: string | string[]\n const styleNode = props.get('style');\n if (styleNode) {\n const arr = extractStringArray(styleNode);\n if (arr) {\n config.style = arr;\n } else {\n const s = extractString(styleNode);\n if (s !== undefined) config.style = s;\n }\n }\n\n // preload: boolean\n const preloadNode = props.get('preload');\n if (preloadNode) {\n const b = extractBoolean(preloadNode);\n if (b !== undefined) config.preload = b;\n }\n\n return config;\n}\n\n// ── Local font config extraction ─────────────────────────────────────────────\n\n/**\n * Extract a single LocalFontSrc entry from an ObjectExpression AST node.\n */\nfunction extractLocalFontSrcEntry(node: AstNode): LocalFontSrc | null {\n if (node.type !== 'ObjectExpression') return null;\n const props = objectProperties(node as ObjectExpressionNode);\n\n const pathNode = props.get('path');\n if (!pathNode) return null;\n const path = extractString(pathNode);\n if (path === undefined) return null;\n\n const entry: LocalFontSrc = { path };\n\n const weightNode = props.get('weight');\n if (weightNode) {\n const w = extractString(weightNode);\n if (w !== undefined) entry.weight = w;\n }\n\n const styleNode = props.get('style');\n if (styleNode) {\n const s = extractString(styleNode);\n if (s !== undefined) entry.style = s;\n }\n\n return entry;\n}\n\n/**\n * Extract a LocalFontConfig from the source text of a localFont() call's\n * object argument.\n *\n * Returns null if parsing or extraction fails.\n */\nexport function extractLocalFontConfigAst(callSource: string): LocalFontConfig | null {\n const node = parseExpression(callSource);\n if (!node || node.type !== 'ObjectExpression') return null;\n\n const props = objectProperties(node as ObjectExpressionNode);\n\n // display: string\n const displayNode = props.get('display');\n const display = displayNode\n ? (extractString(displayNode) as LocalFontConfig['display'])\n : undefined;\n\n // variable: string\n const variableNode = props.get('variable');\n const variable = variableNode ? extractString(variableNode) : undefined;\n\n // family: string\n const familyNode = props.get('family');\n const family = familyNode ? extractString(familyNode) : undefined;\n\n // src: string | LocalFontSrc[]\n const srcNode = props.get('src');\n if (!srcNode) return null;\n\n // String form: src: './fonts/MyFont.woff2'\n const srcString = extractString(srcNode);\n if (srcString !== undefined) {\n return { src: srcString, display, variable, family };\n }\n\n // Array form: src: [{ path: '...', weight: '...' }, ...]\n if (srcNode.type === 'ArrayExpression') {\n const arr = srcNode as ArrayExpressionNode;\n const entries: LocalFontSrc[] = [];\n for (const elem of arr.elements) {\n const entry = extractLocalFontSrcEntry(elem);\n if (!entry) return null;\n entries.push(entry);\n }\n if (entries.length === 0) return null;\n return { src: entries, display, variable, family };\n }\n\n return null;\n}\n\n// ── Dynamic call detection ───────────────────────────────────────────────────\n\n/**\n * Detect if source code contains dynamic/computed font function calls\n * that cannot be statically analyzed.\n *\n * Uses acorn to parse the full source and inspect CallExpression nodes.\n * Returns the offending expression string if found, null if all calls are static.\n */\nexport function detectDynamicFontCallAst(source: string, importedNames: string[]): string | null {\n if (importedNames.length === 0) return null;\n\n let ast;\n try {\n ast = parse(source, {\n ecmaVersion: 'latest',\n sourceType: 'module',\n }) as unknown as { body: AstNode[] };\n } catch {\n // If we can't parse the source at all, fall back to no detection\n return null;\n }\n\n const nameSet = new Set(importedNames);\n const result = walkForDynamicCalls(ast as unknown as AstNode, nameSet, source);\n return result;\n}\n\n/**\n * Recursively walk the AST looking for CallExpression nodes where\n * the callee is one of the imported font names and the first argument\n * is not an ObjectExpression (i.e. it's dynamic).\n */\nfunction walkForDynamicCalls(node: AstNode, names: Set<string>, source: string): string | null {\n if (!node || typeof node !== 'object') return null;\n\n if (node.type === 'CallExpression') {\n const callee = node.callee as AstNode;\n if (callee.type === 'Identifier' && names.has((callee as IdentifierNode).name)) {\n const args = node.arguments as AstNode[];\n if (args.length > 0 && args[0].type !== 'ObjectExpression') {\n // Extract the argument source text\n const argStart = (args[0] as AstNode & { start: number }).start;\n const argEnd = (args[0] as AstNode & { end: number }).end;\n const argText = source.slice(argStart, argEnd);\n const calleeName = (callee as IdentifierNode).name;\n return `${calleeName}(${argText})`;\n }\n }\n }\n\n // Walk all child properties\n for (const key of Object.keys(node)) {\n if (key === 'type') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) {\n if (item && typeof item === 'object' && (item as AstNode).type) {\n const result = walkForDynamicCalls(item as AstNode, names, source);\n if (result) return result;\n }\n }\n } else if (child && typeof child === 'object' && (child as AstNode).type) {\n const result = walkForDynamicCalls(child as AstNode, names, source);\n if (result) return result;\n }\n }\n\n return null;\n}\n","/**\n * Local font processing for the timber-fonts pipeline.\n *\n * Handles:\n * - Resolving font file paths relative to the importing module\n * - Normalizing single-string `src` to array form\n * - Generating @font-face descriptors for each weight/style variant\n *\n * Does NOT handle:\n * - Font format conversion (serve whatever the user provides)\n * - Font subsetting (user's responsibility for local fonts)\n *\n * Design doc: 24-fonts.md §\"Local Fonts\"\n */\n\nimport { resolve, dirname, extname } from 'node:path';\nimport type { LocalFontConfig, LocalFontSrc, FontFaceDescriptor, ExtractedFont } from './types.js';\nimport { buildFontStack } from './fallbacks.js';\nimport { extractLocalFontConfigAst } from './ast.js';\n\n/**\n * Infer the font format from a file extension.\n *\n * Returns the CSS `format()` value for `@font-face` src descriptors.\n */\nexport function inferFontFormat(filePath: string): string {\n const ext = extname(filePath).toLowerCase();\n switch (ext) {\n case '.woff2':\n return 'woff2';\n case '.woff':\n return 'woff';\n case '.ttf':\n return 'truetype';\n case '.otf':\n return 'opentype';\n case '.eot':\n return 'embedded-opentype';\n default:\n return 'woff2';\n }\n}\n\n/**\n * Normalize `src` config to an array of LocalFontSrc entries.\n *\n * When `src` is a single string, it becomes a single entry with\n * default weight '400' and style 'normal'.\n */\nexport function normalizeSrc(src: string | LocalFontSrc[]): LocalFontSrc[] {\n if (typeof src === 'string') {\n return [{ path: src, weight: '400', style: 'normal' }];\n }\n return src.map((entry) => ({\n path: entry.path,\n weight: entry.weight ?? '400',\n style: entry.style ?? 'normal',\n }));\n}\n\n/**\n * Resolve font file paths relative to the importing module's directory.\n *\n * Takes the importer's file path and the normalized src entries,\n * returns new entries with absolute resolved paths.\n */\nexport function resolveLocalFontPaths(\n importerPath: string,\n sources: LocalFontSrc[]\n): LocalFontSrc[] {\n const importerDir = dirname(importerPath);\n return sources.map((entry) => ({\n ...entry,\n path: resolve(importerDir, entry.path),\n }));\n}\n\n/**\n * Generate a deterministic font family name from the file path\n * when no explicit `family` is provided.\n *\n * Uses the filename without extension, e.g. \"MyFont-Regular.woff2\" → \"MyFont-Regular\".\n * For multi-weight sources, uses the first file's name stem.\n */\nexport function generateFamilyName(sources: LocalFontSrc[]): string {\n if (sources.length === 0) return 'Local Font';\n const firstPath = sources[0].path;\n const basename = firstPath.split('/').pop() ?? firstPath;\n // Remove extension and weight/style suffixes for a cleaner family name\n const stem = basename.replace(/\\.[^.]+$/, '');\n // Strip common weight/style suffixes to get the family root\n const family = stem.replace(\n /[-_]?(Regular|Bold|Italic|Light|Medium|SemiBold|ExtraBold|Thin|Black|Heavy)$/i,\n ''\n );\n return family || stem;\n}\n\n/**\n * Generate @font-face descriptors for local font sources.\n *\n * Each source entry produces one @font-face rule. The `src` descriptor\n * uses a `url()` pointing to the served path under `/_timber/fonts/`.\n * The `urlPrefix` defaults to `/_timber/fonts` — the path used by both\n * the dev server middleware and the production build output.\n */\nexport function generateLocalFontFaces(\n family: string,\n sources: LocalFontSrc[],\n display: string,\n urlPrefix = '/_timber/fonts'\n): FontFaceDescriptor[] {\n return sources.map((entry) => {\n const format = inferFontFormat(entry.path);\n const basename = entry.path.split('/').pop() ?? entry.path;\n return {\n family,\n src: `url('${urlPrefix}/${basename}') format('${format}')`,\n weight: entry.weight,\n style: entry.style,\n display,\n };\n });\n}\n\n/**\n * Build the className for a local font, following the same convention\n * as Google fonts: `timber-font-<lowercase-hyphenated-family>`.\n */\nexport function localFontClassName(family: string): string {\n return `timber-font-${family.toLowerCase().replace(/\\s+/g, '-')}`;\n}\n\n/**\n * Process a local font config into an ExtractedFont.\n *\n * This is the main entry point called by the fonts plugin's transform hook\n * when it encounters a `localFont()` call.\n */\nexport function processLocalFont(config: LocalFontConfig, importerPath: string): ExtractedFont {\n const sources = normalizeSrc(config.src);\n const resolvedSources = resolveLocalFontPaths(importerPath, sources);\n const family = config.family ?? generateFamilyName(sources);\n const display = config.display ?? 'swap';\n const className = localFontClassName(family);\n const fontStack = buildFontStack(family);\n\n const weights = [...new Set(resolvedSources.map((s) => s.weight ?? '400'))];\n const styles = [...new Set(resolvedSources.map((s) => s.style ?? 'normal'))];\n\n return {\n id: `local-${family.toLowerCase().replace(/\\s+/g, '-')}-${weights.join(',')}-${styles.join(',')}`,\n family,\n provider: 'local',\n weights,\n styles,\n subsets: [],\n display,\n variable: config.variable,\n localSources: resolvedSources,\n importer: importerPath,\n className,\n fontFamily: fontStack,\n };\n}\n\n/**\n * Extract a LocalFontConfig from a static `localFont()` call source.\n *\n * Parses patterns like:\n * localFont({ src: './fonts/MyFont.woff2', display: 'swap', variable: '--font-custom' })\n * localFont({ src: [{ path: './a.woff2', weight: '400' }, { path: './b.woff2', weight: '700' }] })\n *\n * Returns null if the call cannot be statically analyzed.\n *\n * Uses acorn AST parsing for robust handling of comments, trailing commas,\n * and multi-line configs.\n */\nexport function extractLocalFontConfig(callSource: string): LocalFontConfig | null {\n return extractLocalFontConfigAst(callSource);\n}\n","/**\n * Google Fonts download, caching, and dev CDN fallback.\n *\n * At build time (production only):\n * 1. Queries Google Fonts CSS API v2 for font metadata and file URLs\n * 2. Downloads woff2 font files\n * 3. Caches them in node_modules/.cache/timber-fonts/\n * 4. Content-hashes filenames for cache busting\n * 5. Emits font files into the build output via generateBundle\n *\n * In dev mode:\n * - Generates @font-face rules pointing to Google Fonts CDN\n * - No downloads, no caching\n *\n * Design doc: 24-fonts.md §\"Step 2: Font Download & Subsetting\"\n */\n\nimport { createHash } from 'node:crypto';\nimport { readFile, writeFile, mkdir, stat } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ExtractedFont, FontFaceDescriptor } from './types.js';\n\n/** Google Fonts CSS API v2 base URL. */\nconst GOOGLE_FONTS_API = 'https://fonts.googleapis.com/css2';\n\n/**\n * User-Agent string that requests woff2 format from Google Fonts API.\n * Google serves different formats based on user-agent.\n */\nconst WOFF2_USER_AGENT =\n 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';\n\n/** Default cache directory for downloaded font files. */\nconst DEFAULT_CACHE_DIR = 'node_modules/.cache/timber-fonts';\n\n/** A parsed @font-face block from the Google Fonts CSS response. */\nexport interface GoogleFontFace {\n family: string;\n weight: string;\n style: string;\n /** The remote URL to the font file. */\n url: string;\n /** The unicode-range from the CSS (e.g. `U+0000-00FF, U+0131`). */\n unicodeRange: string;\n /** Subset label extracted from the CSS comment (e.g. `latin`, `cyrillic`). */\n subset: string;\n}\n\n/** A downloaded and cached font file, ready for build output. */\nexport interface CachedFont {\n /** The original parsed face data. */\n face: GoogleFontFace;\n /** Content-hashed filename (e.g. `inter-latin-400-normal-abc123.woff2`). */\n hashedFilename: string;\n /** Absolute path to the cached file. */\n cachePath: string;\n /** Raw font file bytes. */\n data: Buffer;\n}\n\n/**\n * Build the Google Fonts CSS API v2 URL for a given font config.\n *\n * Example output:\n * https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap&subset=latin\n */\nexport function buildGoogleFontsUrl(font: ExtractedFont): string {\n const family = font.family.replace(/\\s+/g, '+');\n\n // Build axis spec: wght for weights, ital for italic styles\n const hasItalic = font.styles.includes('italic');\n const weights = font.weights.map(Number).sort((a, b) => a - b);\n\n let axisSpec: string;\n if (hasItalic && weights.length > 0) {\n // ital,wght@0,400;0,700;1,400;1,700\n const pairs: string[] = [];\n for (const ital of [0, 1]) {\n if (ital === 1 && !hasItalic) continue;\n if (ital === 0 && font.styles.length === 1 && font.styles[0] === 'italic') continue;\n for (const w of weights) {\n pairs.push(`${ital},${w}`);\n }\n }\n axisSpec = `ital,wght@${pairs.join(';')}`;\n } else if (weights.length > 0) {\n axisSpec = `wght@${weights.join(';')}`;\n } else {\n axisSpec = '';\n }\n\n const familyParam = axisSpec ? `${family}:${axisSpec}` : family;\n\n // Build URL manually — URLSearchParams encodes +, :, @, ; which\n // the Google Fonts CSS API v2 requires as literal characters.\n const parts = [`family=${familyParam}`];\n if (font.display) parts.push(`display=${font.display}`);\n\n return `${GOOGLE_FONTS_API}?${parts.join('&')}`;\n}\n\n/**\n * Fetch the CSS from Google Fonts API and parse out @font-face blocks.\n *\n * The API returns CSS with subset comments like:\n * ```\n * /* latin * /\n * @font-face { ... }\n * ```\n *\n * We parse each block to extract the font URL, unicode-range, and subset label.\n */\nexport async function fetchGoogleFontsCss(url: string): Promise<GoogleFontFace[]> {\n const response = await fetch(url, {\n headers: { 'User-Agent': WOFF2_USER_AGENT },\n });\n\n if (!response.ok) {\n throw new Error(\n `Google Fonts API returned ${response.status}: ${response.statusText} for ${url}`\n );\n }\n\n const css = await response.text();\n return parseGoogleFontsCss(css);\n}\n\n/**\n * Parse the CSS response from Google Fonts API into structured font face data.\n *\n * Handles the Google Fonts CSS format with subset comments and @font-face blocks.\n */\nexport function parseGoogleFontsCss(css: string): GoogleFontFace[] {\n const faces: GoogleFontFace[] = [];\n\n // Match subset comments followed by @font-face blocks\n const blockPattern = /\\/\\*\\s*([a-z0-9-]+)\\s*\\*\\/\\s*@font-face\\s*\\{([^}]+)\\}/g;\n\n let match;\n while ((match = blockPattern.exec(css)) !== null) {\n const subset = match[1];\n const block = match[2];\n\n const familyMatch = block.match(/font-family:\\s*'([^']+)'/);\n const weightMatch = block.match(/font-weight:\\s*(\\d+)/);\n const styleMatch = block.match(/font-style:\\s*(\\w+)/);\n const urlMatch = block.match(/url\\(([^)]+)\\)\\s*format\\('woff2'\\)/);\n const rangeMatch = block.match(/unicode-range:\\s*([^;]+)/);\n\n if (familyMatch && urlMatch) {\n faces.push({\n family: familyMatch[1],\n weight: weightMatch?.[1] ?? '400',\n style: styleMatch?.[1] ?? 'normal',\n url: urlMatch[1],\n unicodeRange: rangeMatch?.[1]?.trim() ?? '',\n subset,\n });\n }\n }\n\n return faces;\n}\n\n/**\n * Filter parsed font faces to only the requested subsets.\n */\nexport function filterBySubsets(faces: GoogleFontFace[], subsets: string[]): GoogleFontFace[] {\n if (subsets.length === 0) return faces;\n const subsetSet = new Set(subsets);\n return faces.filter((f) => subsetSet.has(f.subset));\n}\n\n/**\n * Generate a content hash for font data.\n * Returns the first 8 hex chars of the SHA-256 hash.\n */\nexport function contentHash(data: Buffer): string {\n return createHash('sha256').update(data).digest('hex').slice(0, 8);\n}\n\n/**\n * Generate a content-hashed filename for a font face.\n *\n * Format: `<family>-<subset>-<weight>-<style>-<hash>.woff2`\n * Example: `inter-latin-400-normal-abc12345.woff2`\n */\nexport function hashedFontFilename(face: GoogleFontFace, data: Buffer): string {\n const slug = face.family.toLowerCase().replace(/\\s+/g, '-');\n const hash = contentHash(data);\n return `${slug}-${face.subset}-${face.weight}-${face.style}-${hash}.woff2`;\n}\n\n/**\n * Build the cache key for a font face.\n * Used to check if a font has already been downloaded.\n */\nexport function cacheKey(face: GoogleFontFace): string {\n const slug = face.family.toLowerCase().replace(/\\s+/g, '-');\n return `${slug}-${face.subset}-${face.weight}-${face.style}`;\n}\n\n/**\n * Download a single font file from its URL.\n */\nexport async function downloadFontFile(url: string): Promise<Buffer> {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to download font from ${url}: ${response.status}`);\n }\n return Buffer.from(await response.arrayBuffer());\n}\n\n/**\n * Download and cache all font files for a set of extracted Google fonts.\n *\n * - Checks the local cache first (node_modules/.cache/timber-fonts/)\n * - Downloads missing fonts from Google Fonts CDN\n * - Writes downloaded fonts to cache\n * - Returns CachedFont entries with content-hashed filenames\n */\nexport async function downloadAndCacheFonts(\n fonts: ExtractedFont[],\n projectRoot: string\n): Promise<CachedFont[]> {\n const cacheDir = join(projectRoot, DEFAULT_CACHE_DIR);\n await mkdir(cacheDir, { recursive: true });\n\n const googleFonts = fonts.filter((f) => f.provider === 'google');\n const cached: CachedFont[] = [];\n\n for (const font of googleFonts) {\n const apiUrl = buildGoogleFontsUrl(font);\n const faces = await fetchGoogleFontsCss(apiUrl);\n const filtered = filterBySubsets(faces, font.subsets);\n\n for (const face of filtered) {\n const key = cacheKey(face);\n const metaPath = join(cacheDir, `${key}.meta.json`);\n const dataPath = join(cacheDir, `${key}.woff2`);\n\n let data: Buffer;\n let filename: string;\n\n // Check cache\n const cacheHit = await isCacheHit(metaPath, dataPath);\n if (cacheHit) {\n data = await readFile(dataPath);\n const meta = JSON.parse(await readFile(metaPath, 'utf-8'));\n filename = meta.hashedFilename;\n } else {\n // Download and cache\n data = await downloadFontFile(face.url);\n filename = hashedFontFilename(face, data);\n\n await writeFile(dataPath, data);\n await writeFile(metaPath, JSON.stringify({ hashedFilename: filename, url: face.url }));\n }\n\n cached.push({ face, hashedFilename: filename, cachePath: dataPath, data });\n }\n }\n\n return cached;\n}\n\n/**\n * Check if both the meta and data files exist in the cache.\n */\nasync function isCacheHit(metaPath: string, dataPath: string): Promise<boolean> {\n try {\n await stat(metaPath);\n await stat(dataPath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Generate @font-face descriptors for cached (production) Google Fonts.\n *\n * Each CachedFont gets a FontFaceDescriptor pointing to the\n * content-hashed URL under `/_timber/fonts/`.\n */\nexport function generateProductionFontFaces(\n cachedFonts: CachedFont[],\n display: string\n): FontFaceDescriptor[] {\n return cachedFonts.map((cf) => ({\n family: cf.face.family,\n src: `url('/_timber/fonts/${cf.hashedFilename}') format('woff2')`,\n weight: cf.face.weight,\n style: cf.face.style,\n display,\n unicodeRange: cf.face.unicodeRange,\n }));\n}\n\n/**\n * Generate @font-face descriptors for dev mode (CDN-pointing).\n *\n * In dev mode, we query the Google Fonts API but use the CDN URLs\n * directly instead of downloading. This avoids the download/cache\n * step during `vite dev`.\n */\nexport function generateDevFontFaces(\n faces: GoogleFontFace[],\n display: string\n): FontFaceDescriptor[] {\n return faces.map((face) => ({\n family: face.family,\n src: `url('${face.url}') format('woff2')`,\n weight: face.weight,\n style: face.style,\n display,\n unicodeRange: face.unicodeRange,\n }));\n}\n\n/**\n * Resolve dev-mode font faces for an extracted font.\n *\n * Fetches the CSS from Google Fonts API and returns FontFaceDescriptors\n * pointing to CDN URLs. No files are downloaded.\n */\nexport async function resolveDevFontFaces(font: ExtractedFont): Promise<FontFaceDescriptor[]> {\n const apiUrl = buildGoogleFontsUrl(font);\n const faces = await fetchGoogleFontsCss(apiUrl);\n const filtered = filterBySubsets(faces, font.subsets);\n return generateDevFontFaces(filtered, font.display);\n}\n","/**\n * timber-fonts — Vite sub-plugin for build-time font processing.\n *\n * Handles:\n * - Virtual module resolution for `@timber/fonts/google` and `@timber/fonts/local`\n * - Static analysis of font function calls during `transform`\n * - @font-face CSS generation and scoped class output\n * - Size-adjusted fallback font generation\n *\n * Does NOT handle (separate tasks):\n * - Google Fonts downloading/caching (timber-nk5)\n * - Build manifest / Early Hints integration (timber-qnx)\n *\n * Design doc: 24-fonts.md\n */\n\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { resolve, normalize } from 'node:path';\nimport type { PluginContext } from '#/index.js';\nimport type { ExtractedFont, GoogleFontConfig } from '#/fonts/types.js';\nimport type { ManifestFontEntry } from '#/server/build-manifest.js';\nimport { generateVariableClass, generateFontFamilyClass, generateFontFaces } from '#/fonts/css.js';\nimport { generateFallbackCss, buildFontStack } from '#/fonts/fallbacks.js';\nimport { processLocalFont, generateLocalFontFaces } from '#/fonts/local.js';\nimport { inferFontFormat } from '#/fonts/local.js';\nimport { downloadAndCacheFonts, type CachedFont } from '#/fonts/google.js';\nimport {\n extractFontConfigAst,\n extractLocalFontConfigAst,\n detectDynamicFontCallAst,\n} from '#/fonts/ast.js';\n\nconst VIRTUAL_GOOGLE = '@timber/fonts/google';\nconst VIRTUAL_LOCAL = '@timber/fonts/local';\nconst RESOLVED_GOOGLE = '\\0@timber/fonts/google';\nconst RESOLVED_LOCAL = '\\0@timber/fonts/local';\n\n/**\n * Virtual side-effect module that registers font CSS on globalThis.\n *\n * When a file calls localFont() or a Google font function, the transform\n * hook injects `import 'virtual:timber-font-css-register'` into that file.\n * This virtual module sets `globalThis.__timber_font_css` with the combined\n * @font-face CSS. The RSC entry reads it at render time to inline a <style> tag.\n *\n * This approach avoids timing issues because:\n * 1. The font file is in the RSC module graph (imported by layout.tsx)\n * 2. The side-effect import is added to the font file during transform\n * 3. When layout.tsx is loaded, fonts.ts runs → side-effect module runs → globalThis is set\n * 4. RSC entry renders → reads globalThis → inlines <style>\n */\nconst VIRTUAL_FONT_CSS_REGISTER = 'virtual:timber-font-css-register';\nconst RESOLVED_FONT_CSS_REGISTER = '\\0virtual:timber-font-css-register';\n\n/**\n * Registry of fonts extracted during transform.\n * Keyed by a unique font ID derived from family + config.\n */\nexport type FontRegistry = Map<string, ExtractedFont>;\n\n/**\n * Convert a font family name to a PascalCase export name.\n * e.g. \"JetBrains Mono\" → \"JetBrains_Mono\"\n */\nfunction familyToExportName(family: string): string {\n return family.replace(/\\s+/g, '_');\n}\n\n/**\n * Convert a font family name to a scoped class name.\n * e.g. \"JetBrains Mono\" → \"timber-font-jetbrains-mono\"\n */\nfunction familyToClassName(family: string): string {\n return `timber-font-${family.toLowerCase().replace(/\\s+/g, '-')}`;\n}\n\n/**\n * Generate a unique font ID from family + config hash.\n */\nfunction generateFontId(family: string, config: GoogleFontConfig): string {\n const weights = normalizeToArray(config.weight);\n const styles = normalizeToArray(config.style);\n const subsets = config.subsets ?? ['latin'];\n return `${family.toLowerCase()}-${weights.join(',')}-${styles.join(',')}-${subsets.join(',')}`;\n}\n\n/**\n * Normalize a string or string array to an array.\n */\nfunction normalizeToArray(value: string | string[] | undefined): string[] {\n if (!value) return ['400'];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Normalize style to an array.\n */\nfunction normalizeStyleArray(value: string | string[] | undefined): string[] {\n if (!value) return ['normal'];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Extract static font config from a font function call in source code.\n *\n * Parses patterns like:\n * const inter = Inter({ subsets: ['latin'], weight: '400', display: 'swap', variable: '--font-sans' })\n *\n * Returns null if the call cannot be statically analyzed.\n *\n * Uses acorn AST parsing for robust handling of comments, trailing commas,\n * and multi-line configs.\n */\nexport function extractFontConfig(callSource: string): GoogleFontConfig | null {\n return extractFontConfigAst(callSource);\n}\n\n/**\n * Detect if a source file contains dynamic/computed font function calls\n * that cannot be statically analyzed.\n *\n * Returns the offending expression if found, null if all calls are static.\n *\n * Uses acorn AST parsing for accurate detection.\n */\nexport function detectDynamicFontCall(source: string, importedNames: string[]): string | null {\n return detectDynamicFontCallAst(source, importedNames);\n}\n\n/**\n * Regex that matches imports from either `@timber/fonts/google` or `next/font/google`.\n * The shims plugin resolves `next/font/google` to the same virtual module,\n * but the source code still contains the original import specifier.\n */\nconst GOOGLE_FONT_IMPORT_RE =\n /import\\s*\\{([^}]+)\\}\\s*from\\s*['\"](?:@timber\\/fonts\\/google|next\\/font\\/google)['\"]/g;\n\n/**\n * Parse import specifiers from a source file that imports from\n * `@timber/fonts/google` or `next/font/google`.\n *\n * Returns the list of imported font names (e.g. ['Inter', 'JetBrains_Mono']).\n */\nexport function parseGoogleFontImports(source: string): string[] {\n const importPattern = new RegExp(GOOGLE_FONT_IMPORT_RE.source, 'g');\n const names: string[] = [];\n\n let match;\n while ((match = importPattern.exec(source)) !== null) {\n const specifiers = match[1]\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n for (const spec of specifiers) {\n // Handle `Inter as MyInter` — we want the local name\n const parts = spec.split(/\\s+as\\s+/);\n names.push(parts[parts.length - 1].trim());\n }\n }\n\n return names;\n}\n\n/**\n * Parse the original (remote) font family names from imports.\n *\n * Returns a map of local name → family name.\n * e.g. { Inter: 'Inter', JetBrains_Mono: 'JetBrains Mono' }\n */\nexport function parseGoogleFontFamilies(source: string): Map<string, string> {\n const importPattern = new RegExp(GOOGLE_FONT_IMPORT_RE.source, 'g');\n const families = new Map<string, string>();\n\n let match;\n while ((match = importPattern.exec(source)) !== null) {\n const specifiers = match[1]\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n for (const spec of specifiers) {\n const parts = spec.split(/\\s+as\\s+/);\n const originalName = parts[0].trim();\n const localName = parts[parts.length - 1].trim();\n // Convert export name back to family name: JetBrains_Mono → JetBrains Mono\n const family = originalName.replace(/_/g, ' ');\n families.set(localName, family);\n }\n }\n\n return families;\n}\n\n/**\n * Generate the virtual module source for `@timber/fonts/google`.\n *\n * Each Google Font family gets a named export that returns a FontResult.\n * In this base implementation, the functions return static data.\n * The Google Fonts download task (timber-nk5) will add real font file URLs.\n */\nfunction generateGoogleVirtualModule(registry: FontRegistry): string {\n // Collect unique families from the registry\n const families = new Set<string>();\n for (const font of registry.values()) {\n if (font.provider === 'google') families.add(font.family);\n }\n\n const lines = [\n '// Auto-generated virtual module: @timber/fonts/google',\n '// Each export is a font loader function that returns a FontResult.',\n '',\n ];\n\n // If no fonts registered yet, export a generic loader for any font\n // This is the initial load — the transform hook will process actual calls\n lines.push('function createFontResult(family, config) {');\n lines.push(' return {');\n lines.push(' className: `timber-font-${family.toLowerCase().replace(/\\\\s+/g, \"-\")}`,');\n lines.push(' style: { fontFamily: family },');\n lines.push(' variable: config?.variable,');\n lines.push(' };');\n lines.push('}');\n lines.push('');\n\n // Export a Proxy-based default that handles any font name import\n lines.push('export default new Proxy({}, {');\n lines.push(' get(_, prop) {');\n lines.push(' if (typeof prop === \"string\") {');\n lines.push(' return (config) => createFontResult(prop.replace(/_/g, \" \"), config);');\n lines.push(' }');\n lines.push(' }');\n lines.push('});');\n\n // Also export known families as named exports for tree-shaking\n for (const family of families) {\n const exportName = familyToExportName(family);\n lines.push('');\n lines.push(`export function ${exportName}(config) {`);\n lines.push(` return createFontResult('${family}', config);`);\n lines.push('}');\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Generate the virtual module source for `@timber/fonts/local`.\n */\nfunction generateLocalVirtualModule(): string {\n return [\n '// Auto-generated virtual module: @timber/fonts/local',\n '',\n 'export default function localFont(config) {',\n ' const family = config?.family || \"Local Font\";',\n ' return {',\n ' className: `timber-font-${family.toLowerCase().replace(/\\\\s+/g, \"-\")}`,',\n ' style: { fontFamily: family },',\n ' variable: config?.variable,',\n ' };',\n '}',\n ].join('\\n');\n}\n\n/**\n * Generate CSS for a single extracted font.\n *\n * Includes @font-face rules (for local fonts), fallback @font-face,\n * and the scoped class rule.\n */\nexport function generateFontCss(font: ExtractedFont): string {\n const cssParts: string[] = [];\n\n if (font.provider === 'local' && font.localSources) {\n const faces = generateLocalFontFaces(font.family, font.localSources, font.display);\n const faceCss = generateFontFaces(faces);\n if (faceCss) cssParts.push(faceCss);\n }\n\n const fallbackCss = generateFallbackCss(font.family);\n if (fallbackCss) cssParts.push(fallbackCss);\n\n if (font.variable) {\n cssParts.push(generateVariableClass(font.className, font.variable, font.fontFamily));\n } else {\n cssParts.push(generateFontFamilyClass(font.className, font.fontFamily));\n }\n\n return cssParts.join('\\n\\n');\n}\n\n/**\n * Generate the CSS output for all extracted fonts.\n *\n * Includes @font-face rules for local fonts, fallback @font-face rules,\n * and scoped classes.\n */\nexport function generateAllFontCss(registry: FontRegistry): string {\n const cssParts: string[] = [];\n for (const font of registry.values()) {\n cssParts.push(generateFontCss(font));\n }\n return cssParts.join('\\n\\n');\n}\n\n/**\n * Parse the local name used for the default import of `@timber/fonts/local`.\n *\n * Handles:\n * import localFont from '@timber/fonts/local'\n * import myLoader from '@timber/fonts/local'\n */\nexport function parseLocalFontImportName(source: string): string | null {\n const match = source.match(\n /import\\s+(\\w+)\\s+from\\s*['\"](?:@timber\\/fonts\\/local|next\\/font\\/local)['\"]/\n );\n return match ? match[1] : null;\n}\n\n/**\n * Transform local font calls in source code.\n *\n * Finds `localFont({ ... })` calls, extracts the config,\n * registers the font, and replaces the call with a static FontResult.\n */\nfunction transformLocalFonts(\n transformedCode: string,\n originalCode: string,\n importerId: string,\n registry: FontRegistry,\n emitError: (msg: string) => void\n): string {\n const localName = parseLocalFontImportName(originalCode);\n if (!localName) return transformedCode;\n\n // Check for dynamic calls\n const dynamicCall = detectDynamicFontCall(originalCode, [localName]);\n if (dynamicCall) {\n emitError(\n `Font function calls must be statically analyzable. ` +\n `Found dynamic call: ${dynamicCall}. ` +\n `Pass a literal object with string/array values instead.`\n );\n }\n\n // Find all calls: const varName = localFont({ ... })\n const callPattern = new RegExp(\n `(?:const|let|var)\\\\s+(\\\\w+)\\\\s*=\\\\s*${localName}\\\\s*\\\\(\\\\s*(\\\\{[\\\\s\\\\S]*?\\\\})\\\\s*\\\\)`,\n 'g'\n );\n\n let callMatch;\n while ((callMatch = callPattern.exec(originalCode)) !== null) {\n const varName = callMatch[1];\n const configSource = callMatch[2];\n const fullMatch = callMatch[0];\n\n const config = extractLocalFontConfigAst(`(${configSource})`);\n if (!config) {\n emitError(\n `Could not statically analyze local font config. ` +\n `Ensure src is a string or array of { path, weight?, style? } objects.`\n );\n return transformedCode;\n }\n\n const extracted = processLocalFont(config, importerId);\n registry.set(extracted.id, extracted);\n\n const resultObj = extracted.variable\n ? `{ className: \"${extracted.className}\", style: { fontFamily: \"${extracted.fontFamily}\" }, variable: \"${extracted.variable}\" }`\n : `{ className: \"${extracted.className}\", style: { fontFamily: \"${extracted.fontFamily}\" } }`;\n\n const replacement = `const ${varName} = ${resultObj}`;\n transformedCode = transformedCode.replace(fullMatch, replacement);\n }\n\n // Remove the import statement\n transformedCode = transformedCode.replace(\n /import\\s+\\w+\\s+from\\s*['\"](?:@timber\\/fonts\\/local|next\\/font\\/local)['\"];?\\s*\\n?/g,\n ''\n );\n\n return transformedCode;\n}\n\n/**\n * Create the timber-fonts Vite plugin.\n */\nexport function timberFonts(ctx: PluginContext): Plugin {\n const registry: FontRegistry = new Map();\n /** Fonts downloaded during buildStart (production only). */\n let cachedFonts: CachedFont[] = [];\n\n return {\n name: 'timber-fonts',\n\n /**\n * Resolve `@timber/fonts/google`, `@timber/fonts/local`,\n * and `virtual:timber-font-css` virtual modules.\n *\n * Handles \\0 prefix and root prefix stripping for RSC/SSR\n * environments where the RSC plugin re-imports virtual modules\n * with additional prefixes.\n */\n resolveId(id: string) {\n // Strip \\0 prefix (RSC plugin re-imports)\n let cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n // Strip root prefix (SSR build entries)\n if (cleanId.startsWith(ctx.root)) {\n const stripped = cleanId.slice(ctx.root.length);\n if (stripped.startsWith('/') || stripped.startsWith('\\\\')) {\n cleanId = stripped.slice(1);\n } else {\n cleanId = stripped;\n }\n }\n\n if (cleanId === VIRTUAL_GOOGLE) return RESOLVED_GOOGLE;\n if (cleanId === VIRTUAL_LOCAL) return RESOLVED_LOCAL;\n if (cleanId === VIRTUAL_FONT_CSS_REGISTER) return RESOLVED_FONT_CSS_REGISTER;\n return null;\n },\n\n /**\n * Return generated source for font virtual modules.\n *\n * `virtual:timber-font-css` exports the combined @font-face CSS\n * as a string. The RSC entry imports it and inlines a <style> tag.\n * Because this is loaded lazily (on first request), the font\n * registry is always populated by the time it's needed.\n */\n load(id: string) {\n if (id === RESOLVED_GOOGLE) return generateGoogleVirtualModule(registry);\n if (id === RESOLVED_LOCAL) return generateLocalVirtualModule();\n\n if (id === RESOLVED_FONT_CSS_REGISTER) {\n const css = generateAllFontCss(registry);\n // Side-effect module: sets font CSS on globalThis for the RSC entry to read.\n return `globalThis.__timber_font_css = ${JSON.stringify(css)};`;\n }\n return null;\n },\n\n /**\n * Serve local font files and font CSS in dev mode under `/_timber/fonts/`.\n *\n * Serves:\n * - `/_timber/fonts/fonts.css` — combined @font-face + scoped class CSS\n * - `/_timber/fonts/<filename>` — individual font files from the registry\n *\n * Only files registered in the font registry are served.\n * Paths are validated to prevent directory traversal.\n */\n configureServer(server: ViteDevServer) {\n server.middlewares.use((req, res, next) => {\n const url = req.url;\n if (!url || !url.startsWith('/_timber/fonts/')) return next();\n\n const requestedFilename = url.slice('/_timber/fonts/'.length);\n // Reject path traversal attempts\n if (requestedFilename.includes('..') || requestedFilename.includes('/')) {\n res.statusCode = 400;\n res.end('Bad request');\n return;\n }\n\n // Font CSS is now injected via Vite's CSS pipeline (virtual:timber-font-css modules).\n // This middleware only serves font binary files (woff2, etc.).\n\n // Find the matching font file in the registry\n for (const font of registry.values()) {\n if (font.provider !== 'local' || !font.localSources) continue;\n for (const src of font.localSources) {\n const basename = src.path.split('/').pop() ?? '';\n if (basename === requestedFilename) {\n const absolutePath = normalize(resolve(src.path));\n if (!existsSync(absolutePath)) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n const data = readFileSync(absolutePath);\n const ext = absolutePath.split('.').pop()?.toLowerCase();\n const mimeMap: Record<string, string> = {\n woff2: 'font/woff2',\n woff: 'font/woff',\n ttf: 'font/ttf',\n otf: 'font/otf',\n eot: 'application/vnd.ms-fontopen',\n };\n res.setHeader('Content-Type', mimeMap[ext ?? ''] ?? 'application/octet-stream');\n res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.end(data);\n return;\n }\n }\n }\n\n next();\n });\n },\n\n /**\n * Download and cache Google Fonts during production builds.\n *\n * In dev mode this is a no-op — fonts point to the Google CDN.\n * The registry is populated by the transform hook which runs before\n * buildStart in the build pipeline, so all fonts are known here.\n */\n async buildStart() {\n if (ctx.dev) return;\n\n const googleFonts = [...registry.values()].filter((f) => f.provider === 'google');\n if (googleFonts.length === 0) return;\n\n cachedFonts = await downloadAndCacheFonts(googleFonts, ctx.root);\n },\n\n /**\n * Scan source files for font function calls and extract static config.\n *\n * When a file imports from `@timber/fonts/google`, we:\n * 1. Parse the import specifiers to get font family names\n * 2. Find each font function call and extract its config\n * 3. Validate that all calls are statically analyzable\n * 4. Register extracted fonts in the registry\n * 5. Replace the function call with a static FontResult object\n */\n transform(code: string, id: string) {\n // Skip virtual modules and node_modules\n if (id.startsWith('\\0') || id.includes('node_modules')) return null;\n\n const hasGoogleImport =\n code.includes('@timber/fonts/google') || code.includes('next/font/google');\n const hasLocalImport =\n code.includes('@timber/fonts/local') || code.includes('next/font/local');\n if (!hasGoogleImport && !hasLocalImport) return null;\n\n let transformedCode = code;\n\n // ── Google font transform ──────────────────────────────────────────\n if (hasGoogleImport) {\n const families = parseGoogleFontFamilies(code);\n if (families.size > 0) {\n const importedNames = [...families.keys()];\n\n const dynamicCall = detectDynamicFontCall(code, importedNames);\n if (dynamicCall) {\n this.error(\n `Font function calls must be statically analyzable. ` +\n `Found dynamic call: ${dynamicCall}. ` +\n `Pass a literal object with string/array values instead.`\n );\n }\n\n for (const [localName, family] of families) {\n const callPattern = new RegExp(\n `(?:const|let|var)\\\\s+(\\\\w+)\\\\s*=\\\\s*${localName}\\\\s*\\\\(\\\\s*(\\\\{[\\\\s\\\\S]*?\\\\})\\\\s*\\\\)`,\n 'g'\n );\n\n let callMatch;\n while ((callMatch = callPattern.exec(code)) !== null) {\n const varName = callMatch[1];\n const configSource = callMatch[2];\n const fullMatch = callMatch[0];\n\n const config = extractFontConfig(`(${configSource})`);\n if (!config) {\n this.error(\n `Could not statically analyze font config for ${family}. ` +\n `Ensure all config values are string literals or arrays of string literals.`\n );\n return null;\n }\n\n const fontId = generateFontId(family, config);\n const className = familyToClassName(family);\n const fontStack = buildFontStack(family);\n const display = config.display ?? 'swap';\n\n const extracted: ExtractedFont = {\n id: fontId,\n family,\n provider: 'google',\n weights: normalizeToArray(config.weight),\n styles: normalizeStyleArray(config.style),\n subsets: config.subsets ?? ['latin'],\n display,\n variable: config.variable,\n className,\n fontFamily: fontStack,\n importer: id,\n };\n\n registry.set(fontId, extracted);\n\n const resultObj = config.variable\n ? `{ className: \"${className}\", style: { fontFamily: \"${fontStack}\" }, variable: \"${config.variable}\" }`\n : `{ className: \"${className}\", style: { fontFamily: \"${fontStack}\" } }`;\n\n const replacement = `const ${varName} = ${resultObj}`;\n transformedCode = transformedCode.replace(fullMatch, replacement);\n }\n }\n\n transformedCode = transformedCode.replace(\n /import\\s*\\{[^}]+\\}\\s*from\\s*['\"](?:@timber\\/fonts\\/google|next\\/font\\/google)['\"];?\\s*\\n?/g,\n ''\n );\n }\n }\n\n // ── Local font transform ───────────────────────────────────────────\n if (hasLocalImport) {\n transformedCode = transformLocalFonts(\n transformedCode,\n code,\n id,\n registry,\n this.error.bind(this)\n );\n }\n\n if (transformedCode !== code) {\n // Inject side-effect import that registers font CSS on globalThis.\n // The RSC entry reads globalThis.__timber_font_css to inline a <style> tag.\n if (registry.size > 0) {\n transformedCode = `import '${VIRTUAL_FONT_CSS_REGISTER}';\\n` + transformedCode;\n }\n return { code: transformedCode, map: null };\n }\n\n return null;\n },\n\n /**\n * Emit font files and metadata into the build output.\n *\n * For Google fonts: emits the downloaded, content-hashed woff2 files\n * and writes ManifestFontEntry arrays using real hashed URLs.\n *\n * For local fonts: emits entries using the source file paths.\n *\n * In dev mode the build manifest is null, so this is a no-op.\n */\n generateBundle() {\n // Emit cached Google Font files into the build output\n for (const cf of cachedFonts) {\n this.emitFile({\n type: 'asset',\n fileName: `_timber/fonts/${cf.hashedFilename}`,\n source: cf.data,\n });\n }\n\n // Emit local font files as assets\n for (const font of registry.values()) {\n if (font.provider !== 'local' || !font.localSources) continue;\n for (const src of font.localSources) {\n const absolutePath = normalize(resolve(src.path));\n if (!existsSync(absolutePath)) {\n this.warn(`Local font file not found: ${absolutePath}`);\n continue;\n }\n const basename = src.path.split('/').pop() ?? src.path;\n const data = readFileSync(absolutePath);\n this.emitFile({\n type: 'asset',\n fileName: `_timber/fonts/${basename}`,\n source: data,\n });\n }\n }\n\n // Font CSS is emitted by Vite's CSS pipeline via virtual:timber-font-css modules.\n // We only need to emit font binary files and update the build manifest here.\n\n if (!ctx.buildManifest) return;\n\n // Build a lookup from font family → cached files for manifest entries\n const cachedByFamily = new Map<string, CachedFont[]>();\n for (const cf of cachedFonts) {\n const key = cf.face.family.toLowerCase();\n const arr = cachedByFamily.get(key) ?? [];\n arr.push(cf);\n cachedByFamily.set(key, arr);\n }\n\n const fontsByImporter = new Map<string, ManifestFontEntry[]>();\n\n for (const font of registry.values()) {\n const entries = fontsByImporter.get(font.importer) ?? [];\n\n if (font.provider === 'local' && font.localSources) {\n // Local fonts: one entry per source file\n for (const src of font.localSources) {\n const filename = src.path.split('/').pop() ?? src.path;\n const format = inferFontFormat(src.path);\n entries.push({\n href: `/_timber/fonts/${filename}`,\n format,\n crossOrigin: 'anonymous',\n });\n }\n } else {\n // Google fonts: use real content-hashed URLs from cached downloads\n const familyKey = font.family.toLowerCase();\n const familyCached = cachedByFamily.get(familyKey) ?? [];\n for (const cf of familyCached) {\n entries.push({\n href: `/_timber/fonts/${cf.hashedFilename}`,\n format: 'woff2',\n crossOrigin: 'anonymous',\n });\n }\n }\n\n fontsByImporter.set(font.importer, entries);\n }\n\n // Normalize importer paths to be relative to project root (matching\n // how Vite's manifest.json keys work for css/js).\n for (const [importer, entries] of fontsByImporter) {\n const relativePath = importer.startsWith(ctx.root)\n ? importer.slice(ctx.root.length + 1)\n : importer;\n ctx.buildManifest.fonts[relativePath] = entries;\n }\n },\n };\n}\n","/**\n * timber-static-build — Vite sub-plugin for static output mode.\n *\n * When `output: 'static'` is set in timber.config.ts, this plugin:\n * 1. Validates that no dynamic APIs (cookies(), headers()) are used\n * 2. When client JavaScript is disabled, rejects 'use client' and 'use server' directives\n * 3. Coordinates build-time rendering of all pages\n *\n * Design doc: design/15-future-prerendering.md\n */\n\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '#/index.js';\nimport { detectFileDirective } from '#/utils/directive-parser.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface StaticValidationError {\n type: 'dynamic-api' | 'nojs-directive';\n file: string;\n message: string;\n line?: number;\n}\n\nexport interface StaticOptions {\n clientJavascriptDisabled: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Detection: dynamic APIs (cookies, headers)\n// ---------------------------------------------------------------------------\n\n/**\n * Patterns that indicate dynamic per-request API usage.\n * These are build errors in static mode because there is no request at build time.\n *\n * We detect both import-level and call-level usage.\n */\nconst DYNAMIC_API_PATTERNS: Array<{ pattern: RegExp; name: string }> = [\n { pattern: /\\bcookies\\s*\\(/, name: 'cookies()' },\n { pattern: /\\bheaders\\s*\\(/, name: 'headers()' },\n];\n\n/**\n * Detect usage of dynamic per-request APIs (cookies(), headers())\n * that cannot work at build time in static mode.\n *\n * Returns an array of validation errors.\n */\nexport function detectDynamicApis(code: string, fileId: string): StaticValidationError[] {\n const errors: StaticValidationError[] = [];\n\n for (const { pattern, name } of DYNAMIC_API_PATTERNS) {\n if (pattern.test(code)) {\n // Find the line number of the first match\n const lines = code.split('\\n');\n let line: number | undefined;\n for (let i = 0; i < lines.length; i++) {\n if (pattern.test(lines[i])) {\n line = i + 1;\n break;\n }\n }\n\n errors.push({\n type: 'dynamic-api',\n file: fileId,\n message:\n `${name} cannot be used in static mode — there is no request at build time. ` +\n `Remove the ${name} call or switch to output: 'server'.`,\n line,\n });\n }\n }\n\n return errors;\n}\n\n// ---------------------------------------------------------------------------\n// Detection: 'use client' / 'use server' directives (clientJavascript disabled)\n// ---------------------------------------------------------------------------\n\n/**\n * Detect 'use client' and 'use server' directives using AST-based parsing.\n * When client JavaScript is disabled, both are hard build errors — no React\n * runtime or server actions are allowed in the output.\n *\n * When client JavaScript is enabled, these are allowed (client components\n * hydrate, server actions get extracted to API endpoints).\n */\nexport function detectDirectives(\n code: string,\n fileId: string,\n options: StaticOptions\n): StaticValidationError[] {\n if (!options.clientJavascriptDisabled) return [];\n\n const errors: StaticValidationError[] = [];\n\n const clientDirective = detectFileDirective(code, ['use client']);\n if (clientDirective) {\n errors.push({\n type: 'nojs-directive',\n file: fileId,\n message:\n `'use client' is not allowed when client JavaScript is disabled (clientJavascript: false). ` +\n `This mode produces zero JavaScript — client components cannot exist.`,\n line: clientDirective.line,\n });\n }\n\n const serverDirective = detectFileDirective(code, ['use server']);\n if (serverDirective) {\n errors.push({\n type: 'nojs-directive',\n file: fileId,\n message:\n `'use server' is not allowed when client JavaScript is disabled (clientJavascript: false). ` +\n `This mode produces zero JavaScript — server actions cannot exist.`,\n line: serverDirective.line,\n });\n }\n\n return errors;\n}\n\n// ---------------------------------------------------------------------------\n// Combined validation\n// ---------------------------------------------------------------------------\n\n/**\n * Run all static mode validations on a source file.\n *\n * Combines:\n * - Dynamic API detection (cookies, headers) — always in static mode\n * - Directive detection ('use client', 'use server') — only when client JS is disabled\n */\nexport function validateStaticMode(\n code: string,\n fileId: string,\n options: StaticOptions\n): StaticValidationError[] {\n const errors: StaticValidationError[] = [];\n\n errors.push(...detectDynamicApis(code, fileId));\n errors.push(...detectDirectives(code, fileId, options));\n\n return errors;\n}\n\n// ---------------------------------------------------------------------------\n// Vite Plugin\n// ---------------------------------------------------------------------------\n\n/**\n * Create the timber-static-build Vite plugin.\n *\n * Only active when output: 'static' is configured.\n *\n * Hooks:\n * - transform: Validates source files for static mode violations\n */\nexport function timberStaticBuild(ctx: PluginContext): Plugin {\n const isStatic = ctx.config.output === 'static';\n const clientJavascriptDisabled = ctx.clientJavascript.disabled;\n\n return {\n name: 'timber-static-build',\n\n /**\n * Validate source files during transform.\n *\n * In static mode, we check every app/ file for:\n * - Dynamic API usage (cookies(), headers()) → build error\n * - When client JS disabled: 'use client' / 'use server' directives → build error\n */\n transform(code: string, id: string) {\n // Only active in static mode\n if (!isStatic) return null;\n\n // Skip node_modules\n if (id.includes('node_modules')) return null;\n\n // Only check files in the app directory\n if (!id.includes('/app/') && !id.startsWith('app/')) return null;\n\n // Only check JS/TS files\n if (!/\\.[jt]sx?$/.test(id)) return null;\n\n const errors = validateStaticMode(code, id, { clientJavascriptDisabled });\n\n if (errors.length > 0) {\n // Format all errors into a single build error message\n const messages = errors.map(\n (e) =>\n `[timber] Static mode error in ${e.file}${e.line ? `:${e.line}` : ''}: ${e.message}`\n );\n\n this.error(messages.join('\\n\\n'));\n }\n\n return null;\n },\n };\n}\n","/**\n * timber-dynamic-transform — Vite sub-plugin for 'use dynamic' directive.\n *\n * Detects `'use dynamic'` directives in server component function bodies\n * and transforms them into `markDynamic()` runtime calls. The directive\n * declares a dynamic boundary — the component and its subtree opt out of\n * the pre-rendered shell and render per-request.\n *\n * - In `output: 'static'` mode, `'use dynamic'` is a build error.\n * - In standard SSR routes (no prerender.ts), the directive is a no-op\n * (everything is already per-request), but the transform still runs\n * so the runtime can skip unnecessary work.\n *\n * Design doc: design/15-future-prerendering.md §\"'use dynamic'\"\n */\n\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '#/index.js';\nimport { findFunctionsWithDirective, containsDirective } from '#/utils/directive-parser.js';\n\n// ---------------------------------------------------------------------------\n// Detection\n// ---------------------------------------------------------------------------\n\n/**\n * Quick check: does this source file contain 'use dynamic' anywhere?\n * Used as a fast bail-out before doing expensive AST parsing.\n */\nexport function containsUseDynamic(code: string): boolean {\n return containsDirective(code, 'use dynamic');\n}\n\n// ---------------------------------------------------------------------------\n// Transform\n// ---------------------------------------------------------------------------\n\ninterface TransformResult {\n code: string;\n map?: null;\n}\n\n/**\n * Find function declarations/expressions containing 'use dynamic' and\n * transform them into markDynamic() calls.\n *\n * Input:\n * ```tsx\n * export default async function AddToCartButton({ productId }) {\n * 'use dynamic'\n * const user = await getUser()\n * return <button>Add to cart</button>\n * }\n * ```\n *\n * Output:\n * ```tsx\n * import { markDynamic as __markDynamic } from '@timber-js/app/runtime';\n * export default async function AddToCartButton({ productId }) {\n * __markDynamic();\n * const user = await getUser()\n * return <button>Add to cart</button>\n * }\n * ```\n *\n * The markDynamic() call registers the component boundary as dynamic\n * at render time. The pre-render pass uses this to know which subtrees\n * to skip and leave as holes for per-request rendering.\n */\nexport function transformUseDynamic(code: string): TransformResult | null {\n if (!containsUseDynamic(code)) return null;\n\n const functions = findFunctionsWithDirective(code, 'use dynamic');\n if (functions.length === 0) return null;\n\n // Replace directive strings with __markDynamic() calls, processing\n // from end to start to preserve source offsets\n let result = code;\n for (const fn of functions) {\n // Replace the directive in the body content\n const cleanBody = fn.bodyContent.replace(/['\"]use dynamic['\"];?/, '__markDynamic();');\n // Reconstruct: replace the body content between braces\n result = result.slice(0, fn.bodyStart) + cleanBody + result.slice(fn.bodyEnd);\n }\n\n // Add the import at the top\n result = `import { markDynamic as __markDynamic } from '@timber-js/app/runtime';\\n` + result;\n\n return { code: result, map: null };\n}\n\n// ---------------------------------------------------------------------------\n// Static mode validation\n// ---------------------------------------------------------------------------\n\n/**\n * In `output: 'static'` mode, `'use dynamic'` is a build error.\n * Static mode renders everything at build time — there is no per-request\n * rendering to opt into.\n */\nexport function validateNoDynamicInStaticMode(\n code: string\n): { message: string; line?: number } | null {\n if (!containsUseDynamic(code)) return null;\n\n const functions = findFunctionsWithDirective(code, 'use dynamic');\n if (functions.length === 0) return null;\n\n return {\n message:\n `'use dynamic' cannot be used in static mode (output: 'static'). ` +\n `Static mode renders all content at build time — there is no per-request rendering. ` +\n `Remove the directive or switch to output: 'server'.`,\n line: functions[functions.length - 1].directiveLine, // First occurrence (sorted descending)\n };\n}\n\n// ---------------------------------------------------------------------------\n// Vite Plugin\n// ---------------------------------------------------------------------------\n\n/**\n * Create the timber-dynamic-transform Vite plugin.\n *\n * In server mode: transforms 'use dynamic' into markDynamic() calls.\n * In static mode: rejects 'use dynamic' as a build error.\n */\nexport function timberDynamicTransform(ctx: PluginContext): Plugin {\n const isStatic = ctx.config.output === 'static';\n\n return {\n name: 'timber-dynamic-transform',\n\n transform(code: string, id: string) {\n // Skip node_modules\n if (id.includes('node_modules')) return null;\n\n // Only check files in the app directory\n if (!id.includes('/app/') && !id.startsWith('app/')) return null;\n\n // Only check JS/TS files\n if (!/\\.[jt]sx?$/.test(id)) return null;\n\n // Quick bail-out\n if (!containsUseDynamic(code)) return null;\n\n // In static mode, 'use dynamic' is a build error\n if (isStatic) {\n const error = validateNoDynamicInStaticMode(code);\n if (error) {\n this.error(\n `[timber] Static mode error in ${id}${error.line ? `:${error.line}` : ''}: ${error.message}`\n );\n }\n return null;\n }\n\n // In server mode, transform the directive\n return transformUseDynamic(code);\n },\n };\n}\n","import type { Plugin } from 'vite';\nimport { Parser } from 'acorn';\nimport acornJsx from 'acorn-jsx';\nimport { detectFileDirective } from '#/utils/directive-parser.js';\n\nconst jsxParser = Parser.extend(acornJsx());\n\n/**\n * Rewrite 'use server' module exports to bypass RSC plugin AST validation.\n *\n * The RSC plugin's client/SSR proxy transform (transformProxyExport) requires\n * all `export const` initializers to be `async ArrowFunctionExpression`. But\n * `createActionClient().action()` and `validated()` return async functions via\n * CallExpressions — valid at runtime but rejected by the static AST check.\n *\n * This plugin rewrites non-function-expression exports from:\n *\n * export const foo = someCall();\n *\n * to:\n *\n * const foo = someCall();\n * export { foo };\n *\n * The `export { name }` form bypasses the RSC plugin's validation without\n * changing runtime semantics. Function expression exports (async arrows,\n * async function expressions) are left untouched.\n *\n * See design/08-forms-and-actions.md §\"Middleware for Server Actions\"\n */\nexport function timberServerActionExports(): Plugin {\n return {\n name: 'timber-server-action-exports',\n transform(code, id) {\n // Skip non-JS/TS files\n if (!/\\.[jt]sx?$/.test(id)) return;\n // Quick bail-out\n if (!code.includes('use server')) return;\n // Check for file-level directive\n const directive = detectFileDirective(code, ['use server']);\n if (!directive) return;\n\n return rewriteServerActionExports(code);\n },\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AcornNode = any;\n\n/**\n * Check if an AST node is an async function expression (arrow or regular).\n * These are handled correctly by the RSC plugin and don't need rewriting.\n */\nfunction isAsyncFunctionExpr(node: AcornNode): boolean {\n if (!node) return false;\n return (\n (node.type === 'ArrowFunctionExpression' || node.type === 'FunctionExpression') && node.async\n );\n}\n\n/**\n * Extract identifier names from a declarator's id pattern.\n * Handles simple identifiers and destructuring patterns.\n */\nfunction extractDeclNames(id: AcornNode): string[] {\n if (id.type === 'Identifier') return [id.name];\n\n // ObjectPattern: const { a, b } = ...\n if (id.type === 'ObjectPattern') {\n return id.properties.flatMap((p: AcornNode) => extractDeclNames(p.value ?? p.argument));\n }\n\n // ArrayPattern: const [a, b] = ...\n if (id.type === 'ArrayPattern') {\n return id.elements.filter(Boolean).flatMap((e: AcornNode) => extractDeclNames(e));\n }\n\n // RestElement: const [...rest] = ...\n if (id.type === 'RestElement') {\n return extractDeclNames(id.argument);\n }\n\n // AssignmentPattern: const { a = 1 } = ...\n if (id.type === 'AssignmentPattern') {\n return extractDeclNames(id.left);\n }\n\n return [];\n}\n\ninterface RewriteTarget {\n /** Start offset of the `export` keyword */\n exportStart: number;\n /** Start offset of the `const/let/var` keyword (right after `export `) */\n declStart: number;\n /** Names to re-export */\n names: string[];\n}\n\nfunction rewriteServerActionExports(code: string): { code: string; map: null } | undefined {\n let ast: AcornNode;\n try {\n ast = jsxParser.parse(code, {\n ecmaVersion: 'latest',\n sourceType: 'module',\n });\n } catch {\n // TypeScript that esbuild hasn't stripped yet — use regex fallback\n return rewriteServerActionExportsFallback(code);\n }\n\n const targets: RewriteTarget[] = [];\n\n for (const node of ast.body) {\n // Case 1: export const/let/var name = <non-function-expression>\n if (\n node.type === 'ExportNamedDeclaration' &&\n node.declaration?.type === 'VariableDeclaration'\n ) {\n const hasNonFunctionInit = node.declaration.declarations.some(\n (d: AcornNode) => d.init && !isAsyncFunctionExpr(d.init)\n );\n if (!hasNonFunctionInit) continue;\n\n const names = node.declaration.declarations.flatMap((d: AcornNode) => extractDeclNames(d.id));\n if (names.length === 0) continue;\n\n targets.push({\n exportStart: node.start,\n declStart: node.declaration.start,\n names,\n });\n }\n\n // Case 2: export default <non-function-expression>\n if (node.type === 'ExportDefaultDeclaration') {\n const decl = node.declaration;\n if (\n decl.type !== 'FunctionDeclaration' &&\n decl.type !== 'Identifier' &&\n !isAsyncFunctionExpr(decl)\n ) {\n // export default someCall() → const $$default = someCall(); export default $$default;\n targets.push({\n exportStart: node.start,\n declStart: -1, // sentinel for default export\n names: ['default'],\n });\n }\n }\n }\n\n if (targets.length === 0) return undefined;\n\n // Process from end to start to preserve character positions\n let result = code;\n const reExports: string[] = [];\n\n for (let i = targets.length - 1; i >= 0; i--) {\n const target = targets[i];\n\n if (target.declStart === -1) {\n // export default <expr> → const $$default = <expr>;\\nexport default $$default;\n const node = ast.body.find(\n (n: AcornNode) => n.type === 'ExportDefaultDeclaration' && n.start === target.exportStart\n );\n if (node) {\n const exprCode = code.slice(node.declaration.start, node.declaration.end);\n const replacement = `const $$default = ${exprCode};\\nexport default $$default;`;\n result = result.slice(0, node.start) + replacement + result.slice(node.end);\n }\n continue;\n }\n\n // Remove 'export ' from the declaration\n result = result.slice(0, target.exportStart) + result.slice(target.declStart);\n reExports.push(...target.names);\n }\n\n if (reExports.length > 0) {\n result += '\\nexport { ' + reExports.join(', ') + ' };\\n';\n }\n\n return { code: result, map: null };\n}\n\n/**\n * Regex fallback for TypeScript files that acorn cannot parse.\n *\n * Matches `export const/let/var name = <expr>` where the initializer does\n * NOT start with `async function` or `async (` (i.e., not an async\n * function expression or async arrow function).\n */\nfunction rewriteServerActionExportsFallback(code: string): { code: string; map: null } | undefined {\n // Match: export const/let/var <name> = <non-async-function-expr>\n const pattern =\n /^(export\\s+)((?:const|let|var)\\s+(\\w+)\\s*=\\s*)(?!async\\s+(?:function[\\s(]|\\())/gm;\n\n const names: string[] = [];\n let result = code;\n let offset = 0;\n let match;\n\n while ((match = pattern.exec(code)) !== null) {\n const exportKeyword = match[1]; // 'export ' (with trailing space)\n const name = match[3];\n\n // Remove 'export ' at this position (adjusted for prior removals)\n const pos = match.index + offset;\n result = result.slice(0, pos) + result.slice(pos + exportKeyword.length);\n offset -= exportKeyword.length;\n names.push(name);\n }\n\n if (names.length === 0) return undefined;\n\n result += '\\nexport { ' + names.join(', ') + ' };\\n';\n return { code: result, map: null };\n}\n","/**\n * timber-build-manifest — Vite sub-plugin for build asset manifest generation.\n *\n * Provides `virtual:timber-build-manifest` which exports a BuildManifest\n * mapping route segment file paths to their CSS, JS, and modulepreload\n * output chunks.\n *\n * - Dev mode: exports an empty manifest (Vite HMR handles CSS/JS).\n * - Build mode: virtual module reads from globalThis.__TIMBER_BUILD_MANIFEST__\n * at runtime. The actual manifest data is injected by the adapter via a\n * _timber-manifest-init.js module that runs before the RSC handler.\n *\n * The generateBundle hook (client env only) extracts CSS/JS/modulepreload\n * data from the Rollup bundle and populates ctx.buildManifest.\n *\n * Design docs: 18-build-system.md §\"Build Manifest\", 02-rendering-pipeline.md §\"Early Hints\"\n */\n\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport type { PluginContext } from '#/index.js';\nimport type { BuildManifest } from '#/server/build-manifest.js';\n\n// Rollup types used by generateBundle hook — imported from vite which re-exports them.\n// We define minimal interfaces here to avoid a direct 'rollup' dependency.\ninterface OutputChunk {\n type: 'chunk';\n fileName: string;\n facadeModuleId: string | null;\n imports: string[];\n name: string;\n code: string;\n viteMetadata?: { importedCss?: Set<string> };\n}\n\ninterface OutputAsset {\n type: 'asset';\n fileName: string;\n}\n\ntype OutputBundle = Record<string, OutputChunk | OutputAsset>;\n\nconst VIRTUAL_MODULE_ID = 'virtual:timber-build-manifest';\nconst RESOLVED_VIRTUAL_ID = `\\0${VIRTUAL_MODULE_ID}`;\n\n/**\n * Vite's manifest.json entry shape (subset we need).\n * See https://vite.dev/guide/backend-integration.html\n */\ninterface ViteManifestEntry {\n file: string;\n css?: string[];\n imports?: string[];\n}\n\n/**\n * Parse Vite's .vite/manifest.json into a BuildManifest.\n *\n * Walks each entry and collects:\n * - `css`: CSS output URLs per input file (transitive CSS included by Vite)\n * - `js`: Hashed JS chunk URL per input file\n * - `modulepreload`: Transitive JS dependency URLs per input file\n *\n * Keys are input file paths (relative to project root).\n */\nexport function parseViteManifest(\n viteManifest: Record<string, ViteManifestEntry>,\n base: string\n): BuildManifest {\n const css: Record<string, string[]> = {};\n const js: Record<string, string> = {};\n const modulepreload: Record<string, string[]> = {};\n\n for (const [inputPath, entry] of Object.entries(viteManifest)) {\n // JS chunk mapping\n js[inputPath] = base + entry.file;\n\n // CSS mapping\n if (entry.css && entry.css.length > 0) {\n css[inputPath] = entry.css.map((cssPath) => base + cssPath);\n }\n\n // Collect transitive JS dependencies for modulepreload\n modulepreload[inputPath] = collectTransitiveDeps(inputPath, viteManifest, base);\n }\n\n return { css, js, modulepreload, fonts: {} };\n}\n\n/**\n * Recursively collect transitive JS dependency URLs for an entry.\n *\n * Walks the `imports` graph in Vite's manifest, resolving each import\n * key to its output `file` URL. Deduplicates to avoid cycles and\n * redundant preloads.\n */\nfunction collectTransitiveDeps(\n entryKey: string,\n manifest: Record<string, ViteManifestEntry>,\n base: string\n): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n function walk(key: string) {\n const entry = manifest[key];\n if (!entry?.imports) return;\n\n for (const importKey of entry.imports) {\n if (seen.has(importKey)) continue;\n seen.add(importKey);\n\n const dep = manifest[importKey];\n if (dep) {\n result.push(base + dep.file);\n walk(importKey);\n }\n }\n }\n\n walk(entryKey);\n return result;\n}\n\n/**\n * Build a BuildManifest from a Rollup output bundle.\n *\n * Unlike parseViteManifest (which reads Vite's manifest.json), this\n * works directly with the Rollup bundle output. This is necessary because\n * the RSC plugin doesn't produce a standard Vite manifest.json.\n *\n * Walks each chunk in the bundle and collects:\n * - `css`: CSS files imported by each chunk (via viteMetadata.importedCss)\n * - `js`: The output filename for each chunk with a facadeModuleId\n * - `modulepreload`: Transitive JS imports for each entry chunk\n *\n * Keys are input file paths relative to root.\n */\nexport function buildManifestFromBundle(\n bundle: OutputBundle,\n base: string,\n root: string\n): BuildManifest {\n const css: Record<string, string[]> = {};\n const js: Record<string, string> = {};\n const modulepreload: Record<string, string[]> = {};\n\n // Build a map of chunk fileName → chunk for transitive dep resolution\n const chunksByFileName = new Map<string, OutputChunk>();\n for (const item of Object.values(bundle) as (OutputChunk | OutputAsset)[]) {\n if (item.type === 'chunk') {\n chunksByFileName.set(item.fileName, item);\n }\n }\n\n for (const item of Object.values(bundle) as (OutputChunk | OutputAsset)[]) {\n if (item.type !== 'chunk') continue;\n\n const chunk = item;\n if (!chunk.facadeModuleId) continue;\n\n // Convert absolute facadeModuleId to root-relative path\n let inputPath = chunk.facadeModuleId;\n if (inputPath.startsWith(root)) {\n inputPath = inputPath.slice(root.length + 1);\n }\n\n // JS chunk mapping\n js[inputPath] = base + chunk.fileName;\n\n // CSS mapping via viteMetadata\n const viteMetadata = chunk.viteMetadata;\n if (viteMetadata?.importedCss && viteMetadata.importedCss.size > 0) {\n css[inputPath] = Array.from(viteMetadata.importedCss).map((cssFile) => base + cssFile);\n }\n\n // Collect transitive JS dependencies for modulepreload\n const deps = collectTransitiveBundleDeps(chunk, chunksByFileName, base);\n if (deps.length > 0) {\n modulepreload[inputPath] = deps;\n }\n }\n\n // Collect ALL CSS assets from the bundle under the `_global` key.\n // Route files (app/layout.tsx, app/page.tsx) are server components —\n // they don't appear in the client bundle, so per-route CSS keying\n // via facadeModuleId doesn't work. The RSC plugin handles per-route\n // CSS injection via data-rsc-css-href. For Link headers (103 Early\n // Hints), we emit all CSS files — they're just prefetch hints.\n const allCss: string[] = [];\n for (const item of Object.values(bundle) as (OutputChunk | OutputAsset)[]) {\n if (item.type === 'asset' && item.fileName.endsWith('.css')) {\n allCss.push(base + item.fileName);\n }\n }\n if (allCss.length > 0) {\n css['_global'] = allCss;\n }\n\n return { css, js, modulepreload, fonts: {} };\n}\n\n/**\n * Recursively collect transitive JS dependency URLs from a bundle chunk.\n */\nfunction collectTransitiveBundleDeps(\n chunk: OutputChunk,\n chunksByFileName: Map<string, OutputChunk>,\n base: string\n): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n function walk(imports: string[]) {\n for (const importFileName of imports) {\n if (seen.has(importFileName)) continue;\n seen.add(importFileName);\n\n result.push(base + importFileName);\n const dep = chunksByFileName.get(importFileName);\n if (dep) {\n walk(dep.imports);\n }\n }\n }\n\n walk(chunk.imports);\n return result;\n}\n\n/**\n * Create the timber-build-manifest Vite plugin.\n *\n * Hooks: configResolved, resolveId, load, generateBundle (client env only)\n */\nexport function timberBuildManifest(ctx: PluginContext): Plugin {\n let resolvedBase = '/';\n let isDev = false;\n\n return {\n name: 'timber-build-manifest',\n\n configResolved(config: ResolvedConfig) {\n resolvedBase = config.base;\n isDev = config.command === 'serve';\n },\n\n resolveId(id: string) {\n const cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n\n if (cleanId === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n if (cleanId.endsWith(`/${VIRTUAL_MODULE_ID}`)) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n return null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_VIRTUAL_ID) return null;\n\n // In dev mode, return empty manifest — Vite HMR handles CSS.\n if (isDev) {\n return [\n '// Auto-generated build manifest — do not edit.',\n '// Dev mode: empty manifest (Vite HMR handles CSS/JS).',\n '',\n 'const manifest = { css: {}, js: {}, modulepreload: {}, fonts: {} };',\n '',\n 'export default manifest;',\n ].join('\\n');\n }\n\n // In production, read from globalThis at runtime.\n // The adapter writes a _timber-manifest-init.js that sets this global\n // before the RSC handler imports this module. ESM evaluation order\n // guarantees the global is set by the time this code runs.\n return [\n '// Auto-generated build manifest — do not edit.',\n '// Production: reads manifest from globalThis (set by _timber-manifest-init.js).',\n '',\n 'const manifest = globalThis.__TIMBER_BUILD_MANIFEST__ ?? { css: {}, js: {}, modulepreload: {}, fonts: {} };',\n '',\n 'export default manifest;',\n ].join('\\n');\n },\n\n // Extract manifest data from the client bundle only.\n // The RSC plugin runs builds in order: RSC → client → SSR.\n // We only want client env data (CSS assets, client JS chunks).\n generateBundle(_options, bundle) {\n if (isDev) return;\n\n const envName = (this as { environment?: { name: string } }).environment?.name;\n\n if (envName === 'client') {\n ctx.buildManifest = buildManifestFromBundle(bundle, resolvedBase, ctx.root);\n\n // When client JavaScript is disabled, strip JS chunks from the bundle\n // so Rollup never writes them to disk. CSS assets are preserved —\n // they're still needed for server-rendered HTML.\n //\n // This is an optimization: adapter-build.ts still strips JS from the\n // build manifest and RSC assets manifest as a defense-in-depth fallback.\n if (ctx.clientJavascript.disabled) {\n // Clear JS and modulepreload from the manifest (they'd be stripped\n // by adapter-build.ts anyway, but doing it here avoids the round-trip).\n ctx.buildManifest.js = {};\n ctx.buildManifest.modulepreload = {};\n\n // Remove JS chunks from the Rollup bundle — prevents disk writes.\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type === 'chunk') {\n delete bundle[fileName];\n }\n }\n }\n }\n },\n };\n}\n","/**\n * timber-dev-logs — Pipes server console output to the browser console in dev.\n *\n * Patches `console.log/warn/error/debug/info` on the server side and\n * forwards messages to connected browsers via Vite's HMR WebSocket.\n * The browser entry replays them in the browser console with the\n * correct log level and a \"[server]\" prefix.\n *\n * Dev-only: this plugin only runs during `vite dev` (apply: 'serve').\n * No runtime overhead in production.\n *\n * Design docs: 18-build-system.md §\"Dev Server\", 02-rendering-pipeline.md\n */\n\nimport type { Plugin, ViteDevServer } from 'vite';\nimport type { PluginContext } from '#/index.js';\n\n// ─── Types ───────────────────────────────────────────────────────────────\n\n/** Log levels that are patched and forwarded. */\nexport type ServerLogLevel = 'log' | 'warn' | 'error' | 'debug' | 'info';\n\nconst LOG_LEVELS: ServerLogLevel[] = ['log', 'warn', 'error', 'debug', 'info'];\n\n/** Payload sent over Vite's HMR WebSocket. */\nexport interface ServerLogPayload {\n level: ServerLogLevel;\n args: unknown[];\n /** Server-side source location (file:line:col) if available. */\n location: string | null;\n /** Timestamp in ms (Date.now()) */\n timestamp: number;\n}\n\n// ─── Serialization ───────────────────────────────────────────────────────\n\n/** Patterns that look like env vars or secrets — these are redacted. */\nconst SENSITIVE_PATTERNS =\n /(?:^|[^a-z])(?:SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY|AUTH|CREDENTIAL|SESSION_SECRET)(?:[^a-z]|$)/i;\n\n/**\n * Serialize a console argument for transmission over WebSocket.\n *\n * Handles: strings, numbers, booleans, null, undefined, arrays, plain\n * objects, Errors, Dates, RegExps, and falls back to String() for others.\n *\n * Redacts values that match sensitive patterns to avoid leaking secrets.\n */\nfunction serializeArg(arg: unknown, depth = 0): unknown {\n if (depth > 5) return '[...]';\n\n if (arg === null) return null;\n if (arg === undefined) return '[undefined]';\n\n switch (typeof arg) {\n case 'string':\n if (SENSITIVE_PATTERNS.test(arg)) return '[REDACTED]';\n return arg;\n case 'number':\n case 'boolean':\n return arg;\n case 'bigint':\n return `${arg}n`;\n case 'symbol':\n return arg.toString();\n case 'function':\n return `[Function: ${arg.name || 'anonymous'}]`;\n case 'object':\n break;\n default:\n return String(arg);\n }\n\n // Error\n if (arg instanceof Error) {\n return {\n __type: 'Error',\n name: arg.name,\n message: arg.message,\n stack: arg.stack ?? null,\n };\n }\n\n // Date\n if (arg instanceof Date) {\n return arg.toISOString();\n }\n\n // RegExp\n if (arg instanceof RegExp) {\n return arg.toString();\n }\n\n // Array\n if (Array.isArray(arg)) {\n return arg.map((item) => serializeArg(item, depth + 1));\n }\n\n // Map\n if (arg instanceof Map) {\n const entries: Record<string, unknown> = {};\n for (const [key, value] of arg) {\n entries[String(key)] = serializeArg(value, depth + 1);\n }\n return { __type: 'Map', entries };\n }\n\n // Set\n if (arg instanceof Set) {\n return { __type: 'Set', values: [...arg].map((v) => serializeArg(v, depth + 1)) };\n }\n\n // Plain object\n if (Object.getPrototypeOf(arg) === Object.prototype || Object.getPrototypeOf(arg) === null) {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(arg as Record<string, unknown>)) {\n if (SENSITIVE_PATTERNS.test(key)) {\n result[key] = '[REDACTED]';\n } else {\n result[key] = serializeArg(value, depth + 1);\n }\n }\n return result;\n }\n\n // Fallback — use toString or constructor name\n try {\n return `[${(arg as object).constructor?.name ?? 'Object'}]`;\n } catch {\n return '[Object]';\n }\n}\n\n// ─── Source Location ─────────────────────────────────────────────────────\n\n/**\n * Extract the caller's source location from an Error stack trace.\n *\n * Walks the stack to find the first frame that isn't inside this file\n * or Node internals. Returns \"file:line:col\" or null.\n */\nfunction extractCallerLocation(projectRoot: string): string | null {\n const err = new Error();\n const stack = err.stack;\n if (!stack) return null;\n\n const lines = stack.split('\\n');\n // Skip first line (\"Error\") and frames inside this module\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].trim();\n // Skip our own patching frames\n if (line.includes('dev-logs')) continue;\n // Skip node internals\n if (line.includes('node:') || line.includes('node_modules')) continue;\n\n // Extract file path from \"at ... (file:line:col)\" or \"at file:line:col\"\n const match = line.match(/\\((.+?):(\\d+):(\\d+)\\)/) ?? line.match(/at (.+?):(\\d+):(\\d+)/);\n if (match) {\n let filePath = match[1];\n // Make path relative to project root for readability\n if (filePath.startsWith(projectRoot)) {\n filePath = filePath.slice(projectRoot.length + 1);\n }\n return `${filePath}:${match[2]}:${match[3]}`;\n }\n }\n return null;\n}\n\n// ─── Framework-Internal Detection ────────────────────────────────────────\n\n/**\n * Check if the calling code is from timber's internal plugin/adapter plumbing.\n *\n * Only filters logs from `plugins/` and `adapters/` directories — these are\n * framework operational noise (request summaries, codegen warnings, adapter\n * setup). Logs from `server/` are preserved because they surface user errors\n * (render errors, action errors, route handler errors, etc.).\n *\n * Handles both monorepo paths (timber-app/src/plugins/) and installed\n * package paths (@timber-js/app/dist/plugins/).\n */\nexport function isFrameworkInternalCaller(): boolean {\n const err = new Error();\n const stack = err.stack;\n if (!stack) return false;\n\n const lines = stack.split('\\n');\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].trim();\n // Skip our own patching frames\n if (line.includes('dev-logs')) continue;\n // Skip node internals (but NOT node_modules — we need to inspect those)\n if (line.includes('node:')) continue;\n\n // Check if this first real frame is inside timber's own source\n const isTimberPath = line.includes('timber-app/') || line.includes('@timber-js/app/');\n if (!isTimberPath) return false;\n\n // Only filter plugin and adapter internals, not server/ runtime code\n // which surfaces user errors (render errors, action errors, etc.)\n return line.includes('/plugins/') || line.includes('/adapters/');\n }\n return false;\n}\n\n// ─── Console Patching ────────────────────────────────────────────────────\n\n/**\n * Patch console methods to forward logs to the browser via HMR WebSocket.\n *\n * Each patched method:\n * 1. Calls the original console method (server terminal still works)\n * 2. Serializes arguments for JSON transport\n * 3. Sends via server.hot.send() — dropped if no clients connected\n */\nfunction patchConsole(server: ViteDevServer, projectRoot: string): () => void {\n const originals = new Map<ServerLogLevel, (...args: unknown[]) => void>();\n\n for (const level of LOG_LEVELS) {\n originals.set(level, console[level].bind(console));\n\n console[level] = (...args: unknown[]) => {\n // Always call the original — server terminal output is preserved\n originals.get(level)!(...args);\n\n // Skip framework-internal logs (plugins/, adapters/) from browser forwarding.\n // Server runtime logs (render errors, action errors, etc.) are preserved.\n if (isFrameworkInternalCaller()) return;\n\n // Serialize and forward to browser\n try {\n const payload: ServerLogPayload = {\n level,\n args: args.map((arg) => serializeArg(arg)),\n location: extractCallerLocation(projectRoot),\n timestamp: Date.now(),\n };\n\n server.hot.send('timber:server-log', payload);\n } catch {\n // Never let log forwarding break the server\n }\n };\n }\n\n // Return a cleanup function to restore originals\n return () => {\n for (const [level, original] of originals) {\n console[level] = original;\n }\n };\n}\n\n// ─── Plugin ──────────────────────────────────────────────────────────────\n\n/**\n * Create the timber-dev-logs Vite plugin.\n *\n * Patches console methods when the dev server starts and restores them\n * when the server closes. Only active during `vite dev`.\n */\nexport function timberDevLogs(_ctx: PluginContext): Plugin {\n let cleanup: (() => void) | null = null;\n\n return {\n name: 'timber-dev-logs',\n apply: 'serve',\n\n configureServer(server: ViteDevServer) {\n cleanup = patchConsole(server, _ctx.root);\n\n // Restore console on server close\n server.httpServer?.on('close', () => {\n cleanup?.();\n cleanup = null;\n });\n },\n };\n}\n","import type { Plugin } from 'vite';\n\n/**\n * Redirect React's CJS development bundles to production bundles.\n *\n * React packages use a runtime `process.env.NODE_ENV` check in their CJS\n * entry points to conditionally require either `*.development.js` or\n * `*.production.js`. Rollup's CJS plugin resolves both branches statically\n * before the `define` replacement can eliminate the dead branch, causing\n * development React code to be included in production builds.\n *\n * This plugin intercepts `resolveId` and rewrites any `*.development.js`\n * import under `react/cjs/`, `react-dom/cjs/`, or `scheduler/cjs/` to\n * its `*.production.js` counterpart.\n *\n * Only active in production builds. Has no effect in dev mode.\n */\nexport function timberReactProd(): Plugin {\n let isProd = false;\n\n return {\n name: 'timber-react-prod',\n enforce: 'pre',\n configResolved(config) {\n isProd = config.command === 'build' && config.mode === 'production';\n },\n resolveId: {\n order: 'pre',\n async handler(source, importer, options) {\n if (!isProd) return;\n\n // Match: react/cjs/*.development.js, react-dom/cjs/*.development.js, scheduler/cjs/*.development.js\n if (!source.includes('.development.')) return;\n\n const resolved = await this.resolve(source, importer, {\n ...options,\n skipSelf: true,\n });\n if (!resolved) return;\n\n // Only rewrite paths inside react/react-dom/scheduler/react-server-dom CJS directories\n if (\n !resolved.id.includes('/react/cjs/') &&\n !resolved.id.includes('/react-dom/cjs/') &&\n !resolved.id.includes('/scheduler/cjs/') &&\n !resolved.id.includes('/react-server-dom/cjs/')\n ) {\n return;\n }\n\n const prodId = resolved.id.replace('.development.', '.production.');\n return { ...resolved, id: prodId };\n },\n },\n };\n}\n","/**\n * timber-chunks — Vite sub-plugin for client chunk configuration.\n *\n * Previously implemented a 5-tier cache strategy (vendor-react, vendor-timber,\n * vendor-app, shared-app, shared-client) via manualChunks. This was removed\n * in LOCAL-337 because the cache-tier separation added HTTP requests,\n * complicated the architecture, and caused module duplication across chunks\n * that required globalThis + Symbol.for workarounds.\n *\n * Current strategy: let Rolldown handle natural code splitting.\n * Output is typically:\n * - 1 main bundle (React + timber runtime + shared app code + user vendors)\n * - Per-route chunks (page/layout components, only when route-specific)\n * - rolldown-runtime (Rolldown's own output, unavoidable)\n *\n * Design docs: 27-chunking-strategy.md\n */\n\nimport type { Plugin } from 'vite';\n\n/**\n * Check if a module is part of the timber framework runtime.\n *\n * Matches both monorepo paths (packages/timber-app/...) and consumer\n * project paths (node_modules/@timber-js/app/...) so identification\n * is consistent regardless of how timber is installed.\n *\n * Exported for use in tests (singleton-audit, etc.).\n */\nexport function isTimberRuntime(id: string): boolean {\n return (\n id.includes('/timber-app/') ||\n id.includes('/@timber-js/app/') ||\n id.includes('react-server-dom') ||\n id.includes('@vitejs/plugin-rsc')\n );\n}\n\n/**\n * Create the timber-chunks Vite plugin.\n *\n * Currently a no-op — Rolldown's default splitting produces the desired\n * output (one main bundle + per-route chunks). The plugin is retained as\n * a hook point for future chunking adjustments.\n *\n * NOTE: Ideally we'd use Rolldown's `format: 'app'` (module registry format)\n * which guarantees single-copy module semantics like webpack/Turbopack.\n * However, `format: 'app'` is not yet implemented in Rolldown rc.10.\n * Until it ships, singleton state in navigation-context.ts uses\n * globalThis + Symbol.for as a cross-chunk safety net.\n *\n * Design docs: 27-chunking-strategy.md\n */\nexport function timberChunks(): Plugin {\n return {\n name: 'timber-chunks',\n };\n}\n","/**\n * timber-server-bundle — Bundle all dependencies for server environments.\n *\n * In production builds, sets `resolve.noExternal: true` for the rsc and ssr\n * environments. This ensures all npm dependencies are bundled into the output,\n * which is required for platforms like Cloudflare Workers that don't have\n * access to node_modules at runtime.\n *\n * In dev mode, Vite's default externalization is preserved for fast HMR.\n *\n * Design docs: design/11-platform.md, design/25-production-deployments.md\n */\n\nimport type { Plugin } from 'vite';\n\nexport function timberServerBundle(): Plugin[] {\n const bundlePlugin: Plugin = {\n name: 'timber-server-bundle',\n\n config(_cfg, { command }) {\n // In dev mode, Vite externalizes node_modules by default for fast HMR.\n // But server-only/client-only must NOT be externalized — they need to\n // go through the timber-shims plugin so it can replace them with no-op\n // virtual modules. Without this, deps like `bright` that import\n // `server-only` get the real CJS package loaded via Node's require(),\n // which throws in the SSR environment.\n if (command === 'serve') {\n // In dev, Vite externalizes node_modules and loads them via Node's\n // native require(). This causes two problems:\n //\n // 1. Poison-pill packages: deps that import `server-only` (like `bright`)\n // hit the real CJS package which throws in the SSR environment.\n //\n // 2. Dual React instances: deps with React hooks (nuqs, etc.) are\n // externalized and loaded via Node.js, getting their own copy of\n // React. Meanwhile, SSR's renderToReadableStream uses Vite's\n // dep-optimized React. Two React instances = dispatcher mismatch,\n // causing \"Invalid hook call\" / \"Cannot read properties of null\n // (reading 'useId')\" errors. See LOCAL-297.\n //\n // We force these packages to be non-external so they go through\n // Vite's module pipeline, which deduplicates React correctly.\n return {\n environments: {\n rsc: {\n resolve: {\n noExternal: ['server-only', 'client-only'],\n },\n },\n ssr: {\n resolve: {\n noExternal: ['server-only', 'client-only', 'nuqs'],\n },\n },\n },\n };\n }\n\n // Bundle all dependencies in server environments for production.\n // Without this, bare imports like 'nuqs/adapters/custom' are left\n // as external imports in the output, which fails on platforms\n // without node_modules (Cloudflare Workers, edge runtimes).\n // Define process.env.NODE_ENV in server environments so that\n // dead-code branches (dev-only tracing, React dev checks) are\n // eliminated by Rollup's tree-shaking. Without this, the runtime\n // check falls through on platforms where process.env is empty\n // (e.g. Cloudflare Workers), causing dev code to run in production.\n // Define process.env.NODE_ENV so dev-only React code is tree-shaken.\n // TIMBER_DEBUG is intentionally NOT defined here — it must remain a\n // runtime check so `isDebug()` in server/debug.ts can read it at\n // request time. See TIM-365.\n const serverDefine = {\n 'process.env.NODE_ENV': JSON.stringify('production'),\n };\n\n return {\n // Target webworker so Rolldown doesn't emit createRequire(import.meta.url)\n // shims that fail in Cloudflare Workers where import.meta.url is undefined\n // for non-entry modules. See design/11-platform.md.\n ssr: { target: 'webworker' },\n environments: {\n rsc: {\n resolve: { noExternal: true },\n define: serverDefine,\n },\n ssr: {\n resolve: { noExternal: true },\n define: serverDefine,\n },\n },\n };\n },\n };\n\n // Fix Rolldown's broken `__esmMin` lazy initializers in server bundles.\n //\n // Rolldown wraps ESM module initialization in `__esmMin` lazy functions.\n // For packages with `sideEffects: false` (e.g. nuqs), Rolldown drops\n // the variable assignment of the init function — so the module's React\n // imports, context creation, etc. never execute.\n //\n // The fix: patch `__esmMin` to eagerly *attempt* each init, but fall\n // back to lazy retry on failure. This handles two failure modes:\n //\n // 1. Forward references (e.g. Zod v4): `init_iso` calls `init_schemas`\n // which hasn't been defined yet. Eager execution fails, but when the\n // function is called lazily later, all dependencies are available.\n //\n // 2. Optional peer dep shims (e.g. @emotion/is-prop-valid for\n // framer-motion): Vite generates shims that throw for missing\n // optional deps. The throw is deferred to lazy execution where\n // the consuming package's try/catch handles it.\n //\n // The key: on failure, `fn` is NOT cleared, so the next call retries.\n // On success, `fn` is set to 0 so subsequent calls are no-ops.\n const esmInitFixPlugin: Plugin = {\n name: 'timber-esm-init-fix',\n applyToEnvironment(environment) {\n return environment.name === 'rsc' || environment.name === 'ssr';\n },\n renderChunk(code) {\n const lazy = 'var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);';\n if (!code.includes(lazy)) return null;\n\n // Eager-with-retry: attempt init immediately. On success, mark done\n // (fn = 0). On failure, leave fn intact so the lazy wrapper retries\n // on next call — by then forward dependencies are initialized.\n const eager = [\n 'var __esmMin = (fn, res) => {',\n ' var l = () => { if (fn) { var f = fn; try { res = f(); fn = 0; } catch(e) {} } return res; };',\n ' l();',\n ' return l;',\n '};',\n ].join(' ');\n\n return { code: code.replace(lazy, eager), map: null };\n },\n };\n\n return [bundlePlugin, esmInitFixPlugin];\n}\n","/**\n * timber-adapter-build — Invoke the adapter's buildOutput after vite build.\n *\n * After all environments are built and the RSC plugin has written its\n * asset manifests, calls `adapter.buildOutput()` to transform the output\n * into a deployable artifact (e.g., Cloudflare Workers entry + wrangler.jsonc).\n *\n * Uses a `buildApp` hook with `order: 'post'` so that Vite calls the\n * RSC plugin's buildApp (which orchestrates all environment builds and\n * writes asset manifests) first, then runs this handler after everything\n * is complete.\n *\n * Design docs: design/11-platform.md, design/25-production-deployments.md\n */\n\nimport type { Plugin } from 'vite';\nimport { join } from 'node:path';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport type { PluginContext } from '#/index.js';\nimport type { TimberPlatformAdapter, TimberConfig } from '#/adapters/types.js';\n\nexport function timberAdapterBuild(ctx: PluginContext): Plugin {\n return {\n name: 'timber-adapter-build',\n\n // order: 'post' causes Vite to run configBuilder.buildApp() (which\n // includes the RSC plugin's buildApp) before calling this handler.\n // By the time we run, all environments are built and asset manifests\n // are written — safe to copy the output.\n buildApp: {\n order: 'post' as const,\n async handler() {\n if (ctx.dev) return;\n\n const adapter = ctx.config.adapter as TimberPlatformAdapter | undefined;\n if (!adapter || typeof adapter.buildOutput !== 'function') return;\n\n const buildDir = join(ctx.root, 'dist');\n\n // Serialize the build manifest as a JS module that sets the global.\n // The adapter writes this as _timber-manifest-init.mjs and imports it\n // before the RSC handler, so globalThis.__TIMBER_BUILD_MANIFEST__ is\n // available when virtual:timber-build-manifest evaluates.\n let manifestInit: string | undefined;\n if (ctx.buildManifest) {\n // Strip JS/modulepreload from manifest when client JS is disabled —\n // those files aren't served, so hints for them are useless.\n const manifest = ctx.clientJavascript.disabled\n ? { ...ctx.buildManifest, js: {}, modulepreload: {} }\n : ctx.buildManifest;\n const json = JSON.stringify(manifest);\n manifestInit = `globalThis.__TIMBER_BUILD_MANIFEST__ = ${json};\\n`;\n }\n\n // Strip JS from the RSC plugin's assets manifest when client JS\n // is disabled. The RSC plugin writes __vite_rsc_assets_manifest.js\n // with clientReferenceDeps containing JS URLs — used to inject\n // <link rel=\"modulepreload\"> tags. Must happen before the adapter\n // copies files to the output directory.\n if (ctx.clientJavascript.disabled) {\n await stripJsFromRscAssetsManifests(buildDir);\n }\n\n const adapterConfig: TimberConfig = {\n output: ctx.config.output ?? 'server',\n clientJavascriptDisabled: ctx.clientJavascript.disabled,\n manifestInit,\n };\n\n await adapter.buildOutput(adapterConfig, buildDir);\n },\n },\n };\n}\n\n/**\n * Strip JS references from the RSC plugin's assets manifest files.\n *\n * The RSC plugin writes `__vite_rsc_assets_manifest.js` to rsc/ and ssr/\n * as standalone files (not Rollup chunks), so generateBundle can't\n * intercept them. This rewrites the files on disk after all builds\n * complete but before the adapter copies them to the output directory.\n */\nasync function stripJsFromRscAssetsManifests(buildDir: string): Promise<void> {\n const manifestName = '__vite_rsc_assets_manifest.js';\n const paths = [join(buildDir, 'rsc', manifestName), join(buildDir, 'ssr', manifestName)];\n\n for (const path of paths) {\n let content: string;\n try {\n content = await readFile(path, 'utf-8');\n } catch {\n continue;\n }\n\n const jsonStr = content.replace(/^export default\\s*/, '').replace(/;?\\s*$/, '');\n let manifest: Record<string, unknown>;\n try {\n manifest = JSON.parse(jsonStr);\n } catch {\n continue;\n }\n\n // Clear JS from clientReferenceDeps — preserves CSS\n const deps = manifest.clientReferenceDeps as\n | Record<string, { js: string[]; css: string[] }>\n | undefined;\n if (deps) {\n for (const entry of Object.values(deps)) {\n entry.js = [];\n }\n }\n\n manifest.bootstrapScriptContent = '';\n\n await writeFile(path, `export default ${JSON.stringify(manifest, null, 2)};\\n`);\n }\n}\n","/**\n * timber-build-report — Post-build route summary table.\n *\n * After a production build, logs a per-route table showing:\n * - Route type (○ static, λ dynamic, ƒ function)\n * - Route-specific client JS size\n * - First-load JS size (gzip) — route-specific + shared chunks\n *\n * Only active during production builds. Sizes are computed from the\n * already-generated Vite client bundle — no extra analysis passes.\n *\n * Design docs: 18-build-system.md §\"Build Pipeline\", 07-routing.md\n * Task: TIM-287\n */\n\nimport { gzipSync } from 'node:zlib';\nimport type { Plugin, Logger } from 'vite';\nimport type { PluginContext } from '#/index.js';\nimport type { SegmentNode, RouteTree } from '#/routing/types.js';\nimport { formatSize } from '#/utils/format.js';\n\n// ─── Public types ─────────────────────────────────────────────────────────\n\nexport type RouteType = 'static' | 'dynamic' | 'function';\n\nexport interface RouteEntry {\n path: string;\n type: RouteType;\n /** Route-specific client JS size in bytes (raw). */\n size: number;\n /** Total first-load JS in bytes (gzip): route-specific + shared. */\n firstLoadSize: number;\n}\n\n// ─── Route classification ─────────────────────────────────────────────────\n\nconst ROUTE_TYPE_ICONS: Record<RouteType, string> = {\n static: '○',\n dynamic: 'λ',\n function: 'ƒ',\n};\n\n/**\n * Classify a route by its segment chain and output mode.\n *\n * In server mode (default), all pages are dynamic (rendered per-request).\n * In static mode, only pages with dynamic/catch-all segments are dynamic.\n * API routes (route.ts) are always classified as function.\n */\nexport function classifyRoute(\n segments: SegmentNode[],\n outputMode: 'server' | 'static' = 'server'\n): RouteType {\n const leaf = segments[segments.length - 1];\n if (leaf?.route) return 'function';\n if (outputMode === 'server') return 'dynamic';\n\n const isDynamic = segments.some(\n (s) =>\n s.segmentType === 'dynamic' ||\n s.segmentType === 'catch-all' ||\n s.segmentType === 'optional-catch-all'\n );\n return isDynamic ? 'dynamic' : 'static';\n}\n\n// ─── Size helpers ─────────────────────────────────────────────────────────\n\nexport { formatSize };\n\nfunction green(text: string): string {\n return `\\x1b[92m${text}\\x1b[39m`; // bright/light green (ANSI 92)\n}\n\n// ─── Route tree collection ────────────────────────────────────────────────\n\ninterface RouteInfo {\n path: string;\n segments: SegmentNode[];\n entryFilePath: string | null;\n}\n\n/**\n * Walk the route tree and collect all leaf routes (pages + API endpoints).\n *\n * Parallel slots (`@artists`, `@shows`, etc.) are intentionally skipped —\n * they render alongside the parent page at the same URL and are not\n * separately URL-addressable. Their JS is captured in shared/layout chunks.\n *\n * After collection, entries are deduplicated by URL path so that overlapping\n * route groups (e.g. `(browse)` and `(marketing)` both producing `/`) only\n * appear once. The entry with the largest route-specific size wins.\n */\nexport function collectRoutes(tree: RouteTree): RouteInfo[] {\n const routes: RouteInfo[] = [];\n\n function walk(node: SegmentNode, chain: SegmentNode[]): void {\n const currentChain = [...chain, node];\n const path = node.urlPath || '/';\n\n if (node.page) {\n routes.push({ path, segments: currentChain, entryFilePath: node.page.filePath });\n }\n if (node.route) {\n routes.push({ path, segments: currentChain, entryFilePath: node.route.filePath });\n }\n\n // Recurse into child segments only — skip parallel slots (node.slots)\n for (const child of node.children) walk(child, currentChain);\n }\n\n walk(tree.root, []);\n\n // Deduplicate entries with the same URL path (e.g. from overlapping route groups).\n // Keep the entry with the longest segment chain (most specific match).\n const seen = new Map<string, RouteInfo>();\n for (const route of routes) {\n const existing = seen.get(route.path);\n if (!existing || route.segments.length > existing.segments.length) {\n seen.set(route.path, route);\n }\n }\n return Array.from(seen.values());\n}\n\n// ─── Report formatting ────────────────────────────────────────────────────\n\n/** Produce formatted report lines for the Vite logger. */\nexport function buildRouteReport(entries: RouteEntry[], sharedSize: number): string[] {\n const sorted = [...entries].sort((a, b) => a.path.localeCompare(b.path));\n\n const header = 'Route (app)';\n const sizeHeader = 'Size';\n const firstLoadHeader = 'First Load JS';\n\n const pathW = Math.max(header.length + 2, ...sorted.map((e) => e.path.length + 6));\n const sizeW = Math.max(sizeHeader.length, 14);\n const flW = Math.max(firstLoadHeader.length, 10);\n const totalW = pathW + sizeW + flW + 4;\n const sep = '─'.repeat(totalW);\n\n const lines: string[] = [];\n\n // Header\n lines.push(\n `${pad(header, pathW)} ${pad(sizeHeader, sizeW, 'left')} ${pad(firstLoadHeader, flW, 'left')}`\n );\n lines.push(sep);\n\n // Routes\n for (const entry of sorted) {\n const icon = ROUTE_TYPE_ICONS[entry.type];\n const pathStr = ` ${icon} ${entry.path}`;\n const sizeStr = entry.size === 0 ? green('zero unique JS') : formatSize(entry.size);\n const flStr = formatSize(entry.firstLoadSize);\n lines.push(\n `${pad(pathStr, pathW)} ${pad(sizeStr, sizeW, 'left')} ${pad(flStr, flW, 'left')}`\n );\n }\n\n // Footer\n lines.push(sep);\n lines.push(\n `${pad(' Shared by all', pathW)} ${pad('', sizeW, 'left')} ${pad(formatSize(sharedSize), flW, 'left')}`\n );\n lines.push('');\n lines.push('○ (Static) λ (Dynamic) ƒ (Function)');\n\n return lines;\n}\n\nfunction pad(str: string, width: number, align: 'left' | 'right' = 'right'): string {\n const gap = Math.max(0, width - stripAnsi(str).length);\n return align === 'left' ? ' '.repeat(gap) + str : str + ' '.repeat(gap);\n}\n\nfunction stripAnsi(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/\\u001b\\[\\d+m/g, '');\n}\n\n// ─── Bundle analysis ──────────────────────────────────────────────────────\n\ninterface ChunkSize {\n raw: number;\n gzip: number;\n}\n\ninterface OutputChunkLike {\n type: 'chunk' | 'asset';\n fileName: string;\n code?: string;\n source?: string | Uint8Array;\n modules?: Record<string, unknown>;\n facadeModuleId?: string | null;\n}\n\n/** Measure raw + gzip sizes for all JS chunks and CSS assets in a bundle. */\nexport function collectChunkSizes(bundle: Record<string, OutputChunkLike>): Map<string, ChunkSize> {\n const sizes = new Map<string, ChunkSize>();\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type === 'chunk' && item.code) {\n sizes.set(fileName, measure(item.code));\n } else if (item.type === 'asset' && fileName.endsWith('.css') && item.source != null) {\n const src =\n typeof item.source === 'string' ? item.source : new TextDecoder().decode(item.source);\n sizes.set(fileName, measure(src));\n }\n }\n return sizes;\n}\n\nfunction measure(content: string): ChunkSize {\n const buf = new TextEncoder().encode(content);\n return { raw: buf.length, gzip: gzipSync(buf).length };\n}\n\n/** Find the output chunk that contains a given input file. */\nexport function findChunkForFile(\n filePath: string,\n bundle: Record<string, OutputChunkLike>\n): string | null {\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type !== 'chunk') continue;\n if (item.facadeModuleId === filePath) return fileName;\n if (item.modules && filePath in item.modules) return fileName;\n }\n return null;\n}\n\n// ─── Build route entries from collected data ──────────────────────────────\n\nfunction buildEntries(\n routeTree: RouteTree,\n chunkSizes: Map<string, ChunkSize>,\n bundle: Record<string, OutputChunkLike>,\n outputMode: 'server' | 'static'\n): { entries: RouteEntry[]; sharedGzip: number } {\n const routeInfos = collectRoutes(routeTree);\n\n // Total gzip across all client chunks\n let totalGzip = 0;\n for (const s of chunkSizes.values()) totalGzip += s.gzip;\n\n // Per-route sizes and track route-specific chunks\n const routeChunkFiles = new Set<string>();\n const entries: RouteEntry[] = [];\n\n for (const info of routeInfos) {\n let raw = 0;\n let gzip = 0;\n\n if (info.entryFilePath) {\n const chunk = findChunkForFile(info.entryFilePath, bundle);\n if (chunk) {\n const s = chunkSizes.get(chunk);\n if (s) {\n raw = s.raw;\n gzip = s.gzip;\n }\n routeChunkFiles.add(chunk);\n }\n }\n\n entries.push({\n path: info.path,\n type: classifyRoute(info.segments, outputMode),\n size: raw,\n firstLoadSize: gzip, // route-specific gzip — shared added below\n });\n }\n\n // Shared = total gzip minus route-specific gzip\n let routeGzip = 0;\n for (const f of routeChunkFiles) routeGzip += chunkSizes.get(f)?.gzip ?? 0;\n const sharedGzip = totalGzip - routeGzip;\n\n for (const e of entries) e.firstLoadSize += sharedGzip;\n\n return { entries, sharedGzip };\n}\n\n// ─── Vite plugin ──────────────────────────────────────────────────────────\n\n/**\n * Suppress RSC/SSR per-chunk build log lines.\n *\n * Vite logs each output chunk via config.logger.info(). We wrap that method\n * to filter lines matching dist/rsc/ or dist/ssr/ paths. The regex is\n * non-anchored because Vite prepends ANSI color codes.\n */\nfunction suppressNonClientLogs(config: { command: string; logger: Logger }): void {\n if (config.command !== 'build') return;\n const orig = config.logger.info.bind(config.logger);\n config.logger.info = (msg: string, opts?: { timestamp?: boolean }) => {\n if (typeof msg === 'string' && /dist\\/(rsc|ssr)\\//.test(msg)) return;\n orig(msg, opts);\n };\n}\n\nexport function timberBuildReport(ctx: PluginContext): Plugin {\n let logger: Logger | null = null;\n let chunkSizes: Map<string, ChunkSize> | null = null;\n let clientBundle: Record<string, OutputChunkLike> | null = null;\n let reported = false;\n let deferReport = false;\n const buildStart = performance.now();\n\n return {\n name: 'timber-build-report',\n\n config(_cfg, { command }) {\n if (command !== 'build') return;\n return {\n environments: {\n rsc: { build: { reportCompressedSize: false } },\n ssr: { build: { reportCompressedSize: false } },\n },\n };\n },\n\n configResolved(config) {\n logger = config.logger;\n suppressNonClientLogs(config);\n },\n\n generateBundle(_options, bundle) {\n if (ctx.dev) return;\n if (this.environment?.name && this.environment.name !== 'client') return;\n\n chunkSizes = collectChunkSizes(bundle as Record<string, OutputChunkLike>);\n clientBundle = { ...bundle } as Record<string, OutputChunkLike>;\n deferReport = true; // skip client's closeBundle; emit after SSR's\n },\n\n closeBundle() {\n if (ctx.dev || reported) return;\n\n // The client build's closeBundle fires before SSR starts.\n // Defer one cycle so the report appears after all builds complete.\n if (deferReport) {\n deferReport = false;\n return;\n }\n if (!ctx.routeTree || !chunkSizes || !clientBundle || !logger) return;\n\n reported = true;\n const outputMode = ctx.config.output ?? 'server';\n const clientJsDisabled = ctx.clientJavascript.disabled;\n const { entries, sharedGzip } = clientJsDisabled\n ? {\n entries: collectRoutes(ctx.routeTree).map((info) => ({\n path: info.path,\n type: classifyRoute(info.segments, outputMode),\n size: 0,\n firstLoadSize: 0,\n })),\n sharedGzip: 0,\n }\n : buildEntries(ctx.routeTree, chunkSizes, clientBundle, outputMode);\n const elapsed = ((performance.now() - buildStart) / 1000).toFixed(2);\n const lines = buildRouteReport(entries, sharedGzip);\n\n logger.info('');\n for (const line of lines) logger.info(line);\n logger.info('');\n logger.info(\n `✓ built ${entries.length} routes for all three environments (rsc, ssr, client) in ${elapsed}s`\n );\n logger.info('');\n },\n };\n}\n","/**\n * Startup timer — records named phases with their durations.\n *\n * Used by the plugin system to instrument cold start and report a\n * timing breakdown in dev mode. Zero overhead in production (disabled).\n *\n * See design/18-build-system.md, TIM-155.\n */\n\nimport { performance } from 'node:perf_hooks';\n\nexport interface PhaseRecord {\n name: string;\n startMs: number;\n durationMs: number;\n}\n\nexport interface StartupTimer {\n /** Mark the beginning of a named phase. */\n start(phase: string): void;\n /** Mark the end of a named phase. Returns duration in ms. */\n end(phase: string): number;\n /** Get all completed phase records, ordered by start time. */\n getPhases(): PhaseRecord[];\n /** Total elapsed time from first start() to last end(). */\n totalMs(): number;\n /** Format a human-readable summary string. */\n formatSummary(): string;\n}\n\n/**\n * Create a startup timer that records phase durations.\n */\nexport function createStartupTimer(): StartupTimer {\n const pending = new Map<string, number>();\n const phases: PhaseRecord[] = [];\n\n return {\n start(phase: string): void {\n pending.set(phase, performance.now());\n },\n\n end(phase: string): number {\n const startMs = pending.get(phase);\n if (startMs === undefined) {\n return 0;\n }\n pending.delete(phase);\n const durationMs = performance.now() - startMs;\n phases.push({ name: phase, startMs, durationMs });\n return durationMs;\n },\n\n getPhases(): PhaseRecord[] {\n return [...phases].sort((a, b) => a.startMs - b.startMs);\n },\n\n totalMs(): number {\n if (phases.length === 0) return 0;\n const sorted = this.getPhases();\n const first = sorted[0];\n const last = sorted[sorted.length - 1];\n return last.startMs + last.durationMs - first.startMs;\n },\n\n formatSummary(): string {\n const sorted = this.getPhases();\n if (sorted.length === 0) return 'No phases recorded.';\n\n const lines = sorted.map((p) => {\n const ms = p.durationMs.toFixed(1);\n return ` ${p.name.padEnd(30)} ${ms.padStart(8)}ms`;\n });\n\n const total = this.totalMs().toFixed(1);\n lines.push(` ${'total'.padEnd(30)} ${total.padStart(8)}ms`);\n\n return ['[timber] startup timing:', ...lines].join('\\n');\n },\n };\n}\n\n/**\n * No-op timer for production builds — all methods are empty.\n */\nexport function createNoopTimer(): StartupTimer {\n return {\n start() {},\n end() {\n return 0;\n },\n getPhases() {\n return [];\n },\n totalMs() {\n return 0;\n },\n formatSummary() {\n return '';\n },\n };\n}\n","import type { Plugin, PluginOption } from 'vite';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createRequire } from 'node:module';\nimport react from '@vitejs/plugin-react';\nimport { cacheTransformPlugin } from './plugins/cache-transform';\nimport { timberContent } from './plugins/content';\nimport { timberDevServer } from './plugins/dev-server';\nimport { timberEntries } from './plugins/entries';\nimport { timberMdx } from './plugins/mdx';\nimport { timberRouting } from './plugins/routing';\nimport { timberShims } from './plugins/shims';\nimport { timberFonts } from './plugins/fonts';\nimport { timberStaticBuild } from './plugins/static-build';\nimport { timberDynamicTransform } from './plugins/dynamic-transform';\nimport { timberServerActionExports } from './plugins/server-action-exports';\nimport { timberBuildManifest } from './plugins/build-manifest';\nimport { timberDevLogs } from './plugins/dev-logs';\nimport { timberReactProd } from './plugins/react-prod';\nimport { timberChunks } from './plugins/chunks';\nimport { timberServerBundle } from './plugins/server-bundle';\nimport { timberAdapterBuild } from './plugins/adapter-build';\nimport { timberBuildReport } from './plugins/build-report';\nimport type { RouteTree } from './routing/types';\nimport type { BuildManifest } from './server/build-manifest';\nimport type { StartupTimer } from './utils/startup-timer';\nimport { createStartupTimer, createNoopTimer } from './utils/startup-timer';\n\n/** Configuration for client-side JavaScript output. */\nexport interface ClientJavascriptConfig {\n /** When true, no client JS bundles are emitted or referenced in HTML. */\n disabled: boolean;\n /**\n * When `disabled` is true, still inject the Vite HMR client in dev mode\n * so hot reloading works during development. Default: true.\n */\n enableHMRInDev?: boolean;\n}\n\n/** Fully resolved client JavaScript configuration (no optionals). */\nexport interface ResolvedClientJavascript {\n disabled: boolean;\n enableHMRInDev: boolean;\n}\n\nexport interface TimberUserConfig {\n output?: 'server' | 'static';\n /**\n * Enable timber debug logging in production builds.\n *\n * When `true`, timber's own diagnostics (dev warnings, verbose logging)\n * are active even in production mode. React stays in production mode —\n * only timber's logs are affected.\n *\n * Can also be enabled at runtime via the `TIMBER_DEBUG` environment variable.\n *\n * Default: `false`.\n */\n debug?: boolean;\n /**\n * Control client-side JavaScript output.\n *\n * Boolean shorthand:\n * `clientJavascript: false` disables all client JS (equivalent to `{ disabled: true }`).\n * `clientJavascript: true` enables client JS (the default).\n *\n * Object form:\n * `clientJavascript: { disabled: true, enableHMRInDev: true }` disables client JS\n * in production but preserves Vite HMR in dev mode.\n *\n * When `disabled` is true, `enableHMRInDev` defaults to `true`.\n * Server-side JS still runs — this only affects what is sent to the browser.\n */\n clientJavascript?: boolean | ClientJavascriptConfig;\n adapter?: unknown;\n cacheHandler?: unknown;\n allowedOrigins?: string[];\n csrf?: boolean;\n limits?: {\n actionBodySize?: string;\n uploadBodySize?: string;\n maxFields?: number;\n };\n pageExtensions?: string[];\n /**\n * Slow request threshold in milliseconds. Requests exceeding this emit\n * a warning via the logger. Set to 0 to disable. Default: 3000.\n *\n * See design/17-logging.md §\"slowRequestMs\".\n */\n slowRequestMs?: number;\n /** Dev-mode options. These have no effect in production builds. */\n dev?: {\n /** Threshold in ms to highlight slow phases in dev logging output. Default: 200. */\n slowPhaseMs?: number;\n };\n /**\n * Cookie signing configuration. See design/29-cookies.md §\"Signed Cookies\".\n *\n * Provide `secret` for a single key, or `secrets` (array) for key rotation.\n * When `secrets` is used, index 0 is the signing key; all are tried for verification.\n */\n cookies?: {\n /** Single signing secret. Shorthand for `secrets: [secret]`. */\n secret?: string;\n /** Array of signing secrets for key rotation. Index 0 signs; all verify. */\n secrets?: string[];\n };\n /**\n * Control Server-Timing header output.\n *\n * - `'detailed'` — per-phase breakdown (proxy, middleware, render). Useful\n * for APM / network monitoring. Exposes phase names to clients.\n * - `'total'` — single `total;dur=N` entry. Safe to expose, gives\n * browser DevTools useful timing without internal details.\n * - `false` — no Server-Timing header at all.\n *\n * Default: `'detailed'` in dev, `'total'` in production.\n *\n * This is separate from `debug` / `TIMBER_DEBUG` — it's an intentional\n * decision to expose timing data to clients, not a side effect of debug\n * logging.\n */\n serverTiming?: 'detailed' | 'total' | false;\n /**\n * Override the app directory location. By default, timber auto-detects\n * `app/` at the project root, falling back to `src/app/`.\n *\n * Set this to a relative path from the project root (e.g. `'src/app'`)\n * to use a custom location.\n */\n appDir?: string;\n /** MDX compilation options passed to @mdx-js/rollup. See design/20-content-collections.md. */\n mdx?: {\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n recmaPlugins?: unknown[];\n remarkRehypeOptions?: Record<string, unknown>;\n };\n /**\n * Built-in top-loader progress bar for client navigations.\n * Shows an animated bar at the top of the viewport during RSC navigations.\n * Enabled by default — set `enabled: false` to opt out.\n *\n * Users who want a fully custom progress indicator should disable this\n * and use `useNavigationPending()` directly.\n *\n * See LOCAL-336 for design decisions.\n */\n topLoader?: {\n /** Whether the top-loader is enabled. Default: true. */\n enabled?: boolean;\n /** Bar color. Default: '#2299DD'. */\n color?: string;\n /** Bar height in pixels. Default: 3. */\n height?: number;\n /** Show subtle glow/shadow effect. Default: true. */\n shadow?: boolean;\n /** Delay in ms before showing the bar (avoids flash on fast navs). Default: 0. */\n delay?: number;\n /** CSS z-index. Default: 1600. */\n zIndex?: number;\n };\n}\n\n/**\n * Resolve `clientJavascript` into a fully resolved config.\n */\nexport function resolveClientJavascript(config: TimberUserConfig): ResolvedClientJavascript {\n if (config.clientJavascript !== undefined) {\n if (typeof config.clientJavascript === 'boolean') {\n // `clientJavascript: false` → disabled\n // `clientJavascript: true` → enabled (default)\n return {\n disabled: !config.clientJavascript,\n enableHMRInDev: !config.clientJavascript, // default true when disabled\n };\n }\n // Object form\n return {\n disabled: config.clientJavascript.disabled,\n enableHMRInDev: config.clientJavascript.enableHMRInDev ?? config.clientJavascript.disabled,\n };\n }\n\n // Default: client JS enabled\n return { disabled: false, enableHMRInDev: false };\n}\n\n/**\n * Shared context object passed to all sub-plugins via closure.\n *\n * Sub-plugins communicate through this context — not through Vite's\n * plugin API or global state.\n * See design/18-build-system.md §\"Shared Plugin Context\".\n */\nexport interface PluginContext {\n config: TimberUserConfig;\n /** Resolved client JavaScript configuration */\n clientJavascript: ResolvedClientJavascript;\n /** The scanned route tree (populated by timber-routing, consumed by timber-entries) */\n routeTree: RouteTree | null;\n /** Absolute path to the app/ directory */\n appDir: string;\n /** Absolute path to the project root */\n root: string;\n /** Whether the dev server is running (set by timber-root-sync in configResolved) */\n dev: boolean;\n /** CSS build manifest (populated by adapter after client build, null in dev) */\n buildManifest: BuildManifest | null;\n /** Startup timer for profiling cold start phases (active in dev, no-op in prod) */\n timer: StartupTimer;\n}\n\n/**\n * Resolve the app directory. Checks (in order):\n * 1. Explicit `configAppDir` from timber.config.ts\n * 2. `<root>/app`\n * 3. `<root>/src/app`\n *\n * Throws if none exist.\n */\nexport function resolveAppDir(root: string, configAppDir?: string): string {\n if (configAppDir) {\n const explicit = join(root, configAppDir);\n if (!existsSync(explicit)) {\n throw new Error(`[timber] Configured appDir \"${configAppDir}\" does not exist at ${explicit}`);\n }\n return explicit;\n }\n\n const rootApp = join(root, 'app');\n if (existsSync(rootApp)) return rootApp;\n\n const srcApp = join(root, 'src', 'app');\n if (existsSync(srcApp)) return srcApp;\n\n throw new Error(\n `[timber] Could not find app directory. Expected \"app/\" or \"src/app/\" in ${root}. ` +\n `You can set appDir in timber.config.ts to specify a custom location.`\n );\n}\n\nfunction createPluginContext(config?: TimberUserConfig, root?: string): PluginContext {\n const projectRoot = root ?? process.cwd();\n const resolvedConfig: TimberUserConfig = { output: 'server', ...config };\n // Timer starts as active — swapped to noop in configResolved for production builds\n return {\n config: resolvedConfig,\n clientJavascript: resolveClientJavascript(resolvedConfig),\n routeTree: null,\n appDir: join(projectRoot, 'app'),\n root: projectRoot,\n dev: false,\n buildManifest: null,\n timer: createStartupTimer(),\n };\n}\n\n/**\n * Load timber.config.ts (or .js, .mjs) from the project root.\n * Returns the config object or null if no config file is found.\n */\nasync function loadTimberConfigFile(root: string): Promise<TimberUserConfig | null> {\n const configNames = ['timber.config.ts', 'timber.config.js', 'timber.config.mjs'];\n\n for (const name of configNames) {\n const configPath = join(root, name);\n if (existsSync(configPath)) {\n const mod = await import(pathToFileURL(configPath).href);\n return (mod.default ?? mod) as TimberUserConfig;\n }\n }\n return null;\n}\n\n/**\n * Detect config keys set in both inline (vite.config.ts) and file (timber.config.ts)\n * and warn the user. The `output` key is excluded because it defaults to 'server'\n * in createPluginContext and would always appear as an inline key.\n *\n * Returns the list of conflicting key names (for testing).\n */\nexport function warnConfigConflicts(\n inline: TimberUserConfig,\n fileConfig: TimberUserConfig\n): string[] {\n const conflicts: string[] = [];\n for (const key of Object.keys(fileConfig) as (keyof TimberUserConfig)[]) {\n if (key === 'output') continue;\n if (key in inline && inline[key] !== undefined) {\n conflicts.push(key);\n }\n }\n if (conflicts.length > 0) {\n console.warn(\n `[timber] Config conflict: ${conflicts.map((k) => `\"${k}\"`).join(', ')} set in both ` +\n `vite.config.ts (inline) and timber.config.ts. ` +\n `Move all config to timber.config.ts to avoid confusion. ` +\n `The inline value from vite.config.ts will be used.`\n );\n }\n return conflicts;\n}\n\n/**\n * Merge file-based config into ctx.config. Inline config (already in ctx.config)\n * takes precedence — file config only fills in missing fields.\n */\nfunction mergeFileConfig(ctx: PluginContext, fileConfig: TimberUserConfig): void {\n const inline = ctx.config;\n\n // Warn if the same key is set in both places\n warnConfigConflicts(inline, fileConfig);\n\n // For each top-level key, use inline value if present, otherwise file value\n ctx.config = {\n ...fileConfig,\n ...inline,\n // Deep merge for nested objects where both exist\n ...(fileConfig.limits && inline.limits\n ? { limits: { ...fileConfig.limits, ...inline.limits } }\n : {}),\n ...(fileConfig.dev && inline.dev ? { dev: { ...fileConfig.dev, ...inline.dev } } : {}),\n ...(fileConfig.mdx && inline.mdx ? { mdx: { ...fileConfig.mdx, ...inline.mdx } } : {}),\n };\n}\n\nfunction timberCache(_ctx: PluginContext): Plugin {\n return cacheTransformPlugin();\n}\n\nexport function timber(config?: TimberUserConfig): PluginOption[] {\n const ctx = createPluginContext(config);\n // Sync ctx.root and ctx.appDir with Vite's resolved root, which may\n // differ from process.cwd() when --config points to a subdirectory.\n // Also loads timber.config.ts and merges it into ctx.config (inline config wins).\n const rootSync: Plugin = {\n name: 'timber-root-sync',\n async config(userConfig, { command }) {\n // Load timber.config.ts early — before configResolved/buildStart — so\n // all plugins (including timber-mdx) see the merged config in their\n // buildStart hooks. The config hook runs once and supports async.\n const root = userConfig.root ?? process.cwd();\n ctx.timer.start('config-load');\n const fileConfig = await loadTimberConfigFile(root);\n if (fileConfig) {\n mergeFileConfig(ctx, fileConfig);\n ctx.clientJavascript = resolveClientJavascript(ctx.config);\n }\n ctx.timer.end('config-load');\n\n // Force production JSX transform for builds.\n //\n // Vite determines dev vs prod JSX via `isProduction`, which checks\n // `process.env.NODE_ENV === 'production'`. If the shell has\n // NODE_ENV=development (common in dev toolchains), `vite build`\n // respects that and emits jsxDEV calls with fileName/lineNumber\n // args. This causes runtime crashes because the production React\n // jsx-runtime doesn't export jsxDEV, and also leaks file paths\n // into production bundles (security concern).\n //\n // We explicitly set `oxc.jsx.development: false` for builds so\n // the client bundle always uses jsx/jsxs from react/jsx-runtime,\n // regardless of the ambient NODE_ENV value.\n if (command === 'build') {\n return {\n oxc: {\n jsx: {\n development: false,\n },\n },\n };\n }\n },\n configResolved(resolved) {\n ctx.root = resolved.root;\n ctx.appDir = resolveAppDir(resolved.root, ctx.config.appDir);\n ctx.dev = resolved.command === 'serve';\n // In production builds, swap to a no-op timer to avoid overhead\n if (!ctx.dev) {\n ctx.timer = createNoopTimer();\n } else {\n // Start the overall dev server setup timer — ends in timber-dev-server\n ctx.timer.start('dev-server-setup');\n }\n },\n };\n // @vitejs/plugin-rsc handles:\n // - RSC/SSR/client environment setup\n // - \"use client\" directive → client reference proxy transformation\n // - \"use server\" directive → server reference transformation\n // - Client reference tracking and module map generation\n //\n // Loaded via dynamic import() because @vitejs/plugin-rsc is ESM-only.\n // Vite's config loader uses esbuild to transpile to CJS, which breaks\n // static imports of ESM-only packages. The dynamic import() is preserved\n // by esbuild and runs natively in ESM at runtime.\n //\n // serverHandler: false — timber has its own dev server (timber-dev-server)\n // entries — tells the RSC plugin about timber's virtual entry modules so\n // it correctly wires up the browser entry (needed for React Fast Refresh\n // preamble coordination with @vitejs/plugin-react)\n // customClientEntry: true — timber manages its own browser entry and\n // preloading; skips RSC plugin's default \"index\" client entry convention\n //\n // The RSC plugin's built-in buildApp handles the 5-step multi-environment\n // build sequence (analyze references → build RSC → build client → build SSR).\n // We do NOT set customBuildApp — the RSC plugin's orchestration is correct\n // and handles bundle ordering, asset manifest generation, and environment\n // imports manifest. See @vitejs/plugin-rsc's buildApp implementation.\n // Resolve @vitejs/plugin-rsc from the consumer's project (process.cwd()),\n // not from timber's own node_modules. This is critical for pnpm link:\n // when linked, timber's node_modules has a separate vite instance, and\n // the RSC plugin must use the same vite instance as the dev server.\n const consumerRequire = createRequire(join(process.cwd(), 'package.json'));\n const rscPluginPath = consumerRequire.resolve('@vitejs/plugin-rsc');\n ctx.timer.start('rsc-plugin-import');\n const rscPluginsPromise = import(pathToFileURL(rscPluginPath).href).then(\n ({ default: vitePluginRsc }) => {\n ctx.timer.end('rsc-plugin-import');\n return vitePluginRsc({\n serverHandler: false,\n customClientEntry: true,\n entries: {\n rsc: 'virtual:timber-rsc-entry',\n ssr: 'virtual:timber-ssr-entry',\n client: 'virtual:timber-browser-entry',\n },\n // Group all client reference wrappers into a single chunk instead of\n // creating one tiny file per \"use client\" module. Without this, each\n // server chunk's client references become a separate entry point,\n // producing many sub-500B wrapper files (e.g., 30-byte re-exports).\n // A single group eliminates 10+ unnecessary HTTP requests.\n // See design/27-chunking-strategy.md and TIM-440.\n clientChunks: () => 'client-refs',\n });\n }\n );\n\n return [\n rootSync,\n timberReactProd(),\n // @vitejs/plugin-react provides React Fast Refresh (state-preserving HMR)\n // for client components via Babel transform. Placed before @vitejs/plugin-rsc\n // following Vinext's convention — the RSC plugin's virtual browser entry\n // coordinates with plugin-react via __vite_plugin_react_preamble_installed__.\n react(),\n timberServerActionExports(),\n rscPluginsPromise,\n timberShims(ctx),\n timberRouting(ctx),\n timberEntries(ctx),\n timberBuildManifest(ctx),\n timberCache(ctx),\n timberStaticBuild(ctx),\n timberDynamicTransform(ctx),\n timberFonts(ctx),\n timberMdx(ctx),\n timberContent(ctx),\n timberServerBundle(), // Bundle all deps in server environments for prod\n timberChunks(),\n timberBuildReport(ctx), // Post-build: route table with bundle sizes\n timberAdapterBuild(ctx), // Post-build: invoke adapter.buildOutput()\n timberDevLogs(ctx), // Dev-only: forward server console.* to browser console\n timberDevServer(ctx), // Must be last — configureServer post-hook runs after all watchers\n ];\n}\n\n/**\n * Route map interface — augmented by the generated timber-routes.d.ts.\n *\n * Each key is a route path pattern. Values have:\n * params: shape of URL params (e.g. { id: string })\n * searchParams: parsed type from search-params.ts, or {} if none\n *\n * This interface is empty by default and populated via codegen.\n * See design/09-typescript.md §\"Typed Routes\".\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface Routes {}\n\nexport default timber;\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,wBAAwB;CAAC;CAAK;CAAG;CAAK;CAAG;CAAK;CAAG;CAAK;CAAG;CAAM;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAG;CAAG;CAAK;CAAG;CAAK;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAK;CAAG;CAAI;CAAG;CAAI;CAAI;CAAI;CAAG;CAAK;CAAG;CAAI;CAAI;CAAI;CAAI;CAAG;CAAG;CAAI;CAAG;CAAI;CAAI;CAAG;CAAG;CAAI;CAAG;CAAG;CAAG;CAAI;CAAI;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAI;CAAG;CAAI;CAAI;CAAG;CAAG;CAAG;CAAI;CAAI;CAAI;CAAG;CAAG;CAAG;CAAG;CAAK;CAAI;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAI;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAI;CAAI;CAAI;CAAG;CAAG;CAAG;CAAI;CAAI;CAAI;CAAG;CAAK;CAAG;CAAG;CAAG;CAAI;CAAG;CAAI;CAAI;CAAI;CAAG;CAAI;CAAI;CAAG;CAAG;CAAG;CAAI;CAAI;CAAI;CAAG;CAAG;CAAK;CAAI;CAAK;CAAG;CAAI;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG;CAAK;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAG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AQ,iBAAiB;OAG7B,KAAI,MAAM,MAAM,mBAAmB;;EAGxC;CA6BD,MAAM,gBADkB,cAAc,KAAK,QAAQ,KAAK,EAAE,eAAe,CAAC,CACpC,QAAQ,qBAAqB;AACnE,KAAI,MAAM,MAAM,oBAAoB;CACpC,MAAM,oBAAoB,OAAO,cAAc,cAAc,CAAC,MAAM,MACjE,EAAE,SAAS,oBAAoB;AAC9B,MAAI,MAAM,IAAI,oBAAoB;AAClC,SAAO,cAAc;GACnB,eAAe;GACf,mBAAmB;GACnB,SAAS;IACP,KAAK;IACL,KAAK;IACL,QAAQ;IACT;GAOD,oBAAoB;GACrB,CAAC;GAEL;AAED,QAAO;EACL;EACA,iBAAiB;EAKjB,OAAO;EACP,2BAA2B;EAC3B;EACA,YAAY,IAAI;EAChB,cAAc,IAAI;EAClB,cAAc,IAAI;EAClB,oBAAoB,IAAI;EACxB,YAAY,IAAI;EAChB,kBAAkB,IAAI;EACtB,uBAAuB,IAAI;EAC3B,YAAY,IAAI;EAChB,UAAU,IAAI;EACd,cAAc,IAAI;EAClB,oBAAoB;EACpB,cAAc;EACd,kBAAkB,IAAI;EACtB,mBAAmB,IAAI;EACvB,cAAc,IAAI;EAClB,gBAAgB,IAAI;EACrB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/plugins/content.ts","../../../node_modules/.pnpm/srvx@0.11.22/node_modules/srvx/dist/adapters/node.mjs","../src/dev-tools/stack-classifier.ts","../src/dev-tools/terminal.ts","../src/dev-tools/overlay.ts","../src/server/utils/escape-html.ts","../src/dev-tools/dev-page-shell.ts","../src/dev-tools/error-page.ts","../src/config-validation.ts","../src/server/compress.ts","../src/server/tree-match.ts","../src/plugins/dev-server.ts","../src/plugins/entries.ts","../src/plugins/mdx.ts","../src/routing/segment-codegen.ts","../src/routing/manifest-codegen.ts","../src/routing/convention-lint.ts","../src/plugins/routing.ts","../src/plugins/shims.ts","../src/fonts/paths.ts","../src/fonts/google.ts","../src/fonts/css.ts","../src/fonts/fallbacks.ts","../src/fonts/ast-walk.ts","../src/fonts/ast.ts","../src/fonts/local.ts","../src/fonts/virtual-modules.ts","../src/fonts/pipeline.ts","../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs","../src/fonts/transform.ts","../src/fonts/dev-middleware.ts","../src/fonts/bundle.ts","../src/plugins/fonts.ts","../src/plugins/static-build.ts","../src/plugins/build-manifest.ts","../src/dev-tools/logs.ts","../src/dev-tools/browser-logs.ts","../src/plugins/react-prod.ts","../src/plugins/chunks.ts","../src/plugins/client-chunks.ts","../src/plugins/server-bundle.ts","../src/plugins/callsite-ast.ts","../src/plugins/cache.ts","../src/plugins/request-dep.ts","../src/plugins/callsite-jsx.ts","../src/plugins/prebuilt-options-analysis.ts","../src/plugins/prebuilt-capture.ts","../src/plugins/prebuilt.ts","../src/plugins/prerender-sugar.ts","../src/plugins/cloudflare-wasm.ts","../src/plugins/adapter-build.ts","../src/plugins/build-report.ts","../src/server/action-encryption.ts","../src/dev-tools/holding-server.ts","../src/server/port-resolution.ts","../src/index.ts"],"sourcesContent":["/**\n * timber-content — Vite sub-plugin for content collections.\n *\n * Wraps @content-collections/vite to provide content collection support.\n * Activates only when a content-collections.ts config file exists at the\n * project root.\n *\n * Design doc: 20-content-collections.md §\"Content Collections\"\n */\n\nimport type { Plugin } from 'vite';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { PluginContext } from '../plugin-context.js';\n\nconst CONFIG_FILE_NAMES = [\n 'content-collections.ts',\n 'content-collections.js',\n 'content-collections.mts',\n 'content-collections.mjs',\n];\n\n/**\n * Find the content-collections config file at the project root.\n * Returns the filename (not full path) if found, otherwise undefined.\n */\nfunction findConfigFile(root: string): string | undefined {\n for (const name of CONFIG_FILE_NAMES) {\n if (existsSync(join(root, name))) return name;\n }\n return undefined;\n}\n\n/**\n * Create the timber-content Vite plugin.\n *\n * Delegates all content scanning, validation, code generation, and file watching\n * to @content-collections/vite. This plugin only handles detection and activation.\n */\nexport function timberContent(ctx: PluginContext): Plugin {\n let innerPlugin: Plugin | null = null;\n\n async function activate(root: string): Promise<void> {\n if (innerPlugin !== null) return;\n\n const configFile = findConfigFile(root);\n if (!configFile) return;\n\n let createPlugin: ((options?: { configPath?: string }) => Plugin) | undefined;\n try {\n const mod = await import('@content-collections/vite');\n createPlugin = (mod.default ?? mod) as typeof createPlugin;\n } catch {\n throw new Error(\n [\n '[timber] Content collections are enabled but @content-collections/vite is not installed.',\n '',\n 'Install content-collections:',\n ' pnpm add -D @content-collections/core @content-collections/vite',\n '',\n 'For MDX content, also install:',\n ' pnpm add -D @content-collections/mdx',\n '',\n 'Content collections are activated because a content-collections.ts file exists.',\n ].join('\\n')\n );\n }\n\n if (createPlugin) {\n innerPlugin = createPlugin({ configPath: configFile });\n }\n }\n\n return {\n name: 'timber-content',\n\n async config(config, env) {\n const root = config.root ?? ctx.root;\n ctx.timer.start('content-activate');\n await activate(root);\n ctx.timer.end('content-activate');\n if (!innerPlugin) return;\n if (typeof innerPlugin.config === 'function') {\n return innerPlugin.config.call(this, config, env);\n }\n },\n\n async configResolved(config) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.configResolved === 'function') {\n await (innerPlugin.configResolved as (...args: unknown[]) => unknown).call(this, config);\n }\n },\n\n async buildStart(options) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.buildStart === 'function') {\n await (innerPlugin.buildStart as (...args: unknown[]) => unknown).call(this, options);\n }\n },\n\n async resolveId(source: string, importer: string | undefined, options: unknown) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.resolveId === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.resolveId as any).call(this, source, importer, options);\n }\n return null;\n },\n\n async load(id: string) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.load === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.load as any).call(this, id);\n }\n return null;\n },\n\n async transform(code: string, id: string) {\n if (!innerPlugin) return null;\n if (typeof innerPlugin.transform === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.transform as any).call(this, code, id);\n }\n return null;\n },\n\n async configureServer(server) {\n if (!innerPlugin) return;\n if (typeof innerPlugin.configureServer === 'function') {\n await (innerPlugin.configureServer as (...args: unknown[]) => unknown).call(this, server);\n }\n },\n };\n}\n","import { FastURL, lazyInherit } from \"../_chunks/_url.mjs\";\nimport { createWaitUntil, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from \"../_chunks/_utils2.mjs\";\nimport { errorPlugin, gracefulShutdownPlugin, wrapFetch } from \"../_chunks/_plugins.mjs\";\nimport { HOST_RE, firstForwardedValue, isTrustedProxy } from \"../_chunks/_trust-proxy.mjs\";\nimport { createBodyTooLargeError, limitBodyStream } from \"../_chunks/_body-limit.mjs\";\nimport nodeHTTP, { IncomingMessage, ServerResponse } from \"node:http\";\nimport { Duplex, PassThrough, Readable, addAbortSignal } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport nodeHTTPS from \"node:https\";\nimport nodeHTTP2 from \"node:http2\";\nfunction sendNodeResponse(nodeRes, webRes) {\n\ttry {\n\t\treturn _sendNodeResponse(nodeRes, webRes, false) || Promise.resolve();\n\t} catch (error) {\n\t\treturn Promise.reject(error);\n\t}\n}\nfunction sendNodeResponseDetached(nodeRes, webRes) {\n\ttry {\n\t\treturn _sendNodeResponse(nodeRes, webRes, true);\n\t} catch (error) {\n\t\thandleSendError(nodeRes, error);\n\t}\n}\nfunction handleSendError(nodeRes, _error) {\n\tif (nodeRes.headersSent) nodeRes.destroy();\n\telse {\n\t\tnodeRes.statusCode = 500;\n\t\tnodeRes.end();\n\t}\n}\nfunction _sendNodeResponse(nodeRes, webRes, detached) {\n\tif (!webRes) {\n\t\tnodeRes.statusCode = 500;\n\t\treturn endNodeResponse(nodeRes, detached);\n\t}\n\tif (webRes._toNodeResponse) {\n\t\tconst res = webRes._toNodeResponse();\n\t\tif (res.body) {\n\t\t\tif (res.body instanceof ReadableStream) {\n\t\t\t\twriteHead(nodeRes, res.status, res.statusText, res.headers);\n\t\t\t\treturn streamBody(res.body, nodeRes);\n\t\t\t} else if (typeof res.body?.pipe === \"function\") return pipeBody(res.body, nodeRes, res.status, res.statusText, res.headers);\n\t\t\twriteHead(nodeRes, res.status, res.statusText, res.headers);\n\t\t\tnodeRes.write(res.body);\n\t\t} else writeHead(nodeRes, res.status, res.statusText, res.headers);\n\t\treturn endNodeResponse(nodeRes, detached);\n\t}\n\tconst rawHeaders = [];\n\tfor (const [key, value] of webRes.headers) rawHeaders.push(key, value);\n\twriteHead(nodeRes, webRes.status, webRes.statusText, rawHeaders);\n\treturn webRes.body ? streamBody(webRes.body, nodeRes) : endNodeResponse(nodeRes, detached);\n}\nfunction writeHead(nodeRes, status, statusText, rawHeaders) {\n\tif (!nodeRes.headersSent) if (nodeRes.req?.httpVersion === \"2.0\") nodeRes.writeHead(status, rawHeaders);\n\telse nodeRes.writeHead(status, statusText, rawHeaders);\n}\nfunction endNodeResponse(nodeRes, detached) {\n\tif (detached) {\n\t\tnodeRes.end();\n\t\treturn;\n\t}\n\treturn new Promise((resolve) => nodeRes.end(resolve));\n}\nfunction pipeBody(stream, nodeRes, status, statusText, headers) {\n\tif (nodeRes.destroyed) {\n\t\tstream.destroy?.();\n\t\treturn;\n\t}\n\tif (typeof stream.on !== \"function\" || typeof stream.destroy !== \"function\") {\n\t\twriteHead(nodeRes, status, statusText, headers);\n\t\tstream.pipe(nodeRes);\n\t\treturn new Promise((resolve) => nodeRes.on(\"close\", resolve));\n\t}\n\tif (stream.destroyed) {\n\t\twriteHead(nodeRes, 500, \"Internal Server Error\", []);\n\t\treturn endNodeResponse(nodeRes);\n\t}\n\treturn new Promise((resolve) => {\n\t\tfunction onEarlyError() {\n\t\t\tstream.off(\"readable\", onReadable);\n\t\t\tstream.destroy();\n\t\t\twriteHead(nodeRes, 500, \"Internal Server Error\", []);\n\t\t\tendNodeResponse(nodeRes).then(resolve);\n\t\t}\n\t\tfunction onReadable() {\n\t\t\tstream.off(\"error\", onEarlyError);\n\t\t\tif (nodeRes.destroyed) {\n\t\t\t\tstream.destroy();\n\t\t\t\treturn resolve();\n\t\t\t}\n\t\t\twriteHead(nodeRes, status, statusText, headers);\n\t\t\tpipeline(stream, nodeRes).catch(() => {}).then(() => resolve());\n\t\t}\n\t\tstream.once(\"error\", onEarlyError);\n\t\tstream.once(\"readable\", onReadable);\n\t});\n}\nfunction streamBody(stream, nodeRes) {\n\tif (nodeRes.destroyed) {\n\t\tstream.cancel();\n\t\treturn;\n\t}\n\tconst reader = stream.getReader();\n\tfunction streamCancel(error) {\n\t\treader.cancel(error).catch(() => {});\n\t\tif (error) nodeRes.destroy(error);\n\t}\n\tfunction streamHandle({ done, value }) {\n\t\ttry {\n\t\t\tif (done) nodeRes.end();\n\t\t\telse if (nodeRes.write(value)) reader.read().then(streamHandle, streamCancel);\n\t\t\telse nodeRes.once(\"drain\", () => reader.read().then(streamHandle, streamCancel));\n\t\t} catch (error) {\n\t\t\tstreamCancel(error instanceof Error ? error : void 0);\n\t\t}\n\t}\n\tnodeRes.on(\"close\", streamCancel);\n\tnodeRes.on(\"error\", streamCancel);\n\treader.read().then(streamHandle, streamCancel);\n\treturn reader.closed.catch(streamCancel).finally(() => {\n\t\tnodeRes.off(\"close\", streamCancel);\n\t\tnodeRes.off(\"error\", streamCancel);\n\t});\n}\nvar NodeRequestURL = class extends FastURL {\n\tconstructor({ req, trusted = false }) {\n\t\tconst path = req.url || \"/\";\n\t\tconst forwardedHost = trusted ? firstForwardedValue(req.headers[\"x-forwarded-host\"]) : void 0;\n\t\tlet host = (forwardedHost && HOST_RE.test(forwardedHost) ? forwardedHost : void 0) || req.headers.host || req.headers[\":authority\"];\n\t\tif (host && !HOST_RE.test(host)) host = \"_invalid_\";\n\t\telse if (!host) if (req.socket) host = `${req.socket.localFamily === \"IPv6\" ? \"[\" + req.socket.localAddress + \"]\" : req.socket.localAddress}:${req.socket?.localPort || \"80\"}`;\n\t\telse host = \"localhost\";\n\t\tconst forwardedProto = trusted ? firstForwardedValue(req.headers[\"x-forwarded-proto\"]) : void 0;\n\t\tconst protocol = req.socket?.encrypted || forwardedProto === \"https\" || trusted && req.headers[\":scheme\"] === \"https\" ? \"https:\" : \"http:\";\n\t\tif (path[0] === \"/\") {\n\t\t\tconst qIndex = path.indexOf(\"?\");\n\t\t\tsuper({\n\t\t\t\tprotocol,\n\t\t\t\thost,\n\t\t\t\tpathname: qIndex === -1 ? path : path.slice(0, qIndex) || \"/\",\n\t\t\t\tsearch: qIndex === -1 ? \"\" : path.slice(qIndex) || \"\"\n\t\t\t});\n\t\t} else if (path === \"*\") super({\n\t\t\tprotocol,\n\t\t\thost,\n\t\t\tpathname: \"/*\",\n\t\t\tsearch: \"\"\n\t\t});\n\t\telse super(path);\n\t}\n};\nconst _nonJoinedHeaders = /* @__PURE__ */ new Set([\n\t\"age\",\n\t\"authorization\",\n\t\"content-length\",\n\t\"content-type\",\n\t\"etag\",\n\t\"expires\",\n\t\"from\",\n\t\"host\",\n\t\"if-modified-since\",\n\t\"if-unmodified-since\",\n\t\"last-modified\",\n\t\"location\",\n\t\"max-forwards\",\n\t\"proxy-authorization\",\n\t\"referer\",\n\t\"retry-after\",\n\t\"server\",\n\t\"user-agent\"\n]);\nconst _validHeaderNameRE = /^[!#$%&'*+\\-.^_`|~\\dA-Za-z]+$/;\nfunction _isRepeated(rawHeaders, lowerName) {\n\tlet seen = false;\n\tfor (let i = 0; i < rawHeaders.length; i += 2) {\n\t\tconst key = rawHeaders[i];\n\t\tif (key.length === lowerName.length && key.toLowerCase() === lowerName) {\n\t\t\tif (seen) return true;\n\t\t\tseen = true;\n\t\t}\n\t}\n\treturn false;\n}\nconst NodeRequestHeaders = /* @__PURE__ */ (() => {\n\tconst NativeHeaders = globalThis.Headers;\n\tclass Headers {\n\t\t#req;\n\t\t#headers;\n\t\tconstructor(req) {\n\t\t\tthis.#req = req;\n\t\t}\n\t\tstatic [Symbol.hasInstance](val) {\n\t\t\treturn val instanceof NativeHeaders;\n\t\t}\n\t\tget _headers() {\n\t\t\tif (!this.#headers) {\n\t\t\t\tconst headers = new NativeHeaders();\n\t\t\t\tconst rawHeaders = this.#req.rawHeaders;\n\t\t\t\tconst len = rawHeaders.length;\n\t\t\t\tfor (let i = 0; i < len; i += 2) {\n\t\t\t\t\tconst key = rawHeaders[i];\n\t\t\t\t\tif (key.charCodeAt(0) === 58) continue;\n\t\t\t\t\tconst value = rawHeaders[i + 1];\n\t\t\t\t\theaders.append(key, value);\n\t\t\t\t}\n\t\t\t\tthis.#headers = headers;\n\t\t\t}\n\t\t\treturn this.#headers;\n\t\t}\n\t\tget(name) {\n\t\t\tif (this.#headers) return this.#headers.get(name);\n\t\t\tconst lower = name.toLowerCase();\n\t\t\tif (lower.charCodeAt(0) === 58) return this._headers.get(name);\n\t\t\tconst value = this.#req.headers[lower];\n\t\t\tif (typeof value === \"string\") return _nonJoinedHeaders.has(lower) && _isRepeated(this.#req.rawHeaders, lower) ? this._headers.get(name) : value;\n\t\t\tif (Array.isArray(value)) return value.join(\", \");\n\t\t\treturn lower !== \"__proto__\" && _validHeaderNameRE.test(name) ? null : this._headers.get(name);\n\t\t}\n\t\thas(name) {\n\t\t\tif (this.#headers) return this.#headers.has(name);\n\t\t\tconst lower = name.toLowerCase();\n\t\t\tif (lower.charCodeAt(0) === 58) return this._headers.has(name);\n\t\t\tif (Object.hasOwn(this.#req.headers, lower)) return true;\n\t\t\treturn lower !== \"__proto__\" && _validHeaderNameRE.test(name) ? false : this._headers.has(name);\n\t\t}\n\t\tgetSetCookie() {\n\t\t\tif (this.#headers) return this.#headers.getSetCookie();\n\t\t\tconst value = this.#req.headers[\"set-cookie\"];\n\t\t\treturn Array.isArray(value) ? value.slice() : value ? [value] : [];\n\t\t}\n\t\tentries() {\n\t\t\treturn this._headers.entries();\n\t\t}\n\t\t[Symbol.iterator]() {\n\t\t\treturn this.entries();\n\t\t}\n\t}\n\tlazyInherit(Headers.prototype, NativeHeaders.prototype, \"_headers\");\n\tObject.setPrototypeOf(Headers, NativeHeaders);\n\tObject.setPrototypeOf(Headers.prototype, NativeHeaders.prototype);\n\treturn Headers;\n})();\nconst kNativeRequest = /* @__PURE__ */ Symbol.for(\"srvx.nativeRequest\");\nconst NodeRequest = /* @__PURE__ */ (() => {\n\tconst NativeRequest = getNativeRequest();\n\tclass Request {\n\t\truntime;\n\t\twaitUntil;\n\t\t#req;\n\t\t#url;\n\t\t#bodyStream;\n\t\t#request;\n\t\t#headers;\n\t\t#abortController;\n\t\t#maxRequestBodySize;\n\t\t#trustProxy;\n\t\t#ip;\n\t\t#ipResolved = false;\n\t\t#remoteAddress;\n\t\t#trusted;\n\t\tconstructor(ctx) {\n\t\t\tthis.#req = ctx.req;\n\t\t\tthis.#maxRequestBodySize = ctx.maxRequestBodySize;\n\t\t\tthis.#trustProxy = ctx.trustProxy;\n\t\t\tthis.runtime = {\n\t\t\t\tname: \"node\",\n\t\t\t\tnode: ctx\n\t\t\t};\n\t\t}\n\t\tstatic [Symbol.hasInstance](val) {\n\t\t\treturn val instanceof NativeRequest;\n\t\t}\n\t\t#resolveTrusted() {\n\t\t\tif (this.#trusted === void 0) {\n\t\t\t\tthis.#remoteAddress = this.#req.socket?.remoteAddress;\n\t\t\t\tthis.#trusted = isTrustedProxy(this.#trustProxy, this.#remoteAddress);\n\t\t\t}\n\t\t\treturn this.#trusted;\n\t\t}\n\t\tget ip() {\n\t\t\tif (this.#ipResolved) return this.#ip;\n\t\t\tthis.#ipResolved = true;\n\t\t\tif (this.#resolveTrusted()) {\n\t\t\t\tconst forwarded = firstForwardedValue(this.#req.headers[\"x-forwarded-for\"]);\n\t\t\t\tif (forwarded) return this.#ip = forwarded;\n\t\t\t}\n\t\t\treturn this.#ip = this.#remoteAddress;\n\t\t}\n\t\tget method() {\n\t\t\tif (this.#request) return this.#request.method;\n\t\t\treturn this.#req.method || \"GET\";\n\t\t}\n\t\tget _url() {\n\t\t\treturn this.#url ||= new NodeRequestURL({\n\t\t\t\treq: this.#req,\n\t\t\t\ttrusted: this.#resolveTrusted()\n\t\t\t});\n\t\t}\n\t\tset _url(url) {\n\t\t\tthis.#url = url;\n\t\t}\n\t\tget url() {\n\t\t\tif (this.#request) return this.#request.url;\n\t\t\treturn this._url.href;\n\t\t}\n\t\tget headers() {\n\t\t\tif (this.#request) return this.#request.headers;\n\t\t\treturn this.#headers ||= new NodeRequestHeaders(this.#req);\n\t\t}\n\t\tget _abortController() {\n\t\t\tif (!this.#abortController) {\n\t\t\t\tthis.#abortController = new AbortController();\n\t\t\t\tconst { req, res } = this.runtime.node;\n\t\t\t\tconst abortController = this.#abortController;\n\t\t\t\tconst abort = (err) => abortController.abort?.(err);\n\t\t\t\tif (res) res.once(\"close\", () => {\n\t\t\t\t\tconst reqError = req.errored;\n\t\t\t\t\tif (reqError) abort(reqError);\n\t\t\t\t\telse if (!res.writableEnded) abort();\n\t\t\t\t});\n\t\t\t\telse req.once(\"close\", () => {\n\t\t\t\t\tif (!req.complete) abort();\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this.#abortController;\n\t\t}\n\t\tget signal() {\n\t\t\treturn this.#request ? this.#request.signal : this._abortController.signal;\n\t\t}\n\t\tget body() {\n\t\t\tif (this.#request) return this.#request.body;\n\t\t\tif (this.#bodyStream === void 0) {\n\t\t\t\tconst method = this.method;\n\t\t\t\tlet stream = !(method === \"GET\" || method === \"HEAD\") ? Readable.toWeb(this.#req) : null;\n\t\t\t\tif (stream && this.#maxRequestBodySize !== void 0) stream = limitBodyStream(stream, this.#maxRequestBodySize);\n\t\t\t\tthis.#bodyStream = stream;\n\t\t\t}\n\t\t\treturn this.#bodyStream;\n\t\t}\n\t\t#readBuffered() {\n\t\t\treturn readBody(this.#req, this.#maxRequestBodySize);\n\t\t}\n\t\ttext() {\n\t\t\tif (this.#request) return this.#request.text();\n\t\t\tif (this.#bodyStream !== void 0) return this.#bodyStream ? new Response(this.#bodyStream).text() : Promise.resolve(\"\");\n\t\t\treturn this.#readBuffered().then((buf) => buf.toString());\n\t\t}\n\t\tjson() {\n\t\t\tif (this.#request) return this.#request.json();\n\t\t\tif (this.#bodyStream !== void 0) return this.text().then((text) => JSON.parse(text));\n\t\t\treturn this.#readBuffered().then((buf) => JSON.parse(buf.toString()));\n\t\t}\n\t\tget _request() {\n\t\t\tif (!this.#request) {\n\t\t\t\tconst body = this.body;\n\t\t\t\tthis.#request = new NativeRequest(this.url, {\n\t\t\t\t\tmethod: this.method,\n\t\t\t\t\theaders: this.headers,\n\t\t\t\t\tsignal: this._abortController.signal,\n\t\t\t\t\tbody,\n\t\t\t\t\tduplex: body ? \"half\" : void 0\n\t\t\t\t});\n\t\t\t\tthis.#headers = void 0;\n\t\t\t\tthis.#bodyStream = void 0;\n\t\t\t}\n\t\t\treturn this.#request;\n\t\t}\n\t}\n\tlazyInherit(Request.prototype, NativeRequest.prototype, \"_request\");\n\tObject.setPrototypeOf(Request.prototype, NativeRequest.prototype);\n\treturn Request;\n})();\nfunction patchGlobalRequest() {\n\tconst NativeRequest = getNativeRequest();\n\tconst PatchedRequest = class Request extends NativeRequest {\n\t\tstatic _srvx = true;\n\t\tstatic [Symbol.hasInstance](instance) {\n\t\t\tif (this === PatchedRequest) return instance instanceof NativeRequest;\n\t\t\telse return Object.prototype.isPrototypeOf.call(this.prototype, instance);\n\t\t}\n\t\tconstructor(input, options) {\n\t\t\tif (typeof input === \"object\" && \"_request\" in input) input = input._request;\n\t\t\tsuper(input, options);\n\t\t}\n\t};\n\tif (!globalThis.Request._srvx) globalThis.Request = PatchedRequest;\n\treturn PatchedRequest;\n}\nfunction readBody(req, maxRequestBodySize) {\n\tif (\"rawBody\" in req && Buffer.isBuffer(req.rawBody)) {\n\t\tif (maxRequestBodySize !== void 0 && req.rawBody.length > maxRequestBodySize) return Promise.reject(createBodyTooLargeError(maxRequestBodySize));\n\t\treturn Promise.resolve(req.rawBody);\n\t}\n\treturn new Promise((resolve, reject) => {\n\t\tconst chunks = [];\n\t\tlet size = 0;\n\t\tconst cleanup = () => {\n\t\t\treq.off(\"data\", onData);\n\t\t\treq.off(\"end\", onEnd);\n\t\t\treq.off(\"error\", onError);\n\t\t};\n\t\tconst onData = (chunk) => {\n\t\t\tif (maxRequestBodySize !== void 0) {\n\t\t\t\tsize += chunk.length;\n\t\t\t\tif (size > maxRequestBodySize) {\n\t\t\t\t\tcleanup();\n\t\t\t\t\treq.pause?.();\n\t\t\t\t\treject(createBodyTooLargeError(maxRequestBodySize));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tchunks.push(chunk);\n\t\t};\n\t\tconst onError = (err) => {\n\t\t\tcleanup();\n\t\t\treject(err);\n\t\t};\n\t\tconst onEnd = () => {\n\t\t\tcleanup();\n\t\t\tresolve(chunks.length === 1 ? chunks[0] : Buffer.concat(chunks));\n\t\t};\n\t\treq.on(\"data\", onData).once(\"end\", onEnd).once(\"error\", onError);\n\t});\n}\nfunction getNativeRequest() {\n\tlet R = globalThis[kNativeRequest] || globalThis.Request;\n\twhile (R?._srvx) R = Object.getPrototypeOf(R);\n\treturn globalThis[kNativeRequest] ??= R;\n}\nconst NodeResponse = /* @__PURE__ */ (() => {\n\tconst NativeResponse = globalThis.Response;\n\tconst STATUS_CODES = globalThis.process?.getBuiltinModule?.(\"node:http\")?.STATUS_CODES || {};\n\tclass NodeResponse {\n\t\t#body;\n\t\t#init;\n\t\t#headers;\n\t\t#response;\n\t\tconstructor(body, init) {\n\t\t\tthis.#body = body;\n\t\t\tthis.#init = init;\n\t\t}\n\t\tstatic [Symbol.hasInstance](val) {\n\t\t\treturn val instanceof NativeResponse;\n\t\t}\n\t\tget status() {\n\t\t\treturn this.#response?.status || this.#init?.status || 200;\n\t\t}\n\t\tget statusText() {\n\t\t\treturn this.#response?.statusText || this.#init?.statusText || STATUS_CODES[this.status] || \"\";\n\t\t}\n\t\tget headers() {\n\t\t\tif (this.#response) return this.#response.headers;\n\t\t\tif (this.#headers) return this.#headers;\n\t\t\tconst initHeaders = this.#init?.headers;\n\t\t\treturn this.#headers = initHeaders instanceof Headers ? initHeaders : new Headers(initHeaders);\n\t\t}\n\t\tget ok() {\n\t\t\tif (this.#response) return this.#response.ok;\n\t\t\tconst status = this.status;\n\t\t\treturn status >= 200 && status < 300;\n\t\t}\n\t\tget _response() {\n\t\t\tif (this.#response) return this.#response;\n\t\t\tlet body = this.#body;\n\t\t\tif (body && typeof body.pipe === \"function\" && !(body instanceof Readable)) {\n\t\t\t\tconst stream = new PassThrough();\n\t\t\t\tbody.pipe(stream);\n\t\t\t\tconst abort = body.abort;\n\t\t\t\tif (abort) stream.once(\"close\", () => abort());\n\t\t\t\tbody = stream;\n\t\t\t}\n\t\t\tthis.#response = new NativeResponse(body, this.#headers ? {\n\t\t\t\t...this.#init,\n\t\t\t\theaders: this.#headers\n\t\t\t} : this.#init);\n\t\t\tthis.#init = void 0;\n\t\t\tthis.#headers = void 0;\n\t\t\tthis.#body = void 0;\n\t\t\treturn this.#response;\n\t\t}\n\t\t_toNodeResponse() {\n\t\t\tconst status = this.status;\n\t\t\tconst statusText = this.statusText;\n\t\t\tlet body;\n\t\t\tlet contentType;\n\t\t\tlet contentLength;\n\t\t\tif (this.#response) body = this.#response.body;\n\t\t\telse if (this.#body) if (this.#body instanceof ReadableStream) body = this.#body;\n\t\t\telse if (typeof this.#body === \"string\") {\n\t\t\t\tbody = this.#body;\n\t\t\t\tcontentType = \"text/plain; charset=UTF-8\";\n\t\t\t\tcontentLength = Buffer.byteLength(this.#body);\n\t\t\t} else if (this.#body instanceof ArrayBuffer) {\n\t\t\t\tbody = Buffer.from(this.#body);\n\t\t\t\tcontentLength = this.#body.byteLength;\n\t\t\t} else if (this.#body instanceof Uint8Array) {\n\t\t\t\tbody = this.#body;\n\t\t\t\tcontentLength = this.#body.byteLength;\n\t\t\t} else if (this.#body instanceof DataView) {\n\t\t\t\tbody = Buffer.from(this.#body.buffer);\n\t\t\t\tcontentLength = this.#body.byteLength;\n\t\t\t} else if (this.#body instanceof Blob) {\n\t\t\t\tbody = this.#body.stream();\n\t\t\t\tcontentType = this.#body.type;\n\t\t\t\tcontentLength = this.#body.size;\n\t\t\t} else if (typeof this.#body.pipe === \"function\") body = this.#body;\n\t\t\telse body = this._response.body;\n\t\t\tconst headers = [];\n\t\t\tconst initHeaders = this.#init?.headers;\n\t\t\tconst headerEntries = this.#response?.headers || this.#headers || (initHeaders ? Array.isArray(initHeaders) ? initHeaders : initHeaders?.entries ? initHeaders.entries() : Object.entries(initHeaders) : void 0);\n\t\t\tlet hasContentTypeHeader;\n\t\t\tlet hasContentLength;\n\t\t\tif (headerEntries) for (const [key, value] of headerEntries) {\n\t\t\t\tconst lowerKey = typeof key === \"string\" ? key.toLowerCase() : String(key);\n\t\t\t\tif (Array.isArray(value)) for (const v of value) headers.push(lowerKey, v);\n\t\t\t\telse headers.push(lowerKey, value);\n\t\t\t\tif (lowerKey === \"content-type\") hasContentTypeHeader = true;\n\t\t\t\telse if (lowerKey === \"content-length\") hasContentLength = true;\n\t\t\t}\n\t\t\tif (contentType && !hasContentTypeHeader) headers.push(\"content-type\", contentType);\n\t\t\tif (contentLength && !hasContentLength) headers.push(\"content-length\", String(contentLength));\n\t\t\tthis.#init = void 0;\n\t\t\tthis.#headers = void 0;\n\t\t\tthis.#response = void 0;\n\t\t\tthis.#body = void 0;\n\t\t\treturn {\n\t\t\t\tstatus,\n\t\t\t\tstatusText,\n\t\t\t\theaders,\n\t\t\t\tbody\n\t\t\t};\n\t\t}\n\t}\n\tlazyInherit(NodeResponse.prototype, NativeResponse.prototype, \"_response\");\n\tObject.setPrototypeOf(NodeResponse, NativeResponse);\n\tObject.setPrototypeOf(NodeResponse.prototype, NativeResponse.prototype);\n\treturn NodeResponse;\n})();\nfunction prematureCloseError() {\n\treturn Object.assign(/* @__PURE__ */ new Error(\"Connection closed before response was finished\"), { code: \"ERR_STREAM_PREMATURE_CLOSE\" });\n}\nvar WebRequestSocket = class extends Duplex {\n\t_httpMessage;\n\tautoSelectFamilyAttemptedAddresses = [];\n\tbufferSize = 0;\n\tbytesRead = 0;\n\tbytesWritten = 0;\n\tconnecting = false;\n\tpending = false;\n\treadyState = \"open\";\n\tremoteAddress = \"\";\n\tremoteFamily = \"\";\n\tremotePort = 0;\n\t#request;\n\t#timeoutTimer;\n\t#reqReader;\n\t#headersWritten;\n\t#_writeBody;\n\t#resBodyController;\n\t#resBodyClosed;\n\t_webResBody;\n\t#tos = 0;\n\tconstructor(request) {\n\t\tsuper({ allowHalfOpen: true });\n\t\tthis.#request = request;\n\t\tthis._webResBody = new ReadableStream({ start: (controller) => {\n\t\t\tthis.#resBodyController = controller;\n\t\t\tthis.#_writeBody = controller.enqueue.bind(controller);\n\t\t\tthis.once(\"finish\", () => {\n\t\t\t\tthis.readyState = \"closed\";\n\t\t\t\tthis.#resBodyClosed = true;\n\t\t\t\tcontroller.close();\n\t\t\t});\n\t\t} });\n\t\taddAbortSignal(request.signal, this);\n\t}\n\tsetTimeout(ms, cb) {\n\t\tif (typeof ms !== \"number\" || !Number.isFinite(ms) || ms < 0) return this;\n\t\tif (cb) this.on(\"timeout\", cb);\n\t\tif (this.#timeoutTimer) clearTimeout(this.#timeoutTimer);\n\t\tif (ms > 0) this.#timeoutTimer = setTimeout(() => this.emit(\"timeout\"), ms);\n\t\treturn this;\n\t}\n\tsetNoDelay() {\n\t\treturn this;\n\t}\n\tsetKeepAlive() {\n\t\treturn this;\n\t}\n\tref() {\n\t\treturn this;\n\t}\n\tunref() {\n\t\treturn this;\n\t}\n\tdestroySoon() {\n\t\tthis.destroy();\n\t}\n\tconnect() {\n\t\treturn this;\n\t}\n\tresetAndDestroy() {\n\t\tthis.destroy();\n\t\treturn this;\n\t}\n\taddress() {\n\t\treturn {\n\t\t\taddress: \"\",\n\t\t\tfamily: \"\",\n\t\t\tport: 0\n\t\t};\n\t}\n\tbodyReader() {\n\t\ttry {\n\t\t\treturn this.#request.body?.getReader();\n\t\t} catch (error) {\n\t\t\tthis.emit(\"error\", error);\n\t\t}\n\t}\n\tgetTypeOfService() {\n\t\treturn this.#tos;\n\t}\n\tsetTypeOfService(tos) {\n\t\tthis.#tos = tos;\n\t\treturn this;\n\t}\n\t_read(_size) {\n\t\tconst reader = this.#reqReader ??= this.bodyReader();\n\t\tif (!reader) {\n\t\t\tthis.push(null);\n\t\t\treturn;\n\t\t}\n\t\treader.read().then((res) => this._onRead(res)).catch((error) => {\n\t\t\tthis.emit(\"error\", error);\n\t\t});\n\t}\n\t_onRead(res) {\n\t\tif (res.done) {\n\t\t\tthis.push(null);\n\t\t\treturn;\n\t\t}\n\t\tif (res.value) {\n\t\t\tthis.bytesRead += res.value.byteLength;\n\t\t\tthis.push(res.value);\n\t\t}\n\t}\n\t_write(chunk, encoding, callback) {\n\t\tif (this.#headersWritten) this.#_writeBody(typeof chunk === \"string\" ? Buffer.from(chunk, encoding) : chunk);\n\t\telse if (chunk?.length > 0) {\n\t\t\tthis.#headersWritten = true;\n\t\t\tconst headerEnd = chunk.lastIndexOf(\"\\r\\n\\r\\n\");\n\t\t\tif (headerEnd === -1) throw new Error(\"Invalid HTTP headers chunk!\");\n\t\t\tif (headerEnd < chunk.length - 4) {\n\t\t\t\tthis._write(chunk.slice(headerEnd + 4), encoding, () => {\n\t\t\t\t\tcallback(null);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcallback(null);\n\t}\n\t_final(callback) {\n\t\tcallback(null);\n\t}\n\t_destroy(err, cb) {\n\t\tif (this.#timeoutTimer) clearTimeout(this.#timeoutTimer);\n\t\tif (this.#reqReader) this.#reqReader.cancel().catch((error) => {\n\t\t\tconsole.error(error);\n\t\t});\n\t\tif (!this.#resBodyClosed) {\n\t\t\tthis.#resBodyClosed = true;\n\t\t\ttry {\n\t\t\t\tthis.#resBodyController?.error(err ?? prematureCloseError());\n\t\t\t} catch {}\n\t\t}\n\t\tthis.readyState = \"closed\";\n\t\tcb(err ?? void 0);\n\t}\n};\nvar WebIncomingMessage = class extends IncomingMessage {\n\tconstructor(req, socket) {\n\t\tsuper(socket);\n\t\tthis.method = req.method;\n\t\tconst url = req._url ??= new FastURL(req.url);\n\t\tthis.url = url.pathname + url.search;\n\t\tfor (const [key, value] of req.headers.entries()) this.headers[key.toLowerCase()] = value;\n\t\tif (req.method !== \"GET\" && req.method !== \"HEAD\" && !this.headers[\"content-length\"] && !this.headers[\"transfer-encoding\"]) this.headers[\"transfer-encoding\"] = \"chunked\";\n\t\tconst onData = (chunk) => {\n\t\t\tthis.push(chunk);\n\t\t};\n\t\tsocket.on(\"data\", onData);\n\t\tsocket.once(\"end\", () => {\n\t\t\tthis.emit(\"end\");\n\t\t\tthis.off(\"data\", onData);\n\t\t});\n\t}\n};\nfunction callNodeHandler(handler, req) {\n\tconst isMiddleware = handler.length > 2;\n\tconst nodeCtx = req.runtime?.node;\n\tif (!nodeCtx || !nodeCtx.req || !nodeCtx.res) throw new Error(\"Node.js runtime context is not available.\");\n\tconst { req: nodeReq, res: nodeRes } = nodeCtx;\n\tlet _headers;\n\tconst webRes = new NodeResponse(void 0, {\n\t\tget status() {\n\t\t\treturn nodeRes.statusCode;\n\t\t},\n\t\tget statusText() {\n\t\t\treturn nodeRes.statusMessage;\n\t\t},\n\t\tget headers() {\n\t\t\tif (!_headers) {\n\t\t\t\tconst headerEntries = [];\n\t\t\t\tconst rawHeaders = nodeRes.getHeaders();\n\t\t\t\tfor (const [name, value] of Object.entries(rawHeaders)) if (Array.isArray(value)) for (const v of value) headerEntries.push([name, v]);\n\t\t\t\telse if (value) headerEntries.push([name, String(value)]);\n\t\t\t\t_headers = new Headers(headerEntries);\n\t\t\t}\n\t\t\treturn _headers;\n\t\t}\n\t});\n\treturn new Promise((resolve, reject) => {\n\t\tnodeRes.once(\"close\", () => resolve(webRes));\n\t\tnodeRes.once(\"finish\", () => resolve(webRes));\n\t\tnodeRes.once(\"error\", (error) => reject(error));\n\t\tlet streamPromise;\n\t\tnodeRes.once(\"pipe\", (stream) => {\n\t\t\tstreamPromise = new Promise((resolve) => {\n\t\t\t\tstream.once(\"end\", () => resolve(webRes));\n\t\t\t\tstream.once(\"error\", (error) => reject(error));\n\t\t\t});\n\t\t});\n\t\ttry {\n\t\t\tif (isMiddleware) Promise.resolve(handler(nodeReq, nodeRes, (error) => error ? reject(error) : streamPromise || resolve(webRes))).catch((error) => reject(error));\n\t\t\telse Promise.resolve(handler(nodeReq, nodeRes)).then(() => streamPromise || webRes);\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n}\nlet needDrainSymbol;\nfunction getNeedDrainSymbol(res) {\n\tif (needDrainSymbol === void 0) needDrainSymbol = Object.getOwnPropertySymbols(res).find((s) => s.description === \"kNeedDrain\") ?? null;\n\treturn needDrainSymbol;\n}\nvar WebServerResponse = class extends ServerResponse {\n\t#socket;\n\t#socketError;\n\tconstructor(req, socket) {\n\t\tsuper(req);\n\t\tthis.assignSocket(socket);\n\t\tthis.once(\"finish\", () => {\n\t\t\tsocket.end();\n\t\t});\n\t\tthis.#socket = socket;\n\t\tsocket.once(\"error\", (err) => {\n\t\t\tthis.#socketError ??= err;\n\t\t});\n\t\tsocket.on(\"drain\", () => {\n\t\t\tconst kNeedDrain = getNeedDrainSymbol(this);\n\t\t\tif (kNeedDrain && !this[kNeedDrain]) return;\n\t\t\tif (this.destroyed || this.writableFinished) return;\n\t\t\tif (kNeedDrain) this[kNeedDrain] = false;\n\t\t\tthis.emit(\"drain\");\n\t\t});\n\t\tthis.waitToFinish = this.waitToFinish.bind(this);\n\t\tthis.toWebResponse = this.toWebResponse.bind(this);\n\t}\n\twaitToFinish() {\n\t\tif (this.writableFinished) return Promise.resolve();\n\t\tif (this.#socketError || this.#socket.destroyed) return Promise.reject(this.#socketError ?? prematureCloseError());\n\t\tif (this.writableEnded) return Promise.resolve();\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst socket = this.#socket;\n\t\t\tconst settle = (err) => {\n\t\t\t\tthis.removeListener(\"finish\", onFinish);\n\t\t\t\tthis.removeListener(\"error\", onError);\n\t\t\t\tsocket.removeListener(\"error\", onError);\n\t\t\t\tsocket.removeListener(\"close\", onClose);\n\t\t\t\tif (err) reject(err);\n\t\t\t\telse resolve();\n\t\t\t};\n\t\t\tconst onFinish = () => settle();\n\t\t\tconst onError = (err) => settle(err);\n\t\t\tconst onClose = () => {\n\t\t\t\tif (!this.writableFinished) settle(this.#socketError ?? prematureCloseError());\n\t\t\t};\n\t\t\tthis.on(\"finish\", onFinish);\n\t\t\tthis.on(\"error\", onError);\n\t\t\tsocket.on(\"error\", onError);\n\t\t\tsocket.on(\"close\", onClose);\n\t\t});\n\t}\n\tasync toWebResponse() {\n\t\tawait this.waitToFinish();\n\t\tconst headers = [];\n\t\tconst httpHeader = this._header?.split(\"\\r\\n\");\n\t\tfor (let i = 1; httpHeader && i < httpHeader.length; i++) {\n\t\t\tconst sepIndex = httpHeader[i].indexOf(\": \");\n\t\t\tif (sepIndex === -1) continue;\n\t\t\tconst key = httpHeader[i].slice(0, Math.max(0, sepIndex));\n\t\t\tconst value = httpHeader[i].slice(Math.max(0, sepIndex + 2));\n\t\t\tif (!key) continue;\n\t\t\theaders.push([key, value]);\n\t\t}\n\t\treturn new Response(this.#socket._webResBody, {\n\t\t\tstatus: this.statusCode,\n\t\t\tstatusText: this.statusMessage,\n\t\t\theaders\n\t\t});\n\t}\n};\nasync function fetchNodeHandler(handler, req) {\n\tconst nodeRuntime = req.runtime?.node;\n\tif (nodeRuntime && nodeRuntime.req && nodeRuntime.res) return await callNodeHandler(handler, req);\n\tconst socket = new WebRequestSocket(req);\n\tconst nodeReq = new WebIncomingMessage(req, socket);\n\tconst nodeRes = new WebServerResponse(nodeReq, socket);\n\ttry {\n\t\tawait handler(nodeReq, nodeRes);\n\t\treturn await nodeRes.toWebResponse();\n\t} catch (error) {\n\t\tif (!(req.signal?.aborted || error?.name === \"AbortError\" || error?.code === \"ERR_STREAM_PREMATURE_CLOSE\")) console.error(error, { cause: {\n\t\t\treq,\n\t\t\thandler\n\t\t} });\n\t\treturn new Response(null, {\n\t\t\tstatus: 500,\n\t\t\tstatusText: \"Internal Server Error\"\n\t\t});\n\t}\n}\nfunction toNodeHandler(handler, options) {\n\tif (handler.__nodeHandler) return handler.__nodeHandler;\n\tfunction convertedNodeHandler(nodeReq, nodeRes) {\n\t\tconst res = handler(new NodeRequest({\n\t\t\treq: nodeReq,\n\t\t\tres: nodeRes,\n\t\t\tmaxRequestBodySize: options?.maxRequestBodySize,\n\t\t\ttrustProxy: options?.trustProxy\n\t\t}));\n\t\treturn res instanceof Promise ? res.then((resolvedRes) => sendNodeResponse(nodeRes, resolvedRes)) : sendNodeResponse(nodeRes, res);\n\t}\n\tconvertedNodeHandler.__fetchHandler = handler;\n\tassignFnName(convertedNodeHandler, handler, \" (converted to Node handler)\");\n\treturn convertedNodeHandler;\n}\nfunction toFetchHandler(handler) {\n\tif (handler.__fetchHandler) return handler.__fetchHandler;\n\tfunction convertedNodeHandler(req) {\n\t\treturn fetchNodeHandler(handler, req);\n\t}\n\tconvertedNodeHandler.__nodeHandler = handler;\n\tassignFnName(convertedNodeHandler, handler, \" (converted to Web handler)\");\n\treturn convertedNodeHandler;\n}\nfunction assignFnName(target, source, suffix) {\n\tif (source.name) try {\n\t\tObject.defineProperty(target, \"name\", { value: `${source.name}${suffix}` });\n\t} catch {}\n}\nfunction serve(options) {\n\treturn new NodeServer(options);\n}\nvar NodeServer = class {\n\truntime = \"node\";\n\toptions;\n\tnode;\n\tserveOptions;\n\tfetch;\n\twaitUntil;\n\t#isSecure;\n\t#listeningPromise;\n\t#listenError;\n\t#wait;\n\tconstructor(options) {\n\t\tthis.options = {\n\t\t\t...options,\n\t\t\tmiddleware: [...options.middleware || []]\n\t\t};\n\t\tfor (const plugin of options.plugins || []) plugin(this);\n\t\terrorPlugin(this);\n\t\tconst fetchHandler = this.fetch = wrapFetch(this);\n\t\tconst handler = (nodeReq, nodeRes) => {\n\t\t\tconst reqUrl = nodeReq.url;\n\t\t\tif (reqUrl && reqUrl[0] !== \"/\" && reqUrl !== \"*\" && !URL.canParse(reqUrl)) {\n\t\t\t\tnodeRes.statusCode = 400;\n\t\t\t\tnodeRes.end();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst request = new NodeRequest({\n\t\t\t\treq: nodeReq,\n\t\t\t\tres: nodeRes,\n\t\t\t\tmaxRequestBodySize: this.options.maxRequestBodySize,\n\t\t\t\ttrustProxy: this.options.trustProxy\n\t\t\t});\n\t\t\trequest.waitUntil = this.#wait?.waitUntil;\n\t\t\tconst res = fetchHandler(request);\n\t\t\treturn res instanceof Promise ? res.then((resolvedRes) => sendNodeResponseDetached(nodeRes, resolvedRes)) : sendNodeResponseDetached(nodeRes, res);\n\t\t};\n\t\tthis.node = {\n\t\t\thandler,\n\t\t\tserver: void 0\n\t\t};\n\t\tconst loader = globalThis.__srvxLoader__;\n\t\tif (loader) {\n\t\t\tloader({ server: this });\n\t\t\treturn;\n\t\t}\n\t\tgracefulShutdownPlugin(this);\n\t\tthis.#wait = createWaitUntil();\n\t\tthis.waitUntil = this.#wait.waitUntil;\n\t\tconst tls = resolveTLSOptions(this.options);\n\t\tconst { port, hostname: host } = resolvePortAndHost(this.options);\n\t\tthis.serveOptions = {\n\t\t\tport,\n\t\t\thost,\n\t\t\texclusive: !this.options.reusePort,\n\t\t\t...tls,\n\t\t\t...this.options.node\n\t\t};\n\t\tlet server;\n\t\tthis.#isSecure = !!this.serveOptions.cert && this.options.protocol !== \"http\";\n\t\tif (this.options.node?.http2 ?? this.#isSecure) if (this.#isSecure) server = nodeHTTP2.createSecureServer({\n\t\t\tallowHTTP1: true,\n\t\t\t...this.serveOptions\n\t\t}, handler);\n\t\telse throw new Error(\"node.http2 option requires tls certificate!\");\n\t\telse if (this.#isSecure) server = nodeHTTPS.createServer(this.serveOptions, handler);\n\t\telse server = nodeHTTP.createServer(this.serveOptions, handler);\n\t\tthis.node.server = server;\n\t\tif (!options.manual) this.serve().catch(() => {});\n\t}\n\tserve() {\n\t\tif (this.#listeningPromise) return this.#listeningPromise.then(() => this);\n\t\tconst server = this.node?.server;\n\t\tif (!server) return Promise.reject(/* @__PURE__ */ new Error(\"Server not initialized\"));\n\t\tthis.#listenError = void 0;\n\t\tthis.#listeningPromise = new Promise((resolve, reject) => {\n\t\t\tconst onError = (error) => {\n\t\t\t\tserver.off(\"listening\", onListening);\n\t\t\t\tthis.#listenError = error;\n\t\t\t\tthis.#listeningPromise = void 0;\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tconst onListening = () => {\n\t\t\t\tserver.off(\"error\", onError);\n\t\t\t\tprintListening(this.options, this.url);\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\tserver.once(\"error\", onError);\n\t\t\tserver.once(\"listening\", onListening);\n\t\t\tserver.listen(this.serveOptions);\n\t\t});\n\t\treturn this.#listeningPromise.then(() => this);\n\t}\n\tget url() {\n\t\tconst addr = this.node?.server?.address();\n\t\tif (!addr) return;\n\t\treturn typeof addr === \"string\" ? addr : fmtURL(addr.address, addr.port, this.#isSecure);\n\t}\n\tready() {\n\t\tif (this.#listenError) return Promise.reject(this.#listenError);\n\t\treturn Promise.resolve(this.#listeningPromise).then(() => this);\n\t}\n\tasync close(closeAll) {\n\t\tawait Promise.all([this.#wait?.wait(), new Promise((resolve, reject) => {\n\t\t\tconst server = this.node?.server;\n\t\t\tif (server && closeAll && \"closeAllConnections\" in server) server.closeAllConnections();\n\t\t\tif (!server || !server.listening) return resolve();\n\t\t\tserver.close((error) => error ? reject(error) : resolve());\n\t\t})]);\n\t}\n};\nexport { NodeResponse as FastResponse, FastURL, NodeRequest, NodeResponse, fetchNodeHandler, patchGlobalRequest, sendNodeResponse, serve, toFetchHandler, toNodeHandler };\n","/**\n * Stack trace frame classifier — categorizes stack frames by origin.\n *\n * Provides `classifyFrame` (single frame) and `classifyStack` (full stack\n * string) as the shared primitives used by the error page, terminal\n * formatter, and overlay.\n *\n * Dev-only: this module is only imported by other dev-tools modules.\n */\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\nexport type FrameType = 'app' | 'framework' | 'internal';\n\nexport interface ClassifiedFrame {\n raw: string;\n type: FrameType;\n file?: string;\n line?: number;\n col?: number;\n}\n\n// ─── Frame Parsing ──────────────────────────────────────────────────────────\n\n/** Parse file/line/col from a stack frame line. */\nfunction parseFrame(frameLine: string): { file?: string; line?: number; col?: number } {\n const parenMatch = /\\(([^)]+):(\\d+):(\\d+)\\)/.exec(frameLine);\n if (parenMatch) {\n return { file: parenMatch[1], line: Number(parenMatch[2]), col: Number(parenMatch[3]) };\n }\n const bareMatch = /at (\\/[^:]+):(\\d+):(\\d+)/.exec(frameLine);\n if (bareMatch) {\n return { file: bareMatch[1], line: Number(bareMatch[2]), col: Number(bareMatch[3]) };\n }\n return {};\n}\n\n// ─── Classification ─────────────────────────────────────────────────────────\n\n/**\n * Classify a single stack frame line by origin.\n *\n * - 'app': user application code (in project root, not node_modules)\n * - 'framework': timber-app internal code\n * - 'internal': node_modules, Node.js internals\n */\nexport function classifyFrame(frameLine: string, projectRoot: string): FrameType {\n const trimmed = frameLine.trim();\n\n if (trimmed.includes('packages/timber-app/')) return 'framework';\n if (trimmed.includes('node_modules/')) return 'internal';\n if (trimmed.startsWith('at node:') || trimmed.includes('(node:')) return 'internal';\n if (trimmed.includes(projectRoot)) return 'app';\n\n return 'internal';\n}\n\n/**\n * Classify all frames in a full stack trace string.\n *\n * Parses the stack, skips the first line (error message), filters to\n * lines starting with \"at \", and returns classified frames with optional\n * file/line/col metadata.\n */\nexport function classifyStack(stack: string, projectRoot: string): ClassifiedFrame[] {\n return stack\n .split('\\n')\n .slice(1) // skip first line (error message)\n .filter((line) => line.trim().startsWith('at '))\n .map((raw) => {\n const type = classifyFrame(raw, projectRoot);\n const { file, line, col } = parseFrame(raw);\n return { raw, type, file, line, col };\n });\n}\n","/**\n * Terminal error formatting — boxed, color-coded error output for dev mode.\n *\n * Produces a visually scannable error block with:\n * - Unicode box-drawing border around the error\n * - Phase badge and error message\n * - First app frame highlighted as the primary action item\n * - OSC 8 clickable file:line links (VSCode terminal, iTerm2, etc.)\n * - Internal/framework frames collapsed with a count\n * - Component stack (for React render errors)\n *\n * Dev-only: this module is only imported by dev-error-overlay.ts.\n *\n * Design doc: 21-dev-server.md §\"Error Overlay\"\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { InspectColor } from 'node:util';\nimport { styleText } from 'node:util';\nimport {\n extractComponentStack,\n parseFirstAppFrame,\n PHASE_LABELS,\n type ErrorPhase,\n} from './overlay.js';\nimport { classifyStack } from './stack-classifier.js';\n\n// ─── Styling ────────────────────────────────────────────────────────────────\n\ntype Format = InspectColor | readonly InspectColor[];\nconst noValidate = { validateStream: false } as const;\nconst style = (fmt: Format, text: string) => styleText(fmt, text, noValidate);\n\n// ─── OSC 8 Hyperlinks ──────────────────────────────────────────────────────\n\n/**\n * Wrap text in an OSC 8 hyperlink escape sequence.\n *\n * Terminals that support OSC 8 (VSCode, iTerm2, Windows Terminal, etc.)\n * render this as a clickable link. Others ignore the escape sequences\n * and show the text normally.\n *\n * Format: \\x1b]8;;URL\\x07TEXT\\x1b]8;;\\x07\n */\nfunction hyperlink(text: string, url: string): string {\n return `\\x1b]8;;${url}\\x07${text}\\x1b]8;;\\x07`;\n}\n\n/**\n * Format a file:line:col reference as a clickable terminal link.\n *\n * Uses file:// URLs so terminals open the file in the configured editor.\n * The link text is styled with cyan + underline for visibility.\n */\nfunction fileLink(filePath: string, line?: number, col?: number): string {\n const display = line ? `${filePath}:${line}${col ? `:${col}` : ''}` : filePath;\n // Use pathToFileURL for proper encoding of spaces, #, ?, and Windows\n // drive letters (TIM-792). Append :line:col after the URL.\n const base = pathToFileURL(filePath).href;\n const url = line ? `${base}:${line}${col ? `:${col}` : ''}` : base;\n return style(['cyan', 'underline'], hyperlink(display, url));\n}\n\n// ─── Box Drawing ────────────────────────────────────────────────────────────\n\nconst BOX = {\n topLeft: '╭',\n topRight: '╮',\n bottomLeft: '╰',\n bottomRight: '╯',\n horizontal: '─',\n vertical: '│',\n};\n\n/**\n * Wrap lines of text in a Unicode box with a colored left border.\n *\n * @param lines - Content lines (no ANSI length calculation — keeps it simple)\n * @param width - Box width (characters). Lines longer than this are not truncated.\n */\nfunction box(lines: string[], borderFormat: Format, width = 80): string {\n const bar = BOX.horizontal.repeat(width - 2);\n const output: string[] = [];\n\n output.push(style(borderFormat, `${BOX.topLeft}${bar}${BOX.topRight}`));\n for (const line of lines) {\n output.push(`${style(borderFormat, BOX.vertical)} ${line}`);\n }\n output.push(style(borderFormat, `${BOX.bottomLeft}${bar}${BOX.bottomRight}`));\n\n return output.join('\\n');\n}\n\n// Frame classification and parsing provided by stack-classifier.ts\n\n// ─── Public API ─────────────────────────────────────────────────────────────\n\n/**\n * Format an error for terminal output with a boxed layout.\n *\n * The output is designed to be scannable at a glance:\n * 1. Red box with phase badge and error message\n * 2. First app frame as a clickable link (the primary action item)\n * 3. App frames listed normally\n * 4. Internal/framework frames collapsed with count\n * 5. Component stack (if present)\n */\nexport function formatTerminalError(error: Error, phase: ErrorPhase, projectRoot: string): string {\n const sections: string[] = [];\n const componentStack = extractComponentStack(error);\n const loc = parseFirstAppFrame(error.stack ?? '', projectRoot);\n const frames = error.stack ? classifyStack(error.stack, projectRoot) : [];\n const appFrames = frames.filter((f) => f.type === 'app');\n const internalCount = frames.filter((f) => f.type !== 'app').length;\n\n // ── Box: Phase + Message ──────────────────────────────────────────\n const boxLines: string[] = [];\n boxLines.push(style(['red', 'bold'], `${PHASE_LABELS[phase]} Error`));\n boxLines.push('');\n\n // Error message — may be multi-line\n for (const msgLine of error.message.split('\\n')) {\n boxLines.push(style('red', msgLine));\n }\n\n // Primary file location (clickable)\n if (loc) {\n boxLines.push('');\n const relPath = loc.file.startsWith(projectRoot)\n ? loc.file.slice(projectRoot.length + 1)\n : loc.file;\n boxLines.push(\n `${style('bold', '→')} ${fileLink(loc.file, loc.line, loc.column)} ${style('dim', `(${relPath})`)}`\n );\n }\n\n sections.push(box(boxLines, 'red'));\n\n // ── Component Stack ───────────────────────────────────────────────\n if (componentStack) {\n sections.push('');\n sections.push(` ${style('bold', 'Component Stack:')}`);\n for (const csLine of componentStack.trim().split('\\n')) {\n sections.push(` ${style('dim', csLine.trim())}`);\n }\n }\n\n // ── App Frames ────────────────────────────────────────────────────\n if (appFrames.length > 0) {\n sections.push('');\n sections.push(` ${style('bold', 'Application Frames:')}`);\n for (let i = 0; i < appFrames.length; i++) {\n const f = appFrames[i]!;\n if (f.file && f.line) {\n const prefix = i === 0 ? style('bold', '▸') : ' ';\n sections.push(\n ` ${prefix} ${fileLink(f.file, f.line, f.col)} ${style('dim', extractFnName(f.raw))}`\n );\n } else {\n sections.push(` ${f.raw}`);\n }\n }\n }\n\n // ── Internal Frames (collapsed) ───────────────────────────────────\n if (internalCount > 0) {\n sections.push(\n ` ${style('dim', `… ${internalCount} internal frame${internalCount !== 1 ? 's' : ''} hidden`)}`\n );\n }\n\n sections.push('');\n return sections.join('\\n');\n}\n\n// ─── Helpers ────────────────────────────────────────────────────────────────\n\n/** Extract the function name from a stack frame line like \" at fnName (/path:1:2)\". */\nfunction extractFnName(frameLine: string): string {\n const match = /at\\s+(\\S+)\\s+\\(/.exec(frameLine.trim());\n return match ? match[1]! : '';\n}\n","/**\n * Dev error overlay — formats and sends errors to Vite's browser overlay and stderr.\n *\n * Integrates with Vite's built-in error overlay (`server.hot.send`) rather\n * than implementing a custom overlay.\n *\n * Stack trace source-mapping uses the correct Vite environment module graph:\n * RSC errors use `server.environments.rsc.moduleGraph`, SSR/other errors use\n * `server.environments.ssr.moduleGraph`. `server.ssrFixStacktrace()` is NOT\n * used because it hardcodes the SSR module graph, which doesn't contain\n * source maps for RSC modules (separate Vite environment with its own\n * module graph). This caused RSC errors to show transpiled line numbers\n * instead of original source positions.\n *\n * Design doc: 21-dev-server.md §\"Error Overlay\"\n */\n\nimport type { ViteDevServer, DevEnvironment } from 'vite';\nimport { createRequire } from 'node:module';\nimport { resolve, dirname } from 'node:path';\nimport { classifyFrame, type FrameType } from './stack-classifier.js';\n\n// ─── Trace Mapping (lazy-loaded) ─────────────────────────────────────────────\n\ninterface TraceMappingModule {\n TraceMap: new (map: unknown) => unknown;\n originalPositionFor: (\n map: unknown,\n needle: { line: number; column: number }\n ) => { source: string | null; line: number | null; column: number | null };\n}\n\nlet _traceMapping: TraceMappingModule | null = null;\n\n/**\n * Lazy-load @jridgewell/trace-mapping from Vite's dependency tree.\n * Vite bundles it internally; we resolve from Vite's package to avoid\n * adding a direct dependency.\n */\nfunction getTraceMapping(): TraceMappingModule {\n if (_traceMapping) return _traceMapping;\n // Resolve from Vite's package location so we pick up its transitive\n // @jridgewell/trace-mapping without declaring it as a direct dependency.\n // createRequire(import.meta.url) gives us ESM-compatible require (TIM-796),\n // then we hop to Vite's path to reach its dependency tree (TIM-804).\n const esmRequire = createRequire(import.meta.url);\n const vitePath = esmRequire.resolve('vite');\n const viteRequire = createRequire(vitePath);\n _traceMapping = viteRequire('@jridgewell/trace-mapping') as TraceMappingModule;\n return _traceMapping;\n}\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\n/** The phase of the pipeline where the error occurred. */\nexport type ErrorPhase =\n | 'module-transform'\n | 'proxy'\n | 'middleware'\n | 'access'\n | 'render'\n | 'handler';\n\n/** Labels for terminal output. */\nexport const PHASE_LABELS: Record<ErrorPhase, string> = {\n 'module-transform': 'Module Transform',\n 'proxy': 'Proxy',\n 'middleware': 'Middleware',\n 'access': 'Access Check',\n 'render': 'RSC Render',\n 'handler': 'Route Handler',\n};\n\n// ─── Frame Classification (re-exported from stack-classifier) ───────────────\n\nexport {\n classifyFrame,\n classifyStack,\n type FrameType,\n type ClassifiedFrame,\n} from './stack-classifier.js';\n\n// ─── Component Stack Extraction ─────────────────────────────────────────────\n\n/**\n * Extract the React component stack from an error, if present.\n * React attaches this as `componentStack` during renderToReadableStream errors.\n */\nexport function extractComponentStack(error: unknown): string | null {\n if (\n error &&\n typeof error === 'object' &&\n 'componentStack' in error &&\n typeof (error as Record<string, unknown>).componentStack === 'string'\n ) {\n return (error as Record<string, unknown>).componentStack as string;\n }\n return null;\n}\n\n// ─── First App Frame Parsing ────────────────────────────────────────────────\n\ninterface SourceLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/**\n * Parse the first application frame from a stack trace.\n * Returns file/line/column for the overlay's `loc` field.\n */\nexport function parseFirstAppFrame(stack: string, projectRoot: string): SourceLocation | null {\n const lines = stack.split('\\n');\n // Match patterns like:\n // at functionName (/absolute/path:line:column)\n // at /absolute/path:line:column\n const parenRegex = /\\(([^)]+):(\\d+):(\\d+)\\)/;\n const bareRegex = /at (\\/[^:]+):(\\d+):(\\d+)/;\n\n for (const line of lines) {\n if (classifyFrame(line, projectRoot) !== 'app') continue;\n\n const match = parenRegex.exec(line) ?? bareRegex.exec(line);\n if (!match) continue;\n\n const [, file, lineNum, col] = match;\n if (file && lineNum && col) {\n return { file, line: parseInt(lineNum, 10), column: parseInt(col, 10) };\n }\n }\n\n return null;\n}\n\n// ─── Error Phase Classification ─────────────────────────────────────────────\n\n/**\n * Classify the error phase by inspecting the error's stack trace.\n * Falls back to 'render' if no specific phase can be determined.\n */\nexport function classifyErrorPhase(error: Error, projectRoot: string): ErrorPhase {\n const stack = error.stack ?? '';\n\n // Check for React component stack (render error)\n if (extractComponentStack(error)) return 'render';\n\n // Check for specific file patterns in app frames\n const appRoot = projectRoot.replace(/\\/$/, '');\n if (stack.includes(`${appRoot}/app/`) || stack.includes('/app/')) {\n if (stack.includes('/middleware.ts') || stack.includes('/middleware.js')) return 'middleware';\n if (stack.includes('/access.ts') || stack.includes('/access.js')) return 'access';\n if (stack.includes('/route.ts') || stack.includes('/route.js')) return 'handler';\n }\n\n return 'render';\n}\n\n// ─── Terminal Formatting ────────────────────────────────────────────────────\n\n// formatTerminalError is implemented in the dedicated terminal formatter module\n// (terminal.ts) to keep this file under 500 lines.\n// Import for use in sendErrorToOverlay, and re-export for external consumers.\nimport { formatTerminalError as _formatTerminalError } from './terminal.js';\nexport const formatTerminalError = _formatTerminalError;\n\n// ─── RSC Debug Context ──────────────────────────────────────────────────────\n\n/**\n * Component info extracted from the RSC debug channel.\n * Contains only names, environments, and stack frames — never source code.\n */\nexport interface RscDebugComponentInfo {\n name: string;\n env: string | null;\n stack: unknown[] | null;\n}\n\n/**\n * Format RSC debug component info into a readable string for the overlay.\n *\n * Renders the server component tree that was active when an error occurred,\n * including component names and source locations from stack frames. This\n * gives developers visibility into which server components were rendering\n * without exposing source code.\n *\n * Returns an empty string if no components are provided.\n */\nexport function formatRscDebugContext(components: RscDebugComponentInfo[]): string {\n if (!components || components.length === 0) return '';\n\n // Deduplicate by name — the debug channel may emit the same component\n // multiple times (e.g., when re-rendered or when multiple instances exist).\n const seen = new Set<string>();\n const unique: RscDebugComponentInfo[] = [];\n for (const c of components) {\n if (!seen.has(c.name)) {\n seen.add(c.name);\n unique.push(c);\n }\n }\n\n const lines: string[] = ['Server Component Tree:'];\n for (let i = 0; i < unique.length; i++) {\n const c = unique[i]!;\n const indent = ' '.repeat(i + 1);\n const envLabel = c.env ? ` [${c.env}]` : '';\n\n // Extract file location from stack frames if available\n let locStr = '';\n if (c.stack && c.stack.length > 0) {\n const frame = c.stack[0] as [string, string, number, number] | undefined;\n if (Array.isArray(frame) && frame.length >= 3) {\n locStr = ` (${frame[1]}:${frame[2]})`;\n }\n }\n\n lines.push(`${indent}${c.name}${envLabel}${locStr}`);\n }\n\n return lines.join('\\n');\n}\n\n// ─── Module Runner Offset ───────────────────────────────────────────────────\n\n/**\n * Dynamically compute the line offset that Vite's module runner adds\n * when wrapping modules in an async function.\n *\n * Vite's `calculateOffsetOnce()` uses the same technique: create a new\n * AsyncFunction, throw from line 1, and check where the engine reports\n * the error. The difference between the reported line and 1 is the offset.\n *\n * This is engine-dependent (currently 2 on Node 18-22) and could change\n * in future Node.js or V8 versions. Computing it at runtime ensures we\n * always match the actual behavior.\n */\nlet _cachedOffset: number | null = null;\n\nexport function calculateModuleRunnerOffset(): number {\n if (_cachedOffset !== null) return _cachedOffset;\n\n try {\n // Parse the AsyncFunction source to count wrapper lines before the body.\n // AsyncFunction.toString() returns something like:\n // \"async function anonymous(\\n) {\\nBODY\\n}\"\n // The number of newlines before BODY is the offset Vite's module runner adds.\n // eslint-disable-next-line no-new-func -- intentional: mirrors Vite's technique\n const AsyncFunction = async function () {}.constructor as typeof Function;\n const wrapper = new AsyncFunction('BODY');\n const src = wrapper.toString();\n const bodyIndex = src.indexOf('BODY');\n if (bodyIndex === -1) {\n _cachedOffset = 2; // fallback\n return _cachedOffset;\n }\n const beforeBody = src.slice(0, bodyIndex);\n const newlineCount = (beforeBody.match(/\\n/g) || []).length;\n _cachedOffset = newlineCount;\n } catch (e) {\n console.debug(\n '[timber] overlay offset calculation failed:',\n e instanceof Error ? e.message : e\n );\n _cachedOffset = 2; // fallback to known-good value\n }\n\n return _cachedOffset;\n}\n\n// ─── Stack Trace Source-Mapping ──────────────────────────────────────────────\n\n/**\n * Phases where the error originated in the RSC environment.\n * These use `server.environments.rsc.moduleGraph` for source-mapping.\n */\nconst RSC_PHASES: ReadonlySet<ErrorPhase> = new Set(['render', 'access', 'middleware', 'handler']);\n\n/**\n * Rewrite an error's stack trace using the correct Vite environment module graph.\n *\n * `server.ssrFixStacktrace()` hardcodes `server.environments.ssr.moduleGraph`,\n * but RSC errors have stack frames pointing to modules loaded in the RSC\n * environment — a separate Vite module graph with separate transform results\n * and source maps. Using the SSR module graph silently fails to find the\n * modules, leaving transpiled/bundled line numbers in the stack trace.\n *\n * This function picks the RSC module graph for render-phase errors and falls\n * back to SSR for module-transform/proxy errors. If the first pass doesn't\n * rewrite any frames (e.g., mixed RSC+SSR stack), it tries the other graph.\n */\nfunction fixStacktraceForEnvironment(server: ViteDevServer, error: Error, phase: ErrorPhase): void {\n if (!error.stack) return;\n\n // Pick the primary environment based on error phase\n const primaryEnvName = RSC_PHASES.has(phase) ? 'rsc' : 'ssr';\n const fallbackEnvName = primaryEnvName === 'rsc' ? 'ssr' : 'rsc';\n\n const primaryEnv = server.environments[primaryEnvName] as DevEnvironment | undefined;\n const fallbackEnv = server.environments[fallbackEnvName] as DevEnvironment | undefined;\n\n // Try primary environment first\n if (primaryEnv?.moduleGraph) {\n const rewritten = rewriteStacktrace(error.stack, primaryEnv.moduleGraph);\n if (rewritten.changed) {\n error.stack = rewritten.stack;\n return;\n }\n }\n\n // Fall back to the other environment if primary didn't rewrite anything\n if (fallbackEnv?.moduleGraph) {\n const rewritten = rewriteStacktrace(error.stack, fallbackEnv.moduleGraph);\n if (rewritten.changed) {\n error.stack = rewritten.stack;\n return;\n }\n }\n}\n\n/**\n * Rewrite stack trace frames using source maps from an environment's module graph.\n *\n * Mirrors Vite's internal `ssrRewriteStacktrace` logic but works with any\n * `EnvironmentModuleGraph`, not just the SSR one.\n *\n * Returns the rewritten stack and whether any frames were actually changed.\n */\nfunction rewriteStacktrace(\n stack: string,\n moduleGraph: DevEnvironment['moduleGraph']\n): { stack: string; changed: boolean } {\n let changed = false;\n\n const result = stack\n .split('\\n')\n .map((line) => {\n return line.replace(\n /^ {4}at (?:(\\S.*?)\\s\\()?(.+?):(\\d+)(?::(\\d+))?\\)?/,\n (input, varName, id, lineStr, colStr) => {\n if (!id) return input;\n\n const mod = moduleGraph.getModuleById(id);\n const rawSourceMap = mod?.transformResult?.map;\n if (!rawSourceMap) return input;\n\n // Vite's module runner wraps each module in an async function,\n // adding N lines before the module body. The offset is computed\n // dynamically to match the actual engine behavior (see TIM-783).\n const OFFSET = calculateModuleRunnerOffset();\n const origLine = Number(lineStr) - OFFSET;\n const origCol = Number(colStr) - 1;\n if (origLine <= 0 || origCol < 0) return input;\n\n // Use @jridgewell/trace-mapping resolved from Vite's dependency tree.\n // Vite bundles it internally; we resolve from Vite's package location\n // to avoid adding a direct dependency.\n let pos: { source: string | null; line: number | null; column: number | null };\n try {\n const { TraceMap: TM, originalPositionFor: opf } = getTraceMapping();\n const traced = new TM(rawSourceMap);\n pos = opf(traced, { line: origLine, column: origCol });\n } catch (e) {\n console.debug(\n '[timber] source map tracing failed:',\n e instanceof Error ? e.message : e\n );\n return input;\n }\n\n if (!pos.source || pos.line == null) return input;\n\n changed = true;\n const source = `${resolve(dirname(id), pos.source)}:${pos.line}:${(pos.column ?? 0) + 1}`;\n const trimmedVarName = varName?.trim();\n if (!trimmedVarName || trimmedVarName === 'eval') return ` at ${source}`;\n return ` at ${trimmedVarName} (${source})`;\n }\n );\n })\n .join('\\n');\n\n return { stack: result, changed };\n}\n\n// ─── Error Source-Mapping (exported for use by fallback-error.ts) ────────────\n\n/**\n * Source-map an error's stack trace using the Vite dev server's module graph.\n *\n * Exported so that the fallback error renderer (fallback-error.ts) can\n * source-map errors before rendering the dev error page. Without this,\n * the dev error page shows transpiled positions (e.g. page.tsx:1:1 instead\n * of page.tsx:4:9).\n *\n * See TIM-811.\n */\nexport function fixErrorStacktrace(server: ViteDevServer, error: Error, phase?: ErrorPhase): void {\n fixStacktraceForEnvironment(\n server,\n error,\n phase ?? classifyErrorPhase(error, server.config.root)\n );\n}\n\n// ─── Overlay Integration ────────────────────────────────────────────────────\n\n/**\n * Send an error to Vite's browser overlay and log it to stderr.\n *\n * Uses `server.ssrFixStacktrace()` to map stack traces back to source,\n * then sends the error via `server.hot.send()` for the browser overlay.\n *\n * When `rscDebugComponents` is provided (dev mode only), the server\n * component tree context is appended to the error message. This helps\n * developers identify which server component caused the error without\n * exposing source code.\n *\n * The dev server remains running — errors are handled, not fatal.\n */\nexport function sendErrorToOverlay(\n server: ViteDevServer,\n error: Error,\n phase: ErrorPhase,\n projectRoot: string,\n rscDebugComponents?: RscDebugComponentInfo[]\n): void {\n // Fix stack trace to use source-mapped positions.\n // Use the RSC environment's module graph for render/access/middleware errors\n // (which originate in the RSC environment), and fall back to SSR for others.\n // server.ssrFixStacktrace() is NOT used — it hardcodes the SSR module graph\n // which doesn't contain source maps for RSC-loaded modules.\n fixStacktraceForEnvironment(server, error, phase);\n\n // Log to stderr with frame dimming\n const formatted = formatTerminalError(error, phase, projectRoot);\n process.stderr.write(`${formatted}\\n`);\n\n // Build overlay payload\n const loc = parseFirstAppFrame(error.stack ?? '', projectRoot);\n const componentStack = extractComponentStack(error);\n\n let message = error.message;\n if (componentStack) {\n message = `${error.message}\\n\\nComponent Stack:\\n${componentStack.trim()}`;\n }\n\n // Append RSC debug context if available (dev mode only)\n const debugContext = formatRscDebugContext(rscDebugComponents ?? []);\n if (debugContext) {\n message = `${message}\\n\\n${debugContext}`;\n }\n\n // Send to browser via Vite's error overlay protocol\n try {\n server.hot.send({\n type: 'error',\n err: {\n message,\n stack: error.stack ?? '',\n id: loc?.file,\n plugin: `timber (${PHASE_LABELS[phase]})`,\n loc: loc ? { file: loc.file, line: loc.line, column: loc.column } : undefined,\n },\n });\n } catch (e) {\n console.debug('[timber] overlay error send failed:', e instanceof Error ? e.message : e);\n }\n}\n","/**\n * Shared HTML escaping utility.\n *\n * Used by both dev-only paths (error pages, 404 page) and production\n * paths (deny-renderer, RSC helpers). Lives in server/utils/ because\n * it's not dev-only.\n */\n\n/**\n * Escape a string for safe embedding in HTML content or attributes.\n *\n * Replaces `&`, `<`, `>`, and `\"` with their HTML entity equivalents.\n */\nexport function escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n","/**\n * Shared scaffold for dev-mode HTML pages (dev error page, dev 404 page).\n *\n * Both pages are self-contained HTML documents served when the normal\n * render pipeline can't produce a page. They share:\n * - The document scaffold (head, container, footer)\n * - Base CSS (layout, light/dark variables, common components)\n * - The HMR auto-reload script that watches Vite's WebSocket and reloads\n * when the developer fixes the error / adds the missing route\n *\n * Dev-only: this module is only imported by dev-mode code paths. It is\n * never included in production builds.\n *\n * Design doc: 21-dev-server.md §\"Error Overlay\", §\"Dev 404 Page\"\n */\n\nimport { escapeHtml } from '../server/utils/escape-html.js';\n\n// ─── HMR Options ────────────────────────────────────────────────────────────\n\n/**\n * HMR connection options for the dev page auto-reload WebSocket.\n * Derived from Vite's resolved server config so the page can connect\n * to the correct HMR endpoint (TIM-789).\n */\nexport interface DevErrorHmrOptions {\n protocol?: string;\n host?: string;\n port?: number;\n path?: string;\n token?: string;\n}\n\n/**\n * Extract HMR connection options from a Vite resolved config.\n * Used by the dev server to pass HMR config to the dev page generators\n * so the auto-reload WebSocket connects to the correct endpoint.\n */\nexport function extractHmrOptions(config: {\n server?: {\n hmr?:\n | { protocol?: string; host?: string; port?: number; clientPort?: number; path?: string }\n | boolean;\n };\n webSocketToken?: string;\n}): DevErrorHmrOptions | undefined {\n const hmr = config.server?.hmr;\n if (hmr === false) return undefined;\n const hmrOpts = typeof hmr === 'object' ? hmr : {};\n const opts: DevErrorHmrOptions = {\n protocol: hmrOpts.protocol,\n host: hmrOpts.host,\n port: hmrOpts.clientPort || hmrOpts.port,\n path: hmrOpts.path,\n token: config.webSocketToken,\n };\n // If no HMR fields were explicitly configured, return undefined so the\n // reload script derives everything from the browser's location, which\n // correctly includes the current port (TIM-805).\n if (!opts.protocol && !opts.host && !opts.port && !opts.path && !opts.token) {\n return undefined;\n }\n return opts;\n}\n\n// ─── Auto-Reload Script ─────────────────────────────────────────────────────\n\n/**\n * Build the inline auto-reload script for dev pages.\n *\n * The page is static HTML, not a Vite-managed module, so the normal HMR\n * update flow can't reach it. Instead we connect to Vite's HMR WebSocket\n * directly and reload on any update event.\n *\n * URL construction mirrors Vite's own client.mjs: explicitly configured\n * values win, and the browser's location fills any gaps at runtime. This\n * matters because Vite 8 requires a `?token=` on browser WS upgrades in\n * every config — a config with only a token still needs the host and port\n * from `location` (TIM-1067).\n */\nexport function buildReloadScript(hmrOptions?: DevErrorHmrOptions): string {\n // `<` is escaped as a unicode escape so config text can never close the\n // <script> block (same defense as escJsonForScript in error-page.ts, TIM-788).\n const opts = JSON.stringify(hmrOptions ?? {}).replace(/</g, '\\\\u003c');\n return ` (function() {\n try {\n var o = ${opts};\n var protocol = o.protocol || (location.protocol === 'https:' ? 'wss' : 'ws');\n var host = o.host || location.hostname;\n var port = o.port || location.port;\n var url = protocol + '://' + host + (port ? ':' + port : '') + (o.path || '')\n + (o.token ? '?token=' + encodeURIComponent(o.token) : '');\n var ws = new WebSocket(url, 'vite-hmr');\n ws.addEventListener('message', function(e) {\n try {\n var data = JSON.parse(e.data);\n if (data.type === 'full-reload' || data.type === 'update') {\n location.reload();\n }\n } catch (ex) {}\n });\n } catch (ex) {}\n })();`;\n}\n\n// ─── Page Shell ─────────────────────────────────────────────────────────────\n\nexport interface DevPageShellOptions {\n /** Page title — escaped by the shell. */\n title: string;\n /** Page-specific CSS appended after the shared base (badge colors, etc.). */\n extraCss?: string;\n /** Inner HTML of the container — must already be escaped by the caller. */\n bodyHtml: string;\n /** Hint text shown next to the timber logo in the footer. */\n footerHint: string;\n /** Additional inline script placed before the auto-reload script. */\n extraScript?: string;\n /** HMR connection options for the auto-reload WebSocket. */\n hmrOptions?: DevErrorHmrOptions;\n}\n\n/**\n * Render a self-contained dev page: scaffold + shared CSS + footer +\n * HMR auto-reload script.\n */\nexport function renderDevPageShell(opts: DevPageShellOptions): string {\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>${escapeHtml(opts.title)}</title>\n <style>${SHARED_CSS}${opts.extraCss ?? ''}</style>\n</head>\n<body>\n <div class=\"container\">\n ${opts.bodyHtml}\n\n <footer class=\"footer\">\n <span class=\"timber-logo\">🪵 timber.js</span>\n <span class=\"footer-hint\">${opts.footerHint}</span>\n </footer>\n </div>\n\n <script>\n${opts.extraScript ?? ''}\n // Auto-reload when Vite HMR signals an update (file fixed, route added).\n${buildReloadScript(opts.hmrOptions)}\n </script>\n</body>\n</html>`;\n}\n\n// ─── Shared CSS ─────────────────────────────────────────────────────────────\n\n/**\n * Base CSS shared by all dev pages. Pages override the --badge-* variables\n * (and add their own component styles) via `extraCss`.\n */\nconst SHARED_CSS = `\n :root {\n --bg: #fff;\n --fg: #1a1a1a;\n --fg-dim: #6b7280;\n --border: #e5e7eb;\n --source-bg: #fafafa;\n --link: #2563eb;\n --code-bg: #f3f4f6;\n --btn-bg: #f3f4f6;\n --btn-fg: #374151;\n --btn-border: #d1d5db;\n --code-font: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;\n }\n\n @media (prefers-color-scheme: dark) {\n :root {\n --bg: #0a0a0a;\n --fg: #f5f5f5;\n --fg-dim: #9ca3af;\n --border: #27272a;\n --source-bg: #18181b;\n --link: #60a5fa;\n --code-bg: #27272a;\n --btn-bg: #27272a;\n --btn-fg: #e5e7eb;\n --btn-border: #3f3f46;\n }\n }\n\n * { margin: 0; padding: 0; box-sizing: border-box; }\n\n body {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n background: var(--bg);\n color: var(--fg);\n line-height: 1.6;\n padding: 2rem;\n }\n\n .container { max-width: 56rem; margin: 0 auto; }\n .header { margin-bottom: 1.5rem; }\n\n .badge {\n display: inline-block;\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: 0.25rem 0.625rem;\n border-radius: 0.375rem;\n background: var(--badge-bg);\n color: var(--badge-fg);\n border: 1px solid var(--badge-border);\n margin-bottom: 0.75rem;\n }\n\n .message {\n font-size: 1.375rem;\n font-weight: 600;\n line-height: 1.3;\n word-break: break-word;\n }\n\n .hint {\n margin-top: 0.5rem;\n color: var(--fg-dim);\n font-size: 0.875rem;\n }\n\n .section {\n margin-bottom: 1rem;\n border: 1px solid var(--border);\n border-radius: 0.5rem;\n overflow: hidden;\n }\n\n .section-header {\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: 0.5rem 0.75rem;\n background: var(--source-bg);\n border-bottom: 1px solid var(--border);\n color: var(--fg-dim);\n }\n\n .footer {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding-top: 1rem;\n border-top: 1px solid var(--border);\n font-size: 0.75rem;\n color: var(--fg-dim);\n }\n\n .timber-logo { font-weight: 600; white-space: nowrap; }\n`;\n","/**\n * Dev error page — self-contained HTML error page for dev server 500s.\n *\n * Generates a styled, self-contained HTML page when the RSC pipeline fails\n * and the Vite error overlay can't fire (e.g., first page load before HMR\n * WebSocket connects, RSC entry module crash, early pipeline errors).\n *\n * This is NOT a replacement for Vite's error overlay — it's the fallback\n * for when the overlay's transport (WebSocket) isn't available yet.\n *\n * Dev-only: this module is only imported by dev-server.ts (apply: 'serve')\n * and via dynamic import from fallback-error.ts in dev mode. It is never\n * included in production builds.\n *\n * Design doc: 21-dev-server.md §\"Error Overlay\"\n */\n\nimport { readFileSync } from 'node:fs';\nimport { extractComponentStack, parseFirstAppFrame, type ErrorPhase } from './overlay.js';\nimport { classifyStack } from './stack-classifier.js';\nimport { escapeHtml } from '../server/utils/escape-html.js';\nimport { renderDevPageShell, type DevErrorHmrOptions } from './dev-page-shell.js';\n\n// ─── Phase Labels ───────────────────────────────────────────────────────────\n\nconst PHASE_LABELS: Record<ErrorPhase, string> = {\n 'module-transform': 'Module Transform',\n 'proxy': 'Proxy',\n 'middleware': 'Middleware',\n 'access': 'Access Check',\n 'render': 'RSC Render',\n 'handler': 'Route Handler',\n};\n\nconst PHASE_HINTS: Record<ErrorPhase, string> = {\n 'module-transform':\n 'This error occurred while Vite was transforming a module. Check for syntax errors or missing imports.',\n 'proxy': 'This error occurred in proxy.ts. Check your proxy configuration.',\n 'middleware':\n 'This error occurred in a middleware.ts file. Check the middleware function for unhandled exceptions.',\n 'access': 'This error occurred in an access.ts file. Check your access control logic.',\n 'render':\n 'This error occurred while rendering a server component. Check the component for runtime errors.',\n 'handler': 'This error occurred in a route handler (route.ts). Check the handler function.',\n};\n\n// ─── Source Context ─────────────────────────────────────────────────────────\n\n/**\n * Try to read a few lines of source code around the error location.\n * Returns null if the file can't be read (e.g., virtual modules).\n *\n * Uses a top-level `node:fs` import — this module is dev-server-only and\n * Node-only. A bare `require()` here would throw in the ESM build and the\n * code frame would silently never render (TIM-1067, B48).\n */\nfunction readSourceContext(\n filePath: string,\n line: number,\n contextLines = 3\n): { lines: Array<{ num: number; text: string; highlight: boolean }>; startLine: number } | null {\n try {\n const content = readFileSync(filePath, 'utf-8');\n const allLines = content.split('\\n');\n\n const start = Math.max(0, line - 1 - contextLines);\n const end = Math.min(allLines.length, line + contextLines);\n\n return {\n startLine: start + 1,\n lines: allLines.slice(start, end).map((text: string, i: number) => ({\n num: start + 1 + i,\n text,\n highlight: start + 1 + i === line,\n })),\n };\n } catch (e) {\n console.debug('[timber] source context extraction failed:', e instanceof Error ? e.message : e);\n return null;\n }\n}\n\n// HTML escaping provided by server/utils/escape-html.ts\nconst esc = escapeHtml;\n\n/**\n * Escape a JSON string for safe embedding in an HTML `<script>` block.\n *\n * `JSON.stringify` does not escape `</script>`, so error text containing\n * that sequence breaks out of the script block — an XSS vector.\n * We replace all `<` with the equivalent unicode escape, which is valid in\n * JSON strings and prevents the HTML parser from seeing a closing\n * `</script>` tag.\n *\n * Security: TIM-788\n */\nfunction escJsonForScript(json: string): string {\n return json.replace(/</g, '\\\\u003c');\n}\n\n// ─── HTML Generation ────────────────────────────────────────────────────────\n\n/**\n * Generate a self-contained HTML error page for dev server 500 responses.\n *\n * The page includes:\n * - Error message and phase label\n * - Source code context around the first app frame (if readable)\n * - Component stack (for React render errors)\n * - Classified stack trace (app frames highlighted, internals collapsed)\n * - Copy button for the full error\n * - Dark/light mode via prefers-color-scheme\n * - Auto-reconnect script that watches for Vite HMR and reloads\n */\nexport function generateDevErrorPage(\n error: Error,\n phase: ErrorPhase,\n projectRoot: string,\n hmrOptions?: DevErrorHmrOptions\n): string {\n const message = error.message || 'Unknown error';\n const phaseLabel = PHASE_LABELS[phase];\n const phaseHint = PHASE_HINTS[phase];\n const componentStack = extractComponentStack(error);\n const loc = parseFirstAppFrame(error.stack ?? '', projectRoot);\n const frames = error.stack ? classifyStack(error.stack, projectRoot) : [];\n const appFrames = frames.filter((f) => f.type === 'app');\n const internalFrameCount = frames.filter((f) => f.type !== 'app').length;\n\n // Try to read source code context\n let sourceContext: ReturnType<typeof readSourceContext> = null;\n if (loc) {\n sourceContext = readSourceContext(loc.file, loc.line);\n }\n\n // Relative path for display\n const relPath = loc?.file.startsWith(projectRoot)\n ? loc.file.slice(projectRoot.length + 1)\n : loc?.file;\n\n const bodyHtml = `<header class=\"header\">\n <div class=\"badge\">${esc(phaseLabel)} Error</div>\n <h1 class=\"message\">${esc(message)}</h1>\n ${phaseHint ? `<p class=\"hint\">${esc(phaseHint)}</p>` : ''}\n </header>\n\n ${relPath ? `<div class=\"location\">${esc(relPath)}${loc ? `:${loc.line}:${loc.column}` : ''}</div>` : ''}\n\n ${\n sourceContext\n ? `<div class=\"source-context\">\n <div class=\"section-header\">Source</div>\n <pre class=\"source-code\"><code>${sourceContext.lines\n .map(\n (l) =>\n `<span class=\"source-line${l.highlight ? ' source-line-highlight' : ''}\"` +\n `><span class=\"line-num\">${l.num}</span>${esc(l.text)}</span>`\n )\n .join('\\n')}</code></pre>\n </div>`\n : ''\n }\n\n ${\n componentStack\n ? `<div class=\"section\">\n <div class=\"section-header\">Component Stack</div>\n <pre class=\"component-stack\">${esc(componentStack.trim())}</pre>\n </div>`\n : ''\n }\n\n ${\n appFrames.length > 0\n ? `<div class=\"section\">\n <div class=\"section-header\">Application Frames</div>\n <pre class=\"stack\">${appFrames.map((f) => esc(f.raw)).join('\\n')}</pre>\n </div>`\n : ''\n }\n\n ${\n internalFrameCount > 0\n ? `<details class=\"section internal-frames\">\n <summary class=\"section-header clickable\">${internalFrameCount} internal frame${internalFrameCount !== 1 ? 's' : ''}</summary>\n <pre class=\"stack dimmed\">${frames\n .filter((f) => f.type !== 'app')\n .map((f) => esc(f.raw))\n .join('\\n')}</pre>\n </details>`\n : ''\n }\n\n <div class=\"actions\">\n <button class=\"btn\" onclick=\"copyError()\">Copy Error</button>\n </div>`;\n\n const copyScript = ` function copyError() {\n var text = ${escJsonForScript(\n JSON.stringify(\n `${phaseLabel} Error: ${message}\\n\\n` +\n (relPath ? `File: ${relPath}${loc ? `:${loc.line}:${loc.column}` : ''}\\n\\n` : '') +\n (componentStack ? `Component Stack:\\n${componentStack.trim()}\\n\\n` : '') +\n `Stack Trace:\\n${error.stack ?? ''}`\n )\n )};\n navigator.clipboard.writeText(text).then(function() {\n var btn = document.querySelector('.btn');\n if (btn) { btn.textContent = 'Copied!'; setTimeout(function() { btn.textContent = 'Copy Error'; }, 1500); }\n });\n }\n`;\n\n return renderDevPageShell({\n title: `Error — ${phaseLabel} | timber.js`,\n extraCss: ERROR_CSS,\n bodyHtml,\n footerHint: 'Fix the error and save — the page will reload automatically via HMR.',\n extraScript: copyScript,\n hmrOptions,\n });\n}\n\n// ─── Page-Specific CSS ──────────────────────────────────────────────────────\n\nconst ERROR_CSS = `\n :root {\n --badge-bg: #fef2f2;\n --badge-fg: #991b1b;\n --badge-border: #fecaca;\n --highlight-bg: #fef2f2;\n --highlight-border: #ef4444;\n --line-num: #9ca3af;\n }\n\n @media (prefers-color-scheme: dark) {\n :root {\n --badge-bg: #450a0a;\n --badge-fg: #fca5a5;\n --badge-border: #7f1d1d;\n --highlight-bg: #450a0a;\n --highlight-border: #dc2626;\n --line-num: #6b7280;\n }\n }\n\n .location {\n font-family: var(--code-font);\n font-size: 0.8125rem;\n color: var(--link);\n margin-bottom: 1rem;\n padding: 0.5rem 0.75rem;\n background: var(--source-bg);\n border-radius: 0.375rem;\n border: 1px solid var(--border);\n }\n\n .source-context {\n margin-bottom: 1rem;\n border: 1px solid var(--border);\n border-radius: 0.5rem;\n overflow: hidden;\n }\n\n .source-code {\n overflow-x: auto;\n font-family: var(--code-font);\n font-size: 0.8125rem;\n line-height: 1.7;\n padding: 0;\n margin: 0;\n }\n\n .source-code code {\n display: block;\n }\n\n .source-line {\n display: block;\n padding: 0 0.75rem;\n border-left: 3px solid transparent;\n }\n\n .source-line-highlight {\n background: var(--highlight-bg);\n border-left-color: var(--highlight-border);\n }\n\n .line-num {\n display: inline-block;\n width: 3rem;\n text-align: right;\n margin-right: 1rem;\n color: var(--line-num);\n user-select: none;\n }\n\n .clickable { cursor: pointer; }\n .clickable:hover { background: var(--btn-bg); }\n\n .component-stack, .stack {\n font-family: var(--code-font);\n font-size: 0.8125rem;\n line-height: 1.7;\n padding: 0.75rem;\n overflow-x: auto;\n white-space: pre;\n margin: 0;\n }\n\n .dimmed { color: var(--fg-dim); }\n\n .actions {\n margin: 1.5rem 0;\n }\n\n .btn {\n font-family: inherit;\n font-size: 0.8125rem;\n font-weight: 500;\n padding: 0.5rem 1rem;\n border-radius: 0.375rem;\n border: 1px solid var(--btn-border);\n background: var(--btn-bg);\n color: var(--btn-fg);\n cursor: pointer;\n transition: background 0.15s;\n }\n\n .btn:hover { opacity: 0.85; }\n`;\n","/**\n * Config validation — validates timber.config.ts at startup.\n *\n * Runs in the plugin's configResolved hook (once, at startup/build).\n * Each check produces a clear error message with the invalid value,\n * what's expected, and how to fix it.\n *\n * Design doc: 18-build-system.md\n */\n\nimport { createRequire } from 'node:module';\nimport type { TimberUserConfig } from './config-types.js';\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\nexport interface ConfigError {\n field: string;\n message: string;\n value?: unknown;\n suggestion?: string;\n}\n\n// ─── Known config keys ──────────────────────────────────────────────────────\n\n// `satisfies Record<keyof TimberUserConfig, true>` makes this drift-proof:\n// adding a key to TimberUserConfig without listing it here is a compile\n// error, so validateConfig can never reject a documented option (TIM-1066).\nconst KNOWN_CONFIG_KEYS = {\n output: true,\n debug: true,\n clientJavascript: true,\n adapter: true,\n allowedOrigins: true,\n csrf: true,\n limits: true,\n forms: true,\n pageExtensions: true,\n slowRequestMs: true,\n renderTimeoutMs: true,\n devBrowserLogs: true,\n dev: true,\n serverTiming: true,\n appDir: true,\n mdx: true,\n actionEncryption: true,\n reactCompiler: true,\n sitemap: true,\n buildDir: true,\n clientSegmentCache: true,\n topLoader: true,\n budget: true,\n} satisfies Record<keyof TimberUserConfig, true>;\n\nconst knownKeys = new Set<string>(Object.keys(KNOWN_CONFIG_KEYS));\n\n// ─── Validation ─────────────────────────────────────────────────────────────\n\n/**\n * Validate a TimberUserConfig object.\n *\n * Returns an array of errors. Empty array means the config is valid.\n * Does not throw — the caller decides how to surface errors.\n */\nexport function validateConfig(config: TimberUserConfig): ConfigError[] {\n const errors: ConfigError[] = [];\n\n // output\n if (config.output !== undefined && config.output !== 'server' && config.output !== 'static') {\n errors.push({\n field: 'output',\n message: `Invalid output mode: \"${String(config.output)}\". Must be \"server\" or \"static\".`,\n value: config.output,\n suggestion: 'Use output: \"server\" (default) or output: \"static\" for static site generation.',\n });\n }\n\n // pageExtensions\n if (config.pageExtensions !== undefined) {\n if (!Array.isArray(config.pageExtensions)) {\n errors.push({\n field: 'pageExtensions',\n message: 'pageExtensions must be an array of strings.',\n value: config.pageExtensions,\n suggestion: 'Example: pageExtensions: [\"tsx\", \"ts\", \"jsx\", \"js\", \"mdx\"]',\n });\n } else {\n for (const ext of config.pageExtensions) {\n if (typeof ext !== 'string') {\n errors.push({\n field: 'pageExtensions',\n message: `pageExtensions contains a non-string value: ${JSON.stringify(ext)}`,\n value: ext,\n });\n break;\n }\n if (ext.startsWith('.')) {\n errors.push({\n field: 'pageExtensions',\n message: `pageExtensions should not include the leading dot: \"${ext}\"`,\n value: ext,\n suggestion: `Use \"${ext.slice(1)}\" instead of \"${ext}\".`,\n });\n break;\n }\n }\n }\n }\n\n // slowRequestMs\n if (config.slowRequestMs !== undefined) {\n if (typeof config.slowRequestMs !== 'number' || config.slowRequestMs < 0) {\n errors.push({\n field: 'slowRequestMs',\n message: `slowRequestMs must be a non-negative number (got ${JSON.stringify(config.slowRequestMs)}).`,\n value: config.slowRequestMs,\n suggestion: 'Use slowRequestMs: 3000 (default) or slowRequestMs: 0 to disable.',\n });\n }\n }\n\n // renderTimeoutMs\n if (config.renderTimeoutMs !== undefined) {\n if (typeof config.renderTimeoutMs !== 'number' || config.renderTimeoutMs < 0) {\n errors.push({\n field: 'renderTimeoutMs',\n message: `renderTimeoutMs must be a non-negative number (got ${JSON.stringify(config.renderTimeoutMs)}).`,\n value: config.renderTimeoutMs,\n suggestion: 'Use renderTimeoutMs: 30000 (default). Setting 0 uses a 120s safety ceiling.',\n });\n }\n }\n\n // serverTiming\n if (config.serverTiming !== undefined) {\n if (\n config.serverTiming !== 'detailed' &&\n config.serverTiming !== 'total' &&\n config.serverTiming !== false\n ) {\n errors.push({\n field: 'serverTiming',\n message: `Invalid serverTiming value: ${JSON.stringify(config.serverTiming)}.`,\n value: config.serverTiming,\n suggestion: 'Use \"detailed\", \"total\", or false.',\n });\n }\n }\n\n // devBrowserLogs\n if (config.devBrowserLogs !== undefined) {\n const valid = ['error', 'warn', 'info', 'none'];\n if (!valid.includes(config.devBrowserLogs)) {\n errors.push({\n field: 'devBrowserLogs',\n message: `Invalid devBrowserLogs value: ${JSON.stringify(config.devBrowserLogs)}.`,\n value: config.devBrowserLogs,\n suggestion: `Use one of: ${valid.map((v) => `\"${v}\"`).join(', ')}.`,\n });\n }\n }\n\n // sitemap\n if (config.sitemap != null && typeof config.sitemap === 'object') {\n if (config.sitemap.enabled && !config.sitemap.baseUrl) {\n errors.push({\n field: 'sitemap.baseUrl',\n message: 'sitemap.baseUrl is required when sitemap is enabled.',\n suggestion: 'Add sitemap: { enabled: true, baseUrl: \"https://example.com\" }.',\n });\n }\n if (\n config.sitemap.defaultPriority !== undefined &&\n (config.sitemap.defaultPriority < 0 || config.sitemap.defaultPriority > 1)\n ) {\n errors.push({\n field: 'sitemap.defaultPriority',\n message: `sitemap.defaultPriority must be between 0.0 and 1.0 (got ${config.sitemap.defaultPriority}).`,\n value: config.sitemap.defaultPriority,\n });\n }\n }\n\n // budget\n if (config.budget != null && typeof config.budget === 'object') {\n if (\n config.budget.firstLoadJs !== undefined &&\n (typeof config.budget.firstLoadJs !== 'number' || config.budget.firstLoadJs <= 0)\n ) {\n errors.push({\n field: 'budget.firstLoadJs',\n message: `budget.firstLoadJs must be a positive number in bytes (got ${JSON.stringify(config.budget.firstLoadJs)}).`,\n value: config.budget.firstLoadJs,\n suggestion: 'Example: budget: { firstLoadJs: 150_000 } for a ~150 kB limit.',\n });\n }\n }\n\n const MOVED_TO_CACHE_FILE = new Set(['cacheHandler', 'cdnPurge']);\n\n for (const key of Object.keys(config)) {\n if (!knownKeys.has(key)) {\n errors.push({\n field: key,\n message: `Unknown config option: \"${key}\".`,\n suggestion: MOVED_TO_CACHE_FILE.has(key)\n ? `\"${key}\" has moved to timber.cache.ts. Export cacheHandler as default, cdnPurge as a named export.`\n : `Check for typos. Known options: ${[...knownKeys].sort().join(', ')}.`,\n });\n }\n }\n\n return errors;\n}\n\n// ─── Formatting ─────────────────────────────────────────────────────────────\n\nconst RED = '\\x1b[31m';\nconst BOLD = '\\x1b[1m';\nconst DIM = '\\x1b[2m';\nconst RESET = '\\x1b[0m';\n\n/**\n * Format config errors for terminal output.\n */\nexport function formatConfigErrors(errors: ConfigError[]): string {\n if (errors.length === 0) return '';\n\n const lines: string[] = [];\n lines.push(\n `${RED}${BOLD}[timber]${RESET} ${RED}${errors.length} config error${errors.length !== 1 ? 's' : ''} in timber.config.ts:${RESET}`\n );\n\n for (const err of errors) {\n lines.push('');\n lines.push(` ${RED}✗${RESET} ${BOLD}${err.field}${RESET}: ${err.message}`);\n if (err.suggestion) {\n lines.push(` ${DIM}${err.suggestion}${RESET}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n// ─── Virtual Module Name Mapping ────────────────────────────────────────────\n\nconst VIRTUAL_MODULE_NAMES: Record<string, string> = {\n 'virtual:timber-rsc-entry': 'RSC entry (server component handler)',\n 'virtual:timber-ssr-entry': 'SSR entry (HTML renderer)',\n 'virtual:timber-browser-entry': 'Browser entry (client hydration)',\n 'virtual:timber-config': 'Runtime config (timber.config.ts)',\n 'virtual:timber-route-manifest': 'Route manifest (app/ file tree)',\n 'virtual:timber-instrumentation': 'Instrumentation (instrumentation.ts)',\n 'virtual:timber-cache-handler': 'Cache handler (timber.cache.ts)',\n 'virtual:timber-build-manifest': 'Build manifest (asset mapping)',\n};\n\n/**\n * Add timber-specific context to an error message that references virtual modules.\n *\n * If the error message contains a `virtual:timber-*` ID, appends a\n * human-readable explanation. Does not replace the original message.\n */\nexport function addVirtualModuleContext(errorMessage: string): string {\n for (const [id, name] of Object.entries(VIRTUAL_MODULE_NAMES)) {\n if (errorMessage.includes(id)) {\n return `${errorMessage}\\n\\n [timber] This error references \"${id}\" — timber's ${name}.\\n This is an internal module. The issue is likely in your app code or timber configuration.`;\n }\n }\n return errorMessage;\n}\n\n// ─── Peer Dependency Check ──────────────────────────────────────────────────\n\ninterface PeerDepResult {\n name: string;\n status: 'ok' | 'missing';\n}\n\n/**\n * Required (non-optional) peer dependencies that must be installed.\n */\nconst REQUIRED_PEERS = ['react', 'react-dom', '@vitejs/plugin-react', '@vitejs/plugin-rsc'];\n\n/**\n * Check that required peer dependencies are installed.\n *\n * Uses require.resolve with a try/catch — no fs scanning.\n * Returns only the missing packages.\n */\nexport function checkPeerDependencies(projectRoot: string): PeerDepResult[] {\n const results: PeerDepResult[] = [];\n\n // Use createRequire from the project root to resolve as the user would.\n // `createRequire` MUST be a top-level ESM import — inline `require('node:module')`\n // throws \"Dynamic require not supported\" in ESM and the catch below would\n // mark every peer as missing. Same class of bug as TIM-796.\n const userRequire = createRequire(`${projectRoot}/package.json`);\n\n for (const name of REQUIRED_PEERS) {\n try {\n userRequire.resolve(name);\n results.push({ name, status: 'ok' });\n } catch {\n results.push({ name, status: 'missing' });\n }\n }\n\n return results;\n}\n\n/**\n * Format missing peer dependencies as an actionable warning.\n */\nexport function formatMissingPeers(results: PeerDepResult[]): string {\n const missing = results.filter((r) => r.status === 'missing');\n if (missing.length === 0) return '';\n\n const names = missing.map((r) => r.name);\n const lines: string[] = [];\n lines.push(`${RED}${BOLD}[timber]${RESET} ${RED}Missing required dependencies:${RESET}`);\n lines.push('');\n for (const name of names) {\n lines.push(` ${RED}✗${RESET} ${name}`);\n }\n lines.push('');\n lines.push(` ${DIM}Install with:${RESET}`);\n lines.push(` ${BOLD}pnpm add ${names.join(' ')}${RESET}`);\n\n return lines.join('\\n');\n}\n","// Response compression for self-hosted deployments (dev server, Nitro preview).\n//\n// Uses CompressionStream (Web Platform API) for gzip. Brotli is intentionally\n// left to CDNs and reverse proxies — at streaming-friendly quality levels its\n// ratio advantage is marginal, and node:zlib's brotli transform buffers output\n// internally, breaking streaming. Cloudflare Workers auto-compress at the edge —\n// this module is only used on Node.js/Bun.\n//\n// See design/25-production-deployments.md.\n\n// ─── Constants ────────────────────────────────────────────────────────────\n\n/**\n * MIME types that benefit from compression.\n * text/* is handled via prefix matching; these are the specific\n * application/* and image/* types that are compressible.\n */\nexport const COMPRESSIBLE_TYPES = new Set([\n 'text/html',\n 'text/css',\n 'text/plain',\n 'text/xml',\n 'text/javascript',\n 'text/x-component',\n 'application/json',\n 'application/javascript',\n 'application/xml',\n 'application/xhtml+xml',\n 'application/rss+xml',\n 'application/atom+xml',\n 'image/svg+xml',\n]);\n\n/**\n * Status codes that should never be compressed (no body or special semantics).\n */\nconst NO_COMPRESS_STATUSES = new Set([204, 304]);\n\n// ─── Encoding Negotiation ─────────────────────────────────────────────────\n\n/**\n * Parse Accept-Encoding and return the best supported encoding.\n * Returns 'gzip' if the client accepts it, null otherwise.\n *\n * Brotli (br) is intentionally not handled at the application level.\n * At the streaming-friendly quality levels (0–4), brotli's compression\n * ratio advantage over gzip is marginal, and node:zlib's brotli transform\n * buffers output internally — turning smooth streaming responses into\n * large infrequent bursts. Brotli's real wins come from offline/static\n * compression at higher quality levels (5–11), which CDNs and reverse\n * proxies (Cloudflare, nginx, Caddy) apply on cached responses.\n *\n * See design/25-production-deployments.md.\n */\nexport function negotiateEncoding(acceptEncoding: string): 'gzip' | null {\n if (!acceptEncoding) return null;\n\n // Parse tokens with quality values from the Accept-Encoding header.\n // Per RFC 9110 §12.5.3, q=0 means \"not acceptable\" — the client explicitly\n // rejects that encoding. Tokens without a q-value default to q=1.\n // e.g. \"gzip;q=1.0, br;q=0\" → gzip is acceptable, br is rejected.\n const parts = acceptEncoding.split(',');\n for (const part of parts) {\n const [token, ...params] = part.split(';');\n const name = token.trim().toLowerCase();\n if (name !== 'gzip') continue;\n\n // Check for q=0 (explicitly disabled)\n let qValue = 1; // default quality is 1\n for (const param of params) {\n const trimmed = param.trim().toLowerCase();\n if (trimmed.startsWith('q=')) {\n qValue = parseFloat(trimmed.slice(2));\n if (Number.isNaN(qValue)) qValue = 1;\n break;\n }\n }\n\n if (qValue > 0) return 'gzip';\n }\n\n return null;\n}\n\n// ─── Compressibility Check ────────────────────────────────────────────────\n\n/**\n * Determine if a response should be compressed.\n *\n * Returns false for:\n * - Responses without a body (204, 304, null body)\n * - Already-encoded responses (Content-Encoding set)\n * - Non-compressible content types (images, binary)\n * - SSE streams (text/event-stream — must not be buffered)\n */\nexport function shouldCompress(response: Response): boolean {\n // No body to compress\n if (!response.body) return false;\n if (NO_COMPRESS_STATUSES.has(response.status)) return false;\n\n // Already compressed\n if (response.headers.has('Content-Encoding')) return false;\n\n // Check content type\n const contentType = response.headers.get('Content-Type');\n if (!contentType) return false;\n\n // Extract the MIME type (strip charset and other parameters)\n const mimeType = contentType.split(';')[0].trim().toLowerCase();\n\n // SSE must not be compressed — it relies on chunk-by-chunk delivery\n if (mimeType === 'text/event-stream') return false;\n\n return COMPRESSIBLE_TYPES.has(mimeType);\n}\n\n// ─── Compression ──────────────────────────────────────────────────────────\n\n/**\n * Compress a Web Response if the client supports it and the content is compressible.\n *\n * Returns the original response unchanged if compression is not applicable.\n * Returns a new Response with the compressed body, Content-Encoding, and Vary headers.\n *\n * The body is piped through a compression stream — no buffering of the full response.\n * This preserves streaming behavior for HTML shell + deferred Suspense chunks.\n */\nexport function compressResponse(request: Request, response: Response): Response {\n // Check if response is compressible\n if (!shouldCompress(response)) return response;\n\n // Negotiate encoding with the client\n const acceptEncoding = request.headers.get('Accept-Encoding') ?? '';\n const encoding = negotiateEncoding(acceptEncoding);\n if (!encoding) return response;\n\n // Compress the body stream with gzip via the Web Platform CompressionStream API.\n const compressedBody = compressWithGzip(response.body!);\n\n // Build new headers: copy originals, add compression headers, remove Content-Length\n // (compressed size is unknown until streaming completes).\n const headers = new Headers(response.headers);\n headers.set('Content-Encoding', encoding);\n headers.delete('Content-Length');\n\n // Append to Vary header (preserve existing Vary values)\n const existingVary = headers.get('Vary');\n if (existingVary) {\n if (!existingVary.toLowerCase().includes('accept-encoding')) {\n headers.set('Vary', `${existingVary}, Accept-Encoding`);\n }\n } else {\n headers.set('Vary', 'Accept-Encoding');\n }\n\n return new Response(compressedBody, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n}\n\n// ─── Gzip (node:zlib with Z_SYNC_FLUSH) ──────────────────────────────────\n//\n// Uses node:zlib's createGzip with Z_SYNC_FLUSH so each chunk is flushed\n// to the output immediately. The Web Platform CompressionStream API buffers\n// internally and does NOT flush per-chunk — this kills streaming because\n// the browser doesn't receive the HTML shell until the gzip stream closes\n// (i.e. after all Suspense boundaries resolve).\n//\n// Z_SYNC_FLUSH adds ~2–5% size overhead vs Z_NO_FLUSH but preserves\n// correct streaming behavior: the shell renders instantly, Suspense\n// fallbacks are visible immediately, and streamed content appears\n// progressively.\n\nimport { createGzip, constants } from 'node:zlib';\nimport { Readable, pipeline } from 'node:stream';\n\n/**\n * Compress a ReadableStream with gzip, flushing each chunk immediately.\n *\n * Uses node:zlib's createGzip with Z_SYNC_FLUSH to ensure each HTML chunk\n * (shell, Suspense resolution, RSC payload) is delivered to the browser\n * as soon as it's available — preserving streaming semantics.\n */\nfunction compressWithGzip(body: ReadableStream<Uint8Array>): ReadableStream<Uint8Array> {\n const gzip = createGzip({ flush: constants.Z_SYNC_FLUSH });\n const nodeInput = Readable.fromWeb(body as import('stream/web').ReadableStream);\n\n // pipeline() instead of bare pipe(): pipe() does not forward source errors,\n // so an erroring body (streaming route handler, dropped upstream fetch)\n // would emit an unhandled 'error' event and crash the process. pipeline()\n // destroys gzip on source error — the returned web stream rejects — and\n // tears down nodeInput when the consumer cancels the web stream, which\n // cancels the source body via fromWeb. The error reaches the consumer\n // through the web stream; the callback only marks it handled at the Node\n // layer.\n pipeline(nodeInput, gzip, () => {});\n\n return Readable.toWeb(gzip) as ReadableStream<Uint8Array>;\n}\n","/**\n * Shared URL-matching tree walker for segment trees.\n *\n * Both the main route matcher (`route-matcher.ts`) and slot resolver\n * (`slot-resolver.ts`) need to walk a SegmentNode tree, matching URL\n * parts against children with the same priority semantics:\n *\n * static > dynamic > catch-all > optional-catch-all\n *\n * Before this module, each had its own walker with subtle divergences\n * (different group handling, missing backtracking, incomplete\n * optional-catch-all support). This shared walker is the single\n * source of truth for URL-to-segment matching.\n *\n * See design/07-routing.md §\"Request Lifecycle\" and TIM-940.\n */\n\nimport type { SegmentNode } from '../routing/types.js';\n\n// ─── Public API ───────────────────────────────────────────────────────────\n\n/** Result of matching URL parts against a segment tree. */\nexport interface TreeMatchResult<TFile> {\n /** Matched segment chain from root to leaf, inclusive. */\n chain: SegmentNode<TFile>[];\n /** Collected params, keyed by param name. Catch-all params are string[]. */\n params: Record<string, string | string[]>;\n}\n\nexport interface TreeMatchOptions {\n /**\n * When true (default), only match if the leaf node has a page or route\n * handler. Set to false for metadata route matching, where we just need\n * to find the owning segment regardless of whether it has a page.\n */\n requireTerminal?: boolean;\n}\n\n/**\n * Match URL path parts against a segment tree.\n *\n * Walks the tree depth-first with backtracking, applying priority\n * ordering globally across group boundaries. Returns the matched\n * segment chain and collected params, or null if no route matches.\n *\n * By default, a match requires a terminal node (one with `page` or\n * `route`) at the leaf. Pass `{ requireTerminal: false }` to match\n * any segment (used by metadata route matching).\n *\n * @param root The root segment node to start matching from.\n * @param parts URL path parts (e.g. ['blog', 'hello-world']).\n * Empty array matches the root itself (if terminal).\n */\nexport function matchUrlParts<TFile>(\n root: SegmentNode<TFile>,\n parts: string[],\n options?: TreeMatchOptions\n): TreeMatchResult<TFile> | null {\n const chain: SegmentNode<TFile>[] = [];\n const params: Record<string, string | string[]> = {};\n const requireTerminal = options?.requireTerminal ?? true;\n\n if (matchNode(root, parts, 0, chain, params, requireTerminal)) {\n return { chain, params };\n }\n return null;\n}\n\n// ─── Internal ─────────────────────────────────────────────────────────────\n\n/**\n * A child node flattened through group segments, along with the\n * chain of group nodes that must appear in the segment chain\n * before the child to preserve the tree path.\n */\ninterface EffectiveChild<TFile> {\n child: SegmentNode<TFile>;\n groupChain: SegmentNode<TFile>[];\n}\n\n/**\n * Flatten children through group segments.\n *\n * Groups are transparent for URL matching — their non-group descendants\n * are returned with the chain of group nodes leading to them. This lets\n * the caller apply priority ordering (static > dynamic > catch-all >\n * optional-catch-all) across all groups uniformly instead of per-group.\n */\nfunction collectEffectiveChildren<TFile>(\n node: SegmentNode<TFile>,\n groupChain: SegmentNode<TFile>[] = []\n): EffectiveChild<TFile>[] {\n const result: EffectiveChild<TFile>[] = [];\n for (const child of node.children) {\n if (child.segmentType === 'group') {\n const nested = collectEffectiveChildren(child, [...groupChain, child]);\n result.push(...nested);\n } else {\n result.push({ child, groupChain });\n }\n }\n return result;\n}\n\n/** A node is terminal if it can serve a response (has a page or route handler). */\nfunction isTerminal<TFile>(node: SegmentNode<TFile>): boolean {\n return !!(node.page || node.route);\n}\n\n/** Combined affix length for specificity ordering. */\nfunction affixLength<TFile>(node: SegmentNode<TFile>): number {\n return (node.paramPrefix?.length ?? 0) + (node.paramSuffix?.length ?? 0);\n}\n\n/**\n * Recursive depth-first matcher with backtracking.\n *\n * Mutates `chain` and `params` in place for performance; backtracks\n * (restores previous state) when a candidate doesn't lead to a match.\n */\nfunction matchNode<TFile>(\n node: SegmentNode<TFile>,\n parts: string[],\n index: number,\n chain: SegmentNode<TFile>[],\n params: Record<string, string | string[]>,\n requireTerminal: boolean\n): boolean {\n chain.push(node);\n\n // All parts consumed — check if this node is terminal (or any node if !requireTerminal)\n if (index >= parts.length) {\n if (!requireTerminal || isTerminal(node)) return true;\n\n // Groups don't consume URL segments, so a group child's page can\n // match at the same URL depth. Recurse into groups transparently.\n for (const child of node.children) {\n if (child.segmentType === 'group') {\n if (matchNode(child, parts, index, chain, params, requireTerminal)) {\n return true;\n }\n }\n }\n\n // Optional catch-all with zero segments (direct and through groups).\n // The param is NOT set — matching Next.js semantics for [[...slug]]\n // with no path segments.\n const effective = collectEffectiveChildren(node);\n for (const { child, groupChain } of effective) {\n if (child.segmentType === 'optional-catch-all' && (!requireTerminal || isTerminal(child))) {\n chain.push(...groupChain, child);\n return true;\n }\n }\n\n chain.pop();\n return false;\n }\n\n const part = parts[index];\n\n // Flatten children through groups so priority ordering applies globally.\n const effective = collectEffectiveChildren(node);\n\n // 1. Static segments (exact name match)\n for (const { child, groupChain } of effective) {\n if (child.segmentType === 'static' && child.segmentName === part) {\n chain.push(...groupChain);\n if (matchNode(child, parts, index + 1, chain, params, requireTerminal)) {\n return true;\n }\n chain.length -= groupChain.length;\n }\n }\n\n // 2. Affixed dynamic segments (e.g. img-[id].png) — more specific than bare dynamic.\n // Sorted by specificity: longer combined prefix+suffix wins.\n const affixed = effective.filter(\n ({ child }) =>\n child.segmentType === 'dynamic' && child.paramName && (child.paramPrefix || child.paramSuffix)\n );\n affixed.sort((a, b) => affixLength(b.child) - affixLength(a.child));\n for (const { child, groupChain } of affixed) {\n const prefix = child.paramPrefix ?? '';\n const suffix = child.paramSuffix ?? '';\n if (\n part.length > prefix.length + suffix.length &&\n (!prefix || part.startsWith(prefix)) &&\n (!suffix || part.endsWith(suffix))\n ) {\n const value = part.slice(prefix.length, part.length - (suffix.length || 0));\n chain.push(...groupChain);\n const prev = params[child.paramName!];\n params[child.paramName!] = value;\n if (matchNode(child, parts, index + 1, chain, params, requireTerminal)) {\n return true;\n }\n // Backtrack\n chain.length -= groupChain.length;\n if (prev !== undefined) {\n params[child.paramName!] = prev;\n } else {\n delete params[child.paramName!];\n }\n }\n }\n\n // 3. Bare dynamic segments ([param])\n for (const { child, groupChain } of effective) {\n if (\n child.segmentType === 'dynamic' &&\n child.paramName &&\n !child.paramPrefix &&\n !child.paramSuffix\n ) {\n chain.push(...groupChain);\n const prev = params[child.paramName];\n params[child.paramName] = part;\n if (matchNode(child, parts, index + 1, chain, params, requireTerminal)) {\n return true;\n }\n // Backtrack\n chain.length -= groupChain.length;\n if (prev !== undefined) {\n params[child.paramName] = prev;\n } else {\n delete params[child.paramName];\n }\n }\n }\n\n // 4. Catch-all segments ([...param]) — must be terminal unless the\n // caller passed requireTerminal:false (metadata route matching needs to\n // find the owning segment even when it has no page).\n for (const { child, groupChain } of effective) {\n if (\n child.segmentType === 'catch-all' &&\n child.paramName &&\n (!requireTerminal || isTerminal(child))\n ) {\n chain.push(...groupChain, child);\n params[child.paramName] = parts.slice(index);\n return true;\n }\n }\n\n // 5. Optional catch-all segments ([[...param]]) — same terminal rule\n for (const { child, groupChain } of effective) {\n if (\n child.segmentType === 'optional-catch-all' &&\n child.paramName &&\n (!requireTerminal || isTerminal(child))\n ) {\n chain.push(...groupChain, child);\n params[child.paramName] = parts.slice(index);\n return true;\n }\n }\n\n chain.pop();\n return false;\n}\n","/**\n * timber-dev-server — Vite sub-plugin for dev server request handling.\n *\n * Registers a configureServer middleware that intercepts requests and\n * routes them through the timber pipeline:\n * proxy.ts → canonicalize → route match → middleware → access → render → flush\n *\n * The RSC entry module is loaded via Vite's ssrLoadModule, which uses\n * Vite's dev module graph instead of built bundles. The full pipeline\n * (including proxy.ts) runs on every request.\n *\n * Design docs: 18-build-system.md §\"Dev Server\", 02-rendering-pipeline.md\n */\n\nimport type { Plugin, ViteDevServer, DevEnvironment } from 'vite';\nimport type { IncomingMessage, ServerResponse } from 'node:http';\nimport type { TLSSocket } from 'node:tls';\nimport { existsSync, statSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { sendNodeResponse } from 'srvx/node';\nimport type { PluginContext } from '../plugin-context.js';\nimport {\n sendErrorToOverlay,\n classifyErrorPhase,\n fixErrorStacktrace,\n parseFirstAppFrame,\n type ErrorPhase,\n} from '../dev-tools/overlay.js';\nimport { generateDevErrorPage } from '../dev-tools/error-page.js';\nimport { extractHmrOptions, type DevErrorHmrOptions } from '../dev-tools/dev-page-shell.js';\nimport { addVirtualModuleContext } from '../config-validation.js';\nimport { compressResponse } from '../server/compress.js';\nimport { isMetadataRouteServePath } from '../server/metadata-routes.js';\nimport { canonicalize } from '../server/canonicalize.js';\nimport { matchUrlParts } from '../server/tree-match.js';\nimport type { RouteTree } from '../routing/types.js';\n\n// ─── Constants ────────────────────────────────────────────────────────────\n\nconst RSC_ENTRY_ID = 'virtual:timber-rsc-entry';\n\n/**\n * Config file names that trigger a full dev server restart when changed.\n * See 21-dev-server.md §HMR Wiring — config is loaded once at startup.\n */\nconst CONFIG_FILE_NAMES = ['timber.config.ts', 'timber.config.js', 'timber.config.mjs'];\n\n/**\n * URL prefixes that are Vite-internal and should never be intercepted.\n * These are passed through to Vite's built-in middleware.\n */\nconst VITE_INTERNAL_PREFIXES = [\n '/@', // /@vite/client, /@fs/, /@id/\n '/__vite', // /__vite_hmr, /__vite_ping\n '/node_modules/',\n];\n\n/**\n * File extensions that indicate static asset requests.\n * These are passed through to Vite's static file serving.\n */\nconst ASSET_EXTENSIONS =\n /\\.(?:js|ts|tsx|jsx|css|map|json|svg|png|jpg|jpeg|gif|webp|avif|ico|woff|woff2|ttf|eot|mp4|webm|ogg|mp3|wav)(?:\\?.*)?$/;\n\n// ─── Plugin ───────────────────────────────────────────────────────────────\n\n/**\n * Create the timber-dev-server Vite plugin.\n *\n * Hook: configureServer (returns post-hook to register after Vite's middleware)\n */\nexport function timberDevServer(ctx: PluginContext): Plugin {\n return {\n name: 'timber-dev-server',\n\n // Only active in dev mode (command === 'serve'), not during build.\n // See 21-dev-server.md §Plugin Registration.\n apply: 'serve',\n\n /**\n * Register the dev server middleware and config file watcher.\n *\n * Registers as a pre-hook (no return value) so our middleware runs\n * before Vite's built-in SPA fallback / historyApiFallback. This\n * ensures we see the original URL (e.g. /blog) rather than a\n * rewritten /index.html. Vite-internal and asset requests are\n * filtered out explicitly and passed through to Vite.\n */\n configureServer(server: ViteDevServer) {\n // Ensure config files are in the watch set. Vite's watcher covers\n // the project root, but `server.watcher.add()` is a no-op for files\n // already watched, and ensures newly-created config files (e.g. from\n // create-timber-app) are picked up. The actual restart logic is\n // handled by Vite's built-in configFileDependencies check — see the\n // configResolved hook in index.ts where we register the config path.\n // See 21-dev-server.md §HMR Wiring.\n const configPaths = CONFIG_FILE_NAMES.map((name) => join(ctx.root, name));\n server.watcher.add(configPaths);\n\n // Listen for client-side errors forwarded from the browser.\n // The browser entry sends 'timber:client-error' events via HMR\n // for uncaught errors and unhandled rejections. We echo them back\n // as Vite's '{ type: \"error\" }' payload to trigger the overlay.\n listenForClientErrors(server, ctx.root);\n\n // Pre-hook — registers middleware before Vite's internals\n server.middlewares.use(createTimberMiddleware(server, ctx));\n\n // Wrap server.listen() to close the holding server immediately\n // before Vite binds the port — no gap where nothing is listening.\n // The holding server was started in rootSync's config() hook to\n // serve a loading page during initialization.\n // See design/21-dev-server.md §\"Startup Holding Server\", TIM-665.\n if (ctx.holdingServer) {\n const originalListen = server.listen.bind(server);\n const holdingRef = ctx.holdingServer;\n ctx.holdingServer = null;\n server.listen = async (port?: number, isRestart?: boolean) => {\n await holdingRef.close().catch(() => {});\n return originalListen(port, isRestart);\n };\n }\n\n // Log startup timing summary. configureServer runs on all plugins\n // before the server listens, so this captures the full cold start.\n ctx.timer.end('dev-server-setup');\n const summary = ctx.timer.formatSummary();\n if (summary) {\n console.log(summary);\n }\n },\n };\n}\n\n// ─── Middleware ────────────────────────────────────────────────────────────\n\n/**\n * Create the Connect middleware that routes requests through the timber pipeline.\n *\n * For route requests (HTML pages, API endpoints), the middleware:\n * 1. Loads the RSC entry via ssrLoadModule\n * 2. Converts the Node request to a Web Request\n * 3. Passes it through the RSC handler (which runs the full pipeline)\n * 4. Converts the Web Response back to a Node response\n *\n * For non-route requests (assets, Vite internals, HMR), the middleware\n * calls next() to let Vite handle them.\n */\nfunction createTimberMiddleware(server: ViteDevServer, ctx: PluginContext) {\n const projectRoot = ctx.root;\n // Extract HMR connection options once so the error page can construct\n // a correct WebSocket URL (TIM-789).\n const hmrOptions = extractHmrOptions(server.config);\n\n return async (req: IncomingMessage, res: ServerResponse, next: () => void): Promise<void> => {\n const url = req.url;\n if (!url) {\n next();\n return;\n }\n\n // Pass through Vite-internal requests\n if (isViteInternal(url)) {\n next();\n return;\n }\n\n // Files that exist in public/ are always served by Vite's static\n // middleware, regardless of extension. Without this, extensions like\n // .ico, .txt, .xml, .html either get caught by the metadata route\n // check or aren't in ASSET_EXTENSIONS, so they fall through to the\n // app router where a dynamic segment like [artistSlug] 404s them.\n if (isPublicFile(server, url)) {\n next();\n return;\n }\n\n // Pass through static asset requests — but not metadata routes like\n // /favicon.ico that match asset extensions but are handled by timber,\n // and not registered routes like app/feed.json/route.ts whose URL ends\n // in an asset extension. Production serves these through the RSC\n // handler, so letting them fall through to Vite would 404 in dev only\n // (TIM-1038).\n if (\n isAssetRequest(url) &&\n !isMetadataRouteServePath(url) &&\n !isRouteOwnedAsset(ctx.routeTree, server, url)\n ) {\n next();\n return;\n }\n\n // Step 1: Load the RSC entry module from the RSC environment.\n // The RSC entry runs in the 'rsc' Vite environment (separate module\n // graph with react-server conditions). In dev mode, this uses the\n // environment's module runner for HMR-aware loading.\n let handler: (req: Request) => Promise<Response>;\n try {\n const rscEnv = server.environments.rsc as DevEnvironment & {\n runner?: { import: (id: string) => Promise<any> };\n };\n // Duck-type check instead of isRunnableDevEnvironment() — the vite\n // import-based check fails across pnpm link boundaries where the\n // linked package resolves a different vite module instance.\n if (!rscEnv?.runner?.import) {\n throw new Error('[timber] RSC environment is not runnable');\n }\n const rscModule = await rscEnv.runner.import(RSC_ENTRY_ID);\n handler = rscModule.default as (req: Request) => Promise<Response>;\n\n // Wire pipeline errors into the browser error overlay.\n // Set devPipelineErrorHandler directly on the pipeline config —\n // no module-level singleton. The handler receives optional RSC debug\n // component data (component names, environments, stack frames) from\n // the Flight debug channel for render errors.\n const config = rscModule.pipelineConfig as\n | {\n devPipelineErrorHandler?: (\n error: Error,\n phase: string,\n debugComponents?: Array<{\n name: string;\n env: string | null;\n stack: unknown[] | null;\n }>\n ) => void;\n devHmrOptions?: DevErrorHmrOptions;\n }\n | undefined;\n if (config) {\n config.devPipelineErrorHandler = (error, _phase, debugComponents) => {\n sendErrorToOverlay(\n server,\n error,\n classifyErrorPhase(error, projectRoot),\n projectRoot,\n debugComponents\n );\n };\n // Plumb the resolved HMR options into the RSC environment. The RSC\n // entry can't read the Vite server config (separate module graph),\n // but its dev 404 page and fallback error page need the HMR endpoint\n // (including Vite 8's required WS token) for auto-reload (TIM-1067).\n config.devHmrOptions = hmrOptions;\n }\n\n // Wire source-map handler so error pages show original positions.\n // fixErrorStacktrace rewrites the error's stack trace in-place using\n // the Vite dev server's module graph. See TIM-811.\n const setSourceMap = rscModule.setDevSourceMapHandler as\n | ((fn: (error: Error) => void) => void)\n | undefined;\n if (typeof setSourceMap === 'function') {\n setSourceMap((error: Error) => {\n fixErrorStacktrace(server, error);\n });\n }\n } catch (error) {\n // Module transform error — syntax error, missing import, etc.\n // Vite may already show its own overlay for these, but we still\n // log to stderr with frame dimming for the terminal.\n if (error instanceof Error) {\n // Add context for virtual:timber-* module errors\n addTimberContext(error);\n sendErrorToOverlay(server, error, 'module-transform', projectRoot);\n }\n respond500(res, error, 'module-transform', projectRoot, hmrOptions);\n return;\n }\n\n if (typeof handler !== 'function') {\n console.error('[timber] RSC entry module does not export a default function');\n next();\n return;\n }\n\n // Step 2: Run the pipeline.\n try {\n // Convert Node IncomingMessage → Web Request\n const webRequest = toWebRequest(req);\n\n // Check for a platform-specific request wrapper (e.g., Cloudflare\n // dev bindings). The cloudflareDevBindings() plugin stores a wrapper\n // function on the server instance using a well-known Symbol. The\n // wrapper runs the handler inside an ALS context so platform APIs\n // like getCloudflareBindings() work during dev.\n // See design/35-cloudflare-primitives.md §\"Dev Experience\".\n const wrapper = (server as any)[Symbol.for('timber:dev-request-wrapper')] as\n | (<T>(fn: () => T) => T)\n | undefined;\n\n // Run the full pipeline (wrapped if a platform dev plugin is active)\n const webResponse = wrapper\n ? await wrapper(() => handler(webRequest))\n : await handler(webRequest);\n\n // Compress the response if the client supports it.\n // In dev mode, compression is always enabled for parity with production.\n // See design/25-production-deployments.md.\n const finalResponse = compressResponse(webRequest, webResponse);\n\n // Flush headers eagerly so streaming responses (SSE, long-polling)\n // reach the client before the first body chunk. Node.js buffers\n // headers until write()/end() otherwise, which stalls EventSource\n // clients that wait for the response to open. srvx's writeHead\n // skips if headersSent is already true, so pre-flushing is safe.\n res.writeHead(finalResponse.status, [...finalResponse.headers].flat());\n res.flushHeaders();\n\n // Stream the body with backpressure and disconnect handling.\n // srvx skips its own writeHead since headers are already sent.\n await sendNodeResponse(res, finalResponse);\n } catch (error) {\n // Pipeline error — classify the phase, send to overlay, respond 500.\n // The dev server remains running for recovery on file fix + HMR.\n if (error instanceof Error) {\n // Unwrap SsrStreamError to show the real cause in the error overlay.\n // SsrStreamError wraps the original RSC render error with a generic\n // message; the developer needs to see the actual error (e.g.,\n // \"useSegmentParams is not a function\"), not the wrapper.\n const displayError =\n error.name === 'SsrStreamError' && error.cause instanceof Error ? error.cause : error;\n const phase = classifyErrorPhase(displayError, projectRoot);\n sendErrorToOverlay(server, displayError, phase, projectRoot);\n respond500(res, displayError, phase, projectRoot, hmrOptions);\n } else {\n process.stderr.write(`\\x1b[31m[timber] Dev server error:\\x1b[0m ${String(error)}\\n`);\n respond500(res, error, 'render', projectRoot, hmrOptions);\n }\n }\n };\n}\n\n/**\n * Send a 500 response without crashing the dev server.\n *\n * In dev mode, renders a styled HTML error page with source context,\n * classified stack trace, and auto-reload on HMR. Falls back to\n * text/plain if the HTML generator fails (must never crash).\n */\nfunction respond500(\n res: ServerResponse,\n error: unknown,\n phase: ErrorPhase,\n projectRoot: string,\n hmrOptions?: DevErrorHmrOptions\n): void {\n if (res.headersSent) return;\n\n // Try to render the rich HTML error page\n if (error instanceof Error) {\n try {\n const html = generateDevErrorPage(error, phase, projectRoot, hmrOptions);\n res.statusCode = 500;\n res.setHeader('content-type', 'text/html; charset=utf-8');\n res.end(html);\n return;\n } catch (e) {\n console.debug(\n '[timber] dev error page generation failed, falling back to text/plain:',\n e instanceof Error ? e.message : e\n );\n }\n }\n\n // Fallback: plain text (same as before)\n res.statusCode = 500;\n res.setHeader('content-type', 'text/plain');\n res.end(\n `[timber] Internal server error\\n\\n${error instanceof Error ? (error.stack ?? error.message) : String(error)}`\n );\n}\n\n/**\n * Add timber-specific context to an error's message if it references\n * internal virtual modules (virtual:timber-*). Mutates the error in place.\n */\nfunction addTimberContext(error: Error): void {\n const enriched = addVirtualModuleContext(error.message);\n if (enriched !== error.message) {\n error.message = enriched;\n }\n}\n\n// ─── Request/Response Conversion ──────────────────────────────────────────\n\n/**\n * Convert a Node IncomingMessage to a Web Request.\n *\n * Constructs the full URL from the Host header and request URL,\n * and forwards the method, headers, and body.\n *\n * The scheme comes from the socket's TLS state — with `server.https` the\n * browser sends `Origin: https://host`, and a hardcoded `http://` would\n * fail CSRF origin comparison on every POST. X-Forwarded-Proto is NOT\n * consulted: dev connections are direct, so the header would be\n * attacker-controlled. (TIM-1067, B32)\n *\n * Exported for tests.\n */\nexport function toWebRequest(nodeReq: IncomingMessage): Request {\n const protocol = (nodeReq.socket as TLSSocket | undefined)?.encrypted ? 'https' : 'http';\n // Under HTTP/2 there is no Host header — the authority lives in the\n // `:authority` pseudo-header.\n const host =\n nodeReq.headers.host ?? (nodeReq.headers[':authority'] as string | undefined) ?? 'localhost';\n const url = `${protocol}://${host}${nodeReq.url}`;\n\n const headers = new Headers();\n for (const [key, value] of Object.entries(nodeReq.headers)) {\n if (value === undefined) continue;\n // HTTP/2 pseudo-headers (:method, :path, :authority, :scheme) are not\n // valid Headers names — Headers.set() throws on them. They're already\n // reflected in the request URL/method above.\n if (key.startsWith(':')) continue;\n if (Array.isArray(value)) {\n for (const v of value) {\n headers.append(key, v);\n }\n } else {\n headers.set(key, value);\n }\n }\n // HTTP/2 requests carry the authority in `:authority`, not Host — but\n // downstream consumers (CSRF origin validation) read the Host header.\n if (!headers.has('host')) {\n headers.set('host', host);\n }\n\n const method = nodeReq.method ?? 'GET';\n const hasBody = method !== 'GET' && method !== 'HEAD';\n\n return new Request(url, {\n method,\n headers,\n body: hasBody ? nodeReadableToWebStream(nodeReq) : undefined,\n // @ts-expect-error — duplex is required for streaming request bodies\n duplex: hasBody ? 'half' : undefined,\n });\n}\n\n/**\n * Convert a Node Readable stream to a Web ReadableStream.\n */\nfunction nodeReadableToWebStream(nodeStream: IncomingMessage): ReadableStream<Uint8Array> {\n return new ReadableStream({\n start(controller) {\n nodeStream.on('data', (chunk: Buffer) => {\n controller.enqueue(new Uint8Array(chunk));\n });\n nodeStream.on('end', () => {\n controller.close();\n });\n nodeStream.on('error', (err) => {\n controller.error(err);\n });\n },\n });\n}\n\n// ─── URL Classification ──────────────────────────────────────────────────\n\n/**\n * Check if a URL is a Vite-internal request that should be passed through.\n */\nfunction isViteInternal(url: string): boolean {\n return VITE_INTERNAL_PREFIXES.some((prefix) => url.startsWith(prefix));\n}\n\n/**\n * Check if a URL looks like a static asset request.\n */\nfunction isAssetRequest(url: string): boolean {\n return ASSET_EXTENSIONS.test(url);\n}\n\n/**\n * Check if a URL maps to a real file in the project's public/ directory.\n * Vite serves public/ files as static assets — if a file exists there it\n * must be passed through to Vite regardless of extension.\n */\nfunction isPublicFile(server: ViteDevServer, url: string): boolean {\n const { publicDir } = server.config;\n if (!publicDir) return false;\n const pathname = url.split('?')[0];\n const relativePath = pathname.startsWith('/') ? pathname.slice(1) : pathname;\n if (!relativePath) return false;\n const fullPath = join(publicDir, relativePath);\n try {\n return statSync(fullPath).isFile();\n } catch {\n return false;\n }\n}\n\n/**\n * Check whether an asset-extension URL belongs to a scanned route rather\n * than a static file.\n *\n * Route handlers may live at paths ending in asset-like extensions\n * (app/feed.json/route.ts → /feed.json), which the asset bypass would\n * otherwise hand to Vite — 404ing in dev while working in production.\n * Uses the same canonicalization and tree walker as the runtime matcher\n * so dev classification agrees with what the pipeline would match.\n *\n * A file that actually exists on disk wins over the route match: the\n * production server serves public/ statics before the RSC handler (see\n * adapters/nitro.ts), and Vite serves root-relative source files (e.g.\n * /app/global.css) in dev. Without this, a broad catch-all route like\n * app/[...slug] would shadow every static asset. Joining the canonical\n * pathname is traversal-safe — canonicalize() resolves `..` segments and\n * rejects root escapes and encoded separators.\n *\n * Reads ctx.routeTree per request — the routing plugin rescans it on\n * file add/unlink/change, so newly created routes are picked up live.\n */\nfunction isRouteOwnedAsset(\n routeTree: RouteTree | null,\n server: ViteDevServer,\n url: string\n): boolean {\n if (!routeTree) return false;\n const rawPathname = url.split('?')[0];\n const result = canonicalize(rawPathname);\n // Malformed URLs can't match a route — let Vite handle them as before.\n if (!result.ok) return false;\n const parts = result.pathname === '/' ? [] : result.pathname.slice(1).split('/');\n if (matchUrlParts(routeTree.root, parts) === null) return false;\n\n // Real static files win over the route match (dev/prod parity: the\n // production server tries public/ before the RSC handler).\n const relativePath = result.pathname.slice(1);\n const { publicDir, root } = server.config;\n if (publicDir && existsSync(join(publicDir, relativePath))) return false;\n if (existsSync(join(root, relativePath))) return false;\n\n return true;\n}\n\n// ─── Client Error Listener ─────────────────────────────────────────────\n\ninterface ClientErrorPayload {\n message: string;\n stack: string;\n componentStack: string | null;\n}\n\n/**\n * Listen for client-side errors forwarded from the browser via HMR.\n *\n * The browser entry catches uncaught errors and unhandled rejections,\n * then sends them as 'timber:client-error' custom events. We parse\n * the first app frame for the overlay's loc field and forward the\n * error to Vite's overlay protocol.\n */\nfunction listenForClientErrors(server: ViteDevServer, projectRoot: string): void {\n server.hot.on('timber:client-error', (data: ClientErrorPayload) => {\n const loc = parseFirstAppFrame(data.stack, projectRoot);\n\n let message = data.message;\n if (data.componentStack) {\n message = `${data.message}\\n\\nComponent Stack:\\n${data.componentStack.trim()}`;\n }\n\n // Log to stderr\n const RED = '\\x1b[31m';\n const BOLD = '\\x1b[1m';\n const RESET = '\\x1b[0m';\n process.stderr.write(\n `${RED}${BOLD}[timber] Client Error${RESET}\\n${RED}${data.message}${RESET}\\n\\n`\n );\n\n // Forward to Vite's overlay\n try {\n server.hot.send({\n type: 'error',\n err: {\n message,\n stack: data.stack,\n id: loc?.file,\n plugin: 'timber (Client)',\n loc: loc ? { file: loc.file, line: loc.line, column: loc.column } : undefined,\n },\n });\n } catch (e) {\n console.debug('[timber] overlay send failed:', e instanceof Error ? e.message : e);\n }\n });\n}\n","/**\n * timber-entries — Vite sub-plugin for entry virtual module resolution.\n *\n * Resolves virtual:timber-rsc-entry, virtual:timber-ssr-entry,\n * virtual:timber-browser-entry to real TypeScript files, and generates\n * virtual:timber-config as serialized runtime config.\n *\n * Entry modules are real .ts files — NOT codegen strings. The only\n * generated code is virtual:timber-config (serialized runtime config).\n *\n * Design docs: 18-build-system.md §\"Entry Generation\", §\"Virtual Modules\"\n */\n\nimport type { Plugin } from 'vite';\nimport { resolve, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { existsSync } from 'node:fs';\nimport type { PluginContext } from '../plugin-context.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// In workspace dev, __dirname is src/plugins/ and src/ is the parent.\n// In published package, entries.ts is bundled into dist/index.js so\n// __dirname is dist/ and src/ is a sibling directory.\nconst SRC_DIR = existsSync(resolve(__dirname, '..', 'server', 'rsc-entry', 'index.ts'))\n ? resolve(__dirname, '..')\n : resolve(__dirname, '..', 'src');\n\n// ─── Virtual Module IDs ──────────────────────────────────────────────────\n\nconst VIRTUAL_IDS = {\n rscEntry: 'virtual:timber-rsc-entry',\n ssrEntry: 'virtual:timber-ssr-entry',\n browserEntry: 'virtual:timber-browser-entry',\n config: 'virtual:timber-config',\n instrumentation: 'virtual:timber-instrumentation',\n cacheHandler: 'virtual:timber-cache-handler',\n} as const;\n\n/**\n * Map from virtual module IDs to their resolved file paths.\n *\n * These point to .ts source files that Vite transpiles at runtime.\n * They import virtual modules (virtual:timber-config, etc.) so they\n * cannot be pre-compiled — they must be processed by Vite's pipeline\n * with timber's plugin active. The .ts files are included in the\n * published package via the `files` field.\n */\nconst ENTRY_FILE_MAP: Record<string, string> = {\n [VIRTUAL_IDS.rscEntry]: resolve(SRC_DIR, 'server', 'rsc-entry', 'index.ts'),\n [VIRTUAL_IDS.ssrEntry]: resolve(SRC_DIR, 'server', 'ssr-entry.ts'),\n [VIRTUAL_IDS.browserEntry]: resolve(SRC_DIR, 'client', 'browser-entry', 'index.ts'),\n};\n\n/** The \\0-prefixed resolved ID for virtual:timber-config */\nconst RESOLVED_CONFIG_ID = `\\0${VIRTUAL_IDS.config}`;\n\n/** The \\0-prefixed resolved ID for virtual:timber-instrumentation */\nconst RESOLVED_INSTRUMENTATION_ID = `\\0${VIRTUAL_IDS.instrumentation}`;\n\n/** The \\0-prefixed resolved ID for virtual:timber-cache-handler */\nconst RESOLVED_CACHE_HANDLER_ID = `\\0${VIRTUAL_IDS.cacheHandler}`;\n\n/**\n * Strip the \\0 prefix from a module ID.\n *\n * The RSC plugin generates browser entry imports using already-resolved\n * \\0-prefixed IDs. Vite's import-analysis cannot resolve these.\n * See 18-build-system.md §\"Resolution Quirks\".\n */\nfunction stripNullPrefix(id: string): string {\n return id.startsWith('\\0') ? id.slice(1) : id;\n}\n\n/**\n * Strip a root directory prefix from a module ID.\n *\n * Vite prefixes virtual module IDs with the project root when resolving\n * SSR build entries. We need to handle both `virtual:timber-rsc-entry`\n * and `<root>/virtual:timber-rsc-entry`.\n * See 18-build-system.md §\"Resolution Quirks\".\n */\nfunction stripRootPrefix(id: string, root: string): string {\n if (id.startsWith(root)) {\n // Remove root + path separator\n const stripped = id.slice(root.length);\n // Handle both /virtual:... and \\virtual:... (Windows)\n if (stripped.startsWith('/') || stripped.startsWith('\\\\')) {\n return stripped.slice(1);\n }\n return stripped;\n }\n return id;\n}\n\n/**\n * Generate the virtual:timber-config module source.\n *\n * Serializes output mode and feature flags for runtime consumption.\n */\n/**\n * Extract the JSON-serializable subset of `forms` config.\n *\n * Drops function-valued `stripSensitiveFields` with a build-time warning —\n * functions cannot cross the JSON boundary to the runtime, so users must\n * configure function predicates per-action via `createActionClient` instead.\n */\nfunction serializeFormsConfig(\n forms: { stripSensitiveFields?: unknown } | undefined\n): { stripSensitiveFields?: boolean | readonly string[] } | undefined {\n if (!forms) return undefined;\n const opt = forms.stripSensitiveFields;\n if (opt === undefined) return {};\n if (typeof opt === 'boolean') return { stripSensitiveFields: opt };\n if (Array.isArray(opt)) {\n // Coerce to a string array and drop any non-string entries.\n const names = opt.filter((v): v is string => typeof v === 'string');\n return { stripSensitiveFields: names };\n }\n if (typeof opt === 'function') {\n console.warn(\n '[timber] forms.stripSensitiveFields was set to a function in timber.config.ts — ' +\n 'this is not supported at the global level (functions cannot be serialized ' +\n 'into the runtime config). Use a per-action override via ' +\n '`createActionClient({ stripSensitiveFields: (name) => ... })` instead. ' +\n 'The built-in deny-list will be used globally.'\n );\n return {};\n }\n return {};\n}\n\nfunction generateConfigModule(ctx: PluginContext): string {\n const runtimeConfig = {\n output: ctx.config.output ?? 'server',\n csrf: ctx.config.csrf ?? true,\n allowedOrigins: ctx.config.allowedOrigins,\n clientJavascript: ctx.clientJavascript,\n dev: ctx.dev ?? false,\n slowPhaseMs: ctx.config.dev?.slowPhaseMs ?? 200,\n slowRequestMs: ctx.config.slowRequestMs ?? 3000,\n topLoader: ctx.config.topLoader,\n debug: ctx.config.debug ?? false,\n serverTiming: ctx.config.serverTiming,\n renderTimeoutMs: ctx.config.renderTimeoutMs ?? 30_000,\n // Auto-generated sitemap config — opt-in via timber.config.ts.\n // See design/16-metadata.md §\"Auto-generated Sitemap\"\n sitemap: ctx.config.sitemap,\n // Forms config — only the serializable subset. `stripSensitiveFields`\n // accepts boolean | string[] at the global level. Functions must be\n // configured per-action via `createActionClient({ stripSensitiveFields })`\n // because JSON.stringify would silently drop them here. See TIM-816.\n forms: serializeFormsConfig(ctx.config.forms),\n // Per-build deployment ID for version skew detection (TIM-446).\n // Null in dev mode — HMR handles code updates without full reloads.\n deploymentId: ctx.deploymentId ?? null,\n clientSegmentCache: ctx.config.clientSegmentCache ?? false,\n // Browser log forwarding threshold — used by buildClientScripts to\n // decide whether /@vite/client is needed when clientJavascript is\n // disabled. See TIM-1152.\n devBrowserLogs: ctx.config.devBrowserLogs,\n // Note: project root is NOT included here — it was leaking server\n // filesystem paths to client bundles (TIM-787). Dev error pages get\n // the root through the dev server, not the runtime config.\n };\n\n return [\n '// Auto-generated runtime config — do not edit.',\n '// Generated by timber-entries plugin.',\n '',\n `const config = ${JSON.stringify(runtimeConfig, null, 2)};`,\n '',\n 'export default config;',\n ].join('\\n');\n}\n\n/**\n * Detect a user convention file at both root and src/.\n *\n * Root takes precedence over src/, extension priority: .ts > .js > .mjs.\n * Used for instrumentation.ts, timber.cache.ts, and similar file conventions.\n */\nexport function detectConventionFile(root: string, basename: string): string | null {\n const extensions = ['.ts', '.js', '.mjs'];\n const dirs = [root, resolve(root, 'src')];\n for (const dir of dirs) {\n for (const ext of extensions) {\n const candidate = resolve(dir, `${basename}${ext}`);\n if (existsSync(candidate)) return candidate;\n }\n }\n return null;\n}\n\nexport function detectInstrumentationFile(root: string): string | null {\n return detectConventionFile(root, 'instrumentation');\n}\n\n/**\n * Detect the user's timber.cache file.\n *\n * This file holds runtime cache instances (cacheHandler, cdnPurge)\n * that cannot be JSON-serialized. Separating them from timber.config.ts\n * prevents the RSC build from pulling build-time deps (adapters, MDX,\n * rollup) into the runtime bundle. See TIM-1211.\n */\nexport function detectCacheFile(root: string): string | null {\n return detectConventionFile(root, 'timber.cache');\n}\n\n/**\n * Generate the virtual:timber-instrumentation module source.\n *\n * When the user's instrumentation.ts exists, generates a module that\n * dynamically imports it. When it doesn't exist, generates a module\n * that returns null. The RSC entry calls this loader at startup time.\n *\n * See design/17-logging.md §\"instrumentation.ts — The Entry Point\"\n */\nexport function generateInstrumentationModule(instrumentationPath: string | null): string {\n if (instrumentationPath) {\n return [\n '// Auto-generated instrumentation loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '',\n `export default async function loadUserInstrumentation() {`,\n ` return import(${JSON.stringify(instrumentationPath)});`,\n `}`,\n ].join('\\n');\n }\n\n return [\n '// Auto-generated instrumentation loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '// No instrumentation.ts found at project root.',\n '',\n `export default async function loadUserInstrumentation() {`,\n ` return null;`,\n `}`,\n ].join('\\n');\n}\n\n/**\n * Generate the virtual:timber-cache-handler module source.\n *\n * When the user's timber.cache.ts exists, generates a module that\n * dynamically imports it and extracts cacheHandler and cdnPurge.\n * These are class instances (e.g. RedisCacheHandler) that cannot be\n * JSON-serialized into virtual:timber-config, so they must be loaded\n * at runtime via dynamic import.\n *\n * timber.cache.ts exports: default cacheHandler, named cdnPurge.\n *\n * See TIM-1211, TIM-599.\n */\nexport function generateCacheHandlerModule(cachePath: string | null): string {\n if (cachePath) {\n return [\n '// Auto-generated cache handler loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '',\n `export default async function loadCacheHandler() {`,\n ` const mod = await import(${JSON.stringify(cachePath)});`,\n ` return mod.default ?? null;`,\n `}`,\n '',\n `export async function loadCdnPurgeHandler() {`,\n ` const mod = await import(${JSON.stringify(cachePath)});`,\n ` return mod.cdnPurge ?? null;`,\n `}`,\n ].join('\\n');\n }\n\n return [\n '// Auto-generated cache handler loader — do not edit.',\n '// Generated by timber-entries plugin.',\n '// No timber.cache.ts found.',\n '',\n `export default async function loadCacheHandler() {`,\n ` return null;`,\n `}`,\n '',\n `export async function loadCdnPurgeHandler() {`,\n ` return null;`,\n `}`,\n ].join('\\n');\n}\n\n/**\n * Create the timber-entries Vite plugin.\n *\n * Hooks: resolveId, load\n */\nexport function timberEntries(ctx: PluginContext): Plugin {\n return {\n name: 'timber-entries',\n\n /**\n * Resolve virtual entry and config module IDs.\n *\n * Handles:\n * - virtual:timber-rsc-entry → real file path\n * - virtual:timber-ssr-entry → real file path\n * - virtual:timber-browser-entry → real file path\n * - virtual:timber-config → \\0-prefixed virtual ID\n * - \\0 prefix stripping (RSC plugin re-imports)\n * - Root prefix stripping (SSR build entries)\n */\n resolveId(id: string) {\n // Step 1: Strip \\0 prefix if present\n let cleanId = stripNullPrefix(id);\n\n // Step 2: Strip root prefix if present\n cleanId = stripRootPrefix(cleanId, ctx.root);\n\n // Check entry file map (real files)\n if (cleanId in ENTRY_FILE_MAP) {\n return ENTRY_FILE_MAP[cleanId];\n }\n\n // Check config virtual module\n if (cleanId === VIRTUAL_IDS.config) {\n return RESOLVED_CONFIG_ID;\n }\n\n // Check instrumentation virtual module\n if (cleanId === VIRTUAL_IDS.instrumentation) {\n return RESOLVED_INSTRUMENTATION_ID;\n }\n\n // Check cache handler virtual module\n if (cleanId === VIRTUAL_IDS.cacheHandler) {\n return RESOLVED_CACHE_HANDLER_ID;\n }\n\n return null;\n },\n\n /**\n * Load virtual modules: virtual:timber-config and virtual:timber-instrumentation.\n *\n * Entry files (rsc/ssr/browser) are real TypeScript files that Vite\n * processes normally. Only config and instrumentation need generated code.\n */\n load(id: string) {\n if (id === RESOLVED_CONFIG_ID) {\n return generateConfigModule(ctx);\n }\n if (id === RESOLVED_INSTRUMENTATION_ID) {\n const instrumentationPath = detectInstrumentationFile(ctx.root);\n return generateInstrumentationModule(instrumentationPath);\n }\n if (id === RESOLVED_CACHE_HANDLER_ID) {\n const cachePath = detectCacheFile(ctx.root);\n return generateCacheHandlerModule(cachePath);\n }\n return null;\n },\n\n /**\n * Rename \"rsc-entry\" chunks in the client build to \"rsc-client-entry\".\n *\n * The RSC plugin creates client reference facades named after the RSC\n * entry (virtual:timber-rsc-entry), producing chunks like \"rsc-entry-XYZ.js\"\n * in the client output. This is confusing since those chunks contain client\n * components, not server code. Renaming clarifies their purpose.\n */\n // Note: chunk renaming (rsc-entry → rsc-client-entry) was previously done\n // in generateBundle by mutating the bundle object. Rolldown does not support\n // bundle mutation in generateBundle — assignments are silently ignored, which\n // causes the renamed file to never be emitted while code references are\n // updated, breaking client hydration. The rename is purely cosmetic and has\n // been removed. The chunks keep their original \"rsc-entry\" names.\n };\n}\n","/**\n * timber-mdx — Vite sub-plugin for MDX page rendering.\n *\n * Wires @mdx-js/rollup into the Vite pipeline when MDX is activated.\n * MDX is activated when pageExtensions includes 'mdx' or 'md', or\n * when a content/ directory exists at the project root.\n *\n * Design doc: 20-content-collections.md §\"The timber-mdx Plugin\"\n */\n\nimport type { Plugin } from 'vite';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createRequire } from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport type { PluginContext } from '../plugin-context.js';\n\nconst MDX_EXTENSIONS = ['mdx', 'md'];\n\n/**\n * Check if mdx-components.tsx (or .ts, .jsx, .js) exists at the project root\n * or in src/. Root takes precedence, matching Next.js behavior.\n * Returns the absolute path if found, otherwise undefined.\n */\nexport function findMdxComponents(root: string): string | undefined {\n const candidates = [\n 'mdx-components.tsx',\n 'mdx-components.ts',\n 'mdx-components.jsx',\n 'mdx-components.js',\n ];\n const dirs = [root, join(root, 'src')];\n for (const dir of dirs) {\n for (const name of candidates) {\n const p = join(dir, name);\n if (existsSync(p)) return p;\n }\n }\n return undefined;\n}\n\n/**\n * Determine if MDX should be activated based on config and project structure.\n */\nfunction shouldActivate(ctx: PluginContext): boolean {\n const exts = ctx.config.pageExtensions;\n if (exts && exts.some((ext) => MDX_EXTENSIONS.includes(ext))) {\n return true;\n }\n\n if (existsSync(join(ctx.root, 'content'))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Try to dynamically import a module by name, resolving from the user's\n * project root rather than from `@timber-js/app`'s own location.\n *\n * Why this matters: pnpm only hoists declared (peer) dependencies into a\n * package's resolution scope. The MDX integration's optional companions\n * — `remark-frontmatter`, `remark-mdx-frontmatter`, `@mdx-js/rollup` — are\n * installed as direct deps of the consumer (e.g. `packages/website`), not\n * `@timber-js/app`. A bare `import('remark-frontmatter')` from inside this\n * file resolves against `packages/timber-app/node_modules` and silently\n * fails with `ERR_MODULE_NOT_FOUND`, which made `tryImport` return\n * `undefined` and skipped frontmatter parsing entirely — leaving MDX to\n * choke on YAML as JS expressions (TIM-840).\n *\n * Resolving relative to `projectRoot` (via `createRequire`) makes the\n * lookup walk the consumer's `node_modules` tree first, which is where\n * pnpm puts the user's deps.\n *\n * Returns the default export, the module itself, or undefined if the\n * module is not installed.\n */\nasync function tryImport(name: string, projectRoot: string): Promise<unknown | undefined> {\n try {\n // Anchor resolution at the consumer's package.json so we walk their\n // node_modules tree, not @timber-js/app's. createRequire().resolve()\n // returns an absolute file path that ESM dynamic import accepts when\n // wrapped as a file:// URL.\n const require = createRequire(join(projectRoot, 'package.json'));\n const resolved = require.resolve(name);\n const mod = await import(pathToFileURL(resolved).href);\n return mod.default ?? mod;\n } catch {\n // Fall back to a bare import — covers the rare case where the package\n // lives next to @timber-js/app (e.g. monorepo with hoisted deps).\n try {\n const mod = await import(name);\n return mod.default ?? mod;\n } catch (e) {\n console.debug(\n `[timber] optional MDX dependency '${name}' not available:`,\n e instanceof Error ? e.message : e\n );\n return undefined;\n }\n }\n}\n\n/**\n * Create the timber-mdx Vite plugin.\n *\n * Uses the transform and resolveId hooks to delegate MDX compilation\n * to @mdx-js/rollup. The inner plugin is loaded lazily on first activation.\n *\n * Hooks: buildStart (loads @mdx-js/rollup), resolveId, load, transform\n */\nexport function timberMdx(ctx: PluginContext): Plugin {\n let innerPlugin: Plugin | null = null;\n\n async function activate(): Promise<void> {\n if (innerPlugin !== null || !shouldActivate(ctx)) return;\n\n const createMdxPlugin = (await tryImport('@mdx-js/rollup', ctx.root)) as\n | ((options?: Record<string, unknown>) => Plugin)\n | undefined;\n\n if (!createMdxPlugin) {\n throw new Error(\n [\n '[timber] MDX is enabled but @mdx-js/rollup is not installed.',\n '',\n 'Install it:',\n ' pnpm add -D @mdx-js/rollup remark-frontmatter remark-mdx-frontmatter',\n '',\n 'MDX is activated because pageExtensions includes \"mdx\"/\"md\" or a content/ directory exists.',\n ].join('\\n')\n );\n }\n\n const mdxConfig = ctx.config.mdx ?? {};\n\n // Auto-register frontmatter plugins. Resolve from the consumer's root\n // so pnpm finds packages declared in the user's package.json (TIM-840).\n const remarkPlugins: unknown[] = [];\n const remarkFrontmatter = await tryImport('remark-frontmatter', ctx.root);\n const remarkMdxFrontmatter = await tryImport('remark-mdx-frontmatter', ctx.root);\n if (remarkFrontmatter) remarkPlugins.push(remarkFrontmatter);\n if (remarkMdxFrontmatter) remarkPlugins.push(remarkMdxFrontmatter);\n\n if (mdxConfig.remarkPlugins) {\n remarkPlugins.push(...mdxConfig.remarkPlugins);\n }\n\n const mdxOptions: Record<string, unknown> = {\n remarkPlugins,\n rehypePlugins: mdxConfig.rehypePlugins ?? [],\n recmaPlugins: mdxConfig.recmaPlugins ?? [],\n remarkRehypeOptions: mdxConfig.remarkRehypeOptions,\n };\n\n const mdxComponentsPath = findMdxComponents(ctx.root);\n if (mdxComponentsPath) {\n mdxOptions.providerImportSource = mdxComponentsPath;\n }\n\n innerPlugin = createMdxPlugin(mdxOptions);\n }\n\n return {\n name: 'timber-mdx',\n // Must run before @vitejs/plugin-rsc (rsc:use-client) which tries to parse\n // all files as JS. MDX files must be compiled to JS first.\n enforce: 'pre',\n\n async buildStart(options) {\n ctx.timer.start('mdx-activate');\n await activate();\n ctx.timer.end('mdx-activate');\n if (!innerPlugin) return;\n if (typeof innerPlugin.buildStart === 'function') {\n await (innerPlugin.buildStart as (options: unknown) => void | Promise<void>).call(\n this,\n options\n );\n }\n },\n\n async resolveId(source, importer, options) {\n if (!innerPlugin) return null;\n // MDX pages are server components — only compile in the RSC environment.\n // This prevents server-only deps (e.g. bright via mdx-components) from\n // being pulled into SSR or client bundles.\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.resolveId === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.resolveId as any).call(this, source, importer, options);\n }\n return null;\n },\n\n async load(id) {\n if (!innerPlugin) return null;\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.load === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.load as any).call(this, id);\n }\n return null;\n },\n\n async transform(code, id) {\n if (!innerPlugin) return null;\n const envName = (this as unknown as { environment?: { name?: string } }).environment?.name;\n if (envName && envName !== 'rsc') return null;\n if (typeof innerPlugin.transform === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (innerPlugin.transform as any).call(this, code, id);\n }\n return null;\n },\n };\n}\n","/**\n * $segment type generation and directory-to-route mapping.\n *\n * Generates per-route $segment.d.ts files in .timber/types/ that mirror\n * the app/ directory structure. TypeScript's rootDirs feature makes these\n * importable as './$segment' from route files.\n *\n * Design doc: design/41-global-params.md §The $segment Module\n */\n\nimport { writeFile, mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { RouteTree, SegmentNode } from './types.js';\n\n/** Info carried per directory for type generation. */\nexport interface SegmentInfo {\n /** The URL route pattern (groups and slots stripped). e.g. '/[artistSlug]/[year]' */\n route: string;\n /** The full tree path including groups and slots — uniquely identifies a segment.\n * e.g. '/(browse)/[artistSlug]/@shows/[year]' */\n segmentPath: string;\n}\n\n/**\n * Build a map of absolute filesystem directory → segment info.\n * Used by resolveId to map a $segment import's importer to the correct route,\n * and by writeSegmentTypes to generate per-route $segment.d.ts files.\n *\n * Walks every segment (not just leaves) so layouts and middleware\n * at any depth can import $segment.\n */\nexport function buildDirToRouteMap(tree: RouteTree, appDir: string): Map<string, SegmentInfo> {\n const map = new Map<string, SegmentInfo>();\n\n function walk(node: SegmentNode, fsPath: string, treePath: string): void {\n map.set(fsPath, {\n route: node.urlPath || '/',\n segmentPath: treePath || '/',\n });\n\n for (const child of node.children) {\n const childDir = join(fsPath, child.segmentName);\n const childTreePath = `${treePath}/${child.segmentName}`;\n walk(child, childDir, childTreePath);\n }\n for (const [slotName, slotNode] of Object.entries(node.slots)) {\n const slotDir = join(fsPath, `@${slotName}`);\n const slotTreePath = `${treePath}/@${slotName}`;\n walk(slotNode, slotDir, slotTreePath);\n }\n }\n\n walk(tree.root, appDir, '');\n return map;\n}\n\n/**\n * Generate the full $segment.d.ts content for a segment.\n */\nexport function generateSegmentDts(info: SegmentInfo): string {\n return [\n `export const ROUTE: '${info.route}';`,\n `export const SEGMENT_PATH: '${info.segmentPath}';`,\n '',\n ].join('\\n');\n}\n\n/**\n * Generate per-route $segment.d.ts files in .timber/types/ mirroring\n * the app/ directory structure. These files are importable via TypeScript's\n * rootDirs feature.\n */\nexport async function writeSegmentTypes(\n routeTree: RouteTree,\n appDir: string,\n root: string\n): Promise<void> {\n // Compute the relative prefix from project root to appDir.\n // e.g. if appDir is /project/src/app, relative is 'src/app'\n const relative = appDir.slice(root.length + 1);\n const typesBase = join(root, '.timber', 'types', relative);\n const map = buildDirToRouteMap(routeTree, appDir);\n\n const writes: Promise<void>[] = [];\n for (const [fsDir, info] of map) {\n // Mirror the app/ structure under .timber/types/\n const relDir = fsDir.slice(appDir.length); // e.g. '/[artistSlug]/[year]'\n const segmentDir = join(typesBase, relDir);\n const segmentFile = join(segmentDir, '$segment.d.ts');\n const content = generateSegmentDts(info);\n\n writes.push(\n mkdir(segmentDir, { recursive: true }).then(() => writeFile(segmentFile, content, 'utf-8'))\n );\n }\n\n await Promise.all(writes);\n}\n","/**\n * Route manifest codegen — generates virtual module source for the route\n * manifest, search-params registry, and global schema.\n *\n * Extracted from plugins/routing.ts to keep it under the 500-line budget.\n * See design/18-build-system.md §\"Virtual Modules\".\n *\n * Task: TIM-1071 item 8\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { collectInterceptionRewrites } from './interception.js';\nimport { fileHasExport } from './export-detect.js';\nimport type { RouteTree, SegmentNode, RouteFile } from './types.js';\n\n// ── Single-file conventions ─────────────────────────────────────────────\n// Each entry maps to a node property that holds a single RouteFile.\n// Order matches the original serializeNode output for byte-identical diffs.\nconst SINGLE_FILE_KEYS = [\n 'page',\n 'layout',\n 'middleware',\n 'access',\n 'route',\n 'error',\n 'default',\n 'denied',\n 'params',\n] as const;\n\n// ── Record-shaped conventions ───────────────────────────────────────────\n// Each entry maps to a node property that holds Record<string, RouteFile>.\nconst RECORD_FILE_KEYS = [\n 'statusFiles',\n 'jsonStatusFiles',\n 'legacyStatusFiles',\n 'metadataRoutes',\n] as const;\n\nconst SCHEMA_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];\n\n// ── Manifest generation ─────────────────────────────────────────────────\n\n/**\n * Generate the virtual module source for the route manifest.\n *\n * The output is a default-exported object containing the serialized route tree.\n * All file references use absolute paths (required for virtual modules).\n */\nexport function generateManifestModule(tree: RouteTree, viteRoot: string): string {\n const imports: string[] = [];\n let importIndex = 0;\n\n function addImport(file: RouteFile): string {\n const varName = `_route${importIndex++}`;\n imports.push(`const ${varName} = () => import(\"${file.filePath}\");`);\n return varName;\n }\n\n function serializeRouteFile(key: string, file: RouteFile, indent: string): string {\n const v = addImport(file);\n return `${indent}${key}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} },`;\n }\n\n function serializeRouteFileRecord(\n key: string,\n record: Record<string, RouteFile>,\n indent: string\n ): string | null {\n const entries = Object.entries(record);\n if (entries.length === 0) return null;\n const inner = entries.map(([name, file]) => {\n const v = addImport(file);\n return `${indent} ${JSON.stringify(name)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`;\n });\n return `${indent}${key}: {\\n${inner.join(',\\n')}\\n${indent}},`;\n }\n\n function serializeNode(node: SegmentNode, indent: string): string {\n const nextIndent = indent + ' ';\n const parts: string[] = [];\n\n parts.push(`${nextIndent}segmentName: ${JSON.stringify(node.segmentName)},`);\n parts.push(`${nextIndent}segmentType: ${JSON.stringify(node.segmentType)},`);\n parts.push(`${nextIndent}urlPath: ${JSON.stringify(node.urlPath)},`);\n\n if (node.paramName) {\n parts.push(`${nextIndent}paramName: ${JSON.stringify(node.paramName)},`);\n }\n if (node.paramPrefix) {\n parts.push(`${nextIndent}paramPrefix: ${JSON.stringify(node.paramPrefix)},`);\n }\n if (node.paramSuffix) {\n parts.push(`${nextIndent}paramSuffix: ${JSON.stringify(node.paramSuffix)},`);\n }\n\n if (node.interceptionMarker) {\n parts.push(`${nextIndent}interceptionMarker: ${JSON.stringify(node.interceptionMarker)},`);\n }\n if (node.interceptedSegmentName) {\n parts.push(\n `${nextIndent}interceptedSegmentName: ${JSON.stringify(node.interceptedSegmentName)},`\n );\n }\n\n // Single-file conventions — table-driven to avoid copy-paste drift\n for (const key of SINGLE_FILE_KEYS) {\n const file = node[key];\n if (file) {\n parts.push(serializeRouteFile(key, file, nextIndent));\n }\n }\n\n // searchParams is now a named export from page.tsx, not a separate file.\n // The page module's searchParams export is loaded via the page's lazy import.\n // Runtime registration happens in the route loader using the page module.\n\n // Record-shaped conventions — table-driven\n for (const key of RECORD_FILE_KEYS) {\n const record = node[key];\n if (record) {\n const line = serializeRouteFileRecord(key, record, nextIndent);\n if (line) parts.push(line);\n }\n }\n\n // Children\n if (node.children.length > 0) {\n const childNodes = node.children.map((c) => serializeNode(c, nextIndent));\n parts.push(`${nextIndent}children: [\\n${childNodes.join(',\\n')}\\n${nextIndent}],`);\n } else {\n parts.push(`${nextIndent}children: [],`);\n }\n\n // Parallel slots\n const slotKeys = Object.keys(node.slots);\n if (slotKeys.length > 0) {\n const slotEntries: string[] = [];\n for (const slotName of slotKeys) {\n const slotNode = node.slots[slotName]!;\n slotEntries.push(\n `${nextIndent} ${JSON.stringify(slotName)}: ${serializeNode(slotNode, nextIndent + ' ')}`\n );\n }\n parts.push(`${nextIndent}slots: {\\n${slotEntries.join(',\\n')}\\n${nextIndent}},`);\n } else {\n parts.push(`${nextIndent}slots: {},`);\n }\n\n return `${indent}{\\n${parts.join('\\n')}\\n${indent}}`;\n }\n\n const rootSerialized = serializeNode(tree.root, ' ');\n\n let proxyLine = '';\n if (tree.proxy) {\n const v = addImport(tree.proxy);\n proxyLine = ` proxy: { load: ${v}, filePath: ${JSON.stringify(tree.proxy.filePath)} },`;\n }\n\n let globalErrorLine = '';\n if (tree.globalError) {\n const v = addImport(tree.globalError);\n globalErrorLine = ` globalError: { load: ${v}, filePath: ${JSON.stringify(tree.globalError.filePath)} },`;\n }\n\n const rewrites = collectInterceptionRewrites(tree.root);\n const rewritesLine =\n rewrites.length > 0\n ? ` interceptionRewrites: ${JSON.stringify(rewrites.map((r) => ({ interceptedPattern: r.interceptedPattern, interceptingPrefix: r.interceptingPrefix })))},`\n : '';\n\n const code = [\n '// Auto-generated route manifest — do not edit.',\n '// Generated by timber-routing plugin.',\n '',\n ...imports,\n '',\n 'const manifest = {',\n ` viteRoot: ${JSON.stringify(viteRoot)},`,\n proxyLine,\n globalErrorLine,\n rewritesLine,\n ` root: ${rootSerialized},`,\n '};',\n '',\n 'export default manifest;',\n ]\n .filter((line) => line !== undefined && line !== '')\n .join('\\n');\n\n return code;\n}\n\n// ── Search-params registry ──────────────────────────────────────────────\n\n/**\n * Walk the route tree and collect every page that exports a\n * `searchParams` definition, then emit a module that statically imports\n * each export and registers it into the shared search-params registry.\n */\nexport function generateSearchParamsRegistryModule(tree: RouteTree): string {\n const entries: Array<{ urlPath: string; filePath: string }> = [];\n\n function walk(node: SegmentNode): void {\n if (node.page) {\n if (node.params && fileHasSearchParamsExport(node.params.filePath)) {\n entries.push({ urlPath: node.urlPath, filePath: node.params.filePath });\n } else if (fileHasSearchParamsExport(node.page.filePath)) {\n entries.push({ urlPath: node.urlPath, filePath: node.page.filePath });\n }\n }\n for (const child of node.children) walk(child);\n for (const slot of Object.values(node.slots)) walk(slot);\n }\n walk(tree.root);\n\n entries.sort((a, b) => a.urlPath.localeCompare(b.urlPath));\n\n const lines: string[] = [];\n lines.push('// Auto-generated search-params registry — do not edit.');\n lines.push('// Generated by timber-routing plugin (TIM-830).');\n lines.push('');\n lines.push(\"import { registerSearchParams } from '@timber-js/app/search-params';\");\n lines.push('');\n\n entries.forEach((entry, i) => {\n lines.push(`import { searchParams as r${i} } from ${JSON.stringify(entry.filePath)};`);\n });\n lines.push('');\n\n entries.forEach((entry, i) => {\n lines.push(`registerSearchParams(${JSON.stringify(entry.urlPath)}, r${i});`);\n });\n lines.push('');\n\n lines.push('export {};');\n lines.push('');\n\n return lines.join('\\n');\n}\n\nfunction fileHasSearchParamsExport(filePath: string): boolean {\n return fileHasExport(filePath, 'searchParams');\n}\n\n// ── Schema module ───────────────────────────────────────────────────────\n\n/**\n * Generate the virtual:timber-schema module.\n *\n * When app/schema.{ts,tsx,js,jsx} exists, generates a module that\n * imports the schema and resolves its segmentParams codecs into a\n * bare-name codec map for runtime coercion.\n */\nexport function generateSchemaModule(appDir: string): string {\n let schemaPath: string | null = null;\n for (const ext of SCHEMA_EXTENSIONS) {\n const candidate = join(appDir, `schema${ext}`);\n if (existsSync(candidate)) {\n schemaPath = candidate;\n break;\n }\n }\n\n if (!schemaPath) {\n return [\n '// Auto-generated schema loader — no app/schema.ts found.',\n 'export default null;',\n ].join('\\n');\n }\n\n return [\n '// Auto-generated schema loader — do not edit.',\n '// Generated by timber-routing plugin (TIM-931).',\n '',\n `import schema from ${JSON.stringify(schemaPath)};`,\n `import { resolveSchemaCodecs } from '@timber-js/app/params';`,\n '',\n 'const globalCodecs = schema?.segmentParams',\n ' ? resolveSchemaCodecs(schema.segmentParams)',\n ' : null;',\n '',\n 'export default globalCodecs;',\n ].join('\\n');\n}\n","/**\n * Convention linter — validates common misconfigurations in the route tree.\n *\n * Runs at scan time (build and dev startup). Each check produces a warning\n * with the file path, what's wrong, and what to do about it.\n *\n * These are warnings, not errors — they don't block the build. The goal is\n * to catch issues that would otherwise produce cryptic runtime behavior\n * (silent 404s, empty pages, confusing React errors).\n *\n * Design doc: 07-routing.md, 10-error-handling.md\n */\n\nimport { existsSync } from 'node:fs';\nimport type { RouteTree, SegmentNode } from './types.js';\nimport { swallow } from '../server/logger.js';\nimport {\n fileHasAnyExport,\n fileHasDefaultExport,\n fileHasDirective,\n fileHasStarExport,\n} from './export-detect.js';\n\n// ─── Types ──────────────────────────────────────────────────────────────────\n\nexport interface ConventionWarning {\n /** Warning ID for deduplication and filtering. */\n id: string;\n /** Human-readable single-line summary. */\n summary: string;\n /** Multi-line details with file path and fix suggestion. */\n details: string;\n /** Severity: 'warn' for potential issues, 'error' for definite misconfigurations. */\n level: 'warn' | 'error';\n}\n\n// ─── Lint Rules ─────────────────────────────────────────────────────────────\n\n/**\n * Run all convention lint checks on a route tree.\n *\n * Returns an array of warnings. Empty array means everything looks good.\n */\nexport function lintConventions(tree: RouteTree, appDir: string): ConventionWarning[] {\n const warnings: ConventionWarning[] = [];\n\n // Check 1: app/ directory exists (caller should check before scanning,\n // but we validate the root has at least one routable file)\n checkEmptyApp(tree.root, appDir, warnings);\n\n // Check 2: route.ts without recognized HTTP method exports\n checkRouteExports(tree.root, warnings);\n\n // Check 3: Segments with layout but no page/route anywhere in subtree\n // (not a misconfiguration per se — layouts without pages are valid for\n // route groups. Skip this check.)\n\n // Check 4: Root segment has no layout.tsx (no HTML shell)\n checkRootLayout(tree.root, warnings);\n\n // Check 5: page.tsx / layout.tsx without default export\n checkDefaultExports(tree.root, warnings);\n\n // Check 6: error.tsx / global-error.tsx without 'use client' directive\n checkErrorDirectives(tree.root, warnings);\n if (tree.globalError && isScriptExtension(tree.globalError.extension)) {\n checkFileUseClientDirective(tree.globalError.filePath, 'global-error', warnings);\n }\n\n return warnings;\n}\n\n// ─── Check: Empty App ───────────────────────────────────────────────────────\n\n/**\n * Warn when the app/ directory has no routable files at all.\n *\n * This catches the \"I created app/ but didn't add any pages\" case where\n * every request silently 404s with no guidance.\n */\nfunction checkEmptyApp(root: SegmentNode, appDir: string, warnings: ConventionWarning[]): void {\n if (hasAnyRoutable(root)) return;\n\n warnings.push({\n id: 'EMPTY_APP',\n summary: 'No pages or route handlers found in app/',\n details:\n ` Directory: ${appDir}\\n\\n` +\n ' Your app/ directory has no page.tsx or route.ts files.\\n' +\n ' Every request will return 404.\\n\\n' +\n ' To fix: Create app/page.tsx with a default export:\\n\\n' +\n ' export default function Home() {\\n return <h1>Hello</h1>;\\n }\\n',\n level: 'warn',\n });\n}\n\n/**\n * Check if a segment tree has any routable files (page or route) anywhere.\n */\nfunction hasAnyRoutable(node: SegmentNode): boolean {\n if (node.page || node.route) return true;\n for (const child of node.children) {\n if (hasAnyRoutable(child)) return true;\n }\n for (const slot of Object.values(node.slots)) {\n if (hasAnyRoutable(slot)) return true;\n }\n return false;\n}\n\n/**\n * Check if a segment tree has any page files (not just route handlers).\n * Used by checkRootLayout to avoid false positives for API-only apps (TIM-794).\n * API-only apps (just route.ts handlers) don't need a root layout.\n */\nfunction hasAnyPage(node: SegmentNode): boolean {\n if (node.page) return true;\n for (const child of node.children) {\n if (hasAnyPage(child)) return true;\n }\n for (const slot of Object.values(node.slots)) {\n if (hasAnyPage(slot)) return true;\n }\n return false;\n}\n\n// ─── Check: Route Exports ───────────────────────────────────────────────────\n\n/** HTTP methods that route.ts can export. */\nconst HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as const;\n\n/**\n * Warn when a route.ts file doesn't appear to export any recognized HTTP methods.\n *\n * Uses AST-based detection via parseAst for precise matching.\n * Falls back silently when the file can't be parsed (syntax errors produce\n * no spurious warning — the TS compiler will catch those).\n */\nfunction checkRouteExports(node: SegmentNode, warnings: ConventionWarning[]): void {\n if (node.route) {\n const filePath = node.route.filePath;\n try {\n const methods = fileHasAnyExport(filePath, HTTP_METHODS);\n if (methods.size === 0 && !fileHasStarExport(filePath)) {\n const hasDefault = fileHasDefaultExport(filePath);\n const hint = hasDefault\n ? ' It looks like you have a default export. route.ts uses named exports\\n' +\n ' for HTTP methods (GET, POST, etc.), not a default export.\\n'\n : '';\n\n warnings.push({\n id: 'ROUTE_NO_METHODS',\n summary: `route.ts has no HTTP method exports: ${filePath}`,\n details:\n ` File: ${filePath}\\n\\n` +\n ' route.ts files must export named HTTP method handlers.\\n' +\n ' Without them, the route matches but returns 405 Method Not Allowed.\\n\\n' +\n hint +\n ' Example:\\n\\n' +\n ' export function GET(ctx: RouteContext) {\\n' +\n \" return Response.json({ hello: 'world' });\\n\" +\n ' }\\n',\n level: 'warn',\n });\n }\n } catch (err) {\n swallow(err, `convention-lint: unreadable route.ts ${filePath}`);\n }\n }\n\n // Recurse\n for (const child of node.children) {\n checkRouteExports(child, warnings);\n }\n for (const slot of Object.values(node.slots)) {\n checkRouteExports(slot, warnings);\n }\n}\n\n// ─── Check: Root Layout ─────────────────────────────────────────────────────\n\n/**\n * Warn when the root segment has no layout.tsx.\n *\n * Without a root layout, there's no HTML shell (<html>, <body>).\n * The page will render but may have hydration issues or no proper document structure.\n */\nfunction checkRootLayout(root: SegmentNode, warnings: ConventionWarning[]): void {\n if (root.layout) return;\n\n // Only warn if there are pages — API-only apps (just route.ts handlers)\n // don't need a root layout (TIM-794).\n if (!hasAnyPage(root)) return;\n\n warnings.push({\n id: 'NO_ROOT_LAYOUT',\n summary: 'No root layout.tsx found',\n details:\n ' Your app has pages but no root layout.\\n' +\n ' Without app/layout.tsx, pages have no <html> or <body> wrapper.\\n\\n' +\n ' To fix: Create app/layout.tsx:\\n\\n' +\n ' export default function RootLayout({ children }: { children: React.ReactNode }) {\\n' +\n ' return (\\n' +\n ' <html lang=\"en\">\\n' +\n ' <body>{children}</body>\\n' +\n ' </html>\\n' +\n ' );\\n' +\n ' }\\n',\n level: 'warn',\n });\n}\n\n// ─── Check: Default Exports ───────────────────────────────────────────\n\n/**\n * Warn when page.tsx or layout.tsx files don't have a default export.\n *\n * Without a default export:\n * - page.tsx: the page renders nothing (empty content)\n * - layout.tsx: the layout module loads but has no component to render\n *\n * Uses AST-based detection via parseAst for precise matching. Falls back\n * silently when the file can't be parsed (no spurious warning on syntax errors).\n */\nfunction checkDefaultExports(node: SegmentNode, warnings: ConventionWarning[]): void {\n // Check page files (tsx/ts/jsx/js only — not mdx, which is default-exported by the mdx compiler)\n if (node.page && isScriptExtension(node.page.extension)) {\n checkFileDefaultExport(node.page.filePath, 'page', warnings);\n }\n\n // Check layout files\n if (node.layout && isScriptExtension(node.layout.extension)) {\n checkFileDefaultExport(node.layout.filePath, 'layout', warnings);\n }\n\n // Recurse\n for (const child of node.children) {\n checkDefaultExports(child, warnings);\n }\n for (const slot of Object.values(node.slots)) {\n checkDefaultExports(slot, warnings);\n }\n}\n\nfunction isScriptExtension(ext: string): boolean {\n return ext === 'tsx' || ext === 'ts' || ext === 'jsx' || ext === 'js';\n}\n\nfunction checkFileDefaultExport(\n filePath: string,\n fileType: string,\n warnings: ConventionWarning[]\n): void {\n try {\n if (!fileHasDefaultExport(filePath)) {\n warnings.push({\n id: `NO_DEFAULT_EXPORT:${filePath}`,\n summary: `${fileType}.tsx has no default export: ${filePath}`,\n details:\n ` File: ${filePath}\\n\\n` +\n ` ${fileType}.tsx files must export a default React component.\\n` +\n ` Without a default export, the ${fileType === 'page' ? 'page renders nothing' : 'layout has no component to wrap children'}.\\n\\n` +\n ` To fix: Add a default export:\\n\\n` +\n ` export default function My${fileType === 'page' ? 'Page' : 'Layout'}(${fileType === 'layout' ? '{ children }' : ''}) {\\n` +\n ` return ${fileType === 'layout' ? '<div>{children}</div>' : '<h1>Hello</h1>'};\\n` +\n ` }\\n`,\n level: 'warn',\n });\n }\n } catch (err) {\n swallow(err, `convention-lint: unreadable ${fileType} file ${filePath}`);\n }\n}\n\n// ─── Check: Error Directive ─────────────────────────────────────────────────\n\n/**\n * Warn when error.tsx or global-error.tsx is missing 'use client'.\n *\n * React's error boundary API requires client components. Without the directive,\n * the error boundary silently fails — the component renders as a server component\n * with no error catching. Users discover this only via cryptic runtime errors.\n */\nfunction checkErrorDirectives(node: SegmentNode, warnings: ConventionWarning[]): void {\n if (node.error && isScriptExtension(node.error.extension)) {\n checkFileUseClientDirective(node.error.filePath, 'error', warnings);\n }\n\n for (const child of node.children) {\n checkErrorDirectives(child, warnings);\n }\n for (const slot of Object.values(node.slots)) {\n checkErrorDirectives(slot, warnings);\n }\n}\n\nfunction checkFileUseClientDirective(\n filePath: string,\n fileType: string,\n warnings: ConventionWarning[]\n): void {\n try {\n if (!fileHasDirective(filePath, 'use client')) {\n warnings.push({\n id: `ERROR_NO_USE_CLIENT:${filePath}`,\n summary: `${fileType}.tsx is missing 'use client': ${filePath}`,\n details:\n ` File: ${filePath}\\n\\n` +\n ` ${fileType}.tsx must start with 'use client' because React error\\n` +\n ' boundaries require client components. Without it, the error boundary\\n' +\n ' silently fails and errors are uncaught.\\n\\n' +\n \" To fix: Add 'use client' as the first line of the file:\\n\\n\" +\n \" 'use client';\\n\\n\" +\n ` export default function ${fileType === 'global-error' ? 'GlobalError' : 'ErrorBoundary'}({ error, reset }) {\\n` +\n ' return <div><h2>Something went wrong</h2><button onClick={reset}>Try again</button></div>;\\n' +\n ' }\\n',\n level: 'warn',\n });\n }\n } catch (err) {\n swallow(err, `convention-lint: unreadable ${fileType} file ${filePath}`);\n }\n}\n\n// ─── Check: App Directory Exists ────────────────────────────────────────────\n\n/**\n * Check if the app/ directory exists. Called before scanning.\n * Returns a warning if missing, or null if the directory exists.\n */\nexport function checkAppDirExists(appDir: string): ConventionWarning | null {\n if (existsSync(appDir)) return null;\n\n return {\n id: 'NO_APP_DIR',\n summary: 'No app/ directory found',\n details:\n ` Expected: ${appDir}\\n\\n` +\n ' timber.js requires an app/ directory for file-system routing.\\n' +\n ' Every request will return 404 until you create it.\\n\\n' +\n ' To fix: Create the app/ directory with a page:\\n\\n' +\n ' mkdir -p app\\n' +\n ' # Create app/layout.tsx and app/page.tsx\\n',\n level: 'error',\n };\n}\n\n// ─── Formatting ─────────────────────────────────────────────────────────────\n\nimport type { InspectColor } from 'node:util';\nimport { styleText } from 'node:util';\n\ntype Format = InspectColor | readonly InspectColor[];\nconst noValidate = { validateStream: false } as const;\nconst style = (fmt: Format, text: string) => styleText(fmt, text, noValidate);\n\n/**\n * Format warnings for terminal output.\n *\n * Groups by severity, uses colors, and includes fix suggestions.\n */\nexport function formatConventionWarnings(warnings: ConventionWarning[]): string {\n if (warnings.length === 0) return '';\n\n const errors = warnings.filter((w) => w.level === 'error');\n const warns = warnings.filter((w) => w.level === 'warn');\n\n const lines: string[] = [];\n\n if (errors.length > 0) {\n lines.push(\n `${style(['red', 'bold'], '[timber]')} ${style('red', `${errors.length} configuration error${errors.length !== 1 ? 's' : ''}:`)}`\n );\n for (const e of errors) {\n lines.push('');\n lines.push(` ${style('red', '✗')} ${e.summary}`);\n lines.push(style('dim', e.details));\n }\n }\n\n if (warns.length > 0) {\n if (errors.length > 0) lines.push('');\n lines.push(\n `${style(['yellow', 'bold'], '[timber]')} ${style('yellow', `${warns.length} configuration warning${warns.length !== 1 ? 's' : ''}:`)}`\n );\n for (const w of warns) {\n lines.push('');\n lines.push(` ${style('yellow', '⚠')} ${w.summary}`);\n lines.push(style('dim', w.details));\n }\n }\n\n return lines.join('\\n');\n}\n","/**\n * timber-routing — Vite sub-plugin for route manifest generation.\n *\n * Bridges the route scanner with Vite's module graph. Scans app/ at startup,\n * watches for file changes in dev, and serves the virtual:timber-route-manifest\n * module that entry files consume.\n *\n * Design docs: 18-build-system.md §\"Virtual Modules\", 07-routing.md\n */\n\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { writeFile, mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { scanRoutes } from '../routing/scanner.js';\nimport { generateRouteMap } from '../routing/codegen.js';\nimport {\n buildDirToRouteMap,\n writeSegmentTypes,\n type SegmentInfo,\n} from '../routing/segment-codegen.js';\nimport { validateSchemaAgainstRoutes } from '../routing/schema-validation.js';\nimport {\n generateManifestModule,\n generateSearchParamsRegistryModule,\n generateSchemaModule,\n} from '../routing/manifest-codegen.js';\nimport {\n lintConventions,\n checkAppDirExists,\n formatConventionWarnings,\n} from '../routing/convention-lint.js';\nimport type { PluginContext } from '../plugin-context.js';\n\nconst VIRTUAL_MODULE_ID = 'virtual:timber-route-manifest';\nconst RESOLVED_VIRTUAL_ID = `\\0${VIRTUAL_MODULE_ID}`;\n\n// TIM-830: Search-params registry virtual module.\n//\n// Statically imports the `searchParams` named export from every page\n// that exports one, and registers each definition into the shared\n// search-params registry keyed by the un-interpolated route pattern\n// (e.g. '/products/[id]'). This lets `<Link>` serialize flat\n// `Partial<T>` values at runtime without callers importing the\n// definition at the call site.\n//\n// The imports are STATIC (`import { searchParams as r0 } from '...'`)\n// so Vite/Rolldown tree-shakes each page's component body out of the\n// registry chunk — only the `searchParams` named export is pulled in.\nconst SEARCH_PARAMS_REGISTRY_ID = 'virtual:timber-search-params-registry';\nconst RESOLVED_SEARCH_PARAMS_REGISTRY_ID = `\\0${SEARCH_PARAMS_REGISTRY_ID}`;\n\n// TIM-931: Schema virtual module.\n//\n// When app/schema.ts exists, this module imports it and resolves the\n// bracket-keyed segmentParams codecs into a bare-name codec map for\n// runtime coercion. When no schema exists, exports null.\nconst SCHEMA_ID = 'virtual:timber-schema';\nconst RESOLVED_SCHEMA_ID = `\\0${SCHEMA_ID}`;\n\n// TIM-935: $segment virtual module prefix.\n// Resolved ID encodes segment info as JSON after the prefix.\n//\n// Each route directory gets a virtual module that exports the route\n// and segmentPath. `import { route, segmentPath } from './$segment'`\n// resolves to `\\0$segment:<json>`.\nconst SEGMENT_PREFIX = '\\0$segment:';\n\n/**\n * File convention names we track for changes that require manifest regeneration.\n */\nconst ROUTE_FILE_PATTERNS =\n /\\/(page|layout|middleware|access|route|error|global-error|default|denied|params|schema|\\d{3}|[45]xx|not-found|forbidden|unauthorized|sitemap|robots|manifest|favicon|icon|opengraph-image|apple-icon)\\./;\n\n/**\n * Create the timber-routing Vite plugin.\n *\n * Hooks: resolveId, load, buildStart, configureServer\n */\n/** Absolute path to the generated route map declaration file. */\nconst CODEGEN_OUTPUT = '.timber/timber-routes.d.ts';\n\n/**\n * Content of the timber-env.d.ts file written to the project root.\n *\n * Uses a triple-slash reference so TypeScript auto-discovers the generated\n * route map without the user needing to edit tsconfig.json — same pattern\n * as Next.js's next-env.d.ts.\n *\n * Also references `vite/client` so side-effect imports like\n * `import './globals.css'` type-check without ts(2882), and so\n * `import.meta.env`, `import.meta.hot`, `import.meta.glob`, asset\n * imports (`*.png`, `*.svg`, …), CSS modules, and `?url`/`?raw`/\n * `?inline` query variants all resolve without the user editing\n * tsconfig.json themselves. Next.js's next-env.d.ts plays the same\n * role via `next/types/global`.\n *\n * `vite` is a peer dep of `@timber-js/app`, so the reference always\n * resolves in a correctly-installed project.\n */\nconst TIMBER_ENV_DTS = [\n '// This file is auto-generated by timber.js. Do not edit.',\n '// It ensures TypeScript picks up the generated route types and',\n '// Vite-provided ambient types (CSS, assets, import.meta.env, HMR).',\n '/* eslint-disable @typescript-eslint/triple-slash-reference */',\n '/// <reference path=\".timber/timber-routes.d.ts\" />',\n '/// <reference types=\"vite/client\" />',\n '',\n].join('\\n');\n\n/**\n * Write the generated route map and the timber-env.d.ts reference file.\n *\n * Fire-and-forget — never awaited to avoid blocking the hot path.\n * Errors are swallowed; a missing .d.ts is a developer UX issue, not a runtime failure.\n */\nfunction writeCodegen(ctx: PluginContext): void {\n if (!ctx.routeTree) return;\n const timberDir = join(ctx.root, '.timber');\n const content = generateRouteMap(ctx.routeTree, { appDir: ctx.appDir, outputDir: timberDir });\n const routesPath = join(ctx.root, CODEGEN_OUTPUT);\n const envPath = join(ctx.root, 'timber-env.d.ts');\n mkdir(timberDir, { recursive: true })\n .then(() =>\n Promise.all([\n writeFile(routesPath, content, 'utf-8'),\n writeFile(envPath, TIMBER_ENV_DTS, 'utf-8'),\n writeSegmentTypes(ctx.routeTree!, ctx.appDir, ctx.root),\n ])\n )\n .catch((err) => {\n // Non-fatal — types are a dev convenience, but log so issues are visible\n console.warn('[timber] Failed to write codegen output:', err);\n });\n}\n\nexport function timberRouting(ctx: PluginContext): Plugin {\n /** Track warned files to avoid repeating warnings on rescan. */\n const warnedFiles = new Set<string>();\n\n /** Maps absolute filesystem directory → segment info for $segment resolution. */\n let dirToRoute: Map<string, SegmentInfo> = new Map();\n\n function rescan(): void {\n // Check app/ directory exists before scanning\n const appDirWarning = checkAppDirExists(ctx.appDir);\n if (appDirWarning) {\n const formatted = formatConventionWarnings([appDirWarning]);\n if (formatted) process.stderr.write(`${formatted}\\n`);\n // Still create an empty tree so the rest of the pipeline doesn't crash\n ctx.routeTree = {\n root: {\n segmentName: '',\n segmentType: 'static',\n urlPath: '/',\n children: [],\n slots: {},\n },\n };\n return;\n }\n\n ctx.timer.start('route-scan');\n ctx.routeTree = scanRoutes(ctx.appDir, {\n pageExtensions: ctx.config.pageExtensions,\n });\n ctx.timer.end('route-scan');\n dirToRoute = buildDirToRouteMap(ctx.routeTree, ctx.appDir);\n writeCodegen(ctx);\n\n // Validate schema keys against filesystem segments.\n // Warns on stale keys, bracket form mismatches, and missing keys.\n // See design/41-global-params.md §Auto-Scaffolding\n warnSchemaValidation(ctx);\n\n // Lint conventions (empty app, missing methods, missing root layout)\n const conventionWarnings = lintConventions(ctx.routeTree, ctx.appDir);\n const newConventionWarnings = conventionWarnings.filter((w) => !warnedFiles.has(w.id));\n if (newConventionWarnings.length > 0) {\n for (const w of newConventionWarnings) warnedFiles.add(w.id);\n const formatted = formatConventionWarnings(newConventionWarnings);\n if (formatted) process.stderr.write(`${formatted}\\n`);\n }\n }\n\n return {\n name: 'timber-routing',\n\n /**\n * Resolve the virtual module ID.\n *\n * Handles:\n * - virtual:timber-route-manifest\n * - <root>/virtual:timber-route-manifest (Vite SSR build root prefix)\n * - \\0virtual:timber-route-manifest (RSC plugin re-imports)\n */\n resolveId(id: string, importer?: string) {\n // Strip \\0 prefix if present (RSC plugin generates these)\n const cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n\n if (cleanId === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n // Handle root-prefixed resolution in SSR build\n if (cleanId.endsWith(`/${VIRTUAL_MODULE_ID}`)) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n // TIM-830: Search-params registry virtual module\n if (\n cleanId === SEARCH_PARAMS_REGISTRY_ID ||\n cleanId.endsWith(`/${SEARCH_PARAMS_REGISTRY_ID}`)\n ) {\n return RESOLVED_SEARCH_PARAMS_REGISTRY_ID;\n }\n\n // TIM-931: Schema virtual module\n if (cleanId === SCHEMA_ID || cleanId.endsWith(`/${SCHEMA_ID}`)) {\n return RESOLVED_SCHEMA_ID;\n }\n\n // TIM-935: $segment virtual module.\n // Resolves `import { route } from './$segment'` based on the\n // importing file's directory in the app/ tree.\n if (\n importer &&\n (cleanId === './$segment' || cleanId === './$segment.js' || cleanId === './$segment.ts')\n ) {\n // Strip \\0 prefix from importer if present\n const cleanImporter = importer.startsWith('\\0') ? importer.slice(1) : importer;\n const importerDir = cleanImporter.substring(0, cleanImporter.lastIndexOf('/'));\n const segmentInfo = dirToRoute.get(importerDir);\n if (segmentInfo !== undefined) {\n return `${SEGMENT_PREFIX}${JSON.stringify(segmentInfo)}`;\n }\n }\n\n return null;\n },\n\n /**\n * Generate the route manifest module.\n *\n * The manifest exports the route tree as a serialized data structure\n * with absolute import paths for all file references.\n */\n load(id: string) {\n if (id === RESOLVED_VIRTUAL_ID) {\n // If routeTree hasn't been built yet (shouldn't happen), scan now\n if (!ctx.routeTree) {\n rescan();\n }\n return generateManifestModule(ctx.routeTree!, ctx.root);\n }\n\n if (id === RESOLVED_SEARCH_PARAMS_REGISTRY_ID) {\n if (!ctx.routeTree) {\n rescan();\n }\n return generateSearchParamsRegistryModule(ctx.routeTree!);\n }\n\n if (id === RESOLVED_SCHEMA_ID) {\n return generateSchemaModule(ctx.appDir);\n }\n\n // TIM-935: $segment virtual module — exports route and segmentPath.\n if (id.startsWith(SEGMENT_PREFIX)) {\n const info: SegmentInfo = JSON.parse(id.slice(SEGMENT_PREFIX.length));\n return [\n `export const ROUTE = ${JSON.stringify(info.route)};`,\n `export const SEGMENT_PATH = ${JSON.stringify(info.segmentPath)};`,\n '',\n ].join('\\n');\n }\n\n return null;\n },\n\n /**\n * Scan routes at build start.\n *\n * In dev mode, skip — configureServer runs after buildStart and will\n * do its own scan. Avoids a redundant FS traversal on cold start.\n */\n buildStart() {\n if (ctx.dev) return;\n rescan();\n },\n\n /**\n * Set up file watcher in dev mode.\n *\n * Watches app/ for file additions/deletions/renames that affect\n * the route tree, regenerates the manifest, and invalidates\n * dependent modules via HMR.\n */\n configureServer(devServer: ViteDevServer) {\n // Initial scan (only scan point in dev — buildStart is skipped)\n rescan();\n\n // Watch the app directory\n devServer.watcher.add(ctx.appDir);\n\n /** Snapshot of the last generated manifest, used to detect structural changes. */\n let lastManifest = ctx.routeTree ? generateManifestModule(ctx.routeTree, ctx.root) : '';\n\n /**\n * Handle a route-significant file being added or removed.\n * Always triggers a full-reload since the route tree structure changed.\n */\n const handleStructuralChange = (filePath: string) => {\n if (!filePath.startsWith(ctx.appDir)) return;\n if (!ROUTE_FILE_PATTERNS.test(filePath)) return;\n\n rescan();\n lastManifest = ctx.routeTree ? generateManifestModule(ctx.routeTree, ctx.root) : '';\n invalidateManifest(devServer);\n };\n\n /**\n * Handle a route file's content changing.\n *\n * Most content edits (JSX changes, fixing typos) don't affect route\n * metadata — Vite's React Fast Refresh handles those via normal HMR.\n * Only rescan and full-reload when route metadata actually changed\n * (e.g., searchParams export added/removed, metadata export changed).\n */\n const handleContentChange = (filePath: string) => {\n if (!filePath.startsWith(ctx.appDir)) return;\n if (!ROUTE_FILE_PATTERNS.test(filePath)) return;\n\n rescan();\n const newManifest = ctx.routeTree ? generateManifestModule(ctx.routeTree, ctx.root) : '';\n if (newManifest !== lastManifest) {\n lastManifest = newManifest;\n invalidateManifest(devServer);\n }\n // Otherwise: content edit didn't change route metadata — let Vite HMR handle it\n };\n\n devServer.watcher.on('add', handleStructuralChange);\n devServer.watcher.on('unlink', handleStructuralChange);\n // Watch content changes to page files — searchParams detection depends\n // on file contents (export const searchParams), not just file presence.\n // But only full-reload when route metadata actually changes.\n devServer.watcher.on('change', handleContentChange);\n // Also watch renames (which are add+unlink) — handled by the above\n },\n };\n}\n\n/**\n * Invalidate the virtual route manifest module across all Vite environments.\n *\n * When the route tree changes, any environment that has imported the manifest\n * needs to be invalidated so the next request/transform picks up the new tree.\n */\n/** Set of warning keys we've already emitted — avoid repeating on every rescan. */\nconst _warnedKeys = new Set<string>();\n\n/**\n * Validate schema keys against the filesystem route tree.\n * Warns on stale keys, bracket form mismatches, and missing keys.\n * Uses the already-scanned route tree instead of re-scanning.\n */\nfunction warnSchemaValidation(ctx: PluginContext): void {\n if (!ctx.routeTree) return;\n const warnings = validateSchemaAgainstRoutes(ctx.routeTree, ctx.appDir);\n\n for (const w of warnings) {\n const warnKey = `${w.type}:${w.key}`;\n if (_warnedKeys.has(warnKey)) continue;\n _warnedKeys.add(warnKey);\n\n switch (w.type) {\n case 'stale-key':\n console.warn(`[timber] ${w.message}`);\n break;\n case 'bracket-mismatch':\n console.warn(`[timber] ${w.message}`);\n break;\n case 'missing-key':\n console.warn(`[timber] ${w.message}`);\n break;\n }\n }\n}\n\nfunction invalidateManifest(server: ViteDevServer): void {\n for (const envName of Object.keys(server.environments)) {\n const env = server.environments[envName];\n if (!env?.moduleGraph) continue;\n\n for (const virtualId of [\n RESOLVED_VIRTUAL_ID,\n RESOLVED_SEARCH_PARAMS_REGISTRY_ID,\n RESOLVED_SCHEMA_ID,\n ]) {\n const mod = env.moduleGraph.getModuleById(virtualId);\n if (mod) {\n env.moduleGraph.invalidateModule(mod);\n }\n }\n\n // TIM-935: Invalidate all $segment virtual modules (prefixed \\0$segment:)\n for (const mod of env.moduleGraph.idToModuleMap.values()) {\n if (mod.id?.startsWith(SEGMENT_PREFIX)) {\n env.moduleGraph.invalidateModule(mod);\n }\n }\n }\n\n // Trigger HMR full reload — route changes are structural\n server.hot.send({ type: 'full-reload' });\n}\n","/**\n * timber-shims — Vite sub-plugin for next/* → timber shim resolution.\n *\n * Intercepts imports of next/* modules and redirects them to timber.js\n * shim implementations. This enables Next.js-compatible libraries\n * (nuqs, next-intl, etc.) to work unmodified.\n *\n * This plugin also remaps ALL @timber-js/app/* subpath imports to src/ in\n * server environments (RSC + SSR). This is required because dist/ chunks\n * are pre-built and miss Vite's RSC transforms (e.g. createContext from\n * 'react' doesn't exist in RSC's React build). It also ensures a single\n * module instance for shared mutable state. See SUBPATH_SRC_MAP and TIM-568.\n *\n * Design doc: 18-build-system.md §\"Shim Map\"\n */\n\nimport type { Plugin } from 'vite';\nimport { resolve, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { PluginContext } from '../plugin-context.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n// Detect whether we're running from source (src/plugins/) or dist (dist/).\n// From src/plugins/: go up 2 levels to package root.\n// From dist/: go up 1 level to package root.\n// When Rollup bundles into dist/index.js, __dirname is dist/, not src/plugins/.\nconst PKG_ROOT = __dirname.endsWith('plugins')\n ? resolve(__dirname, '..', '..')\n : resolve(__dirname, '..');\nconst SHIMS_DIR = resolve(PKG_ROOT, 'src', 'shims');\n\n/**\n * Virtual module IDs for server-only and client-only poison pills.\n *\n * These packages cause build errors when imported in the wrong environment:\n * - `server-only` errors when imported in a client component\n * - `client-only` errors when imported in a server component\n */\nconst SERVER_ONLY_VIRTUAL = '\\0timber:server-only';\nconst CLIENT_ONLY_VIRTUAL = '\\0timber:client-only';\n\n/**\n * Map from @timber-js/app/<subpath> to relative src/ file paths.\n *\n * Used by the catch-all resolveId rule to remap subpath imports to src/\n * in server environments. When adding a new subpath export to package.json,\n * add it here too — tests/shims-drift.test.ts enumerates package.json\n * exports and fails if an entry is missing. See TIM-568.\n *\n * Exported for the drift test.\n */\nexport const SUBPATH_SRC_MAP: Record<string, string> = {\n 'cache': 'cache/index.ts',\n 'codec': 'codec.ts',\n 'cookies': 'cookies/index.ts',\n 'params': 'params/index.ts',\n 'search-params': 'search-params/index.ts',\n 'segment-params': 'segment-params/index.ts',\n\n 'cache/stores/memory': 'cache/stores/memory.ts',\n 'cache/stores/redis': 'cache/stores/redis.ts',\n 'cache/stores/cloudflare-kv': 'cache/stores/cloudflare-kv.ts',\n 'cache/stores/vercel': 'cache/stores/vercel.ts',\n\n 'cdn': 'cdn/index.ts',\n 'cdn/cloudflare': 'cdn/cloudflare-purge.ts',\n 'cdn/cloudflare-workers': 'cdn/workers-cache-purge.ts',\n 'cdn/fastly': 'cdn/fastly-purge.ts',\n\n 'adapters/cloudflare': 'adapters/cloudflare.ts',\n 'adapters/cloudflare/cache': 'adapters/cloudflare-kv-cache.ts',\n 'adapters/cloudflare/dev': 'adapters/cloudflare-dev.ts',\n 'adapters/nitro': 'adapters/nitro.ts',\n};\n\n/**\n * Runtime value exports of @timber-js/app/server, stubbed in the client\n * (browser) environment so a stray client-side import fails with a clear\n * call-time error instead of a confusing bundler error.\n *\n * Must stay in sync with the actual runtime exports of server/index.ts —\n * tests/shims-drift.test.ts compares this list against\n * Object.keys(import('../server/index.ts')) and fails on drift.\n * Type-only exports (DenyOptions, AccessContext, …) are erased at runtime\n * and must NOT appear here.\n */\nexport const SERVER_STUB_EXPORTS: readonly string[] = [\n // request-context\n 'getHeaders',\n 'getSegmentParams',\n // cookie-context\n 'getCookieJar',\n // primitives\n 'deny',\n 'redirect',\n 'redirectExternal',\n 'RedirectType',\n 'waitUntil',\n // action-client\n 'createActionClient',\n 'ActionError',\n 'validated',\n // form-data\n 'coerce',\n 'parseFormData',\n // form-flash\n 'getFormFlash',\n // revalidation\n 'revalidatePath',\n 'revalidateTag',\n // tracing\n 'getTraceId',\n 'getSpanId',\n 'withSpan',\n 'addSpanEvent',\n];\n\n/**\n * Map from next/* import specifiers to shim file paths.\n *\n * The shim map is a separate data structure (not embedded in the plugin)\n * per the task's approach constraints.\n */\nconst SHIM_MAP: Record<string, string> = {\n 'next/link': resolve(SHIMS_DIR, 'link.ts'),\n 'next/image': resolve(SHIMS_DIR, 'image.ts'),\n 'next/navigation': resolve(SHIMS_DIR, 'navigation.ts'),\n 'next/headers': resolve(SHIMS_DIR, 'headers.ts'),\n // next/font/* and @timber-js/app/fonts/* redirect to the timber-fonts\n // virtual modules. The fonts plugin's load hook serves the actual module\n // code. The package.json exports point to shim stubs for non-Vite contexts\n // (tsc, tests), but in Vite the virtual module takes priority via this map.\n 'next/font/google': '\\0@timber/fonts/google',\n 'next/font/local': '\\0@timber/fonts/local',\n '@timber-js/app/fonts/google': '\\0@timber/fonts/google',\n '@timber-js/app/fonts/local': '\\0@timber/fonts/local',\n};\n\n/**\n * Strip .js extension from an import specifier.\n *\n * Libraries like nuqs import `next/navigation.js` with an explicit\n * extension. We strip it before matching against the shim map.\n */\nfunction stripJsExtension(id: string): string {\n return id.endsWith('.js') ? id.slice(0, -3) : id;\n}\n\n/**\n * Read the Vite environment name from a plugin hook's `this` context.\n *\n * Duck-typed because the hook context type doesn't expose `environment`\n * in a way that survives our Plugin typing — see Vite's Environment API.\n */\nfunction envName(hookCtx: unknown): string | undefined {\n return (hookCtx as { environment?: { name?: string } }).environment?.name;\n}\n\n/**\n * Create the timber-shims Vite plugin.\n *\n * Hooks: resolveId, load\n */\nexport function timberShims(_ctx: PluginContext): Plugin {\n return {\n name: 'timber-shims',\n // Must run before Vite's built-in resolution so that server-only/client-only\n // poison pills are intercepted even when imported from node_modules deps\n // (e.g. bright, next-intl). Without this, the dep optimizer resolves to the\n // real CJS package which throws at runtime in the SSR environment.\n enforce: 'pre',\n\n /**\n * Resolve next/* imports to shim files.\n *\n * Resolution order:\n * 1. Check server-only / client-only poison pill packages\n * 2. Strip .js extension from the import specifier\n * 3. Check next/* shim map\n * 4. Return null (pass through) for everything else\n *\n * In server environments (RSC + SSR), @timber-js/app/* subpath imports\n * are remapped to src/ via SUBPATH_SRC_MAP and the explicit branches\n * below — dist/ chunks miss Vite's RSC transforms and would duplicate\n * mutable module state (see TIM-568 and the rationale comments below).\n *\n * In the client (browser) environment, imports resolve to dist/ via\n * package.json exports — except @timber-js/app/client (remapped to src/\n * to share module instances with browser-entry) and @timber-js/app/server,\n * which returns a virtual stub: server code must never be bundled into\n * the browser.\n */\n resolveId(id: string) {\n // Poison pill packages — resolve to virtual modules handled by load()\n if (id === 'server-only') return SERVER_ONLY_VIRTUAL;\n if (id === 'client-only') return CLIENT_ONLY_VIRTUAL;\n\n const cleanId = stripJsExtension(id);\n\n // Check next/* shim map.\n // In the client (browser) environment, next/navigation resolves to\n // navigation-client.ts which only re-exports client hooks — not server\n // functions like redirect() and deny(). This prevents server/primitives.ts\n // from being pulled into the browser bundle.\n if (cleanId in SHIM_MAP) {\n const env = envName(this);\n if (env === 'client' && cleanId === 'next/navigation') {\n return resolve(SHIMS_DIR, 'navigation-client.ts');\n }\n return SHIM_MAP[cleanId];\n }\n\n // ── @timber-js/app/* → src/ resolution in server environments ──\n //\n // All @timber-js/app/* subpath imports are remapped to src/ in server\n // environments (RSC + SSR). This is required for two reasons:\n //\n // 1. RSC correctness: dist/ chunks eagerly import from 'react' (e.g.\n // createContext in segment-context) which doesn't exist in RSC's\n // React build. Vite's RSC plugin only transforms src/ files —\n // dist/ chunks are pre-built and served as-is.\n //\n // 2. Module singleton correctness: framework internals use relative\n // imports that resolve within src/. If user code resolved to dist/\n // while framework code resolved to src/, mutable module-level state\n // (ALS refs, registered callbacks) would be duplicated. By remapping\n // all @timber-js/app/* to src/, everything shares one module graph.\n //\n // Exception: @timber-js/app/client in RSC resolves to dist/ where\n // 'use client' is preserved for client boundary detection.\n //\n // In the client (browser) environment, all imports resolve to dist/\n // via package.json exports (no remapping needed).\n\n // ── #imports resolution for package-internal modules ─────────────\n //\n // #server-internal and #client-internal are Node package imports\n // (package.json \"imports\" field). They are only resolvable from\n // within this package — external consumers get module-not-found.\n //\n // In Vite, we intercept them here to resolve to src/ for dev/build\n // correctness (same rationale as the @timber-js/app/* remap above).\n if (cleanId === '#server-only-guard') {\n const env = envName(this);\n if (env === 'client') {\n return SERVER_ONLY_VIRTUAL;\n }\n return resolve(PKG_ROOT, 'src', 'server', 'server-only-guard-noop.js');\n }\n\n if (cleanId === '#server-internal') {\n const env = envName(this);\n if (env === 'client') {\n return '\\0timber:server-empty';\n }\n return resolve(PKG_ROOT, 'src', 'server', 'internal.ts');\n }\n\n if (cleanId === '#client-internal') {\n // Always resolve to src/ — all environments (RSC, SSR, client)\n // use src/ for framework internals. In the client env, this\n // ensures browser-entry and @timber-js/app/client share the\n // same module graph (both resolve to src/).\n return resolve(PKG_ROOT, 'src', 'client', 'internal.ts');\n }\n\n if (cleanId === '#routing') {\n return resolve(PKG_ROOT, 'src', 'routing', 'index.ts');\n }\n\n // Legacy aliases — vitest and monorepo configs may still reference\n // the old @timber-js/app/server/internal and @timber-js/app/client/internal\n // specifiers via resolve.alias. When those aliases resolve to the\n // absolute src/ path, they bypass this plugin entirely. But if the\n // specifier reaches us unresolved (e.g., in a Vite build without\n // aliases), handle it the same way as the #imports above.\n if (cleanId === '@timber-js/app/server/internal') {\n const env = envName(this);\n if (env === 'client') {\n return '\\0timber:server-empty';\n }\n return resolve(PKG_ROOT, 'src', 'server', 'internal.ts');\n }\n\n if (cleanId === '@timber-js/app/client/internal') {\n // Same as #client-internal above — always resolve to src/.\n return resolve(PKG_ROOT, 'src', 'client', 'internal.ts');\n }\n\n if (cleanId === '@timber-js/app/server') {\n const env = envName(this);\n if (env === 'client') {\n return '\\0timber:server-empty';\n }\n // RSC + SSR: remap to src/\n return resolve(PKG_ROOT, 'src', 'server', 'index.ts');\n }\n\n // Alias hardening: monorepo dev configs (tests/shared-vite-config.ts,\n // packages/website) alias @timber-js/app/server to the absolute\n // src/server path for vitest compatibility. Vite's resolve.alias runs\n // before every plugin, so the bare-specifier branch above never sees\n // the import in those apps — the real server barrel (and its\n // AsyncLocalStorage) would be bundled into the browser. Catch the\n // already-aliased absolute path here and return the same stub.\n if (\n cleanId === resolve(PKG_ROOT, 'src', 'server', 'index.ts') ||\n cleanId === resolve(PKG_ROOT, 'src', 'server', 'internal.ts')\n ) {\n if (envName(this) === 'client') {\n return '\\0timber:server-empty';\n }\n }\n\n if (cleanId === '@timber-js/app/client') {\n const env = envName(this);\n // RSC: return null — needs dist/ for 'use client' boundary detection.\n // SSR + Client: resolve to src/ so that browser-entry (which uses\n // relative imports from src/) and user code (which uses the bare\n // specifier @timber-js/app/client) share the same module instances.\n // Without this, state.ts is loaded twice (src/ and dist/) and\n // setGlobalRouter() writes to one copy while getRouterOrNull()\n // reads from the other (always null).\n if (env === 'ssr' || env === 'client') {\n return resolve(PKG_ROOT, 'src', 'client', 'index.ts');\n }\n return null;\n }\n\n // Catch-all: remap any other @timber-js/app/<subpath> to src/\n // in non-client environments (RSC + SSR).\n if (cleanId.startsWith('@timber-js/app/') && cleanId !== '@timber-js/app/package.json') {\n const env = envName(this);\n if (env !== 'client') {\n const subpath = cleanId.slice('@timber-js/app/'.length);\n const srcPath = SUBPATH_SRC_MAP[subpath];\n if (srcPath) {\n return resolve(PKG_ROOT, 'src', srcPath);\n }\n }\n }\n\n return null;\n },\n\n /**\n * Serve virtual modules for server-only / client-only poison pills.\n *\n * In the correct environment, the module is a no-op (empty export).\n * In the wrong environment, it throws a build-time error message that\n * clearly identifies the boundary violation.\n */\n load(id: string) {\n const env = envName(this);\n const isClient = env === 'client';\n\n if (id === SERVER_ONLY_VIRTUAL) {\n if (isClient) {\n return `throw new Error(\n \"This module cannot be imported from a Client Component module. \" +\n \"It should only be used from a Server Component.\"\n);`;\n }\n // No-op in server environments (rsc, ssr)\n return 'export {};';\n }\n\n if (id === CLIENT_ONLY_VIRTUAL) {\n if (!isClient) {\n return `throw new Error(\n \"This module cannot be imported from a Server Component module. \" +\n \"It should only be used from a Client Component.\"\n);`;\n }\n // No-op in client environment\n return 'export {};';\n }\n\n // Error module for @timber-js/app/server in client environment.\n // Server modules must never be bundled into the browser — if this\n // module is reached, there is a broken import chain that needs fixing.\n if (id === '\\0timber:server-empty') {\n // Export named stubs instead of throwing at evaluation time.\n // Throwing at eval breaks the module system — the browser can't\n // resolve named imports like `import { deny } from '...'`.\n // Instead, each stub throws at call time with a clear message.\n // The export names are generated from SERVER_STUB_EXPORTS so the\n // list cannot drift from server/index.ts (drift test enforced).\n // RedirectType is a plain const object on the server, so it is\n // mirrored as one here — libraries read RedirectType.push as a value.\n const stubExports = SERVER_STUB_EXPORTS.map((name) =>\n name === 'RedirectType'\n ? `export const RedirectType = { push: 'push', replace: 'replace' };`\n : `export const ${name} = stub;`\n ).join('\\n');\n return `\nconst msg = \"[timber] @timber-js/app/server was imported from client code. \" +\n \"Server modules (headers, cookies, redirect, deny, etc.) cannot be used in client components. \" +\n \"If you need these APIs, move the import to a server component or middleware.\";\nfunction stub() { throw new Error(msg); }\n${stubExports}\n`;\n }\n },\n };\n}\n","/**\n * Shared path/URL helpers for the timber-fonts pipeline.\n *\n * Two concerns live here:\n *\n * - `fontUrlPrefix` — the public URL prefix for font binaries, derived\n * from Vite's resolved `base`. Every URL the pipeline emits (@font-face\n * src, manifest hrefs, dev middleware matching) must go through this so\n * apps deployed under a non-root base (`base: '/my-app/'`) resolve\n * fonts correctly. Emitted *file* locations are not base-prefixed —\n * only URLs are.\n *\n * - `fontOutputBasename` / `hashedFontBasename` — basename derivation for\n * local font sources. Paths are absolutized with `resolve()`, which\n * produces backslash separators on Windows, so `split('/').pop()` is\n * not safe. `path.win32.basename` handles both separators.\n *\n * Design doc: 24-fonts.md\n */\n\nimport { win32 } from 'node:path';\n\n/** Directory (relative to the build output / URL root) holding font binaries. */\nexport const FONT_OUTPUT_DIR = '_timber/fonts';\n\n/**\n * Build the URL prefix for font binaries from Vite's resolved `base`.\n *\n * `fontUrlPrefix('/')` → `/_timber/fonts`\n * `fontUrlPrefix('/my-app/')` → `/my-app/_timber/fonts`\n */\nexport function fontUrlPrefix(base = '/'): string {\n const normalized = base.endsWith('/') ? base : `${base}/`;\n return `${normalized}${FONT_OUTPUT_DIR}`;\n}\n\n/**\n * Derive the output basename for a local font source path.\n *\n * Uses `path.win32.basename` because it splits on both `/` and `\\`,\n * handling absolute paths produced by `resolve()` on any platform.\n */\nexport function fontOutputBasename(srcPath: string): string {\n return win32.basename(srcPath);\n}\n\n/**\n * Derive the content-hashed output basename for a local font source.\n *\n * `hashedFontBasename('C:\\\\fonts\\\\MyFont-Bold.woff2', 'a1b2c3d4')`\n * → `MyFont-Bold-a1b2c3d4.woff2`\n */\nexport function hashedFontBasename(srcPath: string, hash: string): string {\n const basename = fontOutputBasename(srcPath);\n const ext = win32.extname(basename);\n const stem = ext ? basename.slice(0, -ext.length) : basename;\n return `${stem}-${hash}${ext}`;\n}\n","/**\n * Google Fonts download, caching, and dev CDN fallback.\n *\n * At build time (production only):\n * 1. Queries Google Fonts CSS API v2 for font metadata and file URLs\n * 2. Downloads woff2 font files\n * 3. Caches them in node_modules/.cache/timber-fonts/\n * 4. Content-hashes filenames for cache busting\n * 5. Emits font files into the build output via generateBundle\n *\n * In dev mode:\n * - Generates @font-face rules pointing to Google Fonts CDN\n * - No downloads, no caching\n *\n * Design doc: 24-fonts.md §\"Step 2: Font Download & Subsetting\"\n */\n\nimport { createHash } from 'node:crypto';\nimport { readFile, writeFile, mkdir, stat } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ExtractedFont, FontFaceDescriptor } from './types.js';\nimport { fontUrlPrefix } from './paths.js';\n\n/**\n * Extract a recognizable error code (ETIMEDOUT, ENOTFOUND, etc.) from a\n * network error's cause chain. Node's undici-based `fetch` wraps the\n * system error inside `cause` (sometimes as an AggregateError).\n */\nfunction extractNetworkErrorCode(err: unknown): string | undefined {\n if (!(err instanceof Error)) return undefined;\n const code = (err as NodeJS.ErrnoException).code;\n if (code) return code;\n const cause = (err as { cause?: unknown }).cause;\n if (cause instanceof AggregateError) {\n for (const inner of cause.errors) {\n const innerCode = (inner as NodeJS.ErrnoException).code;\n if (innerCode) return innerCode;\n }\n }\n if (cause instanceof Error) {\n return (cause as NodeJS.ErrnoException).code;\n }\n return undefined;\n}\n\nconst MAX_RETRIES = 3;\nconst MIN_TIMEOUT_MS = 100;\n\nasync function retry<T>(fn: () => Promise<T>): Promise<T> {\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n try {\n return await fn();\n } catch (err) {\n lastError = err;\n if (attempt < MAX_RETRIES) {\n const delay = MIN_TIMEOUT_MS * 2 ** attempt;\n console.error(\n `${err instanceof Error ? err.message : String(err)}\\n\\nRetrying ${attempt + 1}/${MAX_RETRIES}...`\n );\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n throw lastError;\n}\n\n/** Google Fonts CSS API v2 base URL. */\nconst GOOGLE_FONTS_API = 'https://fonts.googleapis.com/css2';\n\n/**\n * User-Agent string that requests woff2 format from Google Fonts API.\n * Google serves different formats based on user-agent.\n */\nconst WOFF2_USER_AGENT =\n 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';\n\n/** Default cache directory for downloaded font files. */\nconst DEFAULT_CACHE_DIR = 'node_modules/.cache/timber-fonts';\n\n/** A parsed @font-face block from the Google Fonts CSS response. */\nexport interface GoogleFontFace {\n family: string;\n weight: string;\n style: string;\n /** The remote URL to the font file. */\n url: string;\n /** The unicode-range from the CSS (e.g. `U+0000-00FF, U+0131`). */\n unicodeRange: string;\n /** Subset label extracted from the CSS comment (e.g. `latin`, `cyrillic`). */\n subset: string;\n}\n\n/** A downloaded and cached font file, ready for build output. */\nexport interface CachedFont {\n /** The original parsed face data. */\n face: GoogleFontFace;\n /** Content-hashed filename (e.g. `inter-latin-400-normal-abc123.woff2`). */\n hashedFilename: string;\n /** Absolute path to the cached file. */\n cachePath: string;\n /** Raw font file bytes. */\n data: Buffer;\n}\n\n/**\n * Build the Google Fonts CSS API v2 URL for a given font config.\n *\n * Example output:\n * https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap&subset=latin\n */\nexport function buildGoogleFontsUrl(font: ExtractedFont): string {\n const family = font.family.replace(/\\s+/g, '+');\n\n // Build axis spec: wght for weights, ital for italic styles\n const hasItalic = font.styles.includes('italic');\n const weights = font.weights.map(Number).sort((a, b) => a - b);\n\n let axisSpec: string;\n if (hasItalic && weights.length > 0) {\n // ital,wght@0,400;0,700;1,400;1,700\n const pairs: string[] = [];\n for (const ital of [0, 1]) {\n if (ital === 1 && !hasItalic) continue;\n if (ital === 0 && font.styles.length === 1 && font.styles[0] === 'italic') continue;\n for (const w of weights) {\n pairs.push(`${ital},${w}`);\n }\n }\n axisSpec = `ital,wght@${pairs.join(';')}`;\n } else if (weights.length > 0) {\n axisSpec = `wght@${weights.join(';')}`;\n } else {\n axisSpec = '';\n }\n\n const familyParam = axisSpec ? `${family}:${axisSpec}` : family;\n\n // Build URL manually — URLSearchParams encodes +, :, @, ; which\n // the Google Fonts CSS API v2 requires as literal characters.\n const parts = [`family=${familyParam}`];\n if (font.display) parts.push(`display=${font.display}`);\n\n return `${GOOGLE_FONTS_API}?${parts.join('&')}`;\n}\n\n/**\n * Fetch the CSS from Google Fonts API and parse out @font-face blocks.\n *\n * The API returns CSS with subset comments like:\n * ```\n * /* latin * /\n * @font-face { ... }\n * ```\n *\n * We parse each block to extract the font URL, unicode-range, and subset label.\n */\nexport async function fetchGoogleFontsCss(url: string): Promise<GoogleFontFace[]> {\n const css = await retry(async () => {\n let response: Response;\n try {\n response = await fetch(url, {\n headers: { 'User-Agent': WOFF2_USER_AGENT },\n });\n } catch (err) {\n const code = extractNetworkErrorCode(err);\n throw new Error(\n `[timber] Failed to fetch Google Fonts CSS from ${url}` +\n (code ? ` (${code})` : '') +\n `. Build requires internet access for font optimization.` +\n ` If building offline, set TIMBER_SKIP_FONTS=1 to skip font downloading.`\n );\n }\n\n if (!response.ok) {\n throw new Error(\n `Google Fonts API returned ${response.status}: ${response.statusText} for ${url}`\n );\n }\n\n return response.text();\n });\n\n return parseGoogleFontsCss(css);\n}\n\n/**\n * Parse the CSS response from Google Fonts API into structured font face data.\n *\n * Handles the Google Fonts CSS format with subset comments and @font-face blocks.\n */\nexport function parseGoogleFontsCss(css: string): GoogleFontFace[] {\n const faces: GoogleFontFace[] = [];\n\n // Match subset comments followed by @font-face blocks\n const blockPattern = /\\/\\*\\s*([a-z0-9-]+)\\s*\\*\\/\\s*@font-face\\s*\\{([^}]+)\\}/g;\n\n let match;\n while ((match = blockPattern.exec(css)) !== null) {\n const subset = match[1];\n const block = match[2];\n\n const familyMatch = block.match(/font-family:\\s*'([^']+)'/);\n const weightMatch = block.match(/font-weight:\\s*(\\d+)/);\n const styleMatch = block.match(/font-style:\\s*(\\w+)/);\n const urlMatch = block.match(/url\\(([^)]+)\\)\\s*format\\('woff2'\\)/);\n const rangeMatch = block.match(/unicode-range:\\s*([^;]+)/);\n\n if (familyMatch && urlMatch) {\n faces.push({\n family: familyMatch[1],\n weight: weightMatch?.[1] ?? '400',\n style: styleMatch?.[1] ?? 'normal',\n url: urlMatch[1],\n unicodeRange: rangeMatch?.[1]?.trim() ?? '',\n subset,\n });\n }\n }\n\n return faces;\n}\n\n/**\n * Filter parsed font faces to only the requested subsets.\n */\nexport function filterBySubsets(faces: GoogleFontFace[], subsets: string[]): GoogleFontFace[] {\n if (subsets.length === 0) return faces;\n const subsetSet = new Set(subsets);\n return faces.filter((f) => subsetSet.has(f.subset));\n}\n\n/**\n * Generate a content hash for font data.\n * Returns the first 8 hex chars of the SHA-256 hash.\n */\nexport function contentHash(data: Buffer): string {\n return createHash('sha256').update(data).digest('hex').slice(0, 8);\n}\n\n/**\n * Generate a content-hashed filename for a font face.\n *\n * Format: `<family>-<subset>-<weight>-<style>-<hash>.woff2`\n * Example: `inter-latin-400-normal-abc12345.woff2`\n */\nexport function hashedFontFilename(face: GoogleFontFace, data: Buffer): string {\n const slug = face.family.toLowerCase().replace(/\\s+/g, '-');\n const hash = contentHash(data);\n return `${slug}-${face.subset}-${face.weight}-${face.style}-${hash}.woff2`;\n}\n\n/**\n * Build the cache key for a font face.\n * Used to check if a font has already been downloaded.\n */\nexport function cacheKey(face: GoogleFontFace): string {\n const slug = face.family.toLowerCase().replace(/\\s+/g, '-');\n return `${slug}-${face.subset}-${face.weight}-${face.style}`;\n}\n\n/**\n * Download a single font file from its URL.\n */\nexport async function downloadFontFile(url: string): Promise<Buffer> {\n return retry(async () => {\n let response: Response;\n try {\n response = await fetch(url);\n } catch (err) {\n const code = extractNetworkErrorCode(err);\n throw new Error(\n `[timber] Failed to download font file from ${url}` +\n (code ? ` (${code})` : '') +\n `. Build requires internet access for font optimization.` +\n ` If building offline, set TIMBER_SKIP_FONTS=1 to skip font downloading.`\n );\n }\n if (!response.ok) {\n throw new Error(`Failed to download font from ${url}: ${response.status}`);\n }\n return Buffer.from(await response.arrayBuffer());\n });\n}\n\n/**\n * Download and cache all font files for a set of extracted Google fonts.\n *\n * - Checks the local cache first (node_modules/.cache/timber-fonts/)\n * - Downloads missing fonts from Google Fonts CDN\n * - Writes downloaded fonts to cache\n * - Returns CachedFont entries with content-hashed filenames\n */\nexport async function downloadAndCacheFonts(\n fonts: ExtractedFont[],\n projectRoot: string\n): Promise<CachedFont[]> {\n const cacheDir = join(projectRoot, DEFAULT_CACHE_DIR);\n await mkdir(cacheDir, { recursive: true });\n\n const googleFonts = fonts.filter((f) => f.provider === 'google');\n const cached: CachedFont[] = [];\n\n for (const font of googleFonts) {\n const apiUrl = buildGoogleFontsUrl(font);\n let faces: GoogleFontFace[];\n try {\n faces = await fetchGoogleFontsCss(apiUrl);\n } catch (err) {\n throw new Error(\n `[timber] Failed to download font '${font.family}': ${err instanceof Error ? err.message : String(err)}`\n );\n }\n const filtered = filterBySubsets(faces, font.subsets);\n\n for (const face of filtered) {\n const key = cacheKey(face);\n const metaPath = join(cacheDir, `${key}.meta.json`);\n const dataPath = join(cacheDir, `${key}.woff2`);\n\n let data: Buffer;\n let filename: string;\n\n // Check cache\n const cacheHit = await isCacheHit(metaPath, dataPath);\n if (cacheHit) {\n data = await readFile(dataPath);\n const meta = JSON.parse(await readFile(metaPath, 'utf-8'));\n filename = meta.hashedFilename;\n } else {\n // Download and cache\n data = await downloadFontFile(face.url);\n filename = hashedFontFilename(face, data);\n\n await writeFile(dataPath, data);\n await writeFile(metaPath, JSON.stringify({ hashedFilename: filename, url: face.url }));\n }\n\n cached.push({ face, hashedFilename: filename, cachePath: dataPath, data });\n }\n }\n\n return cached;\n}\n\n/**\n * Check if both the meta and data files exist in the cache.\n */\nasync function isCacheHit(metaPath: string, dataPath: string): Promise<boolean> {\n try {\n await stat(metaPath);\n await stat(dataPath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Generate @font-face descriptors for cached (production) Google Fonts.\n *\n * Each CachedFont gets a FontFaceDescriptor pointing to the\n * content-hashed URL under `<base>_timber/fonts/`. The `urlPrefix` comes\n * from `fontUrlPrefix(viteBase)` so apps deployed under a non-root base\n * resolve fonts correctly.\n */\nexport function generateProductionFontFaces(\n cachedFonts: CachedFont[],\n display: string,\n urlPrefix = fontUrlPrefix()\n): FontFaceDescriptor[] {\n return cachedFonts.map((cf) => ({\n family: cf.face.family,\n src: `url('${urlPrefix}/${cf.hashedFilename}') format('woff2')`,\n weight: cf.face.weight,\n style: cf.face.style,\n display,\n unicodeRange: cf.face.unicodeRange,\n }));\n}\n\n/**\n * Generate @font-face descriptors for dev mode (CDN-pointing).\n *\n * In dev mode, we query the Google Fonts API but use the CDN URLs\n * directly instead of downloading. This avoids the download/cache\n * step during `vite dev`.\n */\nexport function generateDevFontFaces(\n faces: GoogleFontFace[],\n display: string\n): FontFaceDescriptor[] {\n return faces.map((face) => ({\n family: face.family,\n src: `url('${face.url}') format('woff2')`,\n weight: face.weight,\n style: face.style,\n display,\n unicodeRange: face.unicodeRange,\n }));\n}\n\n/**\n * Resolve dev-mode font faces for an extracted font.\n *\n * Fetches the CSS from Google Fonts API and returns FontFaceDescriptors\n * pointing to CDN URLs. No files are downloaded.\n */\nexport async function resolveDevFontFaces(font: ExtractedFont): Promise<FontFaceDescriptor[]> {\n const apiUrl = buildGoogleFontsUrl(font);\n const faces = await fetchGoogleFontsCss(apiUrl);\n const filtered = filterBySubsets(faces, font.subsets);\n return generateDevFontFaces(filtered, font.display);\n}\n","/**\n * @font-face CSS generation.\n *\n * Generates CSS strings from font face descriptors. Used by both\n * Google and local font providers.\n *\n * Design doc: 24-fonts.md §\"Step 3: @font-face Generation\"\n */\n\nimport type { FontFaceDescriptor } from './types.js';\n\n/**\n * Generate a single `@font-face` CSS rule from a descriptor.\n */\nexport function generateFontFace(desc: FontFaceDescriptor): string {\n const lines: string[] = [];\n lines.push('@font-face {');\n lines.push(` font-family: '${desc.family}';`);\n lines.push(` src: ${desc.src};`);\n if (desc.weight) lines.push(` font-weight: ${desc.weight};`);\n if (desc.style) lines.push(` font-style: ${desc.style};`);\n if (desc.display) lines.push(` font-display: ${desc.display};`);\n if (desc.unicodeRange) lines.push(` unicode-range: ${desc.unicodeRange};`);\n lines.push('}');\n return lines.join('\\n');\n}\n\n/**\n * Generate multiple `@font-face` rules from an array of descriptors.\n */\nexport function generateFontFaces(descriptors: FontFaceDescriptor[]): string {\n return descriptors.map(generateFontFace).join('\\n\\n');\n}\n\n/**\n * Generate a scoped CSS class that sets a CSS custom property for the font.\n *\n * Example output:\n * ```css\n * .timber-font-inter {\n * --font-sans: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * font-family: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * }\n * ```\n */\nexport function generateVariableClass(\n className: string,\n variable: string,\n fontFamily: string\n): string {\n return `.${className} {\\n ${variable}: ${fontFamily};\\n font-family: ${fontFamily};\\n}`;\n}\n\n/**\n * Generate a scoped CSS class that applies font-family directly.\n *\n * Used when no `variable` is specified — the className applies\n * the font-family inline instead of through a CSS custom property.\n *\n * Example output:\n * ```css\n * .timber-font-inter {\n * font-family: 'Inter', 'Inter Fallback', system-ui, sans-serif;\n * }\n * ```\n */\nexport function generateFontFamilyClass(className: string, fontFamily: string): string {\n return `.${className} {\\n font-family: ${fontFamily};\\n}`;\n}\n","/**\n * Size-adjusted fallback font generation.\n *\n * Generates `@font-face` declarations for fallback fonts with\n * `size-adjust`, `ascent-override`, `descent-override`, and\n * `line-gap-override` to match custom font metrics and eliminate CLS.\n *\n * Design doc: 24-fonts.md §\"Step 4: Size-Adjusted Fallbacks\"\n */\n\n/**\n * Font metrics for size-adjusted fallback calculation.\n *\n * Values are percentages used in CSS override descriptors.\n */\ninterface FallbackMetrics {\n /** The local() system font to use as base. */\n fallbackFont: string;\n /** size-adjust percentage (e.g. 107.64). */\n sizeAdjust: number;\n /** ascent-override percentage (e.g. 90.49). */\n ascentOverride: number;\n /** descent-override percentage (e.g. 22.48). */\n descentOverride: number;\n /** line-gap-override percentage (e.g. 0). */\n lineGapOverride: number;\n}\n\n/**\n * Lookup table for commonly used Google Fonts.\n *\n * Metrics sourced from fontaine / @capsizecss/metrics.\n * Keyed by lowercase font family name.\n */\nconst FALLBACK_METRICS: Record<string, FallbackMetrics> = {\n 'inter': {\n fallbackFont: 'Arial',\n sizeAdjust: 107.64,\n ascentOverride: 90.49,\n descentOverride: 22.48,\n lineGapOverride: 0,\n },\n 'roboto': {\n fallbackFont: 'Arial',\n sizeAdjust: 100.3,\n ascentOverride: 92.77,\n descentOverride: 24.41,\n lineGapOverride: 0,\n },\n 'open sans': {\n fallbackFont: 'Arial',\n sizeAdjust: 105.48,\n ascentOverride: 101.03,\n descentOverride: 27.47,\n lineGapOverride: 0,\n },\n 'lato': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.5,\n ascentOverride: 100.22,\n descentOverride: 21.16,\n lineGapOverride: 0,\n },\n 'montserrat': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.17,\n ascentOverride: 85.13,\n descentOverride: 22.07,\n lineGapOverride: 0,\n },\n 'poppins': {\n fallbackFont: 'Arial',\n sizeAdjust: 112.76,\n ascentOverride: 96.31,\n descentOverride: 32.1,\n lineGapOverride: 0,\n },\n 'roboto mono': {\n fallbackFont: 'Courier New',\n sizeAdjust: 109.29,\n ascentOverride: 87.79,\n descentOverride: 23.1,\n lineGapOverride: 0,\n },\n 'jetbrains mono': {\n fallbackFont: 'Courier New',\n sizeAdjust: 112.7,\n ascentOverride: 89.53,\n descentOverride: 24.21,\n lineGapOverride: 0,\n },\n 'source code pro': {\n fallbackFont: 'Courier New',\n sizeAdjust: 106.13,\n ascentOverride: 93.47,\n descentOverride: 26.01,\n lineGapOverride: 0,\n },\n 'fira code': {\n fallbackFont: 'Courier New',\n sizeAdjust: 112.96,\n ascentOverride: 86.87,\n descentOverride: 26.34,\n lineGapOverride: 0,\n },\n 'nunito': {\n fallbackFont: 'Arial',\n sizeAdjust: 103.62,\n ascentOverride: 99.45,\n descentOverride: 34.8,\n lineGapOverride: 0,\n },\n 'playfair display': {\n fallbackFont: 'Georgia',\n sizeAdjust: 110.72,\n ascentOverride: 84.44,\n descentOverride: 23.56,\n lineGapOverride: 0,\n },\n 'merriweather': {\n fallbackFont: 'Georgia',\n sizeAdjust: 107.66,\n ascentOverride: 91.93,\n descentOverride: 27.6,\n lineGapOverride: 0,\n },\n 'raleway': {\n fallbackFont: 'Arial',\n sizeAdjust: 107.74,\n ascentOverride: 94.19,\n descentOverride: 26.76,\n lineGapOverride: 0,\n },\n};\n\n/**\n * Known serif font families (lowercase).\n * Used for generic family detection when the name doesn't contain \"serif\".\n */\nconst SERIF_FAMILIES = new Set([\n 'playfair display',\n 'merriweather',\n 'lora',\n 'georgia',\n 'garamond',\n 'eb garamond',\n 'crimson text',\n 'libre baskerville',\n 'source serif pro',\n 'source serif 4',\n 'dm serif display',\n 'dm serif text',\n 'noto serif',\n 'pt serif',\n 'bitter',\n 'domine',\n 'cormorant',\n 'cormorant garamond',\n]);\n\nexport function getGenericFamily(family: string): string {\n const lc = family.toLowerCase();\n if (lc.includes('mono') || lc.includes('code')) return 'monospace';\n if ((lc.includes('serif') && !lc.includes('sans')) || SERIF_FAMILIES.has(lc)) {\n return 'serif';\n }\n return 'sans-serif';\n}\n\n/**\n * Generate the full CSS for a size-adjusted fallback font.\n *\n * This produces a complete @font-face block with override descriptors\n * that FontFaceDescriptor doesn't natively support.\n */\nexport function generateFallbackCss(family: string): string | null {\n const metrics = FALLBACK_METRICS[family.toLowerCase()];\n if (!metrics) return null;\n\n const fallbackFamily = `${family} Fallback`;\n\n const lines = [\n '@font-face {',\n ` font-family: '${fallbackFamily}';`,\n ` src: local('${metrics.fallbackFont}');`,\n ` size-adjust: ${metrics.sizeAdjust}%;`,\n ` ascent-override: ${metrics.ascentOverride}%;`,\n ` descent-override: ${metrics.descentOverride}%;`,\n ` line-gap-override: ${metrics.lineGapOverride}%;`,\n '}',\n ];\n\n return lines.join('\\n');\n}\n\n/**\n * Check whether fallback metrics are available for a font family.\n */\nexport function hasFallbackMetrics(family: string): boolean {\n return family.toLowerCase() in FALLBACK_METRICS;\n}\n\n/**\n * Build the full font stack string for a font, including its\n * size-adjusted fallback and a generic family.\n *\n * Example: `'Inter', 'Inter Fallback', system-ui, sans-serif`\n */\nexport function buildFontStack(family: string): string {\n const generic = getGenericFamily(family);\n const hasMetrics = hasFallbackMetrics(family);\n\n const parts = [`'${family}'`];\n if (hasMetrics) parts.push(`'${family} Fallback'`);\n\n // Add system-ui for sans-serif fonts, ui-monospace for mono\n if (generic === 'monospace') {\n parts.push('ui-monospace');\n } else if (generic === 'sans-serif') {\n parts.push('system-ui');\n }\n parts.push(generic);\n\n return parts.join(', ');\n}\n","/**\n * Generic AST node types and recursive walkers for font static analysis.\n *\n * `ast.ts` owns parsing, config extraction, and call-site discovery; this\n * module owns the recursive walks that police where font bindings may be\n * used (dynamic configs, nested scopes, unconsumed references). Split out\n * to keep `ast.ts` under the 500-code-line limit (design/18-build-system.md).\n *\n * Design doc: 24-fonts.md §\"Step 1: Static Analysis\"\n */\n\n// ── AST node types (minimal subset of estree) ────────────────────────────────\n\nexport interface AstNode {\n type: string;\n [key: string]: unknown;\n}\n\nexport interface IdentifierNode extends AstNode {\n type: 'Identifier';\n name: string;\n}\n\nexport interface PositionedNode extends AstNode {\n start: number;\n end: number;\n}\n\n/** A flagged reference/usage for build-error reporting. */\nexport interface FlaggedUsage {\n name: string;\n line: number;\n column: number;\n}\n\n// ── Offset → line/column helper ──────────────────────────────────────────────\n\n/** Convert a 0-based byte offset into a 1-based line and 0-based column. */\nexport function offsetToLineColumn(\n source: string,\n offset: number\n): { line: number; column: number } {\n let line = 1;\n let lastNewline = -1;\n for (let i = 0; i < offset; i++) {\n if (source[i] === '\\n') {\n line++;\n lastNewline = i;\n }\n }\n return { line, column: offset - lastNewline - 1 };\n}\n\n// ── Shared recursion plumbing ────────────────────────────────────────────────\n\n/**\n * Invoke `visit` on every direct child AST node of `node` (array elements\n * and object-valued properties with a `type` field).\n */\nexport function walkChildNodes(node: AstNode, visit: (child: AstNode) => void): void {\n for (const key of Object.keys(node)) {\n if (key === 'type') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) {\n if (item && typeof item === 'object' && (item as AstNode).type) {\n visit(item as AstNode);\n }\n }\n } else if (child && typeof child === 'object' && (child as AstNode).type) {\n visit(child as AstNode);\n }\n }\n}\n\n// ── Walkers ──────────────────────────────────────────────────────────────────\n\n/**\n * Recursively walk the AST looking for CallExpression nodes where\n * the callee is one of the imported font names and the first argument\n * is not an ObjectExpression (i.e. it's dynamic).\n */\nexport function walkForDynamicCalls(\n node: AstNode,\n names: ReadonlySet<string>,\n source: string\n): string | null {\n if (!node || typeof node !== 'object') return null;\n\n if (node.type === 'CallExpression') {\n const callee = node.callee as AstNode;\n if (callee.type === 'Identifier' && names.has((callee as IdentifierNode).name)) {\n const args = node.arguments as AstNode[];\n if (args.length > 0 && args[0].type !== 'ObjectExpression') {\n // Extract the argument source text\n const argStart = (args[0] as PositionedNode).start;\n const argEnd = (args[0] as PositionedNode).end;\n const argText = source.slice(argStart, argEnd);\n const calleeName = (callee as IdentifierNode).name;\n return `${calleeName}(${argText})`;\n }\n }\n }\n\n let result: string | null = null;\n walkChildNodes(node, (child) => {\n if (!result) result = walkForDynamicCalls(child, names, source);\n });\n return result;\n}\n\n/**\n * Node types that introduce a nested scope — any font call inside is an\n * error (font calls must be module-level, same constraint as Next.js).\n * Module scope so it isn't rebuilt on every recursive walk call.\n */\nconst NESTED_SCOPE_TYPES = new Set([\n 'FunctionDeclaration',\n 'FunctionExpression',\n 'ArrowFunctionExpression',\n 'IfStatement',\n 'ForStatement',\n 'ForInStatement',\n 'ForOfStatement',\n 'WhileStatement',\n 'DoWhileStatement',\n 'SwitchStatement',\n 'TryStatement',\n 'BlockStatement',\n 'ClassDeclaration',\n 'ClassExpression',\n]);\n\n/**\n * Recursively walk an AST node looking for font CallExpressions in nested\n * scopes (function bodies, if-blocks, loops, etc.). Font calls must be\n * module-level; nested calls are collected as errors.\n *\n * `isNested` tracks whether we've descended past the top-level statement.\n * Top-level VariableDeclarations and ExpressionStatements are already\n * handled by the main loop in `findFontCallSites`, so we only flag calls\n * found deeper.\n */\nexport function walkForNestedFontCalls(\n node: AstNode,\n bindingNames: ReadonlyMap<string, unknown>,\n source: string,\n out: FlaggedUsage[],\n isNested: boolean\n): void {\n if (!node || typeof node !== 'object') return;\n\n if (node.type === 'CallExpression') {\n const callee = node.callee as AstNode;\n if (\n isNested &&\n callee.type === 'Identifier' &&\n bindingNames.has((callee as IdentifierNode).name)\n ) {\n const pos = offsetToLineColumn(source, (node as PositionedNode).start);\n out.push({ name: (callee as IdentifierNode).name, line: pos.line, column: pos.column });\n return; // Don't recurse into this call's children\n }\n }\n\n const enterNested = isNested || NESTED_SCOPE_TYPES.has(node.type);\n walkChildNodes(node, (child) =>\n walkForNestedFontCalls(child, bindingNames, source, out, enterNested)\n );\n}\n\n/**\n * Recursively walk an AST node looking for references to font bindings\n * that were not consumed by a recognized call site.\n *\n * Skips:\n * - recognized CallExpressions (the transform rewrites them wholesale)\n * - TS type-position nodes (erased at runtime)\n * - non-computed member properties (`obj.Inter` doesn't reference the binding)\n * - non-computed object keys (`{ Inter: 1 }` doesn't reference the binding)\n * - export aliases (`export { inter as Inter }` — only `local` is a reference)\n */\nexport function walkForUnconsumedReferences(\n node: AstNode,\n bindingNames: ReadonlyMap<string, unknown>,\n consumedCallStarts: ReadonlySet<number>,\n source: string,\n out: FlaggedUsage[]\n): void {\n if (!node || typeof node !== 'object') return;\n if (node.type === 'ImportDeclaration' || node.type.startsWith('TS')) return;\n\n if (node.type === 'Identifier') {\n const name = (node as IdentifierNode).name;\n if (bindingNames.has(name)) {\n const pos = offsetToLineColumn(source, (node as PositionedNode).start);\n out.push({ name, line: pos.line, column: pos.column });\n }\n return;\n }\n\n if (node.type === 'CallExpression' && consumedCallStarts.has((node as PositionedNode).start)) {\n return; // The whole call (callee + config object) is rewritten.\n }\n\n if (node.type === 'MemberExpression' && !(node as { computed?: boolean }).computed) {\n const object = (node as { object?: AstNode }).object;\n if (object) {\n walkForUnconsumedReferences(object, bindingNames, consumedCallStarts, source, out);\n }\n return;\n }\n\n if (node.type === 'Property' && !(node as { computed?: boolean }).computed) {\n const value = (node as { value?: AstNode }).value;\n if (value) {\n walkForUnconsumedReferences(value, bindingNames, consumedCallStarts, source, out);\n }\n return;\n }\n\n if (node.type === 'ExportSpecifier') {\n // Only `local` references a module binding. `exported` is just the\n // public name — `export { inter as Inter }` must not flag `Inter`.\n const local = (node as { local?: AstNode }).local;\n if (local) {\n walkForUnconsumedReferences(local, bindingNames, consumedCallStarts, source, out);\n }\n return;\n }\n\n walkChildNodes(node, (child) =>\n walkForUnconsumedReferences(child, bindingNames, consumedCallStarts, source, out)\n );\n}\n","/**\n * AST utilities for extracting static font configs from source code.\n * Uses OXC via Vite's `parseAst` — handles JS/JSX/TS/TSX natively.\n *\n * Provides two tiers of API:\n *\n * 1. **Source-text helpers** (`extractFontConfigAst`, `extractLocalFontConfigAst`,\n * `detectDynamicFontCallAst`) — parse a snippet and return extracted config.\n * Still used by tests and callers that have only a string.\n *\n * 2. **AST-node helpers** (`extractGoogleFontConfigFromNode`,\n * `extractLocalFontConfigFromNode`, `findFontCallSites`) — operate on\n * nodes from an already-parsed Program so the transform hook can share\n * one parse with all analysis steps.\n *\n * Design doc: 24-fonts.md §\"Step 1: Static Analysis\"\n */\n\nimport { parseAst as viteParseAst } from 'vite';\nimport type { GoogleFontConfig } from './types.js';\nimport type { LocalFontConfig, LocalFontSrc } from './types.js';\nimport type { AstNode, IdentifierNode, PositionedNode, FlaggedUsage } from './ast-walk.js';\nimport {\n offsetToLineColumn,\n walkForDynamicCalls,\n walkForNestedFontCalls,\n walkForUnconsumedReferences,\n} from './ast-walk.js';\n\nexport type { FlaggedUsage } from './ast-walk.js';\n\n// ── AST node types (font-config-specific, on top of ast-walk.ts's base) ──────\n\ninterface LiteralNode extends AstNode {\n type: 'Literal';\n value: string | number | boolean | null;\n}\n\ninterface ArrayExpressionNode extends AstNode {\n type: 'ArrayExpression';\n elements: AstNode[];\n}\n\ninterface ObjectExpressionNode extends AstNode {\n type: 'ObjectExpression';\n properties: PropertyNode[];\n}\n\ninterface PropertyNode extends AstNode {\n type: 'Property';\n key: AstNode & { name?: string; value?: string | number };\n value: AstNode;\n}\n\n// ── Core AST extraction helpers ──────────────────────────────────────────────\n\n/**\n * Parse a JavaScript expression string into an AST node.\n *\n * Wraps the expression in parens so OXC (via vite.parseAst) treats it as an expression statement.\n * Returns null if parsing fails.\n */\nfunction parseExpression(source: string): AstNode | null {\n try {\n const ast = viteParseAst(`(${source})`, { lang: 'tsx' }) as unknown as {\n body: Array<{ expression: AstNode }>;\n };\n return ast.body[0]?.expression ?? null;\n } catch {\n return null;\n }\n}\n\n/**\n * Extract a static string value from an AST node.\n * Returns undefined if the node is not a string literal.\n */\nfunction extractString(node: AstNode): string | undefined {\n if (node.type === 'Literal' && typeof (node as LiteralNode).value === 'string') {\n return (node as LiteralNode).value as string;\n }\n return undefined;\n}\n\n/**\n * Extract a static boolean value from an AST node.\n * Returns undefined if the node is not a boolean literal.\n */\nfunction extractBoolean(node: AstNode): boolean | undefined {\n if (node.type === 'Literal' && typeof (node as LiteralNode).value === 'boolean') {\n return (node as LiteralNode).value as boolean;\n }\n return undefined;\n}\n\n/**\n * Extract a string array from an AST ArrayExpression node.\n * Returns undefined if any element is not a string literal.\n */\nfunction extractStringArray(node: AstNode): string[] | undefined {\n if (node.type !== 'ArrayExpression') return undefined;\n const arr = node as ArrayExpressionNode;\n const result: string[] = [];\n for (const elem of arr.elements) {\n const s = extractString(elem);\n if (s === undefined) return undefined;\n result.push(s);\n }\n return result;\n}\n\n/**\n * Get the key name from a Property node.\n */\nfunction getPropertyKey(prop: PropertyNode): string | undefined {\n if (prop.key.type === 'Identifier') {\n return (prop.key as IdentifierNode).name;\n }\n if (prop.key.type === 'Literal' && typeof prop.key.value === 'string') {\n return prop.key.value;\n }\n return undefined;\n}\n\n/**\n * Build a map of property name → value node from an ObjectExpression.\n */\nfunction objectProperties(node: ObjectExpressionNode): Map<string, AstNode> {\n const map = new Map<string, AstNode>();\n for (const prop of node.properties) {\n // Skip spread elements or computed keys\n if (prop.type !== 'Property') continue;\n const key = getPropertyKey(prop);\n if (key) map.set(key, prop.value);\n }\n return map;\n}\n\n// ── Google font config extraction ────────────────────────────────────────────\n\n/**\n * Extract a GoogleFontConfig from the source text of a font function call's\n * object argument.\n *\n * The `callSource` should be the text of the call's argument list including\n * parens, e.g. `({ subsets: ['latin'], weight: '400' })`.\n *\n * Returns null if parsing or extraction fails.\n */\nexport function extractFontConfigAst(callSource: string): GoogleFontConfig | null {\n const node = parseExpression(callSource);\n if (!node || node.type !== 'ObjectExpression') return null;\n return extractGoogleConfig(node as ObjectExpressionNode);\n}\n\n// ── Local font config extraction ─────────────────────────────────────────────\n\n/**\n * Extract a single LocalFontSrc entry from an ObjectExpression AST node.\n */\nfunction extractLocalFontSrcEntry(node: AstNode): LocalFontSrc | null {\n if (node.type !== 'ObjectExpression') return null;\n const props = objectProperties(node as ObjectExpressionNode);\n\n const pathNode = props.get('path');\n if (!pathNode) return null;\n const path = extractString(pathNode);\n if (path === undefined) return null;\n\n const entry: LocalFontSrc = { path };\n\n const weightNode = props.get('weight');\n if (weightNode) {\n const w = extractString(weightNode);\n if (w !== undefined) entry.weight = w;\n }\n\n const styleNode = props.get('style');\n if (styleNode) {\n const s = extractString(styleNode);\n if (s !== undefined) entry.style = s;\n }\n\n return entry;\n}\n\n/**\n * Extract a LocalFontConfig from the source text of a localFont() call's\n * object argument.\n *\n * Returns null if parsing or extraction fails.\n */\nexport function extractLocalFontConfigAst(callSource: string): LocalFontConfig | null {\n const node = parseExpression(callSource);\n if (!node || node.type !== 'ObjectExpression') return null;\n return extractLocalConfig(node as ObjectExpressionNode);\n}\n\n// ── Dynamic call detection ───────────────────────────────────────────────────\n\n/**\n * Detect if source code contains dynamic/computed font function calls\n * that cannot be statically analyzed.\n *\n * Uses OXC (via vite.parseAst) to parse the full source and inspect CallExpression nodes.\n * Returns the offending expression string if found, null if all calls are static.\n */\nexport function detectDynamicFontCallAst(source: string, importedNames: string[]): string | null {\n if (importedNames.length === 0) return null;\n\n let ast;\n try {\n ast = viteParseAst(source, { lang: 'tsx' }) as unknown as { body: AstNode[] };\n } catch {\n // If we can't parse the source at all, fall back to no detection\n return null;\n }\n\n const nameSet = new Set(importedNames);\n return walkForDynamicCalls(ast as unknown as AstNode, nameSet, source);\n}\n\n// ── AST-node-level config extraction ─────────────────────────────────────────\n//\n// These work on an already-parsed ObjectExpression node so the transform\n// hook can share one OXC (via vite.parseAst) parse of the full source file with all analysis\n// steps (TIM-827).\n\n/**\n * Extract a GoogleFontConfig from an ObjectExpression AST node.\n *\n * This is the node-level equivalent of `extractFontConfigAst` — it skips\n * the parse step because the caller already has a parsed Program.\n */\nexport function extractGoogleFontConfigFromNode(node: AstNode): GoogleFontConfig | null {\n if (node.type !== 'ObjectExpression') return null;\n return extractGoogleConfig(node as ObjectExpressionNode);\n}\n\n/**\n * Extract a LocalFontConfig from an ObjectExpression AST node.\n */\nexport function extractLocalFontConfigFromNode(node: AstNode): LocalFontConfig | null {\n if (node.type !== 'ObjectExpression') return null;\n return extractLocalConfig(node as ObjectExpressionNode);\n}\n\n/** Shared implementation for GoogleFontConfig extraction from an object node. */\nfunction extractGoogleConfig(objNode: ObjectExpressionNode): GoogleFontConfig {\n const props = objectProperties(objNode);\n const config: GoogleFontConfig = {};\n\n const subsetsNode = props.get('subsets');\n if (subsetsNode) {\n const arr = extractStringArray(subsetsNode);\n if (arr) config.subsets = arr;\n }\n\n const weightNode = props.get('weight');\n if (weightNode) {\n const arr = extractStringArray(weightNode);\n if (arr) {\n config.weight = arr;\n } else {\n const s = extractString(weightNode);\n if (s !== undefined) config.weight = s;\n }\n }\n\n const displayNode = props.get('display');\n if (displayNode) {\n const s = extractString(displayNode);\n if (s !== undefined) config.display = s as GoogleFontConfig['display'];\n }\n\n const variableNode = props.get('variable');\n if (variableNode) {\n const s = extractString(variableNode);\n if (s !== undefined) config.variable = s;\n }\n\n const styleNode = props.get('style');\n if (styleNode) {\n const arr = extractStringArray(styleNode);\n if (arr) {\n config.style = arr;\n } else {\n const s = extractString(styleNode);\n if (s !== undefined) config.style = s;\n }\n }\n\n const preloadNode = props.get('preload');\n if (preloadNode) {\n const b = extractBoolean(preloadNode);\n if (b !== undefined) config.preload = b;\n }\n\n return config;\n}\n\n/** Shared implementation for LocalFontConfig extraction from an object node. */\nfunction extractLocalConfig(objNode: ObjectExpressionNode): LocalFontConfig | null {\n const props = objectProperties(objNode);\n\n const displayNode = props.get('display');\n const display = displayNode\n ? (extractString(displayNode) as LocalFontConfig['display'])\n : undefined;\n\n const variableNode = props.get('variable');\n const variable = variableNode ? extractString(variableNode) : undefined;\n\n const familyNode = props.get('family');\n const family = familyNode ? extractString(familyNode) : undefined;\n\n const srcNode = props.get('src');\n if (!srcNode) return null;\n\n const srcString = extractString(srcNode);\n if (srcString !== undefined) {\n return { src: srcString, display, variable, family };\n }\n\n if (srcNode.type === 'ArrayExpression') {\n const arr = srcNode as ArrayExpressionNode;\n const entries: LocalFontSrc[] = [];\n for (const elem of arr.elements) {\n const entry = extractLocalFontSrcEntry(elem);\n if (!entry) return null;\n entries.push(entry);\n }\n if (entries.length === 0) return null;\n return { src: entries, display, variable, family };\n }\n\n return null;\n}\n\n// ── Font module specifiers ───────────────────────────────────────────────────\n\nconst GOOGLE_FONT_SOURCES = new Set([\n '@timber/fonts/google',\n '@timber-js/app/fonts/google',\n 'next/font/google',\n]);\n\nconst LOCAL_FONT_SOURCES = new Set([\n '@timber/fonts/local',\n '@timber-js/app/fonts/local',\n 'next/font/local',\n]);\n\n// ── Parsed source types ──────────────────────────────────────────────────────\n\n/** A font import binding discovered from an ImportDeclaration. */\nexport interface FontBinding {\n /** The local name used in the module (after `as`, if present). */\n localName: string;\n /**\n * The original exported name (before `as`). For Google fonts this is\n * the PascalCase_With_Underscores name that maps to the family. For\n * local fonts (`default` import), this is `'default'`.\n */\n importedName: string;\n /** `'google'` or `'local'`. */\n provider: 'google' | 'local';\n /** The AST node of the ImportDeclaration (for removal via magic-string). */\n importNode: AstNode & { start: number; end: number };\n}\n\n/** A font function call site discovered from a CallExpression. */\nexport interface FontCallSite {\n /** The binding that this call references. */\n binding: FontBinding;\n /**\n * The variable name this call is assigned to, if the call appears in a\n * VariableDeclarator. `null` for bare expression statements.\n */\n assignedName: string | null;\n /** The first argument AST node (expected to be an ObjectExpression). */\n configNode: AstNode;\n /**\n * The outermost AST node to replace. For a VariableDeclaration with a\n * single declarator this is the full declaration; for a bare expression\n * statement it is the ExpressionStatement. The transform replaces\n * `source[replaceStart..replaceEnd]`.\n */\n replaceStart: number;\n replaceEnd: number;\n /** Line number (1-based) of the call for error messages. */\n line: number;\n /** Column (0-based) of the call for error messages. */\n column: number;\n}\n\n/** Result of `findFontCallSites` — everything the transform needs. */\nexport interface FontAnalysis {\n bindings: FontBinding[];\n callSites: FontCallSite[];\n /**\n * Import nodes that should be removed (deduplicated). Only imports that\n * produced at least one font binding are listed — removing an import\n * whose bindings the transform doesn't rewrite (e.g. a namespace\n * import) would leave dangling references behind.\n */\n importNodesToRemove: Array<{ start: number; end: number }>;\n /** First dynamic call expression text, or `null`. */\n dynamicCall: string | null;\n /**\n * Font calls found in nested scopes (functions, if-blocks, etc.).\n * These are errors — font calls must be module-level.\n */\n nestedCalls: FlaggedUsage[];\n /**\n * Namespace imports of font modules (`import * as fonts from ...`).\n * These are errors — the transform cannot rewrite `fonts.Inter(...)`\n * member calls, so the fonts would silently never load.\n */\n namespaceImports: FlaggedUsage[];\n /**\n * References to font bindings that were not consumed by a recognized\n * call site (`export default Inter({...})`, object-literal nesting,\n * member access on the call result, aliasing, re-exports). These are\n * errors — the import is removed, so any leftover reference would be a\n * silent runtime ReferenceError.\n */\n unsupportedUsages: FlaggedUsage[];\n}\n\ninterface ImportDeclarationNode extends PositionedNode {\n type: 'ImportDeclaration';\n source: LiteralNode & { value: string };\n specifiers: Array<\n PositionedNode & {\n type: string;\n local: IdentifierNode;\n imported?: IdentifierNode;\n }\n >;\n}\n\ninterface CallExpressionNode extends PositionedNode {\n type: 'CallExpression';\n callee: AstNode;\n arguments: PositionedNode[];\n}\n\ninterface VariableDeclaratorNode extends PositionedNode {\n type: 'VariableDeclarator';\n id: PositionedNode;\n init: PositionedNode | null;\n}\n\ninterface VariableDeclarationNode extends PositionedNode {\n type: 'VariableDeclaration';\n declarations: VariableDeclaratorNode[];\n}\n\ninterface ExpressionStatementNode extends PositionedNode {\n type: 'ExpressionStatement';\n expression: PositionedNode;\n}\n\ninterface ExportNamedDeclarationNode extends PositionedNode {\n type: 'ExportNamedDeclaration';\n declaration: VariableDeclarationNode | ExpressionStatementNode | null;\n}\n\n// ── Type guards for AST narrowing ────────────────────────────────────────────\n//\n// OXC's parsed nodes all share the base `PositionedNode` shape with\n// `type: string`. TypeScript can't narrow a union that includes a\n// `string`-typed catch-all, so we use explicit type guards instead of\n// bare `.type ===` checks.\n\nfunction isImportDeclaration(node: PositionedNode): node is ImportDeclarationNode {\n return node.type === 'ImportDeclaration';\n}\n\nfunction isVariableDeclaration(node: PositionedNode): node is VariableDeclarationNode {\n return node.type === 'VariableDeclaration';\n}\n\nfunction isExpressionStatement(node: PositionedNode): node is ExpressionStatementNode {\n return node.type === 'ExpressionStatement';\n}\n\nfunction isExportNamedDeclaration(node: PositionedNode): node is ExportNamedDeclarationNode {\n return node.type === 'ExportNamedDeclaration';\n}\n\nfunction isCallExpression(node: PositionedNode): node is CallExpressionNode {\n return node.type === 'CallExpression';\n}\n\nfunction isIdentifier(node: AstNode): node is IdentifierNode {\n return node.type === 'Identifier';\n}\n\ninterface ProgramNode extends PositionedNode {\n type: 'Program';\n body: PositionedNode[];\n}\n\n/**\n * Parse a full source file and find all font imports and call sites.\n *\n * Returns `null` if the source has no font-related imports.\n */\nexport function findFontCallSites(source: string): FontAnalysis | null {\n let program: ProgramNode;\n try {\n program = viteParseAst(source, { lang: 'tsx' }) as unknown as ProgramNode;\n } catch {\n return null;\n }\n\n // Step 1: Find all font import declarations and build the bindings list.\n const bindings: FontBinding[] = [];\n const importNodesToRemove: Array<{ start: number; end: number }> = [];\n const namespaceImports: FlaggedUsage[] = [];\n\n for (const stmt of program.body) {\n if (!isImportDeclaration(stmt)) continue;\n const importDecl = stmt;\n const specSource = importDecl.source.value;\n\n let provider: 'google' | 'local' | null = null;\n if (GOOGLE_FONT_SOURCES.has(specSource)) provider = 'google';\n else if (LOCAL_FONT_SOURCES.has(specSource)) provider = 'local';\n if (!provider) continue;\n\n let producedBinding = false;\n for (const spec of importDecl.specifiers) {\n if (spec.type === 'ImportSpecifier' && provider === 'google') {\n producedBinding = true;\n bindings.push({\n localName: spec.local.name,\n importedName: spec.imported?.name ?? spec.local.name,\n provider,\n importNode: importDecl,\n });\n } else if (spec.type === 'ImportDefaultSpecifier' && provider === 'local') {\n producedBinding = true;\n bindings.push({\n localName: spec.local.name,\n importedName: 'default',\n provider,\n importNode: importDecl,\n });\n } else if (spec.type === 'ImportNamespaceSpecifier') {\n // `import * as fonts from ...` cannot be rewritten — the transform\n // only matches direct identifier calls, so `fonts.Inter(...)` would\n // silently fall through to the runtime fallback module and never\n // load a real font. Collected as a build error.\n const pos = offsetToLineColumn(source, spec.start);\n namespaceImports.push({ name: spec.local.name, line: pos.line, column: pos.column });\n }\n }\n\n // Only remove imports whose bindings the transform actually rewrites.\n // Removing an import that produced no binding (namespace imports,\n // default imports of the google module) would orphan its references.\n if (producedBinding) {\n importNodesToRemove.push({ start: stmt.start, end: stmt.end });\n }\n }\n\n if (bindings.length === 0 && namespaceImports.length === 0) return null;\n\n // Step 2: Walk the AST for CallExpression nodes whose callee is a font binding.\n const bindingsByName = new Map(bindings.map((b) => [b.localName, b]));\n const callSites: FontCallSite[] = [];\n // Start offsets of recognized (and dynamic-flagged) CallExpressions, so\n // the unsupported-reference walk in step 4 can skip them.\n const consumedCallStarts = new Set<number>();\n let dynamicCall: string | null = null;\n\n for (const stmt of program.body) {\n // Unwrap `export const roboto = Roboto(...)` — the AST wraps the\n // VariableDeclaration inside an ExportNamedDeclaration node.\n const effectiveStmt =\n isExportNamedDeclaration(stmt) && stmt.declaration ? stmt.declaration : stmt;\n\n // VariableDeclaration: `const inter = Inter({ ... })`\n if (isVariableDeclaration(effectiveStmt)) {\n for (const declarator of effectiveStmt.declarations) {\n if (!declarator.init) continue;\n if (!isCallExpression(declarator.init)) continue;\n const call = declarator.init;\n const site = matchCallExpression(call, bindingsByName, source);\n if (!site) continue;\n\n if (site === 'dynamic') {\n consumedCallStarts.add(call.start);\n if (!dynamicCall && isIdentifier(call.callee)) {\n const argStart = call.arguments[0].start;\n const argEnd = call.arguments[0].end;\n dynamicCall = `${call.callee.name}(${source.slice(argStart, argEnd)})`;\n }\n continue;\n }\n\n const assignedName = isIdentifier(declarator.id) ? declarator.id.name : null;\n\n const { line, column } = offsetToLineColumn(source, call.start);\n consumedCallStarts.add(call.start);\n callSites.push({\n binding: site.binding,\n assignedName,\n configNode: site.configNode,\n replaceStart: call.start,\n replaceEnd: call.end,\n line,\n column,\n });\n }\n }\n\n // ExpressionStatement: `Inter({ ... })` as a bare call\n if (isExpressionStatement(effectiveStmt)) {\n if (isCallExpression(effectiveStmt.expression)) {\n const call = effectiveStmt.expression;\n const site = matchCallExpression(call, bindingsByName, source);\n if (site && site !== 'dynamic') {\n const { line, column } = offsetToLineColumn(source, call.start);\n consumedCallStarts.add(call.start);\n callSites.push({\n binding: site.binding,\n assignedName: null,\n configNode: site.configNode,\n replaceStart: effectiveStmt.start,\n replaceEnd: effectiveStmt.end,\n line,\n column,\n });\n } else if (site === 'dynamic') {\n consumedCallStarts.add(call.start);\n if (!dynamicCall && isIdentifier(call.callee)) {\n const argStart = call.arguments[0].start;\n const argEnd = call.arguments[0].end;\n dynamicCall = `${call.callee.name}(${source.slice(argStart, argEnd)})`;\n }\n }\n }\n }\n }\n\n // Step 3: Walk nested scopes to find font calls that aren't module-level.\n // Font calls must be at module scope (same constraint as Next.js).\n // If the import is removed but a nested call remains, it's a ReferenceError.\n const nestedCalls: FlaggedUsage[] = [];\n for (const stmt of program.body) {\n if (stmt.type === 'ImportDeclaration') continue;\n walkForNestedFontCalls(stmt as AstNode, bindingsByName, source, nestedCalls, false);\n }\n\n // Step 4: Walk for references to font bindings that were not consumed by\n // a recognized call site. The transform removes the import declarations,\n // so any leftover reference (`export default Inter({...})`, object-literal\n // nesting, `Inter({...}).className`, `const f = Inter`, `export { Inter }`)\n // would become a silent runtime ReferenceError. Collected as build errors.\n const unsupportedUsages: FlaggedUsage[] = [];\n for (const stmt of program.body) {\n if (stmt.type === 'ImportDeclaration') continue;\n walkForUnconsumedReferences(\n stmt as AstNode,\n bindingsByName,\n consumedCallStarts,\n source,\n unsupportedUsages\n );\n }\n\n return {\n bindings,\n callSites,\n importNodesToRemove,\n dynamicCall,\n nestedCalls,\n namespaceImports,\n unsupportedUsages,\n };\n}\n\n/**\n * Match a CallExpression against the font bindings map.\n *\n * Returns the binding + config node if the call is a static font call,\n * `'dynamic'` if it's a font call with a non-object argument, or `null`\n * if the callee doesn't match any font binding.\n */\nfunction matchCallExpression(\n call: CallExpressionNode,\n bindings: Map<string, FontBinding>,\n _source: string\n): { binding: FontBinding; configNode: AstNode } | 'dynamic' | null {\n if (!isIdentifier(call.callee)) return null;\n const calleeName = call.callee.name;\n const binding = bindings.get(calleeName);\n if (!binding) return null;\n\n const args = call.arguments;\n if (args.length === 0 || args[0].type !== 'ObjectExpression') {\n return 'dynamic';\n }\n\n return { binding, configNode: args[0] };\n}\n","/**\n * Local font processing for the timber-fonts pipeline.\n *\n * Handles:\n * - Resolving font file paths relative to the importing module\n * - Normalizing single-string `src` to array form\n * - Generating @font-face descriptors for each weight/style variant\n *\n * Does NOT handle:\n * - Font format conversion (serve whatever the user provides)\n * - Font subsetting (user's responsibility for local fonts)\n *\n * Design doc: 24-fonts.md §\"Local Fonts\"\n */\n\nimport { resolve, dirname, extname } from 'node:path';\nimport type { LocalFontConfig, LocalFontSrc, FontFaceDescriptor, ExtractedFont } from './types.js';\nimport { buildFontStack } from './fallbacks.js';\nimport { extractLocalFontConfigAst } from './ast.js';\nimport { fontOutputBasename, fontUrlPrefix } from './paths.js';\n\n/**\n * Infer the font format from a file extension.\n *\n * Returns the CSS `format()` value for `@font-face` src descriptors.\n */\nexport function inferFontFormat(filePath: string): string {\n const ext = extname(filePath).toLowerCase();\n switch (ext) {\n case '.woff2':\n return 'woff2';\n case '.woff':\n return 'woff';\n case '.ttf':\n return 'truetype';\n case '.otf':\n return 'opentype';\n case '.eot':\n return 'embedded-opentype';\n default:\n return 'woff2';\n }\n}\n\n/**\n * Normalize `src` config to an array of LocalFontSrc entries.\n *\n * When `src` is a single string, it becomes a single entry with\n * default weight '400' and style 'normal'.\n */\nexport function normalizeSrc(src: string | LocalFontSrc[]): LocalFontSrc[] {\n if (typeof src === 'string') {\n return [{ path: src, weight: '400', style: 'normal' }];\n }\n return src.map((entry) => ({\n path: entry.path,\n weight: entry.weight ?? '400',\n style: entry.style ?? 'normal',\n }));\n}\n\n/**\n * Resolve font file paths relative to the importing module's directory.\n *\n * Takes the importer's file path and the normalized src entries,\n * returns new entries with absolute resolved paths.\n */\nexport function resolveLocalFontPaths(\n importerPath: string,\n sources: LocalFontSrc[]\n): LocalFontSrc[] {\n const importerDir = dirname(importerPath);\n return sources.map((entry) => ({\n ...entry,\n path: resolve(importerDir, entry.path),\n }));\n}\n\n/**\n * Generate a deterministic font family name from the file path\n * when no explicit `family` is provided.\n *\n * Uses the filename without extension, e.g. \"MyFont-Regular.woff2\" → \"MyFont-Regular\".\n * For multi-weight sources, uses the first file's name stem.\n */\nexport function generateFamilyName(sources: LocalFontSrc[]): string {\n if (sources.length === 0) return 'Local Font';\n const firstPath = sources[0].path;\n const basename = fontOutputBasename(firstPath);\n // Remove extension and weight/style suffixes for a cleaner family name\n const stem = basename.replace(/\\.[^.]+$/, '');\n // Strip common weight/style suffixes to get the family root\n const family = stem.replace(\n /[-_]?(Regular|Bold|Italic|Light|Medium|SemiBold|ExtraBold|Thin|Black|Heavy)$/i,\n ''\n );\n return family || stem;\n}\n\n/**\n * Generate @font-face descriptors for local font sources.\n *\n * Each source entry produces one @font-face rule. The `src` descriptor\n * uses a `url()` pointing to the served path under `<base>_timber/fonts/`.\n * The `urlPrefix` defaults to `fontUrlPrefix()` (root base) — pass\n * `fontUrlPrefix(viteBase)` so non-root deployments resolve correctly.\n */\nexport function generateLocalFontFaces(\n family: string,\n sources: LocalFontSrc[],\n display: string,\n urlPrefix = fontUrlPrefix()\n): FontFaceDescriptor[] {\n return sources.map((entry) => {\n const format = inferFontFormat(entry.path);\n const filename = entry.hashedBasename ?? fontOutputBasename(entry.path);\n return {\n family,\n src: `url('${urlPrefix}/${filename}') format('${format}')`,\n weight: entry.weight,\n style: entry.style,\n display,\n };\n });\n}\n\n/**\n * Build the className for a local font, following the same convention\n * as Google fonts: `timber-font-<lowercase-hyphenated-family>`.\n */\nexport function localFontClassName(family: string): string {\n return `timber-font-${family.toLowerCase().replace(/\\s+/g, '-')}`;\n}\n\n/**\n * Process a local font config into an ExtractedFont.\n *\n * This is the main entry point called by the fonts plugin's transform hook\n * when it encounters a `localFont()` call.\n */\nexport function processLocalFont(config: LocalFontConfig, importerPath: string): ExtractedFont {\n const sources = normalizeSrc(config.src);\n const resolvedSources = resolveLocalFontPaths(importerPath, sources);\n const family = config.family ?? generateFamilyName(sources);\n const display = config.display ?? 'swap';\n const className = localFontClassName(family);\n const fontStack = buildFontStack(family);\n\n const weights = [...new Set(resolvedSources.map((s) => s.weight ?? '400'))];\n const styles = [...new Set(resolvedSources.map((s) => s.style ?? 'normal'))];\n\n return {\n id: `local-${family.toLowerCase().replace(/\\s+/g, '-')}-${weights.join(',')}-${styles.join(',')}`,\n family,\n provider: 'local',\n weights,\n styles,\n subsets: [],\n display,\n variable: config.variable,\n localSources: resolvedSources,\n importer: importerPath,\n className,\n fontFamily: fontStack,\n };\n}\n\n/**\n * Extract a LocalFontConfig from a static `localFont()` call source.\n *\n * Parses patterns like:\n * localFont({ src: './fonts/MyFont.woff2', display: 'swap', variable: '--font-custom' })\n * localFont({ src: [{ path: './a.woff2', weight: '400' }, { path: './b.woff2', weight: '700' }] })\n *\n * Returns null if the call cannot be statically analyzed.\n *\n * Uses OXC (via vite.parseAst) AST parsing for robust handling of comments, trailing commas,\n * and multi-line configs.\n */\nexport function extractLocalFontConfig(callSource: string): LocalFontConfig | null {\n return extractLocalFontConfigAst(callSource);\n}\n","/**\n * Virtual module source generators for the timber-fonts plugin.\n *\n * The plugin exposes three virtual modules:\n *\n * - `@timber/fonts/google` — exports Google font loader functions. The\n * transform hook replaces actual call sites with static `FontResult`\n * objects, so this module is only loaded as a fallback (e.g. when the\n * transform hook hasn't run yet, or when an unknown font is referenced\n * via the default export proxy).\n * - `@timber/fonts/local` — exports `localFont()` as a fallback default.\n * - `virtual:timber-font-css/<hash>.css` — per-importer CSS module that\n * holds the combined `@font-face` + fallback + class CSS for every\n * font registered under that importer. The transform hook injects a\n * side-effect `import 'virtual:timber-font-css/<hash>.css'` into each\n * file that calls a font function, so Vite's CSS pipeline picks it up\n * like any other CSS asset. @vitejs/plugin-rsc's `collectCss` walks\n * the RSC module graph, finds the virtual module, and injects a\n * `<link rel=\"stylesheet\" data-rsc-css-href=...>` via React Float —\n * the same machinery component CSS rides on (TIM-828).\n *\n * The `.css` suffix is load-bearing: Vite's `isCSSRequest` regex matches\n * on file extension, so keeping it in the virtual id is how we tell\n * Vite's CSS pipeline (dev HMR + build asset emission) that this\n * module is CSS. The old `virtual:timber-font-css-register` side-effect\n * module, `globalThis.__timber_font_css` channel, and inline `<style>`\n * tag in the RSC entry were all removed in TIM-828.\n *\n * Design doc: 24-fonts.md\n */\n\nimport { createHash } from 'node:crypto';\nimport type { ExtractedFont } from './types.js';\n\nexport const VIRTUAL_GOOGLE = '@timber/fonts/google';\nexport const VIRTUAL_LOCAL = '@timber/fonts/local';\nexport const RESOLVED_GOOGLE = '\\0@timber/fonts/google';\nexport const RESOLVED_LOCAL = '\\0@timber/fonts/local';\n\n/**\n * Prefix used for the per-importer virtual CSS modules. The full id is\n * `virtual:timber-font-css/<hash>.css` where `<hash>` is a short SHA-256\n * digest of the importer path. We encode the hash (not the path itself)\n * so the id stays filesystem-safe and opaque to downstream consumers.\n */\nexport const VIRTUAL_FONT_CSS_PREFIX = 'virtual:timber-font-css/';\nexport const VIRTUAL_FONT_CSS_SUFFIX = '.css';\nexport const RESOLVED_FONT_CSS_PREFIX = '\\0' + VIRTUAL_FONT_CSS_PREFIX;\n\n/**\n * In-memory map from the short hash used in virtual module ids back to\n * the absolute importer path. Populated by `virtualFontCssIdFor()` when\n * the transform hook registers an importer and read by the plugin's\n * `load` hook when Vite asks for the CSS content.\n *\n * Scoped to a single `FontPipeline` instance to avoid cross-plugin-\n * instance collisions during multi-build pipelines.\n */\nfunction stripIdDecorations(id: string): string {\n const bare = id.startsWith('\\0') ? id.slice(1) : id;\n const qIdx = bare.indexOf('?');\n return qIdx === -1 ? bare : bare.slice(0, qIdx);\n}\n\nexport class VirtualFontCssIdMap {\n private readonly map = new Map<string, string>();\n\n /**\n * Return a stable virtual module id for `importer`. Calling this twice\n * with the same importer returns the same id. Registering under an\n * existing hash is idempotent.\n */\n idFor(importer: string): string {\n const hash = createHash('sha256').update(importer).digest('hex').slice(0, 16);\n this.map.set(hash, importer);\n return `${VIRTUAL_FONT_CSS_PREFIX}${hash}${VIRTUAL_FONT_CSS_SUFFIX}`;\n }\n\n /** Decode the importer from a resolved (or unresolved) virtual css id. */\n importerFor(id: string): string | undefined {\n const body = stripIdDecorations(id);\n if (!body.startsWith(VIRTUAL_FONT_CSS_PREFIX)) return undefined;\n if (!body.endsWith(VIRTUAL_FONT_CSS_SUFFIX)) return undefined;\n const hash = body.slice(\n VIRTUAL_FONT_CSS_PREFIX.length,\n body.length - VIRTUAL_FONT_CSS_SUFFIX.length\n );\n return this.map.get(hash);\n }\n\n /** True if `id` is any form of the virtual font css module. */\n matches(id: string): boolean {\n const body = stripIdDecorations(id);\n return body.startsWith(VIRTUAL_FONT_CSS_PREFIX) && body.endsWith(VIRTUAL_FONT_CSS_SUFFIX);\n }\n\n /** Drop every registered mapping. Used by tests. */\n clear(): void {\n this.map.clear();\n }\n}\n\n/**\n * Convert a font family name to a PascalCase export name.\n * e.g. \"JetBrains Mono\" → \"JetBrains_Mono\"\n */\nfunction familyToExportName(family: string): string {\n return family.replace(/\\s+/g, '_');\n}\n\n/**\n * Generate the virtual module source for `@timber/fonts/google`.\n *\n * The transform hook replaces real call sites at build time, so this\n * module only matters as a runtime fallback. We export a Proxy default\n * that handles any font name plus named exports for known families\n * (for tree-shaking).\n */\nexport function generateGoogleVirtualModule(fonts: Iterable<ExtractedFont>): string {\n const families = new Set<string>();\n for (const font of fonts) {\n if (font.provider === 'google') families.add(font.family);\n }\n\n const lines = [\n '// Auto-generated virtual module: @timber/fonts/google',\n '// Each export is a font loader function that returns a FontResult.',\n '',\n 'function createFontResult(family, config) {',\n ' return {',\n // eslint-disable-next-line no-template-curly-in-string -- codegen output\n ' className: `timber-font-${family.toLowerCase().replace(/\\\\s+/g, \"-\")}`,',\n ' style: { fontFamily: family },',\n ' variable: config?.variable,',\n ' };',\n '}',\n '',\n 'export default new Proxy({}, {',\n ' get(_, prop) {',\n ' if (typeof prop === \"string\") {',\n ' return (config) => createFontResult(prop.replace(/_/g, \" \"), config);',\n ' }',\n ' }',\n '});',\n ];\n\n for (const family of families) {\n const exportName = familyToExportName(family);\n lines.push('');\n lines.push(`export function ${exportName}(config) {`);\n lines.push(` return createFontResult('${family}', config);`);\n lines.push('}');\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Generate the virtual module source for `@timber/fonts/local`.\n *\n * Like the google virtual module, this is a runtime fallback. The\n * transform hook normally replaces `localFont(...)` calls with static\n * `FontResult` objects at build time.\n */\nexport function generateLocalVirtualModule(): string {\n return [\n '// Auto-generated virtual module: @timber/fonts/local',\n '',\n 'export default function localFont(config) {',\n ' const family = config?.family || \"Local Font\";',\n ' return {',\n // eslint-disable-next-line no-template-curly-in-string -- codegen output\n ' className: `timber-font-${family.toLowerCase().replace(/\\\\s+/g, \"-\")}`,',\n ' style: { fontFamily: family },',\n ' variable: config?.variable,',\n ' };',\n '}',\n ].join('\\n');\n}\n","/**\n * FontPipeline — owns all per-font state for the timber-fonts plugin.\n *\n * Before TIM-829, font state was spread across three parallel mutable maps:\n *\n * - `registry: Map<string, ExtractedFont>`\n * - `googleFontFacesMap: Map<string, FontFaceDescriptor[]>`\n * - `cachedFonts: CachedFont[]`\n *\n * Every plugin hook had to remember which map(s) it owned and which it\n * read. The TIM-824 bug existed because `transform` could write to\n * `registry` multiple times for the same `(importer, family)` pair without\n * a corresponding cleanup of the entries that `buildStart` / `load` would\n * later use. The fix in TIM-824 added prune calls in `transform` for the\n * registry, but the parallel maps still had the same hazard latent in\n * them: any future code path that ran `buildStart`-equivalent logic on\n * HMR could re-introduce a stale-entry leak in a different map.\n *\n * TIM-829 collapses the three maps into a single `Map<string, FontEntry>`\n * keyed by font ID. Mutation goes through a small set of methods that\n * maintain the core invariant: **every piece of state belonging to a font\n * lives on its `FontEntry`, and `pruneFor` removes the entry along with\n * everything attached to it in one call.** No code path inside the plugin\n * touches the underlying map directly.\n *\n * Design doc: 24-fonts.md\n */\n\nimport { readFileSync, existsSync } from 'node:fs';\nimport { resolve, normalize } from 'node:path';\nimport type { ExtractedFont, FontEntry, FontFaceDescriptor } from './types.js';\nimport type { CachedFont } from './google.js';\nimport { contentHash } from './google.js';\nimport { generateVariableClass, generateFontFamilyClass, generateFontFaces } from './css.js';\nimport { generateFallbackCss } from './fallbacks.js';\nimport { generateLocalFontFaces } from './local.js';\nimport { hashedFontBasename, fontUrlPrefix } from './paths.js';\nimport { VirtualFontCssIdMap } from './virtual-modules.js';\n\nexport class FontPipeline {\n /**\n * The single per-font store. Keyed by `FontEntry.id` (which is itself\n * derived from `family + weights + styles + subsets + display`, so any\n * config change produces a new key).\n *\n * Marked `readonly` so the field reference can never be reassigned, but\n * the map contents are mutable through the methods below.\n */\n private readonly _entries = new Map<string, FontEntry>();\n\n /** When true, local font sources are content-hashed at registration time. */\n private readonly _hashOnRegister: boolean;\n\n /**\n * Vite's resolved `base`. Set from the plugin's `configResolved` hook so\n * every @font-face URL the pipeline renders carries the prefix.\n */\n private _base = '/';\n\n constructor(opts?: { hashOnRegister?: boolean }) {\n this._hashOnRegister = opts?.hashOnRegister ?? false;\n }\n\n /** Set Vite's resolved `base` (from `configResolved`). */\n setBase(base: string): void {\n this._base = base;\n }\n\n /**\n * Per-importer virtual CSS module id registry. Populated by the\n * transform hook when it inlines a font function call, read by the\n * plugin's `load` hook when Vite asks for the module's CSS source.\n *\n * Lives on the pipeline (rather than a module-level singleton) so\n * multiple parallel plugin instances — e.g. in the test suite — cannot\n * collide on the hash-to-importer map. Also makes `clear()` reset the\n * id map alongside the font entries so test fixtures start clean.\n */\n readonly cssIdMap = new VirtualFontCssIdMap();\n\n // ── Read-only accessors ─────────────────────────────────────────────────\n\n /** Number of registered fonts. */\n size(): number {\n return this._entries.size;\n }\n\n /** Iterate every entry as a `FontEntry` (with `faces` / `cachedFiles`). */\n entries(): IterableIterator<FontEntry> {\n return this._entries.values();\n }\n\n /** Iterate every entry typed as the narrower `ExtractedFont` shape. */\n fonts(): IterableIterator<ExtractedFont> {\n return this._entries.values();\n }\n\n /** Iterate every Google-provider entry. */\n *googleFonts(): IterableIterator<FontEntry> {\n for (const entry of this._entries.values()) {\n if (entry.provider === 'google') yield entry;\n }\n }\n\n /** Lookup an entry by font ID. */\n getEntry(id: string): FontEntry | undefined {\n return this._entries.get(id);\n }\n\n /**\n * True if `attachFaces()` has been called for `fontId` — even with an\n * empty array. This intentionally treats an empty resolution as\n * \"already processed\" so the dev `load()` path doesn't keep retrying\n * `resolveDevFontFaces()` on every request when Google returns no\n * matching faces for the requested subset(s). Mirrors the previous\n * `Map.has()` semantics this method replaced. (Codex review on PR #596.)\n *\n * Failures inside `resolveDevFontFaces` do not call `attachFaces` at\n * all, so they correctly stay retryable on the next request — see the\n * TIM-636 comment in `plugins/fonts.ts`.\n */\n hasFaces(fontId: string): boolean {\n const entry = this._entries.get(fontId);\n return entry?.faces !== undefined;\n }\n\n /**\n * True if `attachCachedFiles()` has been called for `fontId` — even\n * with an empty array. Same presence-vs-content rationale as\n * `hasFaces`: an empty resolution is a deterministic outcome, not a\n * \"not yet processed\" signal.\n */\n hasCachedFiles(fontId: string): boolean {\n const entry = this._entries.get(fontId);\n return entry?.cachedFiles !== undefined;\n }\n\n // ── Mutators ────────────────────────────────────────────────────────────\n\n /**\n * Register an extracted font under its content-derived ID.\n *\n * If an entry with the same ID already exists it is replaced wholesale,\n * dropping any previously-attached `faces` and `cachedFiles`. Callers\n * must call `pruneFor(importer, family)` first to ensure that any\n * previous registration from the same `(importer, family)` pair has been\n * dropped (TIM-824).\n */\n register(extracted: ExtractedFont): void {\n // Wholesale replace — never merge faces/cachedFiles from a previous\n // registration. Re-registration with the same ID always represents the\n // newest authoritative config and must start from a clean slate.\n const entry: FontEntry = { ...extracted };\n if (this._hashOnRegister && entry.provider === 'local' && entry.localSources) {\n for (const src of entry.localSources) {\n const absolutePath = normalize(resolve(src.path));\n if (!existsSync(absolutePath)) continue;\n const data = readFileSync(absolutePath);\n src.hashedBasename = hashedFontBasename(src.path, contentHash(data));\n }\n }\n this._entries.set(entry.id, entry);\n }\n\n /** Attach pre-resolved `@font-face` descriptors to a font entry. */\n attachFaces(fontId: string, faces: FontFaceDescriptor[]): void {\n const entry = this._entries.get(fontId);\n if (!entry) {\n throw new Error(\n `[timber-fonts] attachFaces: no font entry registered for id \"${fontId}\". ` +\n `Call register() first.`\n );\n }\n entry.faces = faces;\n }\n\n /** Attach downloaded Google Font binaries to a font entry. */\n attachCachedFiles(fontId: string, files: CachedFont[]): void {\n const entry = this._entries.get(fontId);\n if (!entry) {\n throw new Error(\n `[timber-fonts] attachCachedFiles: no font entry registered for id \"${fontId}\". ` +\n `Call register() first.`\n );\n }\n entry.cachedFiles = files;\n }\n\n /**\n * Drop every registry entry that originated from `importer` and shares\n * `family` (case-insensitive), **along with all of its attached state**.\n *\n * This is the single chokepoint that guarantees stale `@font-face`\n * descriptors and orphaned cached binaries cannot leak across HMR edits.\n * Because every piece of per-font state lives on the `FontEntry`,\n * deleting the entry from the underlying map drops everything in one\n * operation — no parallel maps to keep in sync.\n *\n * See TIM-824 (the original prune fix) and TIM-829 (single-store\n * refactor that made this guarantee structural).\n */\n pruneFor(importer: string, family: string): void {\n const familyKey = family.toLowerCase();\n for (const [id, entry] of this._entries) {\n if (entry.importer === importer && entry.family.toLowerCase() === familyKey) {\n this._entries.delete(id);\n }\n }\n }\n\n /** True if at least one entry is registered under `importer`. */\n hasImporter(importer: string): boolean {\n for (const entry of this._entries.values()) {\n if (entry.importer === importer) return true;\n }\n return false;\n }\n\n /**\n * Drop **every** registry entry that originated from `importer`,\n * regardless of family.\n *\n * Called at the start of the transform hook before re-registering the\n * current extraction set. This handles the cases `pruneFor` misses:\n *\n * - **Family rename** (Inter → Roboto): the old family's entries are\n * cleared because we prune by importer, not by (importer, family).\n * - **Font call deleted**: the old entries are cleared even though no\n * new call provides a family to prune against.\n *\n * Other importers' fonts are untouched.\n *\n * See TIM-1087.\n */\n pruneImporter(importer: string): void {\n for (const [id, entry] of this._entries) {\n if (entry.importer === importer) {\n this._entries.delete(id);\n }\n }\n }\n\n /** Drop every registered font. Used by tests and rebuild flows. */\n clear(): void {\n this._entries.clear();\n this.cssIdMap.clear();\n }\n\n // ── Derived views ───────────────────────────────────────────────────────\n\n /**\n * Iterate every cached Google Font binary across all registered entries,\n * deduplicated by `hashedFilename`. Multiple entries that share the same\n * family hold references to the same `CachedFont` objects, so this\n * iterator yields each unique binary exactly once.\n */\n *uniqueCachedFiles(): IterableIterator<CachedFont> {\n const seen = new Set<string>();\n for (const entry of this._entries.values()) {\n if (!entry.cachedFiles) continue;\n for (const cf of entry.cachedFiles) {\n if (seen.has(cf.hashedFilename)) continue;\n seen.add(cf.hashedFilename);\n yield cf;\n }\n }\n }\n\n /**\n * Generate the combined CSS output for every registered font.\n *\n * Includes `@font-face` rules for local and Google fonts, fallback\n * `@font-face` rules, and scoped class rules. Google fonts use the\n * `faces` attached via `attachFaces()` (in `buildStart` for production\n * or lazily in `load` for dev).\n */\n getCss(): string {\n const urlPrefix = fontUrlPrefix(this._base);\n const cssParts: string[] = [];\n for (const entry of this._entries.values()) {\n cssParts.push(renderEntryCss(entry, urlPrefix));\n }\n return cssParts.join('\\n\\n');\n }\n\n /**\n * Render the combined CSS for every font registered from a specific\n * importer file. This is the anchor point for the per-importer virtual\n * CSS module (`virtual:timber-font-css/<hash>.css`) that the transform\n * hook injects as a side-effect import.\n *\n * Scoping by importer means two concurrent requests rendering different\n * routes cannot see each other's font CSS: each importer's virtual\n * module only contains CSS for fonts that module registered. It also\n * means Vite's CSS HMR can surgically reload just the affected importer\n * when a single file changes, rather than rebuilding one giant blob.\n *\n * Returns an empty string when no fonts are registered under `importer`.\n * The empty string is semantically equivalent to \"no CSS\" — Vite's CSS\n * pipeline handles it as a valid empty CSS module.\n */\n getCssForSegment(importer: string): string {\n const urlPrefix = fontUrlPrefix(this._base);\n const cssParts: string[] = [];\n for (const entry of this._entries.values()) {\n if (entry.importer !== importer) continue;\n cssParts.push(renderEntryCss(entry, urlPrefix));\n }\n return cssParts.join('\\n\\n');\n }\n}\n\n/**\n * Render the combined CSS for a single font entry.\n *\n * Reads `faces` straight off the entry. Private to this module — the only\n * public way to render a `FontEntry`'s CSS is through `FontPipeline.getCss()`.\n */\nfunction renderEntryCss(entry: FontEntry, urlPrefix: string): string {\n const cssParts: string[] = [];\n\n if (entry.provider === 'local' && entry.localSources) {\n const faces = generateLocalFontFaces(\n entry.family,\n entry.localSources,\n entry.display,\n urlPrefix\n );\n const faceCss = generateFontFaces(faces);\n if (faceCss) cssParts.push(faceCss);\n }\n\n if (entry.provider === 'google' && entry.faces && entry.faces.length > 0) {\n const faceCss = generateFontFaces(entry.faces);\n if (faceCss) cssParts.push(faceCss);\n }\n\n const fallbackCss = generateFallbackCss(entry.family);\n if (fallbackCss) cssParts.push(fallbackCss);\n\n if (entry.variable) {\n cssParts.push(generateVariableClass(entry.className, entry.variable, entry.fontFamily));\n } else {\n cssParts.push(generateFontFamilyClass(entry.className, entry.fontFamily));\n }\n\n return cssParts.join('\\n\\n');\n}\n","// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -2147483648 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? -delta << 1 | 1 : delta << 1;\n do {\n let clamped = delta & 31;\n delta >>>= 5;\n if (delta > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6) encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(\n reader,\n definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0\n );\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(\n reader,\n sameSource && prevLine === callsiteLine ? callsiteColumn : 0\n );\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1) continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4) continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nclass BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n\nclass Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\t{\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + ''\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nclass SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n\nfunction guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n\nfunction getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n\nconst toString = Object.prototype.toString;\n\nfunction isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n\nfunction getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n\nconst wordRegex = /\\w/;\n\nclass Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t\tcharInHiresBoundary = false;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nclass MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t\toffset: { writable: true, value: options.offset || 0 },\n\t\t});\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\tif (this.outro) {\n\t\t\tmappings.advance(this.outro);\n\t\t}\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t);\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t);\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tindex = index + this.offset;\n\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t);\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length - this.offset) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tlet previousChunk = chunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\n\t\t\t// Prevent infinite loop (e.g. via empty chunks, where start === end)\n\t\t\tif (chunk === previousChunk) return;\n\n\t\t\tpreviousChunk = chunk;\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\treplacement = replacement(string, index, original);\n\t\t\t}\n\t\t\tif (string !== replacement) {\n\t\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tlet _replacement = replacement;\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\t_replacement = replacement(previous, index, original);\n\t\t\t}\n\t\t\tif (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nclass Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n\nexport { Bundle, SourceMap, MagicString as default };\n//# sourceMappingURL=magic-string.es.mjs.map\n","/**\n * Transform-hook logic for the timber-fonts plugin.\n *\n * Scans source files for font function calls (`Inter({...})`,\n * `localFont({...})`), validates that they are statically analysable,\n * registers the extracted fonts in the `FontPipeline`, and rewrites the\n * call sites to static `FontResult` literals so the runtime never has to\n * evaluate the font function.\n *\n * Uses a single OXC (via vite.parseAst) parse of the source file (via `findFontCallSites`)\n * and magic-string for precise source rewrites with source maps.\n *\n * Design doc: 24-fonts.md\n */\n\nimport MagicString from 'magic-string';\nimport type { ExtractedFont, GoogleFontConfig } from './types.js';\nimport { buildFontStack } from './fallbacks.js';\nimport { processLocalFont } from './local.js';\nimport {\n extractFontConfigAst,\n detectDynamicFontCallAst,\n findFontCallSites,\n extractGoogleFontConfigFromNode,\n extractLocalFontConfigFromNode,\n} from './ast.js';\nimport type { FontPipeline } from './pipeline.js';\n\n/**\n * Convert a font family name to a scoped class name.\n * e.g. \"JetBrains Mono\" → \"timber-font-jetbrains-mono\"\n */\nfunction familyToClassName(family: string): string {\n return `timber-font-${family.toLowerCase().replace(/\\s+/g, '-')}`;\n}\n\n/** Normalize a string or string array to an array (default `['400']`). */\nfunction normalizeWeightArray(value: string | string[] | undefined): string[] {\n if (!value) return ['400'];\n return Array.isArray(value) ? value : [value];\n}\n\n/** Normalize style to an array (default `['normal']`). */\nfunction normalizeStyleArray(value: string | string[] | undefined): string[] {\n if (!value) return ['normal'];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Generate a unique font ID from family + config hash.\n *\n * The ID intentionally includes every property that affects the rendered\n * `@font-face` output (`weight`, `style`, `subsets`, `display`) so that an\n * HMR edit changing any of those produces a new ID and the registry is\n * forced to re-emit fresh CSS.\n */\nexport function generateFontId(family: string, config: GoogleFontConfig): string {\n const weights = normalizeWeightArray(config.weight);\n const styles = normalizeStyleArray(config.style);\n const subsets = config.subsets ?? ['latin'];\n const display = config.display ?? 'swap';\n return `${family.toLowerCase()}-${weights.join(',')}-${styles.join(',')}-${subsets.join(',')}-${display}`;\n}\n\n/**\n * Extract static font config from a font function call source.\n *\n * Returns `null` if the call cannot be statically analysed.\n */\nexport function extractFontConfig(callSource: string): GoogleFontConfig | null {\n return extractFontConfigAst(callSource);\n}\n\n/**\n * Detect dynamic/computed font function calls that cannot be statically\n * analysed. Returns the offending expression text, or `null` if all calls\n * are static.\n */\nexport function detectDynamicFontCall(source: string, importedNames: string[]): string | null {\n return detectDynamicFontCallAst(source, importedNames);\n}\n\n// ── Regex-free import/family parsing (thin wrappers over AST) ────────────────\n//\n// These keep the public surface stable. They use `findFontCallSites`\n// internally so they agree with the transform on what counts as an import.\n\n/**\n * Parse the local names imported from `@timber/fonts/google` /\n * `next/font/google`. e.g. `import { Inter, JetBrains_Mono as Mono }` →\n * `['Inter', 'Mono']`.\n */\nexport function parseGoogleFontImports(source: string): string[] {\n const analysis = findFontCallSites(source);\n if (!analysis) return [];\n return analysis.bindings.filter((b) => b.provider === 'google').map((b) => b.localName);\n}\n\n/**\n * Parse Google font imports into a `localName → familyName` map.\n *\n * e.g. `import { JetBrains_Mono as Mono }` → `{ Mono: 'JetBrains Mono' }`.\n * The original (pre-`as`) name is converted from PascalCase-with-underscores\n * to the human-readable family name by replacing `_` with a space.\n */\nexport function parseGoogleFontFamilies(source: string): Map<string, string> {\n const analysis = findFontCallSites(source);\n const families = new Map<string, string>();\n if (!analysis) return families;\n for (const b of analysis.bindings) {\n if (b.provider !== 'google') continue;\n const family = b.importedName.replace(/_/g, ' ');\n families.set(b.localName, family);\n }\n return families;\n}\n\n/**\n * Parse the local name used for the default import of `@timber/fonts/local`.\n *\n * Handles either spelling and arbitrary local names:\n * import localFont from '@timber/fonts/local'\n * import myLoader from 'next/font/local'\n */\nexport function parseLocalFontImportName(source: string): string | null {\n const analysis = findFontCallSites(source);\n if (!analysis) return null;\n const localBinding = analysis.bindings.find((b) => b.provider === 'local');\n return localBinding?.localName ?? null;\n}\n\n/** Build the static `FontResult` literal we substitute for a font call. */\nfunction buildFontResultLiteral(extracted: ExtractedFont): string {\n return extracted.variable\n ? `{ className: \"${extracted.className}\", style: { fontFamily: \"${extracted.fontFamily}\" }, variable: \"${extracted.variable}\" }`\n : `{ className: \"${extracted.className}\", style: { fontFamily: \"${extracted.fontFamily}\" } }`;\n}\n\n/** Type for the Vite plugin's `this.error` callback. */\ntype EmitError = (msg: string) => never;\n\n/**\n * Run the timber-fonts transform pass on a single source file.\n *\n * Parses the source once with OXC (via vite.parseAst), walks the AST to find font imports\n * and call sites, then uses magic-string to rewrite call sites to static\n * `FontResult` literals and strip the import declarations. Returns a\n * source map alongside the transformed code.\n *\n * Returns `null` if the file does not import from any font virtual module.\n *\n * Pre-filtering (extension allow-list, node_modules exclusion, and code\n * substring checks) is handled by Vite 8's rolldown-native `transform.filter`\n * in the plugin hook definition (plugins/fonts.ts). See TIM-840, TIM-1147.\n */\nexport function runFontsTransform(\n code: string,\n id: string,\n pipeline: FontPipeline,\n emitError: EmitError\n): { code: string; map: ReturnType<MagicString['generateMap']> } | null {\n // Single parse + AST walk.\n const analysis = findFontCallSites(code);\n if (!analysis) return null;\n\n // Bail on dynamic calls.\n if (analysis.dynamicCall) {\n emitError(\n `Font function calls must be statically analyzable. ` +\n `Found dynamic call: ${analysis.dynamicCall}. ` +\n `Pass a literal object with string/array values instead.`\n );\n }\n\n // Bail on nested font calls (must be module-level).\n if (analysis.nestedCalls.length > 0) {\n const first = analysis.nestedCalls[0];\n emitError(\n `Font function \\`${first.name}()\\` must be called at module scope. ` +\n `Found nested call at line ${first.line}, column ${first.column}. ` +\n `Move the call to the top level of the module.`\n );\n }\n\n // Bail on namespace imports of font modules — the transform cannot\n // rewrite `fonts.Inter(...)` member calls, so the font would silently\n // never load.\n if (analysis.namespaceImports.length > 0) {\n const first = analysis.namespaceImports[0];\n emitError(\n `Namespace imports of font modules are not supported ` +\n `(\\`* as ${first.name}\\` at line ${first.line}, column ${first.column}). ` +\n `Use a named import instead: \\`import { Inter } from 'next/font/google'\\`.`\n );\n }\n\n // Bail on font binding references the transform cannot rewrite\n // (`export default Inter({...})`, object-literal nesting, member access\n // on the call result, aliasing, re-exports). The import declaration is\n // removed, so leaving these would be a silent runtime ReferenceError.\n if (analysis.unsupportedUsages.length > 0) {\n const first = analysis.unsupportedUsages[0];\n emitError(\n `Unsupported usage of font function \\`${first.name}\\` at ` +\n `line ${first.line}, column ${first.column}. ` +\n `A font call must be \\`const x = Font({...})\\` at module scope ` +\n `(export const is fine). The call result cannot be nested in other ` +\n `expressions, and the imported font function cannot be aliased or re-exported.`\n );\n }\n\n if (analysis.callSites.length === 0 && analysis.bindings.length === 0) return null;\n\n const s = new MagicString(code);\n\n // Extract and validate all call sites before mutating the pipeline.\n // If any extraction fails (emitError throws), the pipeline is untouched\n // so the previous valid CSS stays intact (TIM-1087).\n const pending: { extracted: ExtractedFont; site: (typeof analysis.callSites)[0] }[] = [];\n\n for (const site of analysis.callSites) {\n if (site.binding.provider === 'google') {\n const family = site.binding.importedName.replace(/_/g, ' ');\n\n const config = extractGoogleFontConfigFromNode(site.configNode);\n if (!config) {\n emitError(\n `Could not statically analyze font config for ${family} ` +\n `at line ${site.line}, column ${site.column}. ` +\n `Ensure all config values are string literals or arrays of string literals.`\n );\n }\n\n const fontId = generateFontId(family, config!);\n const className = familyToClassName(family);\n const fontStack = buildFontStack(family);\n const display = config!.display ?? 'swap';\n\n pending.push({\n site,\n extracted: {\n id: fontId,\n family,\n provider: 'google',\n weights: normalizeWeightArray(config!.weight),\n styles: normalizeStyleArray(config!.style),\n subsets: config!.subsets ?? ['latin'],\n display,\n variable: config!.variable,\n className,\n fontFamily: fontStack,\n importer: id,\n },\n });\n } else {\n // local font\n const config = extractLocalFontConfigFromNode(site.configNode);\n if (!config) {\n emitError(\n `Could not statically analyze local font config ` +\n `at line ${site.line}, column ${site.column}. ` +\n `Ensure src is a string or array of { path, weight?, style? } objects.`\n );\n }\n\n pending.push({ site, extracted: processLocalFont(config!, id) });\n }\n }\n\n // All extractions succeeded — now prune stale entries and register.\n // Handles family renames and deleted font calls (TIM-1087).\n pipeline.pruneImporter(id);\n for (const { extracted, site } of pending) {\n pipeline.register(extracted);\n s.overwrite(site.replaceStart, site.replaceEnd, buildFontResultLiteral(extracted));\n }\n\n // Remove font import declarations. Use a Set to avoid double-removing\n // when multiple bindings come from the same ImportDeclaration.\n const removedRanges = new Set<string>();\n for (const imp of analysis.importNodesToRemove) {\n const key = `${imp.start}:${imp.end}`;\n if (removedRanges.has(key)) continue;\n removedRanges.add(key);\n\n // Also remove the trailing newline if present.\n let end = imp.end;\n if (code[end] === '\\n') end++;\n else if (code[end] === '\\r' && code[end + 1] === '\\n') end += 2;\n // Also remove a trailing semicolon before the newline.\n if (code[imp.end] === ';') {\n end = imp.end + 1;\n if (code[end] === '\\n') end++;\n else if (code[end] === '\\r' && code[end + 1] === '\\n') end += 2;\n }\n s.remove(imp.start, end);\n }\n\n if (!s.hasChanged()) return null;\n\n // Inject a side-effect import for the per-importer virtual CSS module.\n if (pipeline.size() > 0) {\n const virtualCssId = pipeline.cssIdMap.idFor(id);\n s.prepend(`import '${virtualCssId}';\\n`);\n }\n\n return {\n code: s.toString(),\n map: s.generateMap({ hires: true }),\n };\n}\n","/**\n * Dev-mode middleware that serves local font binaries under\n * `/_timber/fonts/<basename>`.\n *\n * Only files registered in the FontPipeline are served, and only by\n * basename — directory traversal and path separators in the requested\n * filename are rejected up front. Font CSS is no longer served here; it\n * goes through Vite's CSS pipeline via virtual modules.\n *\n * Design doc: 24-fonts.md\n */\n\nimport type { ViteDevServer } from 'vite';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { resolve, normalize } from 'node:path';\nimport type { FontPipeline } from './pipeline.js';\nimport { fontOutputBasename, fontUrlPrefix } from './paths.js';\n\nconst FONT_MIME_TYPES: Record<string, string> = {\n woff2: 'font/woff2',\n woff: 'font/woff',\n ttf: 'font/ttf',\n otf: 'font/otf',\n eot: 'application/vnd.ms-fontopen',\n};\n\n/**\n * Wire the timber-fonts dev middleware onto a Vite dev server.\n *\n * Returns synchronously after registering the middleware. The pipeline is\n * captured by reference so that fonts registered after `configureServer`\n * runs (during transform) are still resolvable.\n */\nexport function installFontDevMiddleware(\n server: ViteDevServer,\n pipeline: FontPipeline,\n base = '/'\n): void {\n const urlPrefix = `${fontUrlPrefix(base)}/`;\n server.middlewares.use((req, res, next) => {\n const url = req.url;\n if (!url || !url.startsWith(urlPrefix)) return next();\n\n const requestedFilename = url.slice(urlPrefix.length);\n // Reject path traversal attempts and any subdirectory access. We only\n // serve flat basenames out of the registry.\n if (requestedFilename.includes('..') || requestedFilename.includes('/')) {\n res.statusCode = 400;\n res.end('Bad request');\n return;\n }\n\n // Find the matching font file in the registry. We iterate every local\n // font's source list and match by basename. The set is small (one per\n // localFont() call) so this is cheap.\n for (const font of pipeline.fonts()) {\n if (font.provider !== 'local' || !font.localSources) continue;\n for (const src of font.localSources) {\n const basename = fontOutputBasename(src.path);\n if (basename !== requestedFilename && src.hashedBasename !== requestedFilename) continue;\n\n const absolutePath = normalize(resolve(src.path));\n if (!existsSync(absolutePath)) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n const data = readFileSync(absolutePath);\n const ext = absolutePath.split('.').pop()?.toLowerCase();\n res.setHeader('Content-Type', FONT_MIME_TYPES[ext ?? ''] ?? 'application/octet-stream');\n // Dev URLs are raw (unhashed) basenames — `immutable` is only\n // justified by content hashing (design/24-fonts.md). `no-cache`\n // keeps responses revalidatable so edited fonts update without a\n // hard refresh. Production binaries are content-hashed and served\n // immutable by the platform, not this middleware.\n res.setHeader('Cache-Control', 'no-cache');\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.end(data);\n return;\n }\n }\n\n next();\n });\n}\n","/**\n * Build-output emission for the timber-fonts plugin.\n *\n * Splits the `generateBundle` hook into pure helpers so the plugin shell\n * can stay focused on Vite wiring. The functions here are deliberately\n * Rollup-agnostic — they take an `EmitFile` callback so the plugin can\n * pass `this.emitFile` from the `generateBundle` context.\n *\n * Design doc: 24-fonts.md\n */\n\nimport { readFileSync, existsSync } from 'node:fs';\nimport { resolve, normalize } from 'node:path';\nimport type { ManifestFontEntry, BuildManifest } from '../server/build-manifest.js';\nimport { fontOutputBasename, fontUrlPrefix, FONT_OUTPUT_DIR } from './paths.js';\n\n/**\n * Minimal shape of the asset descriptor accepted by Rollup's `emitFile`.\n * Declared inline rather than importing from `rollup` to keep `bundle.ts`\n * Rollup-agnostic and avoid pulling the type into the build graph.\n */\ninterface EmittedAsset {\n type: 'asset';\n fileName: string;\n source: string | Uint8Array;\n}\nimport type { FontPipeline } from './pipeline.js';\nimport type { CachedFont } from './google.js';\nimport { inferFontFormat } from './local.js';\n\ntype EmitFile = (asset: EmittedAsset) => string;\ntype EmitWarning = (msg: string) => void;\n\n/** Group cached Google Font binaries by lowercase family name. */\nexport function groupCachedFontsByFamily(\n cachedFonts: readonly CachedFont[]\n): Map<string, CachedFont[]> {\n const cachedByFamily = new Map<string, CachedFont[]>();\n for (const cf of cachedFonts) {\n const key = cf.face.family.toLowerCase();\n const arr = cachedByFamily.get(key) ?? [];\n arr.push(cf);\n cachedByFamily.set(key, arr);\n }\n return cachedByFamily;\n}\n\n/**\n * Emit cached Google Font binaries and local font files into the build\n * output under `_timber/fonts/`. Local files missing on disk produce a\n * warning rather than an error so the build still succeeds.\n *\n * Cached Google Font binaries are deduplicated by `hashedFilename` so\n * each unique file is written exactly once even when multiple font\n * entries share a family (and therefore share `CachedFont` references).\n */\nexport function emitFontAssets(\n pipeline: FontPipeline,\n emitFile: EmitFile,\n warn: EmitWarning\n): void {\n // Cached Google Font binaries (content-hashed, deduped by filename)\n for (const cf of pipeline.uniqueCachedFiles()) {\n emitFile({\n type: 'asset',\n fileName: `${FONT_OUTPUT_DIR}/${cf.hashedFilename}`,\n source: cf.data,\n });\n }\n\n // Local font files (content-hashed for immutable caching)\n for (const font of pipeline.fonts()) {\n if (font.provider !== 'local' || !font.localSources) continue;\n for (const src of font.localSources) {\n const absolutePath = normalize(resolve(src.path));\n if (!existsSync(absolutePath)) {\n warn(`Local font file not found: ${absolutePath}`);\n continue;\n }\n const filename = src.hashedBasename ?? fontOutputBasename(src.path);\n const data = readFileSync(absolutePath);\n emitFile({\n type: 'asset',\n fileName: `${FONT_OUTPUT_DIR}/${filename}`,\n source: data,\n });\n }\n }\n}\n\n/**\n * Populate `buildManifest.fonts` with `ManifestFontEntry[]` keyed by the\n * absolute importer path. This matches the runtime route manifest's\n * `filePath` values (which are absolute) and is consistent with how\n * `buildManifest.css` keys work after TIM-1014.\n *\n * All font binaries use content-hashed filenames for immutable caching.\n * Hrefs are prefixed with Vite's resolved `base` so they match the URLs\n * the platform serves the emitted binaries under.\n */\nexport function writeFontManifest(\n pipeline: FontPipeline,\n buildManifest: BuildManifest,\n base = '/'\n): void {\n const urlPrefix = fontUrlPrefix(base);\n const fontsByImporter = new Map<string, ManifestFontEntry[]>();\n\n for (const entry of pipeline.entries()) {\n const manifestEntries = fontsByImporter.get(entry.importer) ?? [];\n\n if (entry.provider === 'local' && entry.localSources) {\n for (const src of entry.localSources) {\n const filename = src.hashedBasename ?? fontOutputBasename(src.path);\n const format = inferFontFormat(src.path);\n manifestEntries.push({\n href: `${urlPrefix}/${filename}`,\n format,\n crossOrigin: 'anonymous',\n });\n }\n } else if (entry.cachedFiles) {\n for (const cf of entry.cachedFiles) {\n manifestEntries.push({\n href: `${urlPrefix}/${cf.hashedFilename}`,\n format: 'woff2',\n crossOrigin: 'anonymous',\n });\n }\n }\n\n fontsByImporter.set(entry.importer, manifestEntries);\n }\n\n for (const [importer, entries] of fontsByImporter) {\n buildManifest.fonts[importer] = entries;\n }\n}\n","/**\n * timber-fonts — Vite sub-plugin shell for build-time font processing.\n *\n * This file is intentionally thin: it wires the Vite plugin hooks to the\n * pipeline + per-concern modules under `../fonts/`. All real logic lives\n * in:\n *\n * - `../fonts/pipeline.ts` — `FontPipeline` (state, mutators)\n * - `../fonts/transform.ts` — transform-hook logic, parsing helpers\n * - `../fonts/dev-middleware.ts` — dev font binary server\n * - `../fonts/virtual-modules.ts` — virtual module ID constants + source\n *\n * The public exports below are the stable API that the test suite and\n * other parts of the framework import. Anything new should be added to\n * one of the per-concern modules and re-exported here only if external\n * consumers need it.\n *\n * Design doc: 24-fonts.md\n */\n\nimport { parseAst } from 'vite';\nimport type { Plugin, ResolvedConfig, ViteDevServer } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport {\n downloadAndCacheFonts,\n generateProductionFontFaces,\n resolveDevFontFaces,\n} from '../fonts/google.js';\nimport { fontUrlPrefix } from '../fonts/paths.js';\nimport { FontPipeline } from '../fonts/pipeline.js';\nimport { runFontsTransform } from '../fonts/transform.js';\nimport { installFontDevMiddleware } from '../fonts/dev-middleware.js';\nimport { emitFontAssets, writeFontManifest, groupCachedFontsByFamily } from '../fonts/bundle.js';\nimport {\n RESOLVED_GOOGLE,\n RESOLVED_LOCAL,\n VIRTUAL_GOOGLE,\n VIRTUAL_LOCAL,\n generateGoogleVirtualModule,\n generateLocalVirtualModule,\n} from '../fonts/virtual-modules.js';\n\n// ── Public re-exports ────────────────────────────────────────────────────\n//\n// These exports are part of the stable surface area imported by tests and\n// downstream consumers. Do NOT change their names or signatures without\n// updating every caller. New helpers should be added to the per-concern\n// module first and re-exported here only if external code needs them.\n\nexport { FontPipeline } from '../fonts/pipeline.js';\nexport {\n generateFontId,\n extractFontConfig,\n detectDynamicFontCall,\n parseGoogleFontImports,\n parseGoogleFontFamilies,\n parseLocalFontImportName,\n} from '../fonts/transform.js';\n\n/**\n * Create the timber-fonts Vite plugin.\n */\nexport function timberFonts(ctx: PluginContext): Plugin {\n const pipeline = new FontPipeline({ hashOnRegister: !ctx.dev });\n let resolvedBase = '/';\n\n return {\n name: 'timber-fonts',\n\n /**\n * Capture Vite's resolved `base` so every font URL the pipeline emits\n * (@font-face src, manifest hrefs, dev middleware matching) carries\n * the prefix. Emitted file locations are unaffected — only URLs.\n */\n configResolved(config: ResolvedConfig) {\n resolvedBase = config.base;\n pipeline.setBase(config.base);\n\n // Font binaries are emitted in generateBundle, after Vite's CSS\n // url() resolution runs. The warnings are benign — suppress them.\n const originalWarnOnce = config.logger.warnOnce.bind(config.logger);\n config.logger.warnOnce = (msg, options) => {\n if (msg.includes('_timber/fonts/') && msg.includes(\"didn't resolve at build time\")) return;\n originalWarnOnce(msg, options);\n };\n },\n\n /**\n * `enforce: 'pre'` is load-bearing for the font CSS pipeline (TIM-828).\n *\n * The transform hook injects a side-effect\n * `import 'virtual:timber-font-css/<hash>.css'` into every file that\n * registers a font. @vitejs/plugin-rsc's `rsc:rsc-css-export-transform`\n * later inspects each server component's source for CSS imports and\n * wraps the default export in `import.meta.viteRsc.loadCss(...)` so\n * the matched virtual CSS module ends up `preinit`'d as\n * `<link rel=\"stylesheet\" data-rsc-css-href=...>`.\n *\n * If timber-fonts ran in normal order it would inject the CSS import\n * *after* plugin-rsc had already scanned the source, and the font CSS\n * would be silently dropped from the rendered HTML. Running in the\n * `pre` slot guarantees our injected import is visible to plugin-rsc's\n * later CSS-export scan.\n */\n enforce: 'pre',\n\n /**\n * Resolve `@timber/fonts/google`, `@timber/fonts/local`, and the\n * per-importer `virtual:timber-font-css/<hash>.css` modules injected\n * by the transform hook.\n *\n * Strips the `\\0` prefix added by the RSC plugin's re-imports and the\n * absolute root prefix added by SSR build entries before comparing\n * against the public IDs. The `.css` suffix on font-css ids is\n * preserved so Vite's CSS pipeline (`isCSSRequest`) recognises the\n * resolved id as CSS.\n */\n resolveId(id: string) {\n let cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n const qIdx = cleanId.indexOf('?');\n const query = qIdx !== -1 ? cleanId.slice(qIdx) : '';\n if (qIdx !== -1) cleanId = cleanId.slice(0, qIdx);\n if (cleanId.startsWith(ctx.root)) {\n const stripped = cleanId.slice(ctx.root.length);\n if (stripped.startsWith('/') || stripped.startsWith('\\\\')) {\n cleanId = stripped.slice(1);\n } else {\n cleanId = stripped;\n }\n }\n\n if (cleanId === VIRTUAL_GOOGLE) return RESOLVED_GOOGLE;\n if (cleanId === VIRTUAL_LOCAL) return RESOLVED_LOCAL;\n // Preserve query suffix (notably `?direct`) on the resolved CSS id.\n // Vite's transform middleware appends `?direct` when the browser\n // fetches the URL as a `<link rel=\"stylesheet\">`, and the CSS plugin\n // only skips its JS-wrapping step when `isDirectCSSRequest(id)` sees\n // that query on the resolved id. Dropping it here caused virtual\n // font CSS to be served as Vite's HMR JS shim, leaving the\n // `<link>`-loaded stylesheet empty (TIM-937 follow-up).\n if (pipeline.cssIdMap.matches(cleanId)) return '\\0' + cleanId + query;\n return null;\n },\n\n /**\n * Return generated source for font virtual modules.\n *\n * The per-importer `virtual:timber-font-css/<hash>.css` modules\n * return the combined font CSS for the specific importer that\n * registered them. Vite's CSS pipeline handles injection from here:\n * in dev the module rides the CSS HMR channel; in production it is\n * emitted as a real CSS asset and @vitejs/plugin-rsc's `collectCss`\n * walks the RSC module graph to find it.\n *\n * Google `@font-face` descriptors are resolved lazily here (both\n * dev and production) because `load` runs after `transform` has\n * registered the font. `buildStart` runs before any transforms,\n * so fonts aren't in the pipeline yet when it fires for the first\n * environment.\n */\n async load(id: string) {\n if (id === RESOLVED_GOOGLE) return generateGoogleVirtualModule(pipeline.fonts());\n if (id === RESOLVED_LOCAL) return generateLocalVirtualModule();\n\n if (pipeline.cssIdMap.matches(id)) {\n const importer = pipeline.cssIdMap.importerFor(id);\n if (!importer) {\n return '';\n }\n\n const skipFonts = process.env.TIMBER_SKIP_FONTS === '1';\n\n for (const font of pipeline.googleFonts()) {\n if (font.importer !== importer) continue;\n if (pipeline.hasFaces(font.id)) continue;\n if (skipFonts && !ctx.dev) {\n console.warn(`[timber-fonts] Skipping font \"${font.family}\" (TIMBER_SKIP_FONTS=1)`);\n continue;\n }\n try {\n if (ctx.dev) {\n const faces = await resolveDevFontFaces(font);\n pipeline.attachFaces(font.id, faces);\n } else {\n const cached = await downloadAndCacheFonts([font], ctx.root);\n const byFamily = groupCachedFontsByFamily(cached);\n const familyCached = byFamily.get(font.family.toLowerCase()) ?? [];\n pipeline.attachCachedFiles(font.id, familyCached);\n pipeline.attachFaces(\n font.id,\n generateProductionFontFaces(familyCached, font.display, fontUrlPrefix(resolvedBase))\n );\n }\n } catch (e) {\n if (!ctx.dev) throw e;\n const msg = e instanceof Error ? e.message : String(e);\n console.warn(\n `[timber-fonts] Failed to resolve Google font \"${font.family}\": ${msg}. Will retry on next request.`\n );\n }\n }\n\n return pipeline.getCssForSegment(importer);\n }\n return null;\n },\n\n /**\n * Serve local font files in dev mode under `/_timber/fonts/<basename>`.\n * Font CSS goes through Vite's CSS pipeline (virtual modules), not\n * this middleware.\n */\n configureServer(server: ViteDevServer) {\n installFontDevMiddleware(server, pipeline, resolvedBase);\n },\n\n /**\n * No-op. Font downloading and face attachment happen lazily in `load()`\n * because `buildStart` runs before `transform` — fonts aren't registered\n * in the pipeline yet when this fires for the first environment.\n *\n * Local font hashing is handled at registration time by the pipeline\n * (when `hashOnRegister` is set) so hashed filenames are available\n * before the virtual CSS `load()` hook runs.\n */\n buildStart() {},\n\n /**\n * Prune stale font entries when a module that previously imported fonts\n * no longer contains any font import. The transform hook's `filter.code`\n * skips such modules, so without this hook the old entries would persist\n * until dev restart. See TIM-1087.\n */\n async hotUpdate({ type, file, read }) {\n if (!pipeline.hasImporter(file)) return;\n if (type === 'delete') {\n pipeline.pruneImporter(file);\n return;\n }\n const code = await read();\n const hasFontImport =\n code.includes('@timber/fonts/') ||\n code.includes('@timber-js/app/fonts/') ||\n code.includes('next/font/');\n if (hasFontImport) return;\n // Only prune if the new source parses successfully. A syntax error\n // means the HMR update will fail and the old module stays active —\n // pruning would leave it without font CSS until the next valid save.\n try {\n parseAst(code, { lang: 'tsx' });\n } catch {\n return;\n }\n pipeline.pruneImporter(file);\n },\n\n /**\n * Scan source files for font function calls and extract static config.\n *\n * Delegates to `runFontsTransform`. Errors raised through the\n * `this.error` callback are surfaced as Vite plugin errors.\n *\n * The `filter` option uses Vite 8's rolldown-native hook filters to\n * skip non-JS/TS files and files that don't mention any font module\n * before crossing into JS — replacing the hand-rolled pre-filter that\n * was previously inside `runFontsTransform` (TIM-840, TIM-1147).\n */\n transform: {\n filter: {\n id: {\n include: /^[^?]*\\.(?:js|jsx|ts|tsx|mjs|cjs|mts|cts)(?:\\?|$)/,\n exclude: /(?:^\\0|(?:^|\\/)node_modules\\/)/,\n },\n code: ['@timber/fonts/', '@timber-js/app/fonts/', 'next/font/'],\n },\n handler(code: string, id: string) {\n return runFontsTransform(code, id, pipeline, (msg) => this.error(msg));\n },\n },\n\n /**\n * Emit font binaries and build-manifest entries.\n *\n * All font binaries (Google and local) use content-hashed filenames\n * for immutable caching. Font CSS is handled by Vite's CSS pipeline\n * via virtual modules — we only emit binaries here.\n */\n generateBundle() {\n emitFontAssets(\n pipeline,\n (asset) => this.emitFile(asset),\n (msg) => this.warn(msg)\n );\n if (!ctx.buildManifest) return;\n writeFontManifest(pipeline, ctx.buildManifest, resolvedBase);\n },\n };\n}\n","/**\n * timber-static-build — Vite sub-plugin for static output mode.\n *\n * When `output: 'static'` is set in timber.config.ts, this plugin:\n * 1. Validates that no dynamic APIs (getCookies(), getHeaders()) are used\n * 2. Coordinates build-time rendering of all pages\n *\n * Design doc: design/15-future-prerendering.md\n */\n\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface StaticValidationError {\n type: 'dynamic-api';\n file: string;\n message: string;\n line?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Detection: dynamic APIs (getCookies, getHeaders, and legacy cookies/headers)\n// ---------------------------------------------------------------------------\n\n/**\n * Patterns that indicate dynamic per-request API usage.\n * These are build errors in static mode because there is no request at build time.\n *\n * We detect both import-level and call-level usage.\n */\nconst DYNAMIC_API_PATTERNS: Array<{ pattern: RegExp; name: string }> = [\n { pattern: /\\bgetCookieJar\\s*\\(/, name: 'getCookieJar()' },\n { pattern: /\\bgetHeaders\\s*\\(/, name: 'getHeaders()' },\n { pattern: /\\bcookies\\s*\\(/, name: 'cookies()' },\n { pattern: /\\bheaders\\s*\\(/, name: 'headers()' },\n];\n\n/**\n * Detect usage of dynamic per-request APIs (getCookies(), getHeaders())\n * that cannot work at build time in static mode.\n *\n * Returns an array of validation errors.\n */\nexport function detectDynamicApis(code: string, fileId: string): StaticValidationError[] {\n const errors: StaticValidationError[] = [];\n\n for (const { pattern, name } of DYNAMIC_API_PATTERNS) {\n if (pattern.test(code)) {\n // Find the line number of the first match\n const lines = code.split('\\n');\n let line: number | undefined;\n for (let i = 0; i < lines.length; i++) {\n if (pattern.test(lines[i])) {\n line = i + 1;\n break;\n }\n }\n\n errors.push({\n type: 'dynamic-api',\n file: fileId,\n message:\n `${name} cannot be used in static mode — there is no request at build time. ` +\n `Remove the ${name} call or switch to output: 'server'.`,\n line,\n });\n }\n }\n\n return errors;\n}\n\n// ---------------------------------------------------------------------------\n// Vite Plugin\n// ---------------------------------------------------------------------------\n\n/**\n * Create the timber-static-build Vite plugin.\n *\n * Only active when output: 'static' is configured.\n *\n * Hooks:\n * - transform: Validates source files for static mode violations\n */\nexport function timberStaticBuild(ctx: PluginContext): Plugin {\n return {\n name: 'timber-static-build',\n\n /**\n * Validate source files during transform.\n *\n * In static mode, we check every app/ file for:\n * - Dynamic API usage (getCookies(), getHeaders()) → build error\n */\n transform(code: string, id: string) {\n // Read ctx.config lazily inside the hook — not at plugin construction\n // time — so file-based config from timber.config.ts is respected.\n // See TIM-451.\n const isStatic = ctx.config.output === 'static';\n\n // Only active in static mode\n if (!isStatic) return null;\n\n // Skip node_modules\n if (id.includes('node_modules')) return null;\n\n // Only check files in the app directory\n if (!id.includes('/app/') && !id.startsWith('app/')) return null;\n\n // Only check JS/TS files\n if (!/\\.[jt]sx?$/.test(id)) return null;\n\n const errors = detectDynamicApis(code, id);\n\n if (errors.length > 0) {\n // Format all errors into a single build error message\n const messages = errors.map(\n (e) =>\n `[timber] Static mode error in ${e.file}${e.line ? `:${e.line}` : ''}: ${e.message}`\n );\n\n this.error(messages.join('\\n\\n'));\n }\n\n return null;\n },\n };\n}\n","/**\n * timber-build-manifest — Vite sub-plugin for build asset manifest generation.\n *\n * Provides `virtual:timber-build-manifest` which exports a BuildManifest\n * mapping route segment file paths to their CSS, JS, and modulepreload\n * output chunks.\n *\n * - Dev mode: exports an empty manifest (Vite HMR handles CSS/JS).\n * - Build mode: virtual module reads from globalThis.__TIMBER_BUILD_MANIFEST__\n * at runtime. The actual manifest data is injected by the adapter via a\n * _timber-manifest-init.js module that runs before the RSC handler.\n *\n * The generateBundle hook (client env only) extracts CSS/JS/modulepreload\n * data from the Rollup bundle and populates ctx.buildManifest.\n *\n * Design docs: 18-build-system.md §\"Build Manifest\", 02-rendering-pipeline.md §\"Early Hints\"\n */\n\nimport { randomUUID, createHash } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport type { BuildManifest } from '../server/build-manifest.js';\nimport type { SegmentNode, RouteFile } from '../routing/types.js';\nimport { isDynamicMetadataExtension } from '../server/metadata-routes.js';\n\n// Rollup types used by generateBundle hook — imported from vite which re-exports them.\n// We define minimal interfaces here to avoid a direct 'rollup' dependency.\ninterface OutputChunk {\n type: 'chunk';\n fileName: string;\n facadeModuleId: string | null;\n imports: string[];\n name: string;\n code: string;\n viteMetadata?: { importedCss?: Set<string> };\n modules?: Record<string, { code: string | null; renderedLength: number }>;\n}\n\ninterface OutputAsset {\n type: 'asset';\n fileName: string;\n}\n\ntype OutputBundle = Record<string, OutputChunk | OutputAsset>;\n\nconst VIRTUAL_MODULE_ID = 'virtual:timber-build-manifest';\nconst RESOLVED_VIRTUAL_ID = `\\0${VIRTUAL_MODULE_ID}`;\n\n/**\n * Vite's manifest.json entry shape (subset we need).\n * See https://vite.dev/guide/backend-integration.html\n */\ninterface ViteManifestEntry {\n file: string;\n css?: string[];\n imports?: string[];\n}\n\n/**\n * Parse Vite's .vite/manifest.json into a BuildManifest.\n *\n * Walks each entry and collects:\n * - `css`: CSS output URLs per input file (transitive CSS included by Vite)\n * - `js`: Hashed JS chunk URL per input file\n * - `modulepreload`: Transitive JS dependency URLs per input file\n *\n * Keys are input file paths (relative to project root).\n */\nexport function parseViteManifest(\n viteManifest: Record<string, ViteManifestEntry>,\n base: string\n): BuildManifest {\n const css: Record<string, string[]> = {};\n const js: Record<string, string> = {};\n const modulepreload: Record<string, string[]> = {};\n\n for (const [inputPath, entry] of Object.entries(viteManifest)) {\n // JS chunk mapping\n js[inputPath] = base + entry.file;\n\n // CSS mapping\n if (entry.css && entry.css.length > 0) {\n css[inputPath] = entry.css.map((cssPath) => base + cssPath);\n }\n\n // Collect transitive JS dependencies for modulepreload\n modulepreload[inputPath] = collectTransitiveDeps(inputPath, viteManifest, base);\n }\n\n return { css, js, modulepreload, fonts: {}, metadataRouteHashes: {} };\n}\n\n/**\n * Recursively collect transitive JS dependency URLs for an entry.\n *\n * Walks the `imports` graph in Vite's manifest, resolving each import\n * key to its output `file` URL. Deduplicates to avoid cycles and\n * redundant preloads.\n */\nfunction collectTransitiveDeps(\n entryKey: string,\n manifest: Record<string, ViteManifestEntry>,\n base: string\n): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n function walk(key: string) {\n const entry = manifest[key];\n if (!entry?.imports) return;\n\n for (const importKey of entry.imports) {\n if (seen.has(importKey)) continue;\n seen.add(importKey);\n\n const dep = manifest[importKey];\n if (dep) {\n result.push(base + dep.file);\n walk(importKey);\n }\n }\n }\n\n walk(entryKey);\n return result;\n}\n\n/**\n * Build a BuildManifest from a Rollup output bundle.\n *\n * Unlike parseViteManifest (which reads Vite's manifest.json), this\n * works directly with the Rollup bundle output. This is necessary because\n * the RSC plugin doesn't produce a standard Vite manifest.json.\n *\n * Walks each chunk in the bundle and collects:\n * - `css`: CSS files imported by each chunk (via viteMetadata.importedCss)\n * - `js`: The output filename for each chunk with a facadeModuleId\n * - `modulepreload`: Transitive JS imports for each entry chunk\n *\n * Keys are input file paths relative to root.\n */\nexport function buildManifestFromBundle(\n bundle: OutputBundle,\n base: string,\n root: string\n): BuildManifest {\n const css: Record<string, string[]> = {};\n const js: Record<string, string> = {};\n const modulepreload: Record<string, string[]> = {};\n\n // Build a map of chunk fileName → chunk for transitive dep resolution\n const chunksByFileName = new Map<string, OutputChunk>();\n for (const item of Object.values(bundle) as (OutputChunk | OutputAsset)[]) {\n if (item.type === 'chunk') {\n chunksByFileName.set(item.fileName, item);\n }\n }\n\n for (const item of Object.values(bundle) as (OutputChunk | OutputAsset)[]) {\n if (item.type !== 'chunk') continue;\n\n const chunk = item;\n if (!chunk.facadeModuleId) continue;\n\n // Convert absolute facadeModuleId to root-relative path\n let inputPath = chunk.facadeModuleId;\n if (inputPath.startsWith(root)) {\n inputPath = inputPath.slice(root.length + 1);\n }\n\n // JS chunk mapping\n js[inputPath] = base + chunk.fileName;\n\n // CSS mapping via viteMetadata\n const viteMetadata = chunk.viteMetadata;\n if (viteMetadata?.importedCss && viteMetadata.importedCss.size > 0) {\n css[inputPath] = Array.from(viteMetadata.importedCss).map((cssFile) => base + cssFile);\n }\n\n // Collect transitive JS dependencies for modulepreload\n const deps = collectTransitiveBundleDeps(chunk, chunksByFileName, base);\n if (deps.length > 0) {\n modulepreload[inputPath] = deps;\n }\n }\n\n return { css, js, modulepreload, fonts: {}, metadataRouteHashes: {} };\n}\n\n/**\n * Recursively collect transitive JS dependency URLs from a bundle chunk.\n */\nfunction collectTransitiveBundleDeps(\n chunk: OutputChunk,\n chunksByFileName: Map<string, OutputChunk>,\n base: string\n): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n function walk(imports: string[]) {\n for (const importFileName of imports) {\n if (seen.has(importFileName)) continue;\n seen.add(importFileName);\n\n result.push(base + importFileName);\n const dep = chunksByFileName.get(importFileName);\n if (dep) {\n walk(dep.imports);\n }\n }\n }\n\n walk(chunk.imports);\n return result;\n}\n\n/**\n * Walk the route tree and compute short content hashes for metadata route files\n * (opengraph-image, icon, apple-icon) used for cache-busting\n * the auto-linked URLs in <head>.\n */\nfunction computeMetadataRouteHashes(node: SegmentNode<RouteFile>): Record<string, string> {\n const hashes: Record<string, string> = {};\n\n if (node.metadataRoutes) {\n for (const [baseName, file] of Object.entries(node.metadataRoutes)) {\n if (!isDynamicMetadataExtension(baseName, file.extension)) {\n // For static files, hash the file content\n try {\n const content = readFileSync(file.filePath);\n const hash = createHash('sha256').update(content).digest('hex').slice(0, 8);\n hashes[file.filePath] = hash;\n } catch {\n // File unreadable — skip hash, DEV_NONCE fallback applies\n }\n } else {\n // For dynamic files (.ts/.tsx), hash the source file as a reasonable\n // approximation — the output depends on runtime data too, but the\n // source change is the best build-time signal we have.\n try {\n const content = readFileSync(file.filePath);\n const hash = createHash('sha256').update(content).digest('hex').slice(0, 8);\n hashes[file.filePath] = hash;\n } catch {\n // File unreadable — skip\n }\n }\n }\n }\n\n for (const child of node.children) {\n Object.assign(hashes, computeMetadataRouteHashes(child));\n }\n for (const slot of Object.values(node.slots)) {\n Object.assign(hashes, computeMetadataRouteHashes(slot));\n }\n\n return hashes;\n}\n\n// Regex to extract client reference hash keys from registerClientReference calls.\n// Matches: registerClientReference(..., \"abc123def456\", \"ExportName\")\nconst CLIENT_REF_KEY_RE = /registerClientReference\\([^,]+,\\s*\"([0-9a-f]{12})\"/g;\n\n/**\n * Collect all route file paths (layout, page) from the route tree.\n */\nfunction collectRouteFilePaths(node: SegmentNode<RouteFile>): string[] {\n const paths: string[] = [];\n if (node.layout) paths.push(node.layout.filePath);\n if (node.page) paths.push(node.page.filePath);\n for (const child of node.children) paths.push(...collectRouteFilePaths(child));\n for (const slot of Object.values(node.slots)) paths.push(...collectRouteFilePaths(slot));\n return paths;\n}\n\n/**\n * Scan RSC bundle chunks to find which modules contain registerClientReference\n * calls, and extract the reference hash keys from each.\n */\nfunction buildClientRefIndex(bundle: OutputBundle): Map<string, string[]> {\n const index = new Map<string, string[]>();\n for (const item of Object.values(bundle)) {\n if (item.type !== 'chunk' || !item.modules) continue;\n for (const [moduleId, mod] of Object.entries(item.modules)) {\n if (!mod.code) continue;\n const keys: string[] = [];\n for (const match of mod.code.matchAll(CLIENT_REF_KEY_RE)) {\n keys.push(match[1]);\n }\n if (keys.length > 0) {\n index.set(moduleId, keys);\n }\n }\n }\n return index;\n}\n\n/** Rollup getModuleInfo shape (subset). */\ninterface ModuleInfo {\n importedIds: string[];\n}\n\n/**\n * Walk a module's transitive imports to collect all client reference\n * keys reachable from it.\n */\nfunction walkModuleImports(\n moduleId: string,\n clientRefIndex: Map<string, string[]>,\n visited: Set<string>,\n result: Set<string>,\n getModuleInfo: (id: string) => ModuleInfo | null\n): void {\n if (visited.has(moduleId)) return;\n visited.add(moduleId);\n\n const refKeys = clientRefIndex.get(moduleId);\n if (refKeys) {\n for (const key of refKeys) result.add(key);\n }\n\n const info = getModuleInfo(moduleId);\n if (!info) return;\n for (const importedId of info.importedIds) {\n walkModuleImports(importedId, clientRefIndex, visited, result, getModuleInfo);\n }\n}\n\n/**\n * Create the timber-build-manifest Vite plugin.\n *\n * Hooks: configResolved, resolveId, load, generateBundle (client and RSC envs)\n */\nexport function timberBuildManifest(ctx: PluginContext): Plugin {\n let resolvedBase = '/';\n let isDev = false;\n\n return {\n name: 'timber-build-manifest',\n\n configResolved(config: ResolvedConfig) {\n resolvedBase = config.base;\n isDev = config.command === 'serve';\n\n // Generate a per-build deployment ID early so virtual:timber-config\n // can serialize it during the load hook (which runs before generateBundle).\n // A random UUID is used instead of a content hash — determinism provides\n // no real benefit here since you almost never redeploy identical code,\n // and a random ID avoids the timing problem where the content hash was\n // only available after generateBundle (TIM-452).\n if (!isDev && !ctx.deploymentId) {\n ctx.deploymentId = randomUUID().replace(/-/g, '').slice(0, 16);\n }\n },\n\n resolveId(id: string) {\n const cleanId = id.startsWith('\\0') ? id.slice(1) : id;\n\n if (cleanId === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n if (cleanId.endsWith(`/${VIRTUAL_MODULE_ID}`)) {\n return RESOLVED_VIRTUAL_ID;\n }\n\n return null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_VIRTUAL_ID) return null;\n\n // In dev mode, return empty manifest — Vite HMR handles CSS.\n if (isDev) {\n return [\n '// Auto-generated build manifest — do not edit.',\n '// Dev mode: empty manifest (Vite HMR handles CSS/JS).',\n '',\n 'const manifest = { css: {}, js: {}, modulepreload: {}, fonts: {}, metadataRouteHashes: {} };',\n '',\n 'export default manifest;',\n ].join('\\n');\n }\n\n // In production, read from globalThis at runtime.\n // The adapter writes a _timber-manifest-init.js that sets this global\n // before the RSC handler imports this module. ESM evaluation order\n // guarantees the global is set by the time this code runs.\n return [\n '// Auto-generated build manifest — do not edit.',\n '// Production: reads manifest from globalThis (set by _timber-manifest-init.js).',\n '',\n 'const manifest = globalThis.__TIMBER_BUILD_MANIFEST__ ?? { css: {}, js: {}, modulepreload: {}, fonts: {}, metadataRouteHashes: {}, requestDep: {} };',\n '',\n 'export default manifest;',\n ].join('\\n');\n },\n\n // Extract manifest data from the client bundle only.\n // The RSC plugin runs builds in order: RSC → client → SSR.\n // We only want client env data (CSS assets, client JS chunks).\n generateBundle(_options, bundle) {\n if (isDev) return;\n\n const envName = (this as { environment?: { name: string } }).environment?.name;\n\n // RSC environment: walk the module graph to find which client\n // references each route file transitively imports. Store the\n // mapping in ctx so the adapter-build post hook can cross-reference\n // with clientReferenceDeps to populate per-route modulepreloads.\n if (envName === 'rsc' && ctx.routeTree) {\n const clientRefIndex = buildClientRefIndex(bundle);\n if (clientRefIndex.size > 0) {\n const routeFiles = collectRouteFilePaths(ctx.routeTree.root);\n const routeClientRefKeys = new Map<string, Set<string>>();\n\n const getInfo = (id: string) =>\n (this as { getModuleInfo?: (id: string) => ModuleInfo | null }).getModuleInfo?.(id) ??\n null;\n\n for (const filePath of routeFiles) {\n const refKeys = new Set<string>();\n walkModuleImports(filePath, clientRefIndex, new Set(), refKeys, getInfo);\n if (refKeys.size > 0) {\n routeClientRefKeys.set(filePath, refKeys);\n }\n }\n\n if (routeClientRefKeys.size > 0) {\n ctx.routeClientRefKeys = routeClientRefKeys;\n }\n }\n }\n\n if (envName === 'client') {\n ctx.buildManifest = buildManifestFromBundle(bundle, resolvedBase, ctx.root);\n\n // Compute cache-busting hashes for metadata route files\n if (ctx.routeTree) {\n ctx.buildManifest.metadataRouteHashes = computeMetadataRouteHashes(ctx.routeTree.root);\n }\n\n // Attach static request-dependency map from the request-dep plugin.\n // Computed in the RSC buildEnd hook and stored on ctx.\n const requestDepMap = (ctx as unknown as Record<string, unknown>).requestDepMap as\n | Record<string, boolean>\n | undefined;\n if (requestDepMap) {\n ctx.buildManifest.requestDep = requestDepMap;\n }\n\n // When client JavaScript is disabled, strip JS chunks from the bundle\n // so Rollup never writes them to disk. CSS assets are preserved —\n // they're still needed for server-rendered HTML.\n //\n // This is an optimization: adapter-build.ts still strips JS from the\n // build manifest and RSC assets manifest as a defense-in-depth fallback.\n if (ctx.clientJavascript.disabled) {\n // Clear JS and modulepreload from the manifest (they'd be stripped\n // by adapter-build.ts anyway, but doing it here avoids the round-trip).\n ctx.buildManifest.js = {};\n ctx.buildManifest.modulepreload = {};\n\n // Remove JS chunks from the Rollup bundle — prevents disk writes.\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type === 'chunk') {\n delete bundle[fileName];\n }\n }\n }\n }\n },\n };\n}\n","/**\n * timber-dev-logs — Pipes server console output to the browser console in dev.\n *\n * Patches `console.log/warn/error/debug/info` on the server side and\n * forwards messages to connected browsers via Vite's HMR WebSocket.\n * The browser entry replays them in the browser console with the\n * correct log level and a \"[server]\" prefix.\n *\n * Dev-only: this plugin only runs during `vite dev` (apply: 'serve').\n * No runtime overhead in production.\n *\n * Design docs: 18-build-system.md §\"Dev Server\", 02-rendering-pipeline.md\n */\n\nimport type { Plugin, ViteDevServer, Logger } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\n\n// ─── Original Console Snapshot ──────────────────────────────────────────\n\n/**\n * Snapshot of the original console methods, captured at module load time\n * (before any patching). Used as Vite's `customLogger` console so that\n * forwardConsole output bypasses our patch entirely — eliminating the\n * server→browser→server forwarding loop without string matching.\n */\nexport const originalConsole: Pick<Console, 'log' | 'warn' | 'error' | 'debug' | 'info'> = {\n log: console.log.bind(console),\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n debug: console.debug.bind(console),\n info: console.info.bind(console),\n};\n\n/**\n * Wrap a Vite Logger so its output methods route through `originalConsole`\n * instead of the global (potentially patched) console. This prevents the\n * server→browser→server forwarding loop even when the user supplies their\n * own `customLogger` that internally calls console methods.\n */\nexport function wrapLoggerWithOriginalConsole(logger: Logger): Logger {\n // Swap all patched console methods to originals during any logger call,\n // since user loggers may call any combination of console methods internally.\n function withOriginals<T>(fn: () => T): T {\n const saved = {\n log: console.log,\n warn: console.warn,\n error: console.error,\n debug: console.debug,\n info: console.info,\n };\n console.log = originalConsole.log;\n console.warn = originalConsole.warn;\n console.error = originalConsole.error;\n console.debug = originalConsole.debug;\n console.info = originalConsole.info;\n try {\n return fn();\n } finally {\n console.log = saved.log;\n console.warn = saved.warn;\n console.error = saved.error;\n console.debug = saved.debug;\n console.info = saved.info;\n }\n }\n\n return {\n get hasWarned() {\n return logger.hasWarned;\n },\n set hasWarned(v) {\n logger.hasWarned = v;\n },\n info(msg, opts) {\n withOriginals(() => logger.info(msg, opts));\n },\n warn(msg, opts) {\n withOriginals(() => logger.warn(msg, opts));\n },\n warnOnce(msg, opts) {\n withOriginals(() => logger.warnOnce(msg, opts));\n },\n error(msg, opts) {\n withOriginals(() => logger.error(msg, opts));\n },\n clearScreen(type) {\n logger.clearScreen(type);\n },\n hasErrorLogged(error) {\n return logger.hasErrorLogged(error);\n },\n };\n}\n\n// ─── Types ───────────────────────────────────────────────────────────────\n\n/** Log levels that are patched and forwarded. */\nexport type ServerLogLevel = 'log' | 'warn' | 'error' | 'debug' | 'info';\n\nconst LOG_LEVELS: ServerLogLevel[] = ['log', 'warn', 'error', 'debug', 'info'];\n\n/** Payload sent over Vite's HMR WebSocket. */\nexport interface ServerLogPayload {\n level: ServerLogLevel;\n args: unknown[];\n /** Server-side source location (file:line:col) if available. */\n location: string | null;\n /** Timestamp in ms (Date.now()) */\n timestamp: number;\n}\n\n// ─── Serialization ───────────────────────────────────────────────────────\n\n/** Patterns that look like env vars or secrets — these are redacted. */\nconst SENSITIVE_PATTERNS =\n /(?:^|[^a-z])(?:SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY|AUTH|CREDENTIAL|SESSION_SECRET)(?:[^a-z]|$)/i;\n\n/**\n * Serialize a console argument for transmission over WebSocket.\n *\n * Handles: strings, numbers, booleans, null, undefined, arrays, plain\n * objects, Errors, Dates, RegExps, and falls back to String() for others.\n *\n * Redacts values that match sensitive patterns to avoid leaking secrets.\n */\nfunction serializeArg(arg: unknown, depth = 0): unknown {\n if (depth > 5) return '[...]';\n\n if (arg === null) return null;\n if (arg === undefined) return '[undefined]';\n\n switch (typeof arg) {\n case 'string':\n if (SENSITIVE_PATTERNS.test(arg)) return '[REDACTED]';\n return arg;\n case 'number':\n case 'boolean':\n return arg;\n case 'bigint':\n return `${arg}n`;\n case 'symbol':\n return arg.toString();\n case 'function':\n return `[Function: ${arg.name || 'anonymous'}]`;\n case 'object':\n break;\n default:\n return String(arg);\n }\n\n // Error\n if (arg instanceof Error) {\n return {\n __type: 'Error',\n name: arg.name,\n message: arg.message,\n stack: arg.stack ?? null,\n };\n }\n\n // Date\n if (arg instanceof Date) {\n return arg.toISOString();\n }\n\n // RegExp\n if (arg instanceof RegExp) {\n return arg.toString();\n }\n\n // Array\n if (Array.isArray(arg)) {\n return arg.map((item) => serializeArg(item, depth + 1));\n }\n\n // Map\n if (arg instanceof Map) {\n const entries: Record<string, unknown> = {};\n for (const [key, value] of arg) {\n entries[String(key)] = serializeArg(value, depth + 1);\n }\n return { __type: 'Map', entries };\n }\n\n // Set\n if (arg instanceof Set) {\n return { __type: 'Set', values: [...arg].map((v) => serializeArg(v, depth + 1)) };\n }\n\n // Plain object\n if (Object.getPrototypeOf(arg) === Object.prototype || Object.getPrototypeOf(arg) === null) {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(arg as Record<string, unknown>)) {\n if (SENSITIVE_PATTERNS.test(key)) {\n result[key] = '[REDACTED]';\n } else {\n result[key] = serializeArg(value, depth + 1);\n }\n }\n return result;\n }\n\n // Fallback — use toString or constructor name\n try {\n return `[${(arg as object).constructor?.name ?? 'Object'}]`;\n } catch {\n return '[Object]';\n }\n}\n\n// ─── Source Location ─────────────────────────────────────────────────────\n\n/**\n * Extract the caller's source location from an Error stack trace.\n *\n * Walks the stack to find the first frame that isn't inside this file\n * or Node internals. Returns \"file:line:col\" or null.\n */\nfunction extractCallerLocation(projectRoot: string): string | null {\n const err = new Error();\n const stack = err.stack;\n if (!stack) return null;\n\n const lines = stack.split('\\n');\n // Skip first line (\"Error\") and frames inside this module\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].trim();\n // Skip our own patching frames\n if (line.includes('dev-tools/logs')) continue;\n // Skip node internals\n if (line.includes('node:') || line.includes('node_modules')) continue;\n\n // Extract file path from \"at ... (file:line:col)\" or \"at file:line:col\"\n const match = line.match(/\\((.+?):(\\d+):(\\d+)\\)/) ?? line.match(/at (.+?):(\\d+):(\\d+)/);\n if (match) {\n let filePath = match[1];\n // Make path relative to project root for readability\n if (filePath.startsWith(projectRoot)) {\n filePath = filePath.slice(projectRoot.length + 1);\n }\n return `${filePath}:${match[2]}:${match[3]}`;\n }\n }\n return null;\n}\n\n// ─── Framework-Internal Detection ────────────────────────────────────────\n\n/**\n * Check if the calling code is from timber's internal plugin/adapter plumbing.\n *\n * Only filters logs from `plugins/` and `adapters/` directories — these are\n * framework operational noise (request summaries, codegen warnings, adapter\n * setup). Logs from `server/` are preserved because they surface user errors\n * (render errors, action errors, route handler errors, etc.).\n *\n * Handles both monorepo paths (timber-app/src/plugins/) and installed\n * package paths (@timber-js/app/dist/plugins/).\n */\nexport function isFrameworkInternalCaller(): boolean {\n const err = new Error();\n const stack = err.stack;\n if (!stack) return false;\n\n const lines = stack.split('\\n');\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i].trim();\n // Skip our own patching frames\n if (line.includes('dev-tools/logs')) continue;\n // Skip node internals (but NOT node_modules — we need to inspect those)\n if (line.includes('node:')) continue;\n\n // Check if this first real frame is inside timber's own source\n const isTimberPath = line.includes('timber-app/') || line.includes('@timber-js/app/');\n if (!isTimberPath) return false;\n\n // Only filter plugin and adapter internals, not server/ runtime code\n // which surfaces user errors (render errors, action errors, etc.)\n return line.includes('/plugins/') || line.includes('/adapters/');\n }\n return false;\n}\n\n// ─── Console Patching ────────────────────────────────────────────────────\n\n/**\n * Patch console methods to forward logs to the browser via HMR WebSocket.\n *\n * Each patched method:\n * 1. Calls the original console method (server terminal still works)\n * 2. Serializes arguments for JSON transport\n * 3. Sends via server.hot.send() — dropped if no clients connected\n */\nfunction patchConsole(server: ViteDevServer, projectRoot: string): () => void {\n const prevConsole = new Map<ServerLogLevel, (...args: unknown[]) => void>();\n // Per-level guard so a console.warn inside a console.error handler isn't\n // suppressed — only same-level synchronous re-entrancy is blocked.\n const patchingLevel = new Set<ServerLogLevel>();\n\n for (const level of LOG_LEVELS) {\n prevConsole.set(level, console[level].bind(console));\n\n console[level] = (...args: unknown[]) => {\n // Same-level re-entrancy guard: if prevConsole's wrapper calls back\n // into console[level], just pass through without forwarding.\n if (patchingLevel.has(level)) {\n prevConsole.get(level)!(...args);\n return;\n }\n\n patchingLevel.add(level);\n try {\n // Call the previous console method first — guarantees terminal output\n // even if serialization or forwarding fails downstream. If prevConsole\n // throws, the error propagates (not swallowed) but patchingLevel is\n // still cleaned up by the outer finally.\n prevConsole.get(level)!(...args);\n\n // Skip framework-internal logs (plugins/, adapters/) from browser forwarding.\n if (isFrameworkInternalCaller()) return;\n\n try {\n const payload: ServerLogPayload = {\n level,\n args: args.map((arg) => serializeArg(arg)),\n location: extractCallerLocation(projectRoot),\n timestamp: Date.now(),\n };\n\n server.hot.send('timber:server-log', payload);\n } catch (e) {\n originalConsole.debug(\n '[timber] server log forwarding failed:',\n e instanceof Error ? e.message : e\n );\n }\n } finally {\n patchingLevel.delete(level);\n }\n };\n }\n\n // Return a cleanup function to restore the previous console methods\n return () => {\n for (const [level, prev] of prevConsole) {\n console[level] = prev;\n }\n };\n}\n\n// ─── Plugin ──────────────────────────────────────────────────────────────\n\n/**\n * Create the timber-dev-logs Vite plugin.\n *\n * Patches console methods when the dev server starts and restores them\n * when the server closes. Only active during `vite dev`.\n */\nexport function timberDevLogs(_ctx: PluginContext): Plugin {\n let cleanup: (() => void) | null = null;\n\n return {\n name: 'timber-dev-logs',\n apply: 'serve',\n\n configureServer(server: ViteDevServer) {\n cleanup = patchConsole(server, _ctx.root);\n\n // Restore console on server close\n server.httpServer?.on('close', () => {\n cleanup?.();\n cleanup = null;\n });\n },\n };\n}\n","/**\n * Browser log forwarding — maps timber's devBrowserLogs config to Vite 8's\n * server.forwardConsole option.\n *\n * Vite 8 ships built-in browser→terminal console forwarding via\n * server.forwardConsole, which patches console methods in /@vite/client\n * and prints forwarded output server-side. This replaces timber's custom\n * client-side interception script and HMR WebSocket transport.\n *\n * Client error forwarding (overlay echo, digest filtering, componentStack)\n * remains in browser-dev.ts — Vite's forwardConsole only logs to terminal\n * and has no client-side filter hook. See TIM-1152.\n *\n * See design/21-dev-server.md §\"Browser Log Forwarding\"\n */\n\n// ─── Types ───────────────────────────────────────────────────────────────\n\n/** Log levels forwarded from the browser. */\nexport type BrowserLogLevel = 'error' | 'warn' | 'info';\n\n/** Configuration value for devBrowserLogs in timber.config.ts. */\nexport type DevBrowserLogsConfig = BrowserLogLevel | 'none' | undefined;\n\n// ─── Vite Config Mapping ─────────────────────────────────────────────────\n\n/**\n * Map timber's devBrowserLogs threshold to Vite 8's server.forwardConsole.\n *\n * Vite defaults forwardConsole OFF for non-agent dev; timber enables it\n * based on the configured threshold (default: 'warn'). The threshold acts\n * as a minimum severity — 'warn' forwards errors + warnings, 'info'\n * forwards everything, 'error' forwards only errors, 'none' disables.\n *\n * Vite's unhandledErrors is explicitly disabled — timber's own\n * setupClientErrorForwarding (browser-dev.ts) already catches window\n * error/unhandledrejection, filters framework control-flow signals\n * (redirect/deny digests) and page-unload aborts (TIM-838), and\n * echoes errors to the Vite overlay. Enabling Vite's unhandledErrors\n * would duplicate terminal output for normal errors and reintroduce\n * unfiltered noise for framework signals.\n */\nexport function resolveForwardConsole(\n threshold: DevBrowserLogsConfig\n): boolean | { unhandledErrors: boolean; logLevels: string[] } {\n const resolved = threshold ?? 'warn';\n if (resolved === 'none') return false;\n\n const logLevels: string[] = [];\n if (resolved === 'info') logLevels.push('info', 'warn', 'error');\n else if (resolved === 'warn') logLevels.push('warn', 'error');\n else logLevels.push('error');\n\n return { unhandledErrors: false, logLevels };\n}\n","import type { Plugin } from 'vite';\n\n/**\n * Redirect React's CJS development bundles to production bundles.\n *\n * React packages use a runtime `process.env.NODE_ENV` check in their CJS\n * entry points to conditionally require either `*.development.js` or\n * `*.production.js`. Rollup's CJS plugin resolves both branches statically\n * before the `define` replacement can eliminate the dead branch, causing\n * development React code to be included in production builds.\n *\n * This plugin intercepts `resolveId` and rewrites any `*.development.js`\n * import under `react/cjs/`, `react-dom/cjs/`, or `scheduler/cjs/` to\n * its `*.production.js` counterpart.\n *\n * Only active in production builds. Has no effect in dev mode.\n */\nexport function timberReactProd(): Plugin {\n let isProd = false;\n\n return {\n name: 'timber-react-prod',\n enforce: 'pre',\n configResolved(config) {\n isProd = config.command === 'build' && config.mode === 'production';\n },\n resolveId: {\n order: 'pre',\n async handler(source, importer, options) {\n if (!isProd) return;\n\n // Match: react/cjs/*.development.js, react-dom/cjs/*.development.js, scheduler/cjs/*.development.js\n if (!source.includes('.development.')) return;\n\n const resolved = await this.resolve(source, importer, {\n ...options,\n skipSelf: true,\n });\n if (!resolved) return;\n\n // Only rewrite paths inside react/react-dom/scheduler/react-server-dom CJS directories\n if (\n !resolved.id.includes('/react/cjs/') &&\n !resolved.id.includes('/react-dom/cjs/') &&\n !resolved.id.includes('/scheduler/cjs/') &&\n !resolved.id.includes('/react-server-dom/cjs/')\n ) {\n return;\n }\n\n const prodId = resolved.id.replace('.development.', '.production.');\n return { ...resolved, id: prodId };\n },\n },\n };\n}\n","/**\n * timber-chunks — Vite sub-plugin for client chunk configuration.\n *\n * Previously implemented a 5-tier cache strategy (vendor-react, vendor-timber,\n * vendor-app, shared-app, shared-client) via manualChunks. This was removed\n * in LOCAL-337 because the cache-tier separation added HTTP requests,\n * complicated the architecture, and caused module duplication across chunks\n * that required globalThis + Symbol.for workarounds.\n *\n * Current strategy: let Rolldown handle natural code splitting.\n * Output is typically:\n * - 1 main bundle (React + timber runtime + shared app code + user vendors)\n * - Per-route chunks (page/layout components, only when route-specific)\n * - rolldown-runtime (Rolldown's own output, unavoidable)\n *\n * Additionally, this plugin builds a facade ancestry map during the RSC\n * build so that `clientChunkGroup` can reclassify `shared:` client\n * references that are only consumed by a single route boundary.\n * See TIM-1107, design/27-chunking-strategy.md.\n *\n * Design docs: 27-chunking-strategy.md\n */\n\nimport type { Plugin, Rollup } from 'vite';\nimport type { PluginContext } from '../plugin-context';\n\n/**\n * Check if a module is part of the timber framework runtime.\n *\n * Matches both monorepo paths (packages/timber-app/...) and consumer\n * project paths (node_modules/@timber-js/app/...) so identification\n * is consistent regardless of how timber is installed.\n *\n * Exported for use in tests (singleton-audit, etc.).\n */\nexport function isTimberRuntime(id: string): boolean {\n return (\n id.includes('/timber-app/') ||\n id.includes('/@timber-js/app/') ||\n id.includes('react-server-dom') ||\n id.includes('@vitejs/plugin-rsc')\n );\n}\n\ntype OutputChunk = Rollup.OutputChunk;\n\n/**\n * Build a map from absolute module IDs in non-facade RSC chunks to the\n * absolute facade module paths that transitively import them.\n *\n * Used by `clientChunkGroup` to reclassify `shared:` client references\n * that are only consumed by a single route boundary (TIM-1107).\n */\nfunction buildFacadeAncestryMap(bundle: Rollup.OutputBundle): Map<string, string[]> {\n const chunks = new Map<string, OutputChunk>();\n for (const [file, asset] of Object.entries(bundle)) {\n if (asset.type === 'chunk') chunks.set(file, asset);\n }\n\n // Reverse import graph: which chunks import this chunk file?\n const importedBy = new Map<string, string[]>();\n for (const [file, chunk] of chunks) {\n for (const imp of chunk.imports) {\n let parents = importedBy.get(imp);\n if (!parents) {\n parents = [];\n importedBy.set(imp, parents);\n }\n parents.push(file);\n }\n }\n\n // Trace upward from a chunk to find all facade modules that consume it\n function facadeAncestors(file: string, visited: Set<string>): string[] {\n if (visited.has(file)) return [];\n visited.add(file);\n const chunk = chunks.get(file);\n if (!chunk) return [];\n if (chunk.facadeModuleId) return [chunk.facadeModuleId];\n const parents = importedBy.get(file) ?? [];\n const result: string[] = [];\n for (const p of parents) {\n for (const f of facadeAncestors(p, visited)) result.push(f);\n }\n return result;\n }\n\n const moduleToFacades = new Map<string, string[]>();\n for (const [file, chunk] of chunks) {\n if (chunk.facadeModuleId) continue;\n const facades = facadeAncestors(file, new Set());\n if (facades.length === 0) continue;\n // Deduplicate facades\n const unique = [...new Set(facades)];\n for (const modId of chunk.moduleIds) {\n moduleToFacades.set(modId, unique);\n }\n }\n\n return moduleToFacades;\n}\n\n/**\n * Create the timber-chunks Vite plugin.\n *\n * Rolldown's default splitting produces the desired output (one main\n * bundle + per-route chunks). This plugin's main job is building the\n * facade ancestry map during the RSC build so `clientChunkGroup` can\n * reclassify shared client references to their correct route boundary.\n *\n * NOTE: Ideally we'd use Rolldown's `format: 'app'` (module registry format)\n * which guarantees single-copy module semantics like webpack/Turbopack.\n * However, `format: 'app'` is not yet implemented in Rolldown rc.10.\n * Until it ships, singleton state in navigation-context.ts uses\n * globalThis + Symbol.for as a cross-chunk safety net.\n *\n * Design docs: 27-chunking-strategy.md\n */\nexport function timberChunks(ctx: PluginContext): Plugin {\n return {\n name: 'timber-chunks',\n generateBundle(_options, bundle) {\n if (this.environment?.name !== 'rsc') return;\n ctx.sharedModuleFacades = buildFacadeAncestryMap(bundle);\n },\n };\n}\n","/**\n * Client chunk grouping strategy for @vitejs/plugin-rsc.\n *\n * Groups client reference modules by the **consuming route's** layout boundary\n * (derived from `meta.serverChunk`), not by the module's own file location.\n * This ensures components in shared directories (e.g. `components/`) land in\n * the chunk of the route that uses them, not in a single catch-all chunk.\n *\n * For `shared:` modules (client references in non-facade RSC chunks), the\n * function consults a facade ancestry map built during the RSC build. If all\n * consuming facades belong to the same route boundary, the module is\n * reclassified to that boundary instead of falling through to `client-shared`.\n *\n * See design/27-chunking-strategy.md, TIM-440, TIM-499, TIM-1104, TIM-1107.\n */\n\nimport { relative } from 'node:path';\n\n/**\n * Check whether a root-relative path lives under the app directory,\n * and if so return the first non-group route segment.\n *\n * `appPrefix` is the root-relative app directory with a trailing slash\n * (e.g. \"app/\" or \"src/app/\"), computed once from the resolved appDir\n * and root. Matching uses `startsWith` — no ambiguity.\n *\n * Returns:\n * { inApp: false } — path is not under app/\n * { inApp: true, segment: null } — root of app/ (e.g. app/layout.tsx)\n * { inApp: true, segment: \"dashboard\" } — nested route boundary\n */\nfunction findAppBoundary(\n path: string,\n appPrefix: string\n): { inApp: false } | { inApp: true; segment: string | null } {\n const relPath = path.replace(/\\\\/g, '/');\n if (!relPath.startsWith(appPrefix)) return { inApp: false };\n\n const withinApp = relPath.slice(appPrefix.length);\n const segments = withinApp.split('/');\n\n for (const seg of segments) {\n if (seg.includes('.')) break;\n if (seg.startsWith('(') && seg.endsWith(')')) continue;\n return { inApp: true, segment: seg };\n }\n\n return { inApp: true, segment: null };\n}\n\n/**\n * Check if a string is a bare import specifier (package name, not a path).\n * Bare specifiers don't start with `.`, `/`, or contain `:/`.\n */\nfunction isBareSpecifier(id: string): boolean {\n return !id.startsWith('.') && !id.startsWith('/') && !id.includes(':/');\n}\n\n/**\n * Look up facade ancestors for a module ID, handling bare package specifiers.\n *\n * The facade ancestry map is keyed by absolute resolved paths (from Rollup's\n * moduleIds), but the RSC plugin passes bare package names (e.g. 'streamdown')\n * as meta.id for npm package client references (TIM-1108). When a direct\n * lookup misses and the id is a bare specifier, scan map keys for a matching\n * node_modules path.\n */\nfunction lookupFacades(\n id: string,\n sharedModuleFacades: Map<string, string[]>\n): string[] | undefined {\n const direct = sharedModuleFacades.get(id);\n if (direct) return direct;\n\n if (!isBareSpecifier(id)) return undefined;\n\n // Bare specifier: match against node_modules/<name>/ in map keys.\n // Scoped packages use @scope/name, unscoped use just name.\n // A package may have multiple module IDs in the RSC bundle (e.g. main\n // entry + re-exported submodules), so aggregate facades from all matches.\n const needle = `/node_modules/${id}/`;\n let merged: string[] | undefined;\n for (const [key, facades] of sharedModuleFacades) {\n if (key.includes(needle)) {\n if (!merged) merged = [...facades];\n else merged.push(...facades);\n }\n }\n return merged;\n}\n\n/**\n * For a `shared:` client reference, check the facade ancestry map to\n * see if all consuming facades belong to the same route boundary.\n * Returns the boundary segment name, or null if the module is\n * genuinely shared across multiple boundaries.\n */\nfunction reclassifySharedModule(\n meta: { id: string; normalizedId: string },\n appPrefix: string,\n root: string,\n sharedModuleFacades: Map<string, string[]>\n): string | null {\n const facades = lookupFacades(meta.id, sharedModuleFacades);\n if (!facades || facades.length === 0) return null;\n\n const boundaries = new Set<string>();\n for (const facade of facades) {\n const relFacade = relative(root, facade).replace(/\\\\/g, '/');\n const result = findAppBoundary(relFacade, appPrefix);\n if (result.inApp && result.segment) {\n boundaries.add(result.segment);\n } else if (result.inApp) {\n // Root-level facade — module is used at root, keep shared\n return null;\n } else {\n // Facade outside app/ (e.g. src/posts/foo.mdx) — can't derive a\n // safe common boundary, so keep shared to avoid pulling outside-app\n // deps into a route chunk they don't belong to.\n return null;\n }\n }\n\n if (boundaries.size === 1) return [...boundaries][0];\n return null;\n}\n\n/**\n * Derive a chunk group name for a client reference module.\n *\n * Always derives the group from the **consuming route** (`serverChunk`'s\n * facade path), not from the module's own file location. This prevents\n * components in shared directories (e.g. `app/components/`, `src/lib/`)\n * from collapsing into a single chunk when they're only used by one route.\n *\n * For `shared:` modules (non-facade RSC chunks), consults the facade\n * ancestry map to reclassify modules that are only consumed by a single\n * route boundary. This prevents large dependencies from polluting\n * `client-shared` when they're route-scoped (TIM-1107).\n *\n * Examples:\n * - `facade:app/dashboard/settings/page.tsx` → `\"client-dashboard\"`\n * - `facade:app/(group-a)/group-page-a/page.tsx` → `\"client-group-page-a\"`\n * - `facade:app/layout.tsx` (root layout) → `\"client-shared\"`\n * - `shared:...` (shared across chunks) → reclassified or `\"client-shared\"`\n */\nexport function clientChunkGroup(\n meta: { id: string; normalizedId: string; serverChunk: string },\n appDir: string,\n root: string,\n sharedModuleFacades?: Map<string, string[]>\n): string {\n const { serverChunk } = meta;\n\n // Compute the root-relative app directory prefix once. Both normalizedId\n // and serverChunk paths from the RSC plugin are root-relative (via\n // path.relative(root, absoluteId)), so this prefix matches exactly —\n // no ambiguity with content directories that happen to share a name.\n const appPrefix = relative(root, appDir).replace(/\\\\/g, '/') + '/';\n\n if (serverChunk.startsWith('shared:')) {\n if (sharedModuleFacades) {\n const boundary = reclassifySharedModule(meta, appPrefix, root, sharedModuleFacades);\n if (boundary) return `client-${boundary}`;\n }\n return 'client-shared';\n }\n\n // Derive the group from the serverChunk's facade path — the RSC entry\n // point that references this client module. This groups by the consuming\n // route's layout boundary, not the module's own file location (TIM-1104).\n if (serverChunk.startsWith('facade:')) {\n const facadePath = serverChunk.slice('facade:'.length).replace(/\\\\/g, '/');\n const facadeResult = findAppBoundary(facadePath, appPrefix);\n if (facadeResult.inApp && facadeResult.segment) return `client-${facadeResult.segment}`;\n if (facadeResult.inApp) return 'client-shared';\n\n // Facade is outside app/ (e.g. src/posts/foo.mdx via import.meta.glob).\n // Derive a chunk name from the full facade path to keep these isolated.\n const facadeName = facadePath.replace(/\\.[^.]+$/, '').replace(/\\//g, '-');\n if (facadeName) return `client-${facadeName}`;\n }\n\n return 'client-shared';\n}\n","/**\n * timber-server-bundle — Bundle all dependencies for server environments.\n *\n * In production builds, sets `resolve.noExternal: true` for the rsc and ssr\n * environments. This ensures all npm dependencies are bundled into the output,\n * which is required for platforms like Cloudflare Workers that don't have\n * access to node_modules at runtime.\n *\n * In dev mode, Vite's default externalization is preserved for fast HMR.\n *\n * Design docs: design/11-platform.md, design/25-production-deployments.md\n */\n\nimport { builtinModules } from 'node:module';\nimport type { Plugin } from 'vite';\n\n// Every Node built-in as both bare (`stream`) and prefixed (`node:stream`).\n// Available at runtime on all targets (Node natively, Workers via nodejs_compat).\n// Listing explicitly silences Vite's \"Automatically externalized\" warnings.\nconst NODE_BUILTINS: string[] = builtinModules.flatMap((m) => [m, `node:${m}`]);\n\n// Packages that must never be bundled into the runtime server environments.\n// With `noExternal: true`, rolldown follows all transitive imports. These\n// are build-time-only tools that have no runtime use in a server bundle.\n//\n// The primary leak path (TIM-988) — `virtual:timber-cache-handler` importing\n// `timber.config.ts` and pulling in adapter/MDX deps — was eliminated by\n// TIM-1211: the cache handler virtual module now imports `timber.cache.ts`\n// instead. These externals are retained as defense-in-depth.\n//\n// Cloudflare runtime modules (cloudflare:workers, cloudflare:sockets, etc.)\n// available at runtime on Workers but must not be bundled.\nconst CLOUDFLARE_BUILTINS = [\n 'cloudflare:workers',\n 'cloudflare:sockets',\n 'cloudflare:email',\n 'cloudflare:workflows',\n];\n\nconst BUILD_ONLY_EXTERNALS: string[] = [\n ...NODE_BUILTINS,\n ...CLOUDFLARE_BUILTINS,\n 'vite',\n 'nitro',\n 'rollup',\n '@mdx-js/rollup',\n 'fsevents',\n 'chokidar',\n];\n\nexport function timberServerBundle(): Plugin[] {\n const bundlePlugin: Plugin = {\n name: 'timber-server-bundle',\n\n config(_cfg, { command }) {\n // In dev mode, Vite externalizes node_modules by default for fast HMR.\n // But server-only/client-only must NOT be externalized — they need to\n // go through the timber-shims plugin so it can replace them with no-op\n // virtual modules. Without this, deps like `bright` that import\n // `server-only` get the real CJS package loaded via Node's require(),\n // which throws in the SSR environment.\n if (command === 'serve') {\n // In dev, Vite externalizes node_modules and loads them via Node's\n // native require(). This causes two problems:\n //\n // 1. Poison-pill packages: deps that import `server-only` (like `bright`)\n // hit the real CJS package which throws in the SSR environment.\n //\n // 2. Dual React instances: deps with React hooks (nuqs, etc.) are\n // externalized and loaded via Node.js, getting their own copy of\n // React. Meanwhile, SSR's renderToReadableStream uses Vite's\n // dep-optimized React. Two React instances = dispatcher mismatch,\n // causing \"Invalid hook call\" / \"Cannot read properties of null\n // (reading 'useId')\" errors. See LOCAL-297.\n //\n // We force these packages to be non-external so they go through\n // Vite's module pipeline, which deduplicates React correctly.\n return {\n environments: {\n rsc: {\n resolve: {\n noExternal: ['server-only', 'client-only'],\n },\n },\n ssr: {\n resolve: {\n noExternal: ['server-only', 'client-only', 'nuqs'],\n },\n },\n },\n };\n }\n\n // Bundle all dependencies in server environments for production.\n // Without this, bare imports like 'nuqs/adapters/custom' are left\n // as external imports in the output, which fails on platforms\n // without node_modules (Cloudflare Workers, edge runtimes).\n // Define process.env.NODE_ENV in server environments so that\n // dead-code branches (dev-only tracing, React dev checks) are\n // eliminated by Rollup's tree-shaking. Without this, the runtime\n // check falls through on platforms where process.env is empty\n // (e.g. Cloudflare Workers), causing dev code to run in production.\n // Define process.env.NODE_ENV so dev-only React code is tree-shaken.\n // TIMBER_DEBUG is intentionally NOT defined here — it must remain a\n // runtime check so `isDebug()` in server/debug.ts can read it at\n // request time. See TIM-365.\n const serverDefine = {\n 'process.env.NODE_ENV': JSON.stringify('production'),\n };\n\n return {\n // Target webworker so Rolldown doesn't emit createRequire(import.meta.url)\n // shims that fail in Cloudflare Workers where import.meta.url is undefined\n // for non-entry modules. See design/11-platform.md.\n ssr: { target: 'webworker' },\n environments: {\n rsc: {\n resolve: { noExternal: true, external: BUILD_ONLY_EXTERNALS },\n build: { rolldownOptions: { external: [/^cloudflare:/] } },\n define: serverDefine,\n },\n ssr: {\n resolve: { noExternal: true, external: BUILD_ONLY_EXTERNALS },\n build: { rolldownOptions: { external: [/^cloudflare:/] } },\n define: serverDefine,\n },\n },\n };\n },\n };\n\n // Fix Rolldown's broken `__esmMin` lazy initializers in server bundles.\n //\n // Rolldown wraps ESM module initialization in `__esmMin` lazy functions.\n // For packages with `sideEffects: false` (e.g. nuqs), Rolldown drops\n // the variable assignment of the init function — so the module's React\n // imports, context creation, etc. never execute.\n //\n // The fix: patch `__esmMin` to eagerly *attempt* each init, but fall\n // back to lazy retry on failure. This handles two failure modes:\n //\n // 1. Forward references (e.g. Zod v4): `init_iso` calls `init_schemas`\n // which hasn't been defined yet. Eager execution fails silently, but\n // when the function is called lazily later, all dependencies are\n // available and the retry succeeds (and caches).\n //\n // 2. Optional peer dep shims (e.g. @emotion/is-prop-valid for\n // framer-motion): Vite generates shims that throw for missing\n // optional deps. The eager attempt swallows the throw; the lazy call\n // PROPAGATES it so the consuming package's try/catch handles it.\n //\n // The key: only the eager attempt swallows errors. Once the helper is\n // returned, lazy calls use the original Rolldown semantics — a throwing\n // init propagates to the caller (and clears `fn`, matching upstream).\n // On success, `fn` is set to 0 so subsequent calls are no-ops.\n const esmInitFixPlugin: Plugin = {\n name: 'timber-esm-init-fix',\n applyToEnvironment(environment) {\n return environment.name === 'rsc' || environment.name === 'ssr';\n },\n renderChunk(code) {\n const lazy = 'var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);';\n if (!code.includes(lazy)) return null;\n\n // Eager-with-retry: attempt init immediately, swallowing failures\n // (forward refs aren't defined yet). After the eager attempt, flip\n // to lazy mode where errors propagate to the caller — consumers'\n // try/catch (framer-motion's optional @emotion dep) must see them.\n const eager = [\n 'var __esmMin = (fn, res) => {',\n ' var eager = 1;',\n ' var l = () => {',\n ' if (fn) { if (eager) { try { res = fn(); fn = 0; } catch(e) {} } else { res = fn(fn = 0); } }',\n ' return res;',\n ' };',\n ' l();',\n ' eager = 0;',\n ' return l;',\n '};',\n ].join(' ');\n\n return { code: code.replace(lazy, eager), map: null };\n },\n };\n\n // Fix Rolldown's `createRequire(import.meta.url)` CJS interop shim for\n // Cloudflare Workers. Rolldown emits this for CJS dependencies (e.g.\n // @opentelemetry/context-async-hooks) that use `require()`. On Workers,\n // `import.meta.url` is `undefined` for non-entry modules, causing:\n // TypeError: The argument 'path' must be a file URL object, a file URL\n // string, or an absolute path string. Received 'undefined'\n //\n // The fix: provide a fallback URL when `import.meta.url` is undefined.\n // The actual URL doesn't matter — `createRequire` only needs it for\n // resolving relative paths, but the only `__require()` calls are for\n // Node built-ins (events, async_hooks) which resolve from any base.\n //\n // The top-level `ssr: { target: 'webworker' }` was supposed to prevent\n // this, but it doesn't propagate to custom environments (rsc) in Vite's\n // Environment API. See LOCAL-405.\n const createRequireFixPlugin: Plugin = {\n name: 'timber-create-require-fix',\n applyToEnvironment(environment) {\n return environment.name === 'rsc' || environment.name === 'ssr';\n },\n renderChunk(code) {\n const pattern = 'createRequire(import.meta.url)';\n if (!code.includes(pattern)) return null;\n\n return {\n code: code.replace(pattern, 'createRequire(import.meta.url || \"file:///app\")'),\n map: null,\n };\n },\n };\n\n return [bundlePlugin, esmInitFixPlugin, createRequireFixPlugin];\n}\n","/**\n * Shared AST helpers for callsite-ID transforms.\n *\n * Both timber-cache-transform (plugins/cache.ts) and timber-prebuilt\n * (plugins/prebuilt.ts) detect calls on bindings imported from the cache\n * module and stamp them with content-derived stable IDs. The node shapes,\n * import-binding resolution, recursive call walk, and ID derivation are\n * identical — only the callee shape and rewrite differ per plugin.\n *\n * See TIM-997, TIM-1053, design/06-caching.md §\"Cache Key Security\".\n */\n\nimport { fnv1aHash } from '../cache/fast-hash.js';\n\n/** Module specifiers whose bindings the transforms track. */\nexport const CACHE_MODULE_SOURCES = new Set(['@timber-js/app/cache', 'timber/cache']);\n\nexport interface PositionedNode {\n type: string;\n start: number;\n end: number;\n [key: string]: unknown;\n}\n\nexport interface IdentifierNode extends PositionedNode {\n type: 'Identifier';\n name: string;\n}\n\nexport interface ImportDeclarationNode extends PositionedNode {\n type: 'ImportDeclaration';\n source: { value: string };\n specifiers: Array<\n PositionedNode & {\n type: string;\n local: IdentifierNode;\n imported?: IdentifierNode;\n }\n >;\n}\n\nexport interface CallExpressionNode extends PositionedNode {\n type: 'CallExpression';\n callee: PositionedNode;\n arguments: PositionedNode[];\n}\n\nexport interface MemberExpressionNode extends PositionedNode {\n type: 'MemberExpression';\n object: PositionedNode;\n property: PositionedNode;\n computed: boolean;\n}\n\nexport interface ProgramNode extends PositionedNode {\n type: 'Program';\n body: PositionedNode[];\n}\n\nexport interface ImportBindings {\n /** Local names bound to the named import (`import { cache as c }`). */\n named: Set<string>;\n /** Local names of namespace imports (`import * as ns`) of a tracked module. */\n namespaces: Set<string>;\n}\n\n/**\n * Find the local binding name(s) for `importedName` imported from one of\n * `sources` — both named imports (including aliases) and namespace imports\n * (TIM-1054).\n */\nexport function findImportBindings(\n program: ProgramNode,\n sources: ReadonlySet<string>,\n importedName: string\n): ImportBindings {\n const named = new Set<string>();\n const namespaces = new Set<string>();\n for (const stmt of program.body) {\n if (stmt.type !== 'ImportDeclaration') continue;\n const decl = stmt as unknown as ImportDeclarationNode;\n if (!sources.has(decl.source.value)) continue;\n for (const spec of decl.specifiers) {\n if (spec.type === 'ImportNamespaceSpecifier') {\n namespaces.add(spec.local.name);\n continue;\n }\n if (spec.type !== 'ImportSpecifier') continue;\n const specImportedName = spec.imported?.name ?? spec.local.name;\n if (specImportedName === importedName) {\n named.add(spec.local.name);\n }\n }\n }\n return { named, namespaces };\n}\n\n/** Extract all bound identifier names from a parameter/binding pattern. */\nfunction collectPatternNames(node: PositionedNode, out: Set<string>): void {\n switch (node.type) {\n case 'Identifier':\n out.add((node as IdentifierNode).name);\n break;\n case 'AssignmentPattern':\n collectPatternNames(node.left as PositionedNode, out);\n break;\n case 'RestElement':\n collectPatternNames(node.argument as PositionedNode, out);\n break;\n case 'ArrayPattern':\n for (const el of (node.elements as (PositionedNode | null)[] | undefined) ?? []) {\n if (el) collectPatternNames(el, out);\n }\n break;\n case 'ObjectPattern':\n for (const prop of (node.properties as PositionedNode[] | undefined) ?? []) {\n if (prop.type === 'RestElement') {\n collectPatternNames(prop, out);\n } else {\n collectPatternNames(prop.value as PositionedNode, out);\n }\n }\n break;\n case 'TSParameterProperty':\n // TS constructor parameter properties: `constructor(private cache)`\n if (node.parameter) collectPatternNames(node.parameter as PositionedNode, out);\n break;\n }\n}\n\n/** Return the intersection of param names with `tracked`, or null if none. */\nfunction shadowedParamNames(\n params: PositionedNode[] | undefined,\n tracked: ReadonlySet<string>\n): Set<string> | null {\n if (!params) return null;\n const names = new Set<string>();\n for (const p of params) collectPatternNames(p, names);\n const hit = new Set<string>();\n for (const n of names) {\n if (tracked.has(n)) hit.add(n);\n }\n return hit.size > 0 ? hit : null;\n}\n\n/**\n * Collect names declared by `VariableDeclaration`, `FunctionDeclaration`,\n * and `ClassDeclaration` in a statement list. Only scans direct children\n * (not nested blocks). For-loop bindings are NOT included — they are\n * scoped to the loop statement and handled separately in\n * `collectShadowRanges` (codex review round 4 on PR #876).\n */\nfunction collectLexicalDeclNames(stmts: PositionedNode[], out: Set<string>): void {\n for (const stmt of stmts) {\n if (stmt.type === 'VariableDeclaration') {\n for (const decl of (stmt.declarations as PositionedNode[] | undefined) ?? []) {\n if (decl.id) collectPatternNames(decl.id as PositionedNode, out);\n }\n } else if (stmt.type === 'FunctionDeclaration' || stmt.type === 'ClassDeclaration') {\n if (stmt.id && (stmt.id as PositionedNode).type === 'Identifier') {\n out.add((stmt.id as IdentifierNode).name);\n }\n }\n }\n}\n\n/**\n * Extract binding names from a for-loop's init/left clause, but ONLY for\n * `const`/`let` (block-scoped). `var` bindings hoist to the enclosing\n * function and are handled by `collectVarDeclNames` instead (codex review\n * round 5 on PR #876).\n */\nfunction collectForLoopBlockBindingNames(loop: PositionedNode, out: Set<string>): void {\n const init = (loop.init ?? loop.left) as PositionedNode | undefined;\n if (init?.type === 'VariableDeclaration' && init.kind !== 'var') {\n for (const decl of (init.declarations as PositionedNode[] | undefined) ?? []) {\n if (decl.id) collectPatternNames(decl.id as PositionedNode, out);\n }\n }\n}\n\n/**\n * Recursively collect `var` declaration names from a statement tree.\n * `var` hoists to the enclosing function regardless of block nesting,\n * so we must scan nested blocks, loops, switch cases, etc.\n */\nfunction collectVarDeclNames(stmts: PositionedNode[], out: Set<string>): void {\n for (const stmt of stmts) {\n if (stmt.type === 'VariableDeclaration' && stmt.kind === 'var') {\n for (const decl of (stmt.declarations as PositionedNode[] | undefined) ?? []) {\n if (decl.id) collectPatternNames(decl.id as PositionedNode, out);\n }\n }\n // Recurse into blocks, loops, if/else, switch, etc.\n if (stmt.type === 'BlockStatement' || stmt.type === 'StaticBlock') {\n collectVarDeclNames((stmt.body as PositionedNode[] | undefined) ?? [], out);\n } else if (stmt.type === 'IfStatement') {\n if (stmt.consequent) collectVarDeclNames([stmt.consequent as PositionedNode], out);\n if (stmt.alternate) collectVarDeclNames([stmt.alternate as PositionedNode], out);\n } else if (stmt.type === 'SwitchStatement') {\n for (const c of (stmt.cases as PositionedNode[] | undefined) ?? []) {\n collectVarDeclNames((c.consequent as PositionedNode[] | undefined) ?? [], out);\n }\n } else if (\n stmt.type === 'ForStatement' ||\n stmt.type === 'ForInStatement' ||\n stmt.type === 'ForOfStatement' ||\n stmt.type === 'WhileStatement' ||\n stmt.type === 'DoWhileStatement'\n ) {\n const init = (stmt.init ?? stmt.left) as PositionedNode | undefined;\n if (init?.type === 'VariableDeclaration' && init.kind === 'var') {\n for (const decl of (init.declarations as PositionedNode[] | undefined) ?? []) {\n if (decl.id) collectPatternNames(decl.id as PositionedNode, out);\n }\n }\n if (stmt.body) collectVarDeclNames([stmt.body as PositionedNode], out);\n } else if (stmt.type === 'WithStatement' || stmt.type === 'LabeledStatement') {\n if (stmt.body) collectVarDeclNames([stmt.body as PositionedNode], out);\n } else if (stmt.type === 'TryStatement') {\n if (stmt.block) collectVarDeclNames([stmt.block as PositionedNode], out);\n const handler = stmt.handler as PositionedNode | undefined;\n if (handler?.body) collectVarDeclNames([handler.body as PositionedNode], out);\n if (stmt.finalizer) collectVarDeclNames([stmt.finalizer as PositionedNode], out);\n }\n }\n}\n\nexport interface ShadowRange {\n start: number;\n end: number;\n /** Which tracked binding names are shadowed in this range. */\n names: ReadonlySet<string>;\n}\n\n/**\n * Collect byte ranges where any name in `tracked` is shadowed by a\n * function/arrow parameter, catch clause binding, or lexical declaration\n * (`const`/`let`/`var`, `function`, `class`, for-loop binding). Calls\n * inside these ranges must NOT be rewritten — the name resolves to the\n * local binding, not the import (TIM-1141).\n *\n * Each range records WHICH names are shadowed so the consumer can skip\n * only calls to the shadowed name, not unrelated imports (codex review\n * on PR #876).\n *\n * When a scope shadows some-but-not-all tracked names, the walker\n * continues descending to find inner scopes that shadow remaining names\n * (codex review round 2 on PR #876).\n */\nexport function collectShadowRanges(\n node: PositionedNode,\n tracked: ReadonlySet<string>,\n ranges: ShadowRange[]\n): void {\n if (tracked.size === 0) return;\n\n const isFn =\n node.type === 'FunctionDeclaration' ||\n node.type === 'FunctionExpression' ||\n node.type === 'ArrowFunctionExpression';\n\n let remainingTracked = tracked;\n\n // ── Function/arrow parameters + named function expression id ───────\n if (isFn) {\n const paramNames = new Set<string>();\n for (const p of (node.params as PositionedNode[] | undefined) ?? []) {\n collectPatternNames(p, paramNames);\n }\n // Named function expressions: `const w = function cache() { ... }`\n // — the name is in scope inside the body (codex review round 5).\n if (node.type === 'FunctionExpression' && node.id) {\n const fnId = node.id as PositionedNode;\n if (fnId.type === 'Identifier') paramNames.add((fnId as IdentifierNode).name);\n }\n const shadowed = new Set<string>();\n for (const n of paramNames) {\n if (tracked.has(n)) shadowed.add(n);\n }\n if (shadowed.size > 0) {\n ranges.push({ start: node.start, end: node.end, names: shadowed });\n if (shadowed.size === tracked.size) return;\n remainingTracked = new Set([...tracked].filter((n) => !shadowed.has(n)));\n }\n }\n\n // ── Catch clause binding ───────────────────────────────────────────\n if (node.type === 'CatchClause') {\n const param = node.param as PositionedNode | undefined;\n if (param) {\n const shadowed = shadowedParamNames([param], tracked);\n if (shadowed) {\n ranges.push({ start: node.start, end: node.end, names: shadowed });\n if (shadowed.size === tracked.size) return;\n remainingTracked = new Set([...tracked].filter((n) => !shadowed.has(n)));\n }\n }\n }\n\n // ── Named class expressions ───────────────────────────────────────\n // `const C = class cache { ... }` — the class name is in scope inside\n // the class body (codex review round 6 on PR #876).\n if (node.type === 'ClassExpression' && node.id) {\n const clsId = node.id as PositionedNode;\n if (clsId.type === 'Identifier' && remainingTracked.has((clsId as IdentifierNode).name)) {\n const names = new Set([(clsId as IdentifierNode).name]);\n ranges.push({ start: node.start, end: node.end, names });\n if (names.size === remainingTracked.size) return;\n remainingTracked = new Set([...remainingTracked].filter((n) => !names.has(n)));\n }\n }\n\n // ── For-loop bindings (scoped to the loop, not the enclosing body) ─\n // `for (const cache of items) { ... }` shadows `cache` only inside\n // the loop statement, not in the rest of the function. Codex review\n // round 4 on PR #876.\n if (\n node.type === 'ForStatement' ||\n node.type === 'ForInStatement' ||\n node.type === 'ForOfStatement'\n ) {\n const loopNames = new Set<string>();\n collectForLoopBlockBindingNames(node, loopNames);\n const loopShadowed = new Set<string>();\n for (const n of loopNames) {\n if (remainingTracked.has(n)) loopShadowed.add(n);\n }\n if (loopShadowed.size > 0) {\n ranges.push({ start: node.start, end: node.end, names: loopShadowed });\n if (loopShadowed.size === remainingTracked.size) return;\n remainingTracked = new Set([...remainingTracked].filter((n) => !loopShadowed.has(n)));\n }\n }\n\n // ── Lexical declarations in function/block/switch bodies ────────────\n // `const cache = ...`, `function cache() {}`, `class cache {}` inside\n // a function body, block, or switch shadow the tracked name for the\n // enclosing scope. `var` hoists to the enclosing function — scanned\n // recursively. Codex review rounds 3 & 5 on PR #876.\n const isScope =\n isFn ||\n node.type === 'BlockStatement' ||\n node.type === 'SwitchStatement' ||\n node.type === 'StaticBlock';\n if (isScope) {\n let bodyStmts: PositionedNode[] | null = null;\n if (isFn) {\n const body = node.body as PositionedNode | undefined;\n if (body?.type === 'BlockStatement') {\n bodyStmts = (body.body as PositionedNode[] | undefined) ?? null;\n }\n } else if (node.type === 'SwitchStatement') {\n // Switch cases: declarations in unbraced cases are scoped to the switch block\n const caseStmts: PositionedNode[] = [];\n for (const c of (node.cases as PositionedNode[] | undefined) ?? []) {\n for (const s of (c.consequent as PositionedNode[] | undefined) ?? []) {\n caseStmts.push(s);\n }\n }\n bodyStmts = caseStmts;\n } else {\n bodyStmts = (node.body as PositionedNode[] | undefined) ?? null;\n }\n if (bodyStmts) {\n const declNames = new Set<string>();\n collectLexicalDeclNames(bodyStmts, declNames);\n // For function scopes, also collect hoisted `var` declarations\n // from the entire body tree (var hoists past blocks).\n if (isFn) {\n collectVarDeclNames(bodyStmts, declNames);\n }\n const lexShadowed = new Set<string>();\n for (const n of declNames) {\n if (remainingTracked.has(n)) lexShadowed.add(n);\n }\n if (lexShadowed.size > 0) {\n ranges.push({ start: node.start, end: node.end, names: lexShadowed });\n if (lexShadowed.size === remainingTracked.size) return;\n remainingTracked = new Set([...remainingTracked].filter((n) => !lexShadowed.has(n)));\n }\n }\n }\n\n // ── Recurse into children ──────────────────────────────────────────\n for (const key of Object.keys(node)) {\n if (key === 'type' || key === 'start' || key === 'end') continue;\n const val = node[key];\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (const item of val) {\n if (item && typeof item === 'object' && typeof item.type === 'string') {\n collectShadowRanges(item as PositionedNode, remainingTracked, ranges);\n }\n }\n } else if (typeof (val as PositionedNode).type === 'string') {\n collectShadowRanges(val as PositionedNode, remainingTracked, ranges);\n }\n }\n }\n}\n\n/**\n * Recursively walk AST nodes collecting call expressions accepted by\n * `matches`. Calls are typically at module scope, but calls inside\n * functions/blocks are handled for completeness.\n *\n * Consumers that match by binding NAME should pair this with\n * `collectShadowRanges` to filter out calls in scopes where the tracked\n * name is shadowed (TIM-1141). The prebuilt transform avoids the class\n * entirely by allowlisting top-level declarator positions\n * (plugins/prebuilt.ts).\n */\nexport function findCallSites(\n node: PositionedNode,\n matches: (call: CallExpressionNode) => boolean,\n results: CallExpressionNode[]\n): void {\n if (node.type === 'CallExpression') {\n const call = node as unknown as CallExpressionNode;\n if (matches(call)) {\n results.push(call);\n }\n }\n for (const key of Object.keys(node)) {\n if (key === 'type' || key === 'start' || key === 'end') continue;\n const val = node[key];\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (const item of val) {\n if (item && typeof item === 'object' && typeof item.type === 'string') {\n findCallSites(item as PositionedNode, matches, results);\n }\n }\n } else if (typeof (val as PositionedNode).type === 'string') {\n findCallSites(val as PositionedNode, matches, results);\n }\n }\n }\n}\n\n/**\n * Generate a stable callsite ID from a module path, a kind discriminator\n * ('cache' | 'component'), the source text of the enclosing top-level\n * statement, the source text of the call expression, and an occurrence index\n * among fully byte-identical (statement, call) pairs in the same file.\n *\n * The ID is deterministic and:\n * - Stable across cold starts AND across builds/deploys for unchanged calls —\n * inserting, deleting, or reordering other calls does not affect it\n * - Unique across different modules (relPath component)\n * - Unique across distinct calls within a module (statement + span hashes),\n * with fully identical duplicates disambiguated by source-order occurrence\n * - Fresh when the wrapped fn, opts, or enclosing statement change, which\n * intentionally invalidates the old persisted entries\n *\n * The enclosing-statement text is included so that byte-identical calls in\n * different scopes — e.g. two factory helpers with identical call spans —\n * get distinct, insertion-stable IDs. See plugins/cache.ts header for the\n * full derivation rationale (TIM-1053).\n */\nexport function generateStableCallsiteId(\n relativeModulePath: string,\n kind: string,\n statementText: string,\n callSpanText: string,\n occurrence: number\n): string {\n return fnv1aHash(\n `${relativeModulePath}:${kind}:${fnv1aHash(statementText)}:${fnv1aHash(callSpanText)}:${occurrence}`\n );\n}\n","/**\n * timber-cache-transform — Vite plugin that injects stable callsite IDs\n * into `cache.data()` calls imported from `@timber-js/app/cache`.\n *\n * Detected callsite forms (TIM-1054):\n * - named imports, including aliases: `import { cache as c }` + `c.data(fn, opts)`\n * - namespace imports: `import * as ns` + `ns.cache.data(fn, opts)`\n * Forms a per-module transform cannot trace — local variable aliases\n * (`const c = cache`), user re-export wrapper modules, computed access\n * (`cache['data']`) — fall back to the runtime fnId derived from\n * fnv1a(fn.toString()) (see cache/timber-cache.ts), which is deterministic\n * across instances and cold starts of the same build. Without either\n * mechanism, an ordinal counter would collide across instances with a shared\n * CacheHandler (Redis/KV) — cache key poisoning, serving one route's cached\n * data to another.\n *\n * The plugin transforms:\n * cache.data(fn, opts) → cache.data(fn, opts, \"stable-id\")\n * ns.cache.data(fn, opts) → ns.cache.data(fn, opts, \"stable-id\")\n *\n * where stable-id =\n * fnv1a(relPath + \":cache:\" + fnv1a(stmtText) + \":\" + fnv1a(callSpanText) + \":\" + occurrence)\n *\n * stmtText is the source text of the enclosing *top-level statement* and\n * callSpanText is the source text of the cache(...) call expression itself.\n *\n * The ID is derived from the *content* of the call, not its ordinal position\n * in the file. A position-based index (the original TIM-997 scheme) was stable\n * within one build but shifted across builds: inserting, deleting, or\n * reordering a cache() call changed the index of every call below it, so with\n * a persistent shared CacheHandler (Redis/KV) a new function could inherit\n * another function's old ID and serve its persisted data — cross-deploy cache\n * poisoning (TIM-1053). Content hashing makes IDs immune to reordering and\n * unrelated edits, while a changed call gets a fresh ID — which is exactly\n * when invalidation is wanted.\n *\n * The enclosing-statement text is included so that byte-identical cache.data()\n * calls in different scopes — e.g. two factory helpers that each `return\n * cache.data(fn, { ttl: 60 })` — get distinct, insertion-stable IDs: their\n * enclosing declarations differ by name/body even when the call spans are\n * identical. Without it, a source-order occurrence counter alone would shift\n * when an identical span is inserted above, reassigning IDs across deploys.\n * Calls that are byte-identical INCLUDING their enclosing top-level statement\n * are disambiguated by a source-order occurrence index. That residue is safe:\n * identical top-level declarations are a redeclaration error, so fully\n * identical (statement, call) pairs can only be expression statements\n * referencing the same bindings — the same function, where an ID swap is\n * harmless.\n *\n * AST helpers and the ID derivation are shared with timber-prebuilt\n * (plugins/prebuilt.ts) via plugins/callsite-ast.ts.\n *\n * See TIM-997, TIM-1053, design/06-caching.md §\"Cache Key Security\".\n */\n\nimport { relative } from 'node:path';\nimport MagicString from 'magic-string';\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport {\n CACHE_MODULE_SOURCES,\n collectShadowRanges,\n findCallSites,\n findImportBindings,\n generateStableCallsiteId,\n} from './callsite-ast.js';\nimport type {\n CallExpressionNode,\n IdentifierNode,\n ImportBindings,\n MemberExpressionNode,\n PositionedNode,\n ProgramNode,\n ShadowRange,\n} from './callsite-ast.js';\n\n/**\n * Is this callee a `cache.data(...)` call? Matches two forms:\n * - Named import: `cache.data(fn, opts)` where `cache` is the imported binding\n * - Namespace import: `ns.cache.data(fn, opts)` where `ns` is the namespace\n * Computed access (`cache['data']`) is deliberately not matched; it falls back\n * to the runtime fnId derivation.\n */\nfunction isCacheDataCallee(callee: PositionedNode, bindings: ImportBindings): boolean {\n if (callee.type !== 'MemberExpression') return false;\n const member = callee as unknown as MemberExpressionNode;\n if (member.computed) return false;\n if (member.property.type !== 'Identifier' || (member.property as IdentifierNode).name !== 'data')\n return false;\n\n const obj = member.object;\n // Named import: `cache.data(...)` — obj is the imported `cache` identifier\n if (obj.type === 'Identifier') {\n return bindings.named.has((obj as IdentifierNode).name);\n }\n // Namespace import: `ns.cache.data(...)` — obj is `ns.cache`\n if (obj.type === 'MemberExpression') {\n const outer = obj as unknown as MemberExpressionNode;\n return (\n !outer.computed &&\n outer.object.type === 'Identifier' &&\n bindings.namespaces.has((outer.object as IdentifierNode).name) &&\n outer.property.type === 'Identifier' &&\n (outer.property as IdentifierNode).name === 'cache'\n );\n }\n return false;\n}\n\n/**\n * Extract the local binding name that a cache.data callee resolves to — the\n * `cache` identifier for named imports, or the namespace object for `ns.cache.data()`.\n */\nfunction calleeBindingName(callee: PositionedNode, bindings: ImportBindings): string | null {\n if (callee.type !== 'MemberExpression') return null;\n const member = callee as unknown as MemberExpressionNode;\n const obj = member.object;\n // Named import: `cache.data(...)` — binding is `cache`\n if (obj.type === 'Identifier') {\n const name = (obj as IdentifierNode).name;\n return bindings.named.has(name) ? name : null;\n }\n // Namespace import: `ns.cache.data(...)` — binding is `ns`\n if (obj.type === 'MemberExpression') {\n const outer = obj as unknown as MemberExpressionNode;\n if (outer.object.type === 'Identifier') {\n const name = (outer.object as IdentifierNode).name;\n return bindings.namespaces.has(name) ? name : null;\n }\n }\n return null;\n}\n\n/**\n * Generate a stable callsite ID for a cache() call. See callsite-ast.ts for\n * the derivation properties.\n */\nfunction generateStableId(\n relativeModulePath: string,\n statementText: string,\n callSpanText: string,\n occurrence: number\n): string {\n return generateStableCallsiteId(\n relativeModulePath,\n 'cache',\n statementText,\n callSpanText,\n occurrence\n );\n}\n\nexport function timberCacheTransform(ctx: PluginContext): Plugin {\n return {\n name: 'timber-cache-transform',\n\n transform(code, id) {\n if (!code.includes('@timber-js/app/cache') && !code.includes('timber/cache')) return;\n // Skip node_modules (don't transform third-party code)\n if (id.includes('node_modules')) return;\n\n let program: ProgramNode;\n try {\n program = ctx.parseCached!.parse(code);\n } catch {\n return;\n }\n\n const cacheBindings = findImportBindings(program, CACHE_MODULE_SOURCES, 'cache');\n if (cacheBindings.named.size === 0 && cacheBindings.namespaces.size === 0) return;\n\n // Collect byte ranges where tracked binding names are shadowed by\n // function/arrow parameters or catch bindings (TIM-1141). Calls inside\n // these ranges are NOT rewritten — they fall back to the runtime fnId.\n const trackedNames = new Set([...cacheBindings.named, ...cacheBindings.namespaces]);\n const shadowRanges: ShadowRange[] = [];\n collectShadowRanges(program, trackedNames, shadowRanges);\n\n // Check whether the specific binding name a callee resolves to is\n // shadowed at the call position. Only that name is blocked — other\n // tracked imports from the same module remain valid (codex review\n // on PR #876).\n const isCalleeShadowed = (call: CallExpressionNode): boolean => {\n const name = calleeBindingName(call.callee, cacheBindings);\n if (!name) return false;\n return shadowRanges.some(\n (r) => call.start >= r.start && call.start < r.end && r.names.has(name)\n );\n };\n\n // Collect call sites per top-level statement so each call carries its\n // enclosing statement's source text into the ID hash.\n const callSites: Array<{ call: CallExpressionNode; stmt: PositionedNode }> = [];\n for (const stmt of program.body) {\n const calls: CallExpressionNode[] = [];\n findCallSites(\n stmt,\n (call) =>\n call.arguments.length === 2 &&\n isCacheDataCallee(call.callee, cacheBindings) &&\n !isCalleeShadowed(call),\n calls\n );\n for (const call of calls) callSites.push({ call, stmt });\n }\n if (callSites.length === 0) return;\n\n // Sort by position in file so occurrence indices among byte-identical\n // (statement, call) pairs are assigned in deterministic source order\n callSites.sort((a, b) => a.call.start - b.call.start);\n\n const root = ctx.root || process.cwd();\n const relPath = relative(root, id);\n const s = new MagicString(code);\n const occurrences = new Map<string, number>();\n\n for (const { call, stmt } of callSites) {\n const stmtText = code.slice(stmt.start, stmt.end);\n const spanText = code.slice(call.start, call.end);\n const dupKey = stmtText + String.fromCharCode(0) + spanText;\n const occurrence = occurrences.get(dupKey) ?? 0;\n occurrences.set(dupKey, occurrence + 1);\n const stableId = generateStableId(relPath, stmtText, spanText, occurrence);\n // Insert the stable ID as the 3rd argument directly after the last\n // argument — NOT before the closing ')'. The call may already have a\n // trailing comma after the options argument (Prettier v3 default for\n // multiline calls); inserting before ')' would emit `,, \"id\"`, a\n // parse error (TIM-1021). A trailing comma after the inserted\n // argument remains valid JS.\n const lastArg = call.arguments[call.arguments.length - 1];\n s.appendLeft(lastArg.end, `, \"${stableId}\"`);\n }\n\n return {\n code: s.toString(),\n map: s.generateMap({ hires: 'boundary' }),\n };\n },\n };\n}\n\n// Exported for testing\nexport { generateStableId };\n","/**\n * timber-request-dep — Static module-graph analysis for request-dependency.\n *\n * Replaces runtime ALS-based taint tracking with a build/dev-time computed\n * map: segment entry file → statically request-dependent?\n *\n * A segment/slot is request-dependent iff any module reachable from its\n * layout/page/default in the RSC module graph (stopping at client-reference\n * boundaries) imports and calls a request accessor (getHeaders, cookies,\n * getSearchParams, etc.) or calls .get() on a search-params/cookie\n * definition object.\n *\n * This is deterministic, covers children/barrels/node_modules/Suspense-\n * deferred code, and is computed before any byte is flushed.\n *\n * See design/19-client-navigation.md §\"X-Timber-State-Tree Header\"\n */\n\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport {\n findImportBindings,\n type ProgramNode,\n type CallExpressionNode,\n type MemberExpressionNode,\n type IdentifierNode,\n} from './callsite-ast.js';\n\n// ─── Module specifiers whose bindings are request accessors ──────────────\n\nconst ACCESSOR_SOURCES = new Set(['@timber-js/app/server', 'next/headers', 'next/headers.js']);\n\nconst ACCESSOR_NAMES = new Set([\n 'getHeaders',\n 'getHeader',\n 'getSearchParams',\n 'getCookieJar',\n 'getCookie',\n // next/headers shim names\n 'headers',\n 'cookies',\n]);\n\nconst DEFINITION_FACTORY_SOURCES = new Set([\n '@timber-js/app/search-params',\n '@timber-js/app/cookies',\n]);\n\nconst DEFINITION_FACTORY_NAMES = new Set(['defineSearchParams', 'defineCookie']);\n\n// ─── Fast token pre-filter ───────────────────────────────────────────────\n\nconst ACCESSOR_TOKENS = [\n 'getHeaders',\n 'getHeader',\n 'getSearchParams',\n 'getCookieJar',\n 'getCookie',\n 'headers',\n 'cookies',\n 'defineSearchParams',\n 'defineCookie',\n // .get() on imported/local definition bindings (searchParams.get())\n '.get(',\n];\n\nfunction hasRelevantToken(code: string): boolean {\n for (const token of ACCESSOR_TOKENS) {\n if (code.includes(token)) return true;\n }\n return false;\n}\n\n// ─── Per-module facts ────────────────────────────────────────────────────\n\ninterface ModuleFacts {\n /** Module directly calls a request accessor. */\n callsAccessor: boolean;\n /** Module imports a definition factory (defineSearchParams/defineCookie). */\n importsDefinitionFactory: boolean;\n /** Import specifiers where `.get()` was called on the binding. */\n getterCallSources: string[];\n}\n\n// ─── AST analysis ────────────────────────────────────────────────────────\n\nfunction analyzeModule(code: string, program: ProgramNode): ModuleFacts {\n const facts: ModuleFacts = {\n callsAccessor: false,\n importsDefinitionFactory: false,\n getterCallSources: [],\n };\n\n // Check for accessor imports\n for (const name of ACCESSOR_NAMES) {\n const bindings = findImportBindings(program, ACCESSOR_SOURCES, name);\n if (bindings.named.size > 0 || bindings.namespaces.size > 0) {\n // Check if any binding is actually called (not just imported)\n if (hasCallSite(program, bindings.named, bindings.namespaces, name)) {\n facts.callsAccessor = true;\n }\n }\n }\n\n // Check for definition factory imports\n for (const name of DEFINITION_FACTORY_NAMES) {\n const bindings = findImportBindings(program, DEFINITION_FACTORY_SOURCES, name);\n if (bindings.named.size > 0 || bindings.namespaces.size > 0) {\n facts.importsDefinitionFactory = true;\n }\n }\n\n // Check for .get() calls on imported bindings (searchParams.get(), etc.)\n // Collect which import sources have .get() called on their bindings.\n for (const stmt of program.body) {\n if (stmt.type !== 'ImportDeclaration') continue;\n const decl = stmt as unknown as {\n source: { value: string };\n specifiers: Array<{ type: string; local: IdentifierNode; imported?: IdentifierNode }>;\n };\n for (const spec of decl.specifiers) {\n if (spec.type === 'ImportDefaultSpecifier' || spec.type === 'ImportSpecifier') {\n const localName = spec.local.name;\n if (hasGetterCall(program, localName)) {\n facts.getterCallSources.push(decl.source.value);\n }\n }\n }\n }\n\n // Check for co-located definitions: const sp = defineSearchParams(...); sp.get()\n // If a module both mints a definition AND calls .get() on any local binding\n // whose init is a defineSearchParams/defineCookie call, it's a taint source.\n if (facts.importsDefinitionFactory) {\n for (const stmt of program.body) {\n if (stmt.type !== 'VariableDeclaration') continue;\n for (const decl of ((stmt as Record<string, unknown>).declarations as Array<\n Record<string, unknown>\n >) ?? []) {\n if (!decl.init || !decl.id) continue;\n const init = decl.init as Record<string, unknown>;\n // Check if init is a call to a definition factory\n if (init.type === 'CallExpression') {\n const callee = init.callee as Record<string, unknown>;\n if (callee.type === 'Identifier') {\n const calleeName = (callee as unknown as IdentifierNode).name;\n // Check if this name is a definition factory binding\n for (const factoryName of DEFINITION_FACTORY_NAMES) {\n const bindings = findImportBindings(program, DEFINITION_FACTORY_SOURCES, factoryName);\n if (bindings.named.has(calleeName)) {\n // This local variable is a definition instance\n const localName =\n (decl.id as Record<string, unknown>).type === 'Identifier'\n ? (decl.id as unknown as IdentifierNode).name\n : null;\n if (localName && hasGetterCall(program, localName)) {\n facts.callsAccessor = true;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return facts;\n}\n\n/** Check if any named/namespace binding is called as a function. */\nfunction hasCallSite(\n program: ProgramNode,\n named: Set<string>,\n namespaces: Set<string>,\n importedName: string\n): boolean {\n return walkForCall(program, named, namespaces, importedName);\n}\n\nfunction walkForCall(\n node: Record<string, unknown>,\n named: Set<string>,\n namespaces: Set<string>,\n importedName: string\n): boolean {\n if (node.type === 'CallExpression') {\n const call = node as unknown as CallExpressionNode;\n const callee = call.callee;\n // Direct call: getHeaders()\n if (callee.type === 'Identifier' && named.has((callee as IdentifierNode).name)) {\n return true;\n }\n // Namespace call: ns.getHeaders()\n if (callee.type === 'MemberExpression') {\n const member = callee as MemberExpressionNode;\n if (\n !member.computed &&\n member.object.type === 'Identifier' &&\n namespaces.has((member.object as IdentifierNode).name) &&\n member.property.type === 'Identifier' &&\n (member.property as IdentifierNode).name === importedName\n ) {\n return true;\n }\n }\n }\n for (const key of Object.keys(node)) {\n if (key === 'type' || key === 'start' || key === 'end') continue;\n const val = node[key];\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (const item of val) {\n if (item && typeof item === 'object' && typeof item.type === 'string') {\n if (walkForCall(item as Record<string, unknown>, named, namespaces, importedName))\n return true;\n }\n }\n } else if (typeof (val as Record<string, unknown>).type === 'string') {\n if (walkForCall(val as Record<string, unknown>, named, namespaces, importedName))\n return true;\n }\n }\n }\n return false;\n}\n\n/** Check if `localName.get(...)` appears anywhere in the module. */\nfunction hasGetterCall(node: Record<string, unknown>, localName: string): boolean {\n if (node.type === 'CallExpression') {\n const call = node as unknown as CallExpressionNode;\n if (call.callee.type === 'MemberExpression') {\n const member = call.callee as MemberExpressionNode;\n if (\n !member.computed &&\n member.object.type === 'Identifier' &&\n (member.object as IdentifierNode).name === localName &&\n member.property.type === 'Identifier' &&\n (member.property as IdentifierNode).name === 'get'\n ) {\n return true;\n }\n }\n }\n for (const key of Object.keys(node)) {\n if (key === 'type' || key === 'start' || key === 'end') continue;\n const val = node[key];\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (const item of val) {\n if (item && typeof item === 'object' && typeof item.type === 'string') {\n if (hasGetterCall(item as Record<string, unknown>, localName)) return true;\n }\n }\n } else if (typeof (val as Record<string, unknown>).type === 'string') {\n if (hasGetterCall(val as Record<string, unknown>, localName)) return true;\n }\n }\n }\n return false;\n}\n\n// ─── Module graph reachability ───────────────────────────────────────────\n\n/** Walk the module graph from an entry, returning true if any taint source is reachable. */\nfunction isReachableTaintSource(\n entryId: string,\n factsMap: Map<string, ModuleFacts>,\n definitionModules: Set<string>,\n getImports: (id: string) => string[]\n): boolean {\n const visited = new Set<string>();\n const stack = [entryId];\n\n while (stack.length > 0) {\n const id = stack.pop()!;\n if (visited.has(id)) continue;\n visited.add(id);\n\n const facts = factsMap.get(id);\n if (facts) {\n if (facts.callsAccessor) return true;\n // Check if any .get() call is on a definition module\n for (const source of facts.getterCallSources) {\n // Resolve relative to the module — for now just check if the\n // resolved ID is a definition module.\n // In dev, the getter source is unresolved; we check if any\n // imported module is a definition module by looking at actual imports.\n }\n }\n\n // Check if this module IS a definition module and has .get() callers\n // (handled by the importer's facts)\n\n const imports = getImports(id);\n for (const imp of imports) {\n // Stop at client boundaries — 'use client' modules in the RSC graph\n // resolve to generated proxy stubs with no further imports.\n // Also stop at virtual modules (they're framework internals).\n if (!imp.startsWith('\\0') && !visited.has(imp)) {\n stack.push(imp);\n }\n }\n }\n\n // Second pass: check getter calls against definition modules\n for (const id of visited) {\n const facts = factsMap.get(id);\n if (!facts) continue;\n if (facts.getterCallSources.length === 0) continue;\n // Check if any import of this module is a definition module\n const imports = getImports(id);\n for (const imp of imports) {\n if (definitionModules.has(imp)) {\n // This module imports a definition module and calls .get() on some binding.\n // Conservative: treat it as a taint source.\n return true;\n }\n }\n }\n\n return false;\n}\n\n// ─── Plugin ──────────────────────────────────────────────────────────────\n\nconst BRIDGE_KEY = Symbol.for('timber:request-dep');\n\nexport function timberRequestDep(ctx: PluginContext): Plugin {\n const factsMap = new Map<string, ModuleFacts>();\n const definitionModules = new Set<string>();\n const cache = new Map<string, boolean>();\n\n return {\n name: 'timber-request-dep',\n // Only run in RSC environment — that's where server components render.\n applyToEnvironment(env) {\n return env.name === 'rsc';\n },\n\n async transform(code, id) {\n // Skip non-JS (include .mdx/.md — compiled to JS by timber-mdx before this runs)\n if (!/\\.[mc]?[jt]sx?$/.test(id) && !/\\.mdx?$/.test(id)) return;\n // Skip virtual modules\n if (id.startsWith('\\0') || id.startsWith('virtual:')) return;\n // Fast token check\n if (!hasRelevantToken(code)) return;\n\n const program = (this as unknown as { parse(code: string): ProgramNode }).parse(code);\n const facts = analyzeModule(code, program);\n\n if (\n facts.callsAccessor ||\n facts.importsDefinitionFactory ||\n facts.getterCallSources.length > 0\n ) {\n factsMap.set(id, facts);\n if (facts.importsDefinitionFactory) {\n definitionModules.add(id);\n }\n }\n\n // No code transform needed — this is analysis only.\n return undefined;\n },\n\n configureServer(server) {\n // Register the bridge so runtime can query request-dep status.\n const resolver = (filePath: string): boolean => {\n if (cache.has(filePath)) return cache.get(filePath)!;\n\n const rscEnv = server.environments?.rsc;\n if (!rscEnv?.moduleGraph) {\n return true; // Unknown → conservative\n }\n\n const getImports = (moduleId: string): string[] => {\n const mod = rscEnv.moduleGraph.getModuleById(moduleId);\n if (!mod) return [];\n const result: string[] = [];\n for (const imp of mod.importedModules) {\n if (imp.id) result.push(imp.id);\n }\n return result;\n };\n\n const result = isReachableTaintSource(filePath, factsMap, definitionModules, getImports);\n cache.set(filePath, result);\n return result;\n };\n\n (globalThis as Record<symbol, unknown>)[BRIDGE_KEY] = resolver;\n\n // Clear cache on file changes\n const clearCache = () => cache.clear();\n server.watcher.on('change', clearCache);\n server.watcher.on('add', clearCache);\n server.watcher.on('unlink', clearCache);\n },\n\n buildEnd() {\n // Prod: compute the full map and register on globalThis for the\n // build manifest plugin to pick up.\n if (ctx.dev) return;\n\n const getModuleInfo = (\n this as unknown as {\n getModuleInfo: (\n id: string\n ) => { importedIds?: string[]; dynamicallyImportedIds?: string[] } | null;\n }\n ).getModuleInfo;\n\n const getImports = (moduleId: string): string[] => {\n const info = getModuleInfo(moduleId);\n if (!info) return [];\n return [...(info.importedIds ?? []), ...(info.dynamicallyImportedIds ?? [])];\n };\n\n const requestDepMap: Record<string, boolean> = {};\n\n // Walk the route tree to find all segment entry files\n if (ctx.routeTree) {\n walkSegmentTree(ctx.routeTree.root as unknown as WalkableNode, (filePath: string) => {\n const result = isReachableTaintSource(filePath, factsMap, definitionModules, getImports);\n requestDepMap[filePath] = result;\n });\n }\n\n // Store on ctx for build-manifest plugin to serialize into the manifest.\n // Prod runtime reads from __TIMBER_BUILD_MANIFEST__.requestDep.\n (ctx as unknown as Record<string, unknown>).requestDepMap = requestDepMap;\n },\n };\n}\n\ninterface WalkableNode {\n layout?: { filePath: string };\n page?: { filePath: string };\n default?: { filePath: string };\n children?: unknown[];\n slots?: Record<string, unknown>;\n}\n\nfunction walkSegmentTree(node: WalkableNode, fn: (filePath: string) => void): void {\n if (node.layout) fn(node.layout.filePath);\n if (node.page) fn(node.page.filePath);\n if (node.default) fn((node.default as { filePath: string }).filePath);\n if (node.children) {\n for (const child of node.children) {\n walkSegmentTree(child as typeof node, fn);\n }\n }\n if (node.slots) {\n for (const slot of Object.values(node.slots)) {\n walkSegmentTree(slot as typeof node, fn);\n }\n }\n}\n","/**\n * JSX call-site props extraction for prebuilt components (TIM-1142).\n *\n * At build time, the timber-prebuilt transform captures the exact props\n * from each JSX usage site of a cache.component binding so the post-build\n * capture pass can prerender entries for each distinct prop set. Only\n * statically analyzable props (JSON-safe literals, arrays, and plain\n * objects) are captured; dynamic/computed props bail — those call sites\n * fall back to live rendering per design/44 §Props Derivation.\n *\n * See design/44-render-at-build-time.md §Props Derivation at Build Time.\n */\n\nimport type { PluginContext } from '../plugin-context.js';\nimport type { IdentifierNode, PositionedNode, ProgramNode } from './callsite-ast.js';\n\ninterface JSXElementNode extends PositionedNode {\n type: 'JSXElement';\n openingElement: {\n type: 'JSXOpeningElement';\n name: PositionedNode;\n attributes: PositionedNode[];\n };\n}\n\ninterface JSXAttributeNode extends PositionedNode {\n type: 'JSXAttribute';\n name: { type: string; name?: string };\n value: PositionedNode | null;\n}\n\ninterface JSXExpressionContainerNode extends PositionedNode {\n type: 'JSXExpressionContainer';\n expression: PositionedNode;\n}\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue };\n\n/**\n * Try to extract a static JSON-safe value from an AST expression node.\n * Returns `undefined` (not null — null is a valid JSON value) when the\n * expression is dynamic/computed and cannot be captured statically.\n */\nfunction tryExtractStaticValue(node: PositionedNode): JsonValue | undefined {\n if (node.type === 'Literal') {\n const val = (node as { value?: unknown }).value;\n if (\n val === null ||\n typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean'\n ) {\n return val as JsonValue;\n }\n return undefined; // regex or bigint literal\n }\n if (node.type === 'UnaryExpression') {\n const unary = node as unknown as { operator: string; argument: PositionedNode };\n if (unary.operator === '-' && unary.argument.type === 'Literal') {\n const val = (unary.argument as { value?: unknown }).value;\n if (typeof val === 'number') return -val;\n }\n return undefined;\n }\n if (node.type === 'TemplateLiteral') {\n const tpl = node as unknown as {\n quasis: { value: { cooked: string } }[];\n expressions: unknown[];\n };\n if (tpl.expressions.length === 0) return tpl.quasis[0]?.value.cooked ?? undefined;\n return undefined;\n }\n if (node.type === 'ArrayExpression') {\n const elements = (node as unknown as { elements: (PositionedNode | null)[] }).elements;\n const arr: JsonValue[] = [];\n for (const el of elements) {\n if (el === null) return undefined; // sparse\n const val = tryExtractStaticValue(el);\n if (val === undefined) return undefined;\n arr.push(val);\n }\n return arr;\n }\n if (node.type === 'ObjectExpression') {\n const properties = (node as unknown as { properties: PositionedNode[] }).properties;\n const obj: Record<string, JsonValue> = {};\n for (const prop of properties) {\n if (prop.type === 'SpreadElement') return undefined;\n if (prop.type !== 'Property') return undefined;\n const p = prop as unknown as {\n computed?: boolean;\n key: PositionedNode & { name?: string; value?: unknown };\n value: PositionedNode;\n };\n if (p.computed) return undefined;\n const keyName =\n p.key.type === 'Identifier'\n ? p.key.name\n : p.key.type === 'Literal'\n ? String(p.key.value)\n : undefined;\n if (keyName === undefined) return undefined;\n const val = tryExtractStaticValue(p.value);\n if (val === undefined) return undefined;\n obj[keyName] = val;\n }\n return obj;\n }\n return undefined;\n}\n\n/**\n * Extract static props from a JSX element's attributes. Returns null if\n * any attribute is dynamic (spread, computed expression, JSX element, etc.)\n * — the component must fall back to dynamic rendering for that call site.\n */\nexport function extractStaticJsxProps(\n attributes: PositionedNode[]\n): Record<string, JsonValue> | null {\n const props: Record<string, JsonValue> = {};\n for (const attr of attributes) {\n if (attr.type === 'JSXSpreadAttribute') return null;\n if (attr.type !== 'JSXAttribute') return null;\n const jsxAttr = attr as unknown as JSXAttributeNode;\n const name = jsxAttr.name?.name;\n if (!name) return null;\n // React strips key and ref before passing to component props — including\n // them would produce cache entries unaddressable at request time.\n if (name === 'key' || name === 'ref') continue;\n if (jsxAttr.value === null) {\n props[name] = true;\n continue;\n }\n if (jsxAttr.value.type === 'Literal') {\n const val = tryExtractStaticValue(jsxAttr.value);\n if (val === undefined) return null;\n props[name] = val;\n continue;\n }\n if (jsxAttr.value.type === 'JSXExpressionContainer') {\n const container = jsxAttr.value as unknown as JSXExpressionContainerNode;\n const val = tryExtractStaticValue(container.expression);\n if (val === undefined) return null;\n props[name] = val;\n continue;\n }\n return null;\n }\n return props;\n}\n\n/**\n * Walk an AST tree and collect JSX usages of the given binding names,\n * returning the static props for each usage. Returns a map of\n * bindingName → array of static prop objects (or null for dynamic props).\n */\nexport function collectJsxUsages(\n program: ProgramNode,\n bindingNames: Set<string>\n): Map<string, Array<Record<string, JsonValue> | null>> {\n const result = new Map<string, Array<Record<string, JsonValue> | null>>();\n const walk = (node: unknown) => {\n if (!node || typeof node !== 'object') return;\n const n = node as PositionedNode;\n if (n.type === 'JSXElement') {\n const jsx = n as unknown as JSXElementNode;\n const tagName = jsx.openingElement.name;\n if (tagName.type === 'JSXIdentifier') {\n const name = (tagName as IdentifierNode).name;\n if (bindingNames.has(name)) {\n // Children become props.children at runtime — if the element has\n // children we can't capture the full props shape statically, so\n // treat it as a dynamic call site (bail to null).\n const children = (jsx as unknown as { children?: unknown[] }).children ?? [];\n const hasChildren =\n children.length > 0 &&\n children.some((c: unknown) => {\n const child = c as PositionedNode;\n if (child.type === 'JSXText') {\n // Whitespace-only text nodes are not passed as children\n return (child as unknown as { value: string }).value.trim().length > 0;\n }\n return true;\n });\n const props = hasChildren ? null : extractStaticJsxProps(jsx.openingElement.attributes);\n const usages = result.get(name) ?? [];\n usages.push(props);\n result.set(name, usages);\n }\n }\n }\n for (const value of Object.values(n)) {\n if (Array.isArray(value)) {\n for (const item of value) walk(item);\n } else if (value && typeof value === 'object' && 'type' in value) {\n walk(value);\n }\n }\n };\n for (const stmt of program.body) walk(stmt);\n return result;\n}\n\n/**\n * Deep stable JSON stringification with recursively sorted keys.\n * `JSON.stringify` with an array replacer only includes listed keys at\n * ALL nesting levels, so `{config:{theme:'dark'}}` and\n * `{config:{theme:'light'}}` would both serialize as `{\"config\":{}}`.\n */\nfunction stableStringify(value: unknown): string {\n if (value === null || typeof value !== 'object') return JSON.stringify(value);\n if (Array.isArray(value)) return '[' + value.map(stableStringify).join(',') + ']';\n const obj = value as Record<string, unknown>;\n const parts = Object.keys(obj)\n .sort()\n .map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]));\n return '{' + parts.join(',') + '}';\n}\n\n/**\n * Add a distinct props object to the call-site-props map for a component,\n * deduplicating by deep JSON value (recursively sorted keys).\n */\nexport function recordCallSiteProps(\n ctx: PluginContext,\n componentId: string,\n props: Record<string, JsonValue>\n): void {\n ctx.prebuiltCallSiteProps ??= new Map();\n const existing = ctx.prebuiltCallSiteProps.get(componentId) ?? [];\n const canonical = stableStringify(props);\n const isDuplicate = existing.some((p) => stableStringify(p) === canonical);\n if (!isDuplicate) {\n existing.push(props);\n ctx.prebuiltCallSiteProps.set(componentId, existing);\n }\n}\n","/**\n * Static analysis of `cache.component(fn, options)` option literals for\n * the timber-prebuilt transform: can this call site's options put the\n * component in the prerender tier?\n *\n * Runtime-tier call sites must do NO build work — recording them would\n * make the post-build hook import the built RSC entry (running production\n * startup) and load route modules for routes that have nothing to\n * prerender (codex P2 on PR #836). The analysis is conservative in one\n * direction only: over-inclusion costs a wasted entry load (the capture\n * pass re-checks the real options at runtime and skips), under-inclusion\n * would silently skip prerendering.\n */\n\nimport type { CallExpressionNode, PositionedNode } from './callsite-ast.js';\n\nconst EXPRESSION_WRAPPER_TYPES = new Set([\n 'TSAsExpression',\n 'TSSatisfiesExpression',\n 'TSNonNullExpression',\n 'ParenthesizedExpression',\n]);\n\n/** Unwrap TS expression wrappers (`as`, `satisfies`, `!`, parens). */\nexport function unwrapExpression(node: PositionedNode): PositionedNode {\n let current = node;\n while (EXPRESSION_WRAPPER_TYPES.has(current.type) && current.expression) {\n current = current.expression as PositionedNode;\n }\n return current;\n}\n\ninterface ObjectPropertyNode extends PositionedNode {\n type: 'Property';\n computed?: boolean;\n key: PositionedNode & { name?: string; value?: unknown };\n value: PositionedNode & { value?: unknown };\n}\n\n/** Three-state static knowledge about a property's runtime effect. */\ntype Tri = 'yes' | 'no' | 'unknown';\n\n/**\n * Statically classify a `slots` value node against resolveSlotNames'\n * runtime rules (server/prebuilt/slots.ts):\n *\n * - `yes` — certainly an ACTIVE shape: dense, non-empty array literal of\n * non-empty string literals.\n * - `no` — certainly NOT active (absent/empty/malformed): registration\n * falls back to non-slot semantics with `prerender` preserved.\n * - `unknown` — identifiers, spreads, holes, non-literal elements.\n */\nfunction classifySlotsValue(node: PositionedNode): Tri {\n const value = unwrapExpression(node);\n if (value.type === 'ArrayExpression') {\n const elements = ((value as unknown as { elements: (PositionedNode | null)[] }).elements ??\n []) as (PositionedNode | null)[];\n if (elements.length === 0) return 'no'; // empty → kind 'none'\n let allValidStrings = true;\n for (const el of elements) {\n if (el === null) return 'no'; // hole → sparse → malformed at runtime\n if (el.type === 'SpreadElement') return 'unknown';\n const entry = unwrapExpression(el) as { type: string; value?: unknown };\n if (entry.type !== 'Literal') {\n allValidStrings = false; // could still be a valid string at runtime\n continue;\n }\n if (typeof entry.value !== 'string' || entry.value.length === 0) {\n return 'no'; // a non-string/empty literal is malformed regardless of the rest\n }\n }\n return allValidStrings ? 'yes' : 'unknown';\n }\n if (value.type === 'Literal') return 'no'; // null / primitive → malformed → disabled\n if (value.type === 'Identifier' && (value as { name?: string }).name === 'undefined') {\n return 'no'; // absent\n }\n return 'unknown';\n}\n\n/** Statically classify whether a `ttl` value gives a runtime lifetime (`ttl !== undefined`). */\nfunction classifyTtlValue(node: PositionedNode): Tri {\n const value = unwrapExpression(node);\n if (value.type === 'Literal') return 'yes'; // any literal (number, null, …) !== undefined\n if (value.type === 'Identifier' && (value as { name?: string }).name === 'undefined') return 'no';\n return 'unknown';\n}\n\n/** Statically classify whether a `tags` value gives a runtime lifetime (`tags != null`). */\nfunction classifyTagsValue(node: PositionedNode): Tri {\n const value = unwrapExpression(node);\n if (value.type === 'ArrayExpression') return 'yes';\n if (value.type === 'ArrowFunctionExpression' || value.type === 'FunctionExpression') return 'yes';\n if (value.type === 'Literal') {\n return (value as { value?: unknown }).value === null ? 'no' : 'yes';\n }\n if (value.type === 'Identifier' && (value as { name?: string }).name === 'undefined') return 'no';\n return 'unknown';\n}\n\n/**\n * Can this call site's options put the component in the prerender tier?\n * The answer is static only when the options argument is an object\n * literal:\n *\n * - literal with `prerender: true` → yes\n * - literal with `prerender: false`/absent → no (spread-free)\n * - literal with statically ACTIVE `slots` + certain runtime lifetime\n * → no — registration strips `prerender` for active slot components\n * (TIM-1173), so attributing the callsite would make the post-build\n * hook import the RSC entry and enumerate route params for entries\n * the capture pass then skips (codex P2 on PR #890)\n * - anything else (identifier, spread, non-literal values)\n * → conservatively yes — the capture pass re-checks at runtime\n *\n * Properties walk in source order with last-write-wins, mirroring\n * object-literal evaluation: `{ prerender: false, ...opts }` may end up\n * prerenderable (the spread can override), while `{ ...opts,\n * prerender: false }` is statically false (codex P2 on PR #836).\n * Computed keys are treated like spreads — they may evaluate to any of\n * the tracked names.\n */\nexport function mayPrerender(call: CallExpressionNode): boolean {\n if (call.arguments.length < 2) return false; // no options → no lifetime → never prerender\n const options = unwrapExpression(call.arguments[1] as PositionedNode);\n if (options.type !== 'ObjectExpression') return true;\n const properties = (options as unknown as { properties: PositionedNode[] }).properties ?? [];\n\n type Verdict = 'absent' | 'true' | 'false' | 'unknown';\n let verdict: Verdict = 'absent';\n let slotsActive: Tri = 'no'; // absent slots are certainly not active\n let ttl: Tri = 'no';\n let tags: Tri = 'no';\n\n for (const prop of properties) {\n if (prop.type === 'SpreadElement' || (prop as ObjectPropertyNode).computed) {\n // A spread/computed key may write ANY of the tracked options.\n verdict = 'unknown';\n slotsActive = 'unknown';\n ttl = 'unknown';\n tags = 'unknown';\n continue;\n }\n if (prop.type !== 'Property') continue;\n const property = prop as ObjectPropertyNode;\n const keyName =\n property.key.type === 'Identifier'\n ? property.key.name\n : property.key.type === 'Literal'\n ? String(property.key.value)\n : undefined;\n if (keyName === 'prerender') {\n const value = unwrapExpression(property.value);\n if (value.type === 'Literal') {\n verdict = (value as { value?: unknown }).value === true ? 'true' : 'false';\n } else {\n verdict = 'unknown'; // `prerender: flag` — not statically known\n }\n } else if (keyName === 'slots') {\n slotsActive = classifySlotsValue(property.value);\n } else if (keyName === 'ttl') {\n ttl = classifyTtlValue(property.value);\n } else if (keyName === 'tags') {\n tags = classifyTagsValue(property.value);\n }\n }\n\n if (verdict !== 'true' && verdict !== 'unknown') return false;\n // Active slots + certain runtime lifetime → registration strips\n // prerender, so the callsite is certainly runtime-tier. Any uncertainty\n // (slots or lifetime not statically known) keeps the conservative\n // attribution.\n if (slotsActive === 'yes' && (ttl === 'yes' || tags === 'yes')) return false;\n return true;\n}\n","/**\n * Post-build prebuilt capture — Node-side orchestration (TIM-1119).\n *\n * Runs from timber-prebuilt's `buildApp` post hook, after Vite's 5-step\n * build sequence. Imports the BUILT `rsc/index.js` (the bundle carries\n * the react-server condition resolved at build time, so a plain dynamic\n * import works) and calls its `__timber_capturePrebuilt` export — the\n * capture itself must run inside the bundle's module graph, where the\n * component registry and flight renderer live. See\n * server/prebuilt-builder.ts and design/44-render-at-build-time.md\n * §Build Phase.\n *\n * This side owns PERSISTENCE: each captured payload is written to\n * `.timber/dist/prebuilt/<componentId>/<cacheKey>.flight` atomically\n * (temp file + rename — a crashed build never leaves a torn artifact\n * under its final name), and `manifest.json` is written last, only after\n * every payload it references is fully on disk. Keeping node:fs on the\n * plugin side keeps it out of the server bundle, which must also run on\n * Cloudflare Workers.\n *\n * NOTE: importing the built entry runs the app's production startup —\n * instrumentation.ts register() and the configured cache handler load\n * inside the build process. That is by design (prebuilt components may\n * call timber.cache), and it only happens when the app actually declares\n * prebuilt components.\n */\n\nimport { existsSync } from 'node:fs';\nimport { mkdir, rename, rm, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport type { PluginContext } from '../plugin-context.js';\nimport type { CaptureOptions, CaptureSummary, CapturedEntry } from '../server/prebuilt-builder.js';\nimport type { PrebuiltManifest } from '../server/prebuilt/payload-source.js';\n\n// ─── Artifact writer ──────────────────────────────────────────────────────\n\n/**\n * Both patterns are framework-generated (plugins/prebuilt.ts assigns IDs,\n * server/prebuilt/cache-key.ts hashes keys), so a mismatch is a framework\n * bug or a tampered registry — either way it must never reach a path join.\n */\nconst COMPONENT_ID_RE = /^[a-z0-9]+_[0-9a-f]{16}$/;\nconst CACHE_KEY_RE = /^[0-9a-f]{16}$/;\n\nexport interface PrebuiltArtifactWriter {\n write(entry: CapturedEntry): Promise<void>;\n /** Write manifest.json (if any entries exist). Returns the entry count. */\n finalize(): Promise<number>;\n}\n\n/** Write a file atomically: temp sibling + rename. */\nasync function writeFileAtomic(path: string, data: Uint8Array | string): Promise<void> {\n const tmp = `${path}.tmp`;\n await writeFile(tmp, data);\n await rename(tmp, path);\n}\n\n/**\n * Create the writer for `.timber/dist/prebuilt/`. Storage layout per\n * design/44 §Storage: one directory per component ID, one `.flight` file\n * per cache key, one manifest.json mapping componentId + key → file +\n * metadata.\n */\nexport function createPrebuiltArtifactWriter(prebuiltDir: string): PrebuiltArtifactWriter {\n const manifest: PrebuiltManifest = {};\n const buildTimestamp = Date.now();\n let count = 0;\n\n return {\n async write(entry: CapturedEntry): Promise<void> {\n if (!COMPONENT_ID_RE.test(entry.componentId) || !CACHE_KEY_RE.test(entry.cacheKey)) {\n throw new Error(\n `[timber] prebuilt artifact writer received a malformed identity ` +\n `(componentId: ${JSON.stringify(entry.componentId)}, cacheKey: ` +\n `${JSON.stringify(entry.cacheKey)}) — refusing to write`\n );\n }\n const relativeFile = `${entry.componentId}/${entry.cacheKey}.flight`;\n const path = join(prebuiltDir, relativeFile);\n await mkdir(dirname(path), { recursive: true });\n await writeFileAtomic(path, entry.bytes);\n\n manifest[entry.componentId] ??= { entries: {} };\n if (entry.paramIndependent) manifest[entry.componentId].paramIndependent = true;\n manifest[entry.componentId].entries[entry.cacheKey] = {\n params: entry.params,\n file: relativeFile,\n bytes: entry.bytes.byteLength,\n buildTimestamp,\n ...(entry.tags ? { tags: entry.tags } : {}),\n };\n count++;\n },\n\n async finalize(): Promise<number> {\n if (count === 0) return 0;\n await writeFileAtomic(\n join(prebuiltDir, 'manifest.json'),\n JSON.stringify(manifest, null, 2) + '\\n'\n );\n return count;\n },\n };\n}\n\n/**\n * Remove any `prebuilt/` output left by a previous build in this\n * directory (watch mode, `emptyOutDir: false`). A stale manifest would\n * make adapters ship payloads from an OLD build — reviving them serves\n * outdated content with that build's chunk references instead of the\n * intended miss → live render. Runs unconditionally at the start of the\n * post-build hook, BEFORE the capture decision: a build whose app no\n * longer declares any prebuilt components must also shed the artifacts\n * (codex P2 on PR #836).\n */\nexport async function cleanPrebuiltDir(buildDir: string): Promise<void> {\n await rm(join(buildDir, 'prebuilt'), { recursive: true, force: true });\n}\n\n// ─── Capture orchestration ────────────────────────────────────────────────\n\n/** Shape of the built RSC entry's capture export. */\ninterface CaptureModule {\n __timber_capturePrebuilt?: (options: CaptureOptions) => Promise<CaptureSummary>;\n}\n\n/**\n * Load the built RSC entry and run the capture pass. Throws (failing the\n * build) on infrastructure errors — missing/unloadable entry — and on\n * dynamic-context hard errors (cookies()/headers() in a prerendered\n * component). Per-entry data errors skip-and-report per design/44\n * §Build-Phase Error Handling.\n */\nexport async function runPrebuiltCapture(ctx: PluginContext): Promise<CaptureSummary> {\n const routeComponents = ctx.routePrebuiltComponents;\n if (!routeComponents || routeComponents.size === 0) {\n return { captured: 0, skipped: [], hardErrors: [], nestingWarnings: 0 };\n }\n\n const entryPath = join(ctx.buildDir, 'rsc', 'index.js');\n if (!existsSync(entryPath)) {\n throw new Error(\n `[timber] prebuilt capture: built RSC entry not found at ${entryPath} — ` +\n `the app declares cache.component({ prerender: true }) call sites but the ` +\n `RSC build output is missing`\n );\n }\n\n // The same globals the adapter entry sets before importing the handler\n // (adapter-build.ts). The bundle's virtual:timber-build-manifest falls\n // back to an empty manifest, but set the real values when available so\n // capture-time behavior matches production startup.\n const g = globalThis as Record<string, unknown>;\n if (ctx.buildManifest) g.__TIMBER_BUILD_MANIFEST__ ??= ctx.buildManifest;\n if (ctx.deploymentId) g.__TIMBER_DEPLOYMENT_ID__ ??= ctx.deploymentId;\n\n console.log('[timber] cache.component: capturing prebuilt flight payloads…');\n\n // Tell the RSC entry to skip createRequestHandler — the capture pass\n // only needs __timber_capturePrebuilt + the route manifest. Running the\n // full production startup (instrumentation, cache handler, CDN purge,\n // OTEL tracing, route matchers) is wasted work that can take 100+ seconds\n // on large apps.\n g.__TIMBER_CAPTURE_MODE__ = true;\n\n let mod: CaptureModule;\n try {\n // Cache-busting query: in a long-lived build process (vite build\n // --watch), a bare file URL would return the FIRST build's module from\n // the ESM cache — stale code and a stale (already-walked) registry.\n const entryUrl = `${pathToFileURL(entryPath).href}?t=${Date.now()}`;\n mod = (await import(/* @vite-ignore */ entryUrl)) as CaptureModule;\n } catch (error) {\n throw new Error(\n `[timber] prebuilt capture: failed to load the built RSC entry (${entryPath}). ` +\n `The capture pass runs the production server module inside the build process — ` +\n `its startup must succeed for prerendering to work.`,\n { cause: error }\n );\n }\n const capture = mod.__timber_capturePrebuilt;\n if (typeof capture !== 'function') {\n throw new Error(\n `[timber] prebuilt capture: built RSC entry does not export __timber_capturePrebuilt — ` +\n `the build output predates this framework version; rebuild from a clean .timber/dist`\n );\n }\n\n const writer = createPrebuiltArtifactWriter(join(ctx.buildDir, 'prebuilt'));\n const summary = await capture({\n fileComponentMap: Object.fromEntries(routeComponents),\n callSiteProps: ctx.prebuiltCallSiteProps\n ? Object.fromEntries(ctx.prebuiltCallSiteProps)\n : undefined,\n lazyChunks: ctx.prebuiltLazyChunks ? Object.fromEntries(ctx.prebuiltLazyChunks) : undefined,\n onEntry: (entry) => writer.write(entry),\n });\n\n if (summary.hardErrors.length > 0) {\n const details = summary.hardErrors.map((issue) => ` - ${issue.message}`).join('\\n');\n throw new Error(\n `[timber] prebuilt capture failed: ${summary.hardErrors.length} component(s) read ` +\n `per-request context at build time:\\n${details}`\n );\n }\n\n await writer.finalize();\n\n const total = summary.captured + summary.skipped.length;\n console.log(\n `[timber] Prebuilt ${summary.captured}/${total} entries.` +\n (summary.skipped.length > 0 ? ` ${summary.skipped.length} skipped due to errors.` : '')\n );\n return summary;\n}\n","/**\n * timber-prebuilt — Vite plugin that detects `cache.component(...)` call\n * sites and rewrites them to `__prebuilt(stableId, component, options)`.\n *\n * `timber.cache.component(Component, { prerender: true })` is a build-time\n * transform, not a runtime function (design/44-render-at-build-time.md\n * §Registration, surface API renamed by design/45-cache-lifetimes.md). The\n * rewrite registers the component in the server-side prebuilt registry under\n * a stable ID that keys its cached flight payloads.\n *\n * Detected callsite forms (mirrors timber-cache-transform, TIM-1054):\n * - named imports, including aliases:\n * `import { cache } from '@timber-js/app/cache'` + `cache.component(fn, opts)`\n * - namespace imports:\n * `import * as timber` + `timber.cache.component(fn, opts)`\n * Computed access (`cache['component']`) is deliberately not matched — the\n * untransformed call reaches the runtime `cache.component` fallback\n * (cache/cache-api.ts), which warns once and renders dynamically.\n *\n * Matching is an ALLOWLIST of module-scope positions: the direct initializer\n * of a top-level variable declarator (including exported ones) and a\n * top-level `export default cache.component(...)`, with TS expression\n * wrappers (`as`, `satisfies`, `!`) unwrapped. Nothing else is walked — no\n * function/class/loop bodies, no params, no call arguments. Two reasons:\n * (1) `__prebuilt` must register exactly once at module load time; the\n * post-build capture pass walks the registry after loading modules, so a\n * call inside a function registers too late to ever be prebuilt, and a call\n * in a loop would re-register per iteration. (2) Name-based callee matching\n * is only shadow-proof in these positions — nested scopes can rebind `cache`\n * (`function render(cache) {...}`, `for (const cache of caches) ...`), and\n * rewriting those would corrupt user code; a top-level declarator initializer\n * cannot see a shadow of an import binding (redeclaration error). Calls in\n * other positions fall back to the runtime path like other untraceable forms.\n *\n * The rewrite per mode:\n * production: cache.component(fn, opts) → __prebuilt(\"<id>\", fn, opts)\n * dev: cache.component(fn, opts) → __prebuiltDev(\"<name>\", fn, opts)\n *\n * with `import { __prebuilt } from '#server-internal'` prepended. In dev the\n * wrapper is a no-op that logs once per component and renders dynamically —\n * no caching, no markers (design/44 §Dev Mode).\n *\n * Component identity: `<name>_<hash16>`, e.g. `blogbody_a1b2c3d4e5f6a7b8`.\n * The name prefix is the declaring variable's name (lowercased, for legible\n * manifest keys and log lines); the hash is the same content-derived callsite\n * scheme as the data cache transform (callsite-ast.ts) — deterministic across\n * builds for unchanged calls, immune to inserting/reordering other calls, and\n * fresh when the component or its options change. Component cache entries are\n * per-deploy (design/45 §Per-deploy namespacing) so cross-deploy ID reuse is\n * not a poisoning vector, but content-derived IDs keep prebuilt artifacts\n * addressable across incremental edits for free.\n *\n * The transform is skipped in the client environment: server components never\n * execute there, and `#server-internal` resolves to an empty stub in the\n * client bundle (plugins/shims.ts).\n *\n * See TIM-1118, design/44-render-at-build-time.md, design/45-cache-lifetimes.md.\n */\n\nimport { readFileSync } from 'node:fs';\nimport { relative } from 'node:path';\nimport MagicString from 'magic-string';\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport type { SegmentNode } from '../routing/types.js';\nimport {\n CACHE_MODULE_SOURCES,\n findImportBindings,\n generateStableCallsiteId,\n} from './callsite-ast.js';\nimport { collectJsxUsages, recordCallSiteProps } from './callsite-jsx.js';\nimport { mayPrerender, unwrapExpression } from './prebuilt-options-analysis.js';\nimport { cleanPrebuiltDir, runPrebuiltCapture } from './prebuilt-capture.js';\nimport type {\n CallExpressionNode,\n IdentifierNode,\n ImportBindings,\n MemberExpressionNode,\n PositionedNode,\n ProgramNode,\n} from './callsite-ast.js';\n\n/**\n * Is this callee `cache.component` (named import, aliases included) or\n * `ns.cache.component` (namespace import)? Computed access is not matched.\n */\nfunction isCacheComponentCallee(callee: PositionedNode, bindings: ImportBindings): boolean {\n if (callee.type !== 'MemberExpression') return false;\n const member = callee as unknown as MemberExpressionNode;\n if (\n member.computed ||\n member.property.type !== 'Identifier' ||\n (member.property as IdentifierNode).name !== 'component'\n ) {\n return false;\n }\n // cache.component — object is a named-import binding of `cache`\n if (member.object.type === 'Identifier') {\n return bindings.named.has((member.object as IdentifierNode).name);\n }\n // ns.cache.component — object is `ns.cache` on a namespace import\n if (member.object.type === 'MemberExpression') {\n const inner = member.object as unknown as MemberExpressionNode;\n return (\n !inner.computed &&\n inner.object.type === 'Identifier' &&\n bindings.namespaces.has((inner.object as IdentifierNode).name) &&\n inner.property.type === 'Identifier' &&\n (inner.property as IdentifierNode).name === 'cache'\n );\n }\n return false;\n}\n\ninterface VariableDeclaratorNode extends PositionedNode {\n type: 'VariableDeclarator';\n id: PositionedNode;\n init?: PositionedNode | null;\n}\n\n/**\n * Offset where an injected import may be inserted: after the directive\n * prologue ('use server', 'use strict', ...). Prepending at offset 0 would\n * demote a leading directive to a plain expression statement — silently\n * disabling it.\n */\nfunction importInsertionOffset(program: ProgramNode): number {\n for (const stmt of program.body) {\n const isDirective =\n stmt.type === 'ExpressionStatement' &&\n typeof (stmt as { directive?: unknown }).directive === 'string';\n if (!isDirective) return stmt.start;\n }\n // All statements are directives — no call sites can exist, but be safe.\n return program.body.length > 0 ? program.body[program.body.length - 1].end : 0;\n}\n\ninterface CandidateSite {\n call: CallExpressionNode;\n stmt: PositionedNode;\n displayName: string;\n}\n\n/**\n * Collect matching call sites from the allowlisted module-scope positions:\n * top-level (possibly exported) variable declarator initializers and\n * `export default` expressions. Returned in source order. The display name\n * is the declaring variable's name, or 'Component' for default exports.\n */\nfunction collectModuleScopeSites(program: ProgramNode, bindings: ImportBindings): CandidateSite[] {\n const isMatch = (node: PositionedNode): node is CallExpressionNode =>\n node.type === 'CallExpression' &&\n (node as unknown as CallExpressionNode).arguments.length >= 1 &&\n (node as unknown as CallExpressionNode).arguments.length <= 2 &&\n isCacheComponentCallee((node as unknown as CallExpressionNode).callee, bindings);\n\n const sites: CandidateSite[] = [];\n for (const stmt of program.body) {\n if (stmt.type === 'ExportDefaultDeclaration' && stmt.declaration) {\n const call = unwrapExpression(stmt.declaration as PositionedNode);\n if (isMatch(call)) sites.push({ call, stmt, displayName: 'Component' });\n continue;\n }\n let decl = stmt;\n if (stmt.type === 'ExportNamedDeclaration' && stmt.declaration) {\n decl = stmt.declaration as PositionedNode;\n }\n if (decl.type !== 'VariableDeclaration' || !Array.isArray(decl.declarations)) continue;\n for (const d of decl.declarations as VariableDeclaratorNode[]) {\n if (!d.init) continue;\n const call = unwrapExpression(d.init as PositionedNode);\n if (!isMatch(call)) continue;\n const displayName = d.id.type === 'Identifier' ? (d.id as IdentifierNode).name : 'Component';\n sites.push({ call, stmt, displayName });\n }\n }\n return sites;\n}\n\n/**\n * Generate the stable component ID for a cache.component() call site:\n * `<sanitized-name>_<content-hash16>`. Exported for testing.\n */\nexport function generatePrebuiltId(\n relativeModulePath: string,\n statementText: string,\n callSpanText: string,\n occurrence: number,\n displayName: string\n): string {\n const prefix = displayName.toLowerCase().replace(/[^a-z0-9]/g, '') || 'component';\n const hash = generateStableCallsiteId(\n relativeModulePath,\n 'component',\n statementText,\n callSpanText,\n occurrence\n );\n return `${prefix}_${hash}`;\n}\n\n// ─── Route → component attribution (module-graph walk) ────────────────────\n\n/** Rollup getModuleInfo shape (subset — static + dynamic imports). */\nexport interface PrebuiltModuleInfo {\n importedIds: string[];\n dynamicallyImportedIds?: string[];\n}\n\n/**\n * Collect the prebuilt component IDs transitively reachable from a route\n * file, following static AND dynamic imports. Same pattern as the\n * client-reference walk in build-manifest.ts; dynamic imports are included\n * because a dynamically-imported module still registers its components\n * when it eventually loads — attribution over-approximating registration\n * is handled at capture time (an attributed-but-unregistered component is\n * reported and skipped).\n */\nexport function collectReachablePrebuiltComponents(\n entryModuleId: string,\n moduleComponents: Map<string, string[]>,\n getModuleInfo: (id: string) => PrebuiltModuleInfo | null\n): string[] {\n const visited = new Set<string>();\n const result = new Set<string>();\n const stack = [entryModuleId];\n while (stack.length > 0) {\n const moduleId = stack.pop()!;\n if (visited.has(moduleId)) continue;\n visited.add(moduleId);\n const ids = moduleComponents.get(moduleId);\n if (ids) for (const id of ids) result.add(id);\n const info = getModuleInfo(moduleId);\n if (!info) continue;\n for (const imported of info.importedIds) stack.push(imported);\n for (const imported of info.dynamicallyImportedIds ?? []) stack.push(imported);\n }\n return Array.from(result);\n}\n\n/**\n * Collect page and layout file paths from the scanned route tree — the\n * walk roots for attribution. Slots and intercepting/private segments are\n * excluded, mirroring the capture pass's route walk\n * (server/prebuilt-builder.ts §collectCandidateRoutes).\n */\nfunction collectPageAndLayoutFiles(root: SegmentNode): string[] {\n const files: string[] = [];\n const walk = (node: SegmentNode) => {\n if (node.segmentType === 'intercepting' || node.segmentType === 'private') return;\n if (node.page) files.push(node.page.filePath);\n if (node.layout) files.push(node.layout.filePath);\n for (const child of node.children) walk(child);\n };\n walk(root);\n return files;\n}\n\n// Sentinel key for default-export component IDs in the binding map.\n// Uses \\0 prefix so it can never collide with a real JS export name\n// (TIM-1187: 'Component'/'default' leaked into the named-import namespace).\nconst DEFAULT_SENTINEL = '\\0default';\n\nasync function collectCrossModuleProps(\n ctx: PluginContext,\n moduleId: string,\n getInfo: (id: string) => PrebuiltModuleInfo | null,\n resolve: (source: string, importer: string) => Promise<string | null>\n): Promise<void> {\n const bindingNames = ctx.prebuiltBindingNames!;\n\n const info = getInfo(moduleId);\n if (!info) return;\n\n const declaringImports = info.importedIds.filter((id) => bindingNames.has(id) && id !== moduleId);\n if (declaringImports.length === 0) return;\n\n // Collect exported binding names from reachable declaring modules.\n // Skip sentinel keys — they are per-module and handled in the default\n // import branch below. Only real export names go into the merged map.\n const exportNameToId = new Map<string, string>();\n const collisions = new Set<string>();\n for (const declId of declaringImports) {\n const map = bindingNames.get(declId)!;\n for (const [name, compId] of map) {\n if (name === DEFAULT_SENTINEL) continue;\n if (exportNameToId.has(name)) collisions.add(name);\n exportNameToId.set(name, compId);\n }\n }\n for (const name of collisions) exportNameToId.delete(name);\n\n let source: string | null = null;\n const extInfo = getInfo(moduleId) as unknown as { code?: string | null };\n if (extInfo && typeof extInfo.code === 'string') {\n source = extInfo.code;\n } else {\n try {\n source = readFileSync(moduleId, 'utf8');\n } catch {\n return;\n }\n }\n if (!source) return;\n\n let program: ProgramNode;\n try {\n program = ctx.parseCached!.parse(source);\n } catch {\n return;\n }\n\n const declaringSet = new Set(declaringImports);\n const localToComponentId = new Map<string, string>();\n for (const stmt of program.body) {\n if (stmt.type !== 'ImportDeclaration') continue;\n const importDecl = stmt as unknown as {\n source: { value: string };\n specifiers: Array<{\n type: string;\n local: { name: string };\n imported?: { name: string };\n }>;\n };\n for (const spec of importDecl.specifiers) {\n if (spec.type === 'ImportSpecifier') {\n const exportedName = spec.imported?.name ?? spec.local.name;\n // `import { default as X }` is parsed as an ImportSpecifier\n // with imported.name === 'default' — route through the same\n // per-source sentinel lookup as ImportDefaultSpecifier.\n if (exportedName === 'default') {\n const resolvedId = await resolve(importDecl.source.value, moduleId);\n if (resolvedId && declaringSet.has(resolvedId)) {\n const map = bindingNames.get(resolvedId)!;\n const compId = map.get(DEFAULT_SENTINEL);\n if (compId) localToComponentId.set(spec.local.name, compId);\n }\n } else {\n const compId = exportNameToId.get(exportedName);\n if (compId) localToComponentId.set(spec.local.name, compId);\n }\n } else if (spec.type === 'ImportDefaultSpecifier') {\n const resolvedId = await resolve(importDecl.source.value, moduleId);\n if (resolvedId && declaringSet.has(resolvedId)) {\n const map = bindingNames.get(resolvedId)!;\n const compId = map.get(DEFAULT_SENTINEL);\n if (compId) localToComponentId.set(spec.local.name, compId);\n }\n }\n }\n }\n if (localToComponentId.size === 0) return;\n\n const usages = collectJsxUsages(program, new Set(localToComponentId.keys()));\n for (const [localName, propsList] of usages) {\n const componentId = localToComponentId.get(localName);\n if (!componentId) continue;\n for (const props of propsList) {\n if (props === null) continue;\n recordCallSiteProps(ctx, componentId, props);\n }\n }\n}\n\nexport function timberPrebuilt(ctx: PluginContext): Plugin {\n return {\n name: 'timber-prebuilt',\n\n transform(code, id) {\n // Drop this module's stale attribution first — in a long-lived\n // `vite build --watch` process the plugin context outlives builds,\n // and an edit that removes a module's prerender call sites must\n // remove its recorded IDs even when this transform exits early\n // below (codex P2 on PR #836). Re-recorded at the bottom if the\n // edited module still has prerender-capable call sites.\n if (!ctx.dev && this?.environment?.name === 'rsc') {\n ctx.prebuiltModuleComponents?.delete(id);\n }\n if (!code.includes('@timber-js/app/cache') && !code.includes('timber/cache')) return;\n // Skip node_modules (don't transform third-party code)\n if (id.includes('node_modules')) return;\n // Skip the client environment — server components never execute there\n // and #server-internal resolves to an empty stub.\n if (this?.environment?.name === 'client') return;\n\n let program: ProgramNode;\n try {\n program = ctx.parseCached!.parse(code);\n } catch {\n return;\n }\n\n const bindings = findImportBindings(program, CACHE_MODULE_SOURCES, 'cache');\n if (bindings.named.size === 0 && bindings.namespaces.size === 0) return;\n\n // Allowlisted module-scope positions only — each site carries its\n // enclosing statement's source text (into the ID hash) and the\n // declaring variable's name (display name). Already in source order.\n const callSites = collectModuleScopeSites(program, bindings);\n if (callSites.length === 0) return;\n\n const root = ctx.root || process.cwd();\n const relPath = relative(root, id);\n const s = new MagicString(code);\n const occurrences = new Map<string, number>();\n const wrapperName = ctx.dev ? '__prebuiltDev' : '__prebuilt';\n const componentIds: string[] = [];\n\n for (const { call, stmt, displayName } of callSites) {\n const stmtText = code.slice(stmt.start, stmt.end);\n const spanText = code.slice(call.start, call.end);\n // Byte-identical (statement, call) pairs are only possible via `var`\n // redeclaration; the occurrence index keeps their IDs distinct.\n const dupKey = stmtText + String.fromCharCode(0) + spanText;\n const occurrence = occurrences.get(dupKey) ?? 0;\n occurrences.set(dupKey, occurrence + 1);\n\n // Production gets the stable ID (keys build artifacts and cache\n // entries); dev gets the display name (only used for the one-time\n // \"rendering dynamically\" log).\n const firstArg = ctx.dev\n ? displayName\n : generatePrebuiltId(relPath, stmtText, spanText, occurrence, displayName);\n // Only prerender-capable call sites feed the capture attribution —\n // runtime-tier components (ttl/tags only) must do no build work.\n if (!ctx.dev && mayPrerender(call)) componentIds.push(firstArg);\n\n s.overwrite(call.callee.start, call.callee.end, wrapperName);\n s.appendLeft(call.arguments[0].start, `${JSON.stringify(firstArg)}, `);\n }\n\n // Record this module's component IDs for the RSC generateBundle\n // module-graph walk (route → component attribution, TIM-1119).\n if (!ctx.dev && componentIds.length > 0 && this?.environment?.name === 'rsc') {\n ctx.prebuiltModuleComponents ??= new Map();\n ctx.prebuiltModuleComponents.set(id, componentIds);\n\n // Record binding name → component ID mapping for cross-module\n // prop detection at generateBundle time (TIM-1142).\n const bindingMap = new Map<string, string>();\n let componentIdIdx = 0;\n for (const { call, stmt, displayName } of callSites) {\n if (!ctx.dev && mayPrerender(call)) {\n const compId = componentIds[componentIdIdx++];\n // Direct `export default cache.component(...)` produces\n // displayName 'Component' from an ExportDefaultDeclaration —\n // a synthetic name, not a real export. Store only the sentinel\n // key. A variable literally named `Component` (from a\n // VariableDeclarator) is a real binding and stored as-is.\n if (stmt.type === 'ExportDefaultDeclaration') {\n bindingMap.set(DEFAULT_SENTINEL, compId);\n } else {\n bindingMap.set(displayName, compId);\n }\n }\n }\n // Detect default re-exports that reference a declared binding\n // and add a sentinel alias so cross-module default imports can\n // resolve the component ID. Handles both `export default X` and\n // `export { X as default }` (TIM-1189).\n for (const stmt of program.body) {\n if (\n stmt.type === 'ExportDefaultDeclaration' &&\n stmt.declaration &&\n (stmt.declaration as PositionedNode).type === 'Identifier'\n ) {\n const name = (stmt.declaration as PositionedNode as unknown as IdentifierNode).name;\n if (bindingMap.has(name) && !bindingMap.has(DEFAULT_SENTINEL)) {\n bindingMap.set(DEFAULT_SENTINEL, bindingMap.get(name)!);\n }\n }\n if (stmt.type === 'ExportNamedDeclaration' && Array.isArray(stmt.specifiers)) {\n for (const spec of stmt.specifiers as Array<{\n local: IdentifierNode;\n exported: IdentifierNode;\n }>) {\n if (spec.exported.name === 'default') {\n const compId = bindingMap.get(spec.local.name);\n if (compId && !bindingMap.has(DEFAULT_SENTINEL)) {\n bindingMap.set(DEFAULT_SENTINEL, compId);\n }\n }\n }\n }\n }\n\n if (bindingMap.size > 0) {\n ctx.prebuiltBindingNames ??= new Map();\n ctx.prebuiltBindingNames.set(id, bindingMap);\n }\n\n // Same-module JSX usages: if a prebuilt component is declared AND\n // used (<BlogBody variant=\"full\" />) in the same module, capture\n // its static call-site props here (TIM-1142, design/44 §Props).\n // Exclude sentinel keys — they are not real JSX element names.\n const declaredBindings = new Set(\n [...bindingMap.keys()].filter((k) => k !== DEFAULT_SENTINEL)\n );\n if (declaredBindings.size > 0) {\n const usages = collectJsxUsages(program, declaredBindings);\n for (const [bindingName, propsList] of usages) {\n const compId = bindingMap.get(bindingName);\n if (!compId) continue;\n for (const props of propsList) {\n if (props === null) {\n // Dynamic props at this call site — warn at build time,\n // this usage will always render live (design/44 §Props\n // Derivation limitation).\n continue;\n }\n recordCallSiteProps(ctx, compId, props);\n }\n }\n }\n }\n\n s.appendLeft(\n importInsertionOffset(program),\n `import { ${wrapperName} } from '#server-internal';\\n`\n );\n\n return {\n code: s.toString(),\n map: s.generateMap({ hires: 'boundary' }),\n };\n },\n\n /**\n * RSC environment, production: walk each route file's module graph to\n * attribute prebuilt components to the routes that can render them.\n * The graph walk (rather than load-order registry deltas) is what makes\n * SHARED components work — a component imported by several routes is\n * captured under every importing route's param combos.\n */\n async generateBundle(\n _options?: unknown,\n bundle?: Record<\n string,\n { type: string; modules?: Record<string, unknown>; fileName?: string }\n >\n ) {\n if (ctx.dev) return;\n if (this?.environment?.name !== 'rsc') return;\n ctx.routePrebuiltComponents = undefined;\n const moduleComponents = ctx.prebuiltModuleComponents;\n if (!moduleComponents || moduleComponents.size === 0 || !ctx.routeTree) return;\n\n const self = this as unknown as {\n getModuleInfo?: (id: string) => PrebuiltModuleInfo | null;\n resolve?: (\n source: string,\n importer: string,\n opts?: unknown\n ) => Promise<{ id: string } | null>;\n };\n const getInfo = (id: string) => self.getModuleInfo?.(id) ?? null;\n const resolveFn = async (source: string, importer: string): Promise<string | null> => {\n const result = await self.resolve?.(source, importer);\n return result?.id ?? null;\n };\n\n const routeComponents = new Map<string, string[]>();\n for (const filePath of collectPageAndLayoutFiles(ctx.routeTree.root)) {\n const ids = collectReachablePrebuiltComponents(filePath, moduleComponents, getInfo);\n if (ids.length > 0) routeComponents.set(filePath, ids);\n }\n if (routeComponents.size > 0) {\n ctx.routePrebuiltComponents = routeComponents;\n\n // Build a map of componentId → chunk fileName for declaring\n // modules that aren't route files themselves (behind dynamic\n // imports like import.meta.glob). The capture pass imports these\n // chunks to trigger cache.component() registration.\n if (bundle) {\n const routeFileSet = new Set(routeComponents.keys());\n const lazyChunks = new Map<string, string>();\n for (const [moduleId, componentIds] of moduleComponents) {\n if (routeFileSet.has(moduleId)) continue;\n for (const [, chunk] of Object.entries(bundle)) {\n if (chunk.type !== 'chunk' || !chunk.modules) continue;\n if (moduleId in chunk.modules) {\n for (const id of componentIds) lazyChunks.set(id, chunk.fileName!);\n break;\n }\n }\n }\n if (lazyChunks.size > 0) ctx.prebuiltLazyChunks = lazyChunks;\n }\n\n // Cross-module call-site prop detection (TIM-1142): walk the\n // module graph from each route file and scan ALL reachable modules\n // for JSX usages of prebuilt components — not just the route files\n // themselves. A component used in a helper (page → Shell → <BlogBody>)\n // must have its props captured from wherever the JSX lives.\n if (ctx.prebuiltBindingNames && ctx.prebuiltBindingNames.size > 0) {\n const scannedModules = new Set<string>();\n for (const filePath of routeComponents.keys()) {\n const visited = new Set<string>();\n const stack = [filePath];\n while (stack.length > 0) {\n const modId = stack.pop()!;\n if (visited.has(modId)) continue;\n visited.add(modId);\n if (!scannedModules.has(modId)) {\n scannedModules.add(modId);\n await collectCrossModuleProps(ctx, modId, getInfo, resolveFn);\n }\n const modInfo = getInfo(modId);\n if (!modInfo) continue;\n for (const imp of modInfo.importedIds) stack.push(imp);\n for (const imp of modInfo.dynamicallyImportedIds ?? []) stack.push(imp);\n }\n }\n }\n } else {\n // Call sites were transformed but none are reachable from any route\n // file — either they live behind slots (not modeled) or the graph\n // walk's module IDs diverged from the route tree's file paths. Say\n // so loudly: the alternative is prerender silently doing nothing.\n console.warn(\n `[timber] cache.component: ${moduleComponents.size} module(s) declare prebuilt ` +\n `components, but none are reachable from any page or layout — no payloads ` +\n `will be prerendered`\n );\n }\n },\n\n /**\n * Post-build capture (design/44 §Build Phase). `order: 'post'` runs\n * after the RSC plugin's buildApp — all five build steps are complete —\n * and BEFORE timber-adapter-build's post hook (plugin array order), so\n * `prebuilt/` exists when the adapter assembles its output (TIM-1122).\n */\n buildApp: {\n order: 'post' as const,\n async handler() {\n if (ctx.dev) return;\n ctx.captureSummary = undefined;\n // Always shed a previous build's artifacts first — even when THIS\n // build captures nothing, a stale manifest must never ship.\n await cleanPrebuiltDir(ctx.buildDir);\n if (!ctx.routePrebuiltComponents || ctx.routePrebuiltComponents.size === 0) return;\n if (ctx.config.output === 'static') {\n // design/44 §output: 'static' — everything already renders at\n // build time there; the wrapper is a no-op, not an error.\n console.log(\n `[timber] cache.component: skipped prerender capture (output: 'static' renders all components at build time)`\n );\n return;\n }\n ctx.captureSummary = await runPrebuiltCapture(ctx);\n },\n },\n };\n}\n","/**\n * timber-prerender-sugar — Vite plugin that desugars `export const prerender`\n * on page and layout files into `cache.component(...)` wrappers.\n *\n * Design doc: design/45-cache-lifetimes.md §\"Route-Level Static\" and\n * §\"Layout Propagation\".\n *\n * `export const prerender = true` on a page is pure sugar: it desugars to\n * wrapping the page's default export in `timber.cache.component(Component,\n * { prerender: true })`. Layout propagation cascades a layout's\n * `export const prerender` to descendant pages via most-specific-wins:\n * walk the segment tree from leaf to root, first explicit value wins.\n *\n * A layout that declares `export const prerender` is ALSO wrapped — the\n * layout's flight payload is its own static shell (`children` is a\n * separate component boundary), so caching it is natural (nav, sidebar,\n * footer benefit from build-time rendering). See design/45 §Layout\n * Propagation.\n *\n * This transform runs BEFORE timber-prebuilt so the generated\n * `cache.component(...)` call is picked up by the callsite rewrite.\n */\n\nimport MagicString from 'magic-string';\nimport type { Plugin } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport type { SegmentNode, RouteFile } from '../routing/types.js';\nimport { getPrerenderExport, type PrerenderExportValue } from '../routing/export-detect.js';\n\ninterface AstNode {\n type: string;\n start: number;\n end: number;\n name?: string;\n declaration?: AstNode;\n id?: AstNode & { name?: string };\n expression?: AstNode;\n}\n\n/**\n * Walk the segment tree and resolve the effective prerender value for\n * every page and layout. Returns a map from file path to resolved value.\n *\n * **Pages:** walk from leaf toward root; first explicit `export const prerender`\n * wins (page > nearest layout > ... > root layout). If none, dynamic.\n *\n * **Layouts:** a layout that declares `export const prerender` is wrapped\n * directly (its own shell is a separate component boundary from `children`).\n * Layouts without their own declaration are NOT wrapped — they don't\n * inherit from ancestors, because wrapping a layout's shell without the\n * author's explicit opt-in would cache content they may expect to be dynamic.\n */\nexport function resolvePagePrerender(root: SegmentNode): Map<string, PrerenderExportValue> {\n const result = new Map<string, PrerenderExportValue>();\n\n function walk(node: SegmentNode, ancestorStack: PrerenderExportValue[]) {\n if (node.segmentType === 'intercepting' || node.segmentType === 'private') return;\n\n // Check this segment's layout for a prerender export\n const layoutValue = node.layout ? getPrerenderExport(node.layout.filePath) : undefined;\n const stack = layoutValue !== undefined ? [layoutValue, ...ancestorStack] : ancestorStack;\n\n // Wrap the layout itself if it declares prerender (truthy)\n if (node.layout && layoutValue !== undefined && layoutValue !== false) {\n result.set(node.layout.filePath, layoutValue);\n }\n\n if (node.page) {\n const pageValue = getPrerenderExport(node.page.filePath);\n // Page's own value takes priority; otherwise use nearest ancestor\n const resolved = pageValue !== undefined ? pageValue : stack[0];\n // Only record if the resolved value is truthy (prerender: true or options object)\n // prerender: false explicitly opts out\n if (resolved !== undefined && resolved !== false) {\n result.set(node.page.filePath, resolved);\n }\n }\n\n for (const child of node.children) walk(child, stack);\n for (const slot of Object.values(node.slots)) walk(slot, stack);\n }\n\n walk(root, []);\n return result;\n}\n\n/**\n * Build the `cache.component` options source text from a resolved value.\n */\nfunction buildOptionsSource(value: PrerenderExportValue): string {\n if (value === true) return '{ prerender: true }';\n if (typeof value === 'object') {\n const parts = ['prerender: true'];\n if (value.ttl !== undefined) parts.push(`ttl: ${value.ttl}`);\n if (value.tags !== undefined) parts.push(`tags: ${JSON.stringify(value.tags)}`);\n return `{ ${parts.join(', ')} }`;\n }\n return '{ prerender: true }';\n}\n\n/**\n * Find the default export in the AST and return info needed for the rewrite.\n */\ninterface DefaultExportInfo {\n kind: 'declaration' | 'expression' | 'identifier';\n node: AstNode;\n name?: string;\n /** For `export { X as default, Y }` — position of the default specifier. */\n specifierIndex?: number;\n specifierCount?: number;\n specifierStart?: number;\n specifierEnd?: number;\n}\n\nfunction findDefaultExport(program: { body: AstNode[] }, source: string): DefaultExportInfo | null {\n for (const stmt of program.body) {\n if (stmt.type !== 'ExportDefaultDeclaration' || !stmt.declaration) continue;\n const decl = stmt.declaration;\n\n // export default function Name(...) { ... }\n // export default class Name { ... }\n if (decl.type === 'FunctionDeclaration' || decl.type === 'ClassDeclaration') {\n const name = decl.id?.name;\n if (name) return { kind: 'declaration', node: stmt, name };\n // Anonymous function/class — treat as expression\n return { kind: 'expression', node: stmt };\n }\n\n // export default SomeIdentifier\n if (decl.type === 'Identifier') {\n return { kind: 'identifier', node: stmt, name: decl.name };\n }\n\n // export default <expression>\n return { kind: 'expression', node: stmt };\n }\n\n // Check for `export { X as default }` (not re-exports from other modules)\n for (const stmt of program.body) {\n if (stmt.type !== 'ExportNamedDeclaration') continue;\n // Skip re-exports: `export { X as default } from './other'`\n if ((stmt as any).source) continue;\n const specifiers = (stmt as any).specifiers as\n | Array<{\n type: string;\n start: number;\n end: number;\n local?: { name: string };\n exported?: { name: string };\n }>\n | undefined;\n if (!specifiers) continue;\n for (let i = 0; i < specifiers.length; i++) {\n const spec = specifiers[i];\n if (spec.exported?.name === 'default' && spec.local?.name && spec.local.name !== 'default') {\n return {\n kind: 'identifier' as const,\n node: stmt,\n name: spec.local.name,\n specifierIndex: i,\n specifierCount: specifiers.length,\n specifierStart: spec.start,\n specifierEnd: spec.end,\n };\n }\n }\n }\n\n return null;\n}\n\nexport function timberPrerenderSugar(ctx: PluginContext): Plugin {\n let resolvedPages: Map<string, PrerenderExportValue> | null = null;\n\n function ensureResolved() {\n if (resolvedPages) return;\n if (!ctx.routeTree) {\n resolvedPages = new Map();\n return;\n }\n resolvedPages = resolvePagePrerender(ctx.routeTree.root);\n }\n\n return {\n name: 'timber-prerender-sugar',\n\n buildStart() {\n // Reset on each build (watch mode rebuilds)\n resolvedPages = null;\n },\n\n transform(code, id) {\n // Only process in RSC environment (same gate as prebuilt.ts)\n if (this?.environment?.name === 'client') return;\n // Skip node_modules\n if (id.includes('node_modules')) return;\n\n ensureResolved();\n if (!resolvedPages || resolvedPages.size === 0) return;\n\n const value = resolvedPages.get(id);\n if (!value) return;\n\n // This page has a resolved prerender value — wrap its default export\n let program: { body: AstNode[] };\n try {\n program = ctx.parseCached!.parse(code) as unknown as { body: AstNode[] };\n } catch {\n return;\n }\n\n const defaultExport = findDefaultExport(program, code);\n if (!defaultExport) {\n // Warn if the file has a prerender export but no wrappable default export\n // (e.g. `export { default } from './impl'` — a re-export we can't rewrite).\n if (value) {\n const relPath = id.replace(ctx.root + '/', '');\n console.warn(\n `[timber] ${relPath}: export const prerender is declared but the default ` +\n `export cannot be wrapped (re-export or missing). The prerender declaration ` +\n `will be ignored for this file.`\n );\n }\n return;\n }\n\n // Skip if the default export is already a cache.component(...) call —\n // avoid double-wrapping. Only check the default export itself, not the\n // whole file (a page may use cache.component for child components).\n if (defaultExport.kind === 'expression' && defaultExport.node.declaration) {\n const declText = code.slice(\n defaultExport.node.declaration.start,\n defaultExport.node.declaration.end\n );\n if (declText.includes('.component(')) return;\n }\n\n // Record this page as desugared for downstream attribution\n ctx.prerenderSugarPages ??= new Set();\n ctx.prerenderSugarPages.add(id);\n\n const s = new MagicString(code);\n const optionsSource = buildOptionsSource(value);\n\n // Add the cache import at the top (after directives)\n const importAlias = '__timber_prerender_cache__';\n let insertOffset = 0;\n for (const stmt of program.body) {\n const isDirective =\n stmt.type === 'ExpressionStatement' && typeof (stmt as any).directive === 'string';\n if (!isDirective) {\n insertOffset = stmt.start;\n break;\n }\n }\n s.appendLeft(\n insertOffset,\n `import { cache as ${importAlias} } from '@timber-js/app/cache';\\n`\n );\n\n switch (defaultExport.kind) {\n case 'declaration': {\n // `export default function Name() { ... }`\n // → `function Name() { ... }` + `export default cache.component(Name, opts)`\n const declStart = defaultExport.node.declaration!.start;\n // Remove `export default ` prefix\n s.overwrite(defaultExport.node.start, declStart, '');\n // Append the wrapped export at the end\n s.append(\n `\\nexport default ${importAlias}.component(${defaultExport.name}, ${optionsSource});\\n`\n );\n break;\n }\n case 'identifier': {\n if (defaultExport.specifierCount !== undefined && defaultExport.specifierCount > 1) {\n // Multi-specifier: `export { Page as default, generateStaticSegmentParams }`\n // Remove only the default specifier + surrounding comma, keep others.\n const specStart = defaultExport.specifierStart!;\n const specEnd = defaultExport.specifierEnd!;\n const idx = defaultExport.specifierIndex!;\n // Remove the specifier and a comma (trailing if first, leading otherwise)\n if (idx === 0) {\n // First specifier: remove text up to (but not including) the next specifier start\n const nextSpec = (defaultExport.node as any).specifiers?.[1];\n if (nextSpec) s.remove(specStart, nextSpec.start);\n } else {\n // Not first: remove from end of previous specifier to this specifier's end\n const prevSpec = (defaultExport.node as any).specifiers?.[idx - 1];\n if (prevSpec) s.remove(prevSpec.end, specEnd);\n }\n // Append the wrapped default export separately\n s.appendLeft(\n defaultExport.node.end,\n `\\nexport default ${importAlias}.component(${defaultExport.name}, ${optionsSource});`\n );\n } else {\n // `export default MyPage` or `export { MyPage as default }` (sole specifier)\n // → `export default cache.component(MyPage, opts)`\n s.overwrite(\n defaultExport.node.start,\n defaultExport.node.end,\n `export default ${importAlias}.component(${defaultExport.name}, ${optionsSource});`\n );\n }\n break;\n }\n case 'expression': {\n // `export default () => <div/>` or `export default async function() { ... }`\n // → `const __default = ...; export default cache.component(__default, opts)`\n const decl = defaultExport.node.declaration!;\n s.overwrite(defaultExport.node.start, decl.start, 'const __timber_default_page__ = ');\n // Ensure trailing semicolon\n const afterExpr = code.charAt(defaultExport.node.end - 1) === ';' ? '' : ';';\n s.appendLeft(\n defaultExport.node.end,\n `${afterExpr}\\nexport default ${importAlias}.component(__timber_default_page__, ${optionsSource});`\n );\n break;\n }\n }\n\n return {\n code: s.toString(),\n map: s.generateMap({ hires: 'boundary' }),\n };\n },\n };\n}\n","/**\n * timber-cloudflare-wasm — Handle WASM modules for Cloudflare Workers builds.\n *\n * Cloudflare Workers can natively import `.wasm` files as compiled\n * WebAssembly.Module. But Rolldown can't load `.wasm` files at build time.\n *\n * This plugin bridges the gap:\n * 1. Adds the `workerd` resolve condition so libraries like @takumi-rs/wasm\n * resolve to their Cloudflare-native entry (bare `.wasm` import)\n * 2. Externalizes `.wasm` imports so Rolldown skips them\n * 3. Copies the WASM files to the build output so wrangler can find them\n *\n * Only active for Cloudflare adapter production builds — every hook bails\n * unless `isCloudflareBuild` was set in configResolved. In dev and non-CF\n * builds, `.wasm` imports are left to Vite's own handling (?init / ?url or\n * a clear build error), never silently externalized.\n */\n\nimport { basename, resolve, dirname } from 'node:path';\nimport { createHash } from 'node:crypto';\nimport { copyFile, mkdir, readFile } from 'node:fs/promises';\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\n\nfunction isCloudflareAdapter(ctx: PluginContext): boolean {\n const adapter = ctx.config.adapter as { name?: string } | undefined;\n return adapter?.name === 'cloudflare';\n}\n\nexport function timberCloudflareWasm(ctx: PluginContext): Plugin[] {\n // Resolved WASM files, keyed by absolute source path so two files that\n // share a basename (e.g. lib_bg.wasm from two packages) don't collide.\n // The value is the unique output basename used for the external import\n // specifier and the copy destination.\n const wasmFiles = new Map<string, string>();\n const usedBasenames = new Set<string>();\n let isCloudflareBuild = false;\n\n const plugin: Plugin = {\n name: 'timber-cloudflare-wasm',\n\n configResolved(resolved: ResolvedConfig) {\n if (resolved.command !== 'build') return;\n if (!isCloudflareAdapter(ctx)) return;\n isCloudflareBuild = true;\n\n // Prepend `workerd` to resolve conditions for server environments\n // so @takumi-rs/wasm/auto resolves to the Cloudflare-native entry\n // (bare WASM import) instead of the Vite entry (?url + fetch).\n // Must happen in configResolved because the RSC plugin sets its own\n // conditions during config — merging via config() would lose them.\n for (const envName of ['rsc', 'ssr']) {\n const env = resolved.environments[envName];\n if (!env) continue;\n const conditions = env.resolve.conditions;\n if (!conditions.includes('workerd')) {\n conditions.unshift('workerd');\n }\n }\n },\n\n // Strip /* @vite-ignore */ from @takumi-rs/wasm dynamic imports so\n // Rolldown bundles them instead of leaving bare specifiers that fail\n // at runtime on Cloudflare Workers (no node_modules).\n transform(code, id) {\n if (!isCloudflareBuild) return;\n if (!id.includes('takumi')) return;\n const stripped = code.replaceAll(\n /\\/\\*\\s*@vite-ignore\\s*\\*\\/\\s*\\n\\s*\"@takumi-rs\\/wasm\"/g,\n '\"@takumi-rs/wasm\"'\n );\n if (stripped !== code) return stripped;\n },\n\n resolveId: {\n order: 'pre',\n async handler(source, importer) {\n if (!isCloudflareBuild) return;\n if (!source.endsWith('.wasm')) return;\n\n let absolutePath: string;\n if (source.startsWith('.') && importer) {\n absolutePath = resolve(dirname(importer), source);\n } else {\n return;\n }\n\n let outputName = wasmFiles.get(absolutePath);\n if (!outputName) {\n outputName = basename(absolutePath);\n if (usedBasenames.has(outputName)) {\n // Another wasm file already claimed this basename — disambiguate\n // with a short content hash so both files land in the output.\n const hash = createHash('sha256')\n .update(await readFile(absolutePath))\n .digest('hex')\n .slice(0, 8);\n outputName = outputName.replace(/\\.wasm$/, `.${hash}.wasm`);\n }\n usedBasenames.add(outputName);\n wasmFiles.set(absolutePath, outputName);\n }\n\n return { id: './' + outputName, external: true };\n },\n },\n\n async writeBundle(options, bundle) {\n if (!isCloudflareBuild) return;\n if (wasmFiles.size === 0) return;\n\n const outDir = options.dir;\n if (!outDir) return;\n\n // Find which output chunks reference WASM files and copy the WASM\n // to the same directory so the relative imports resolve correctly.\n const targetDirs = new Set<string>();\n for (const chunk of Object.values(bundle)) {\n if (chunk.type !== 'chunk') continue;\n for (const outputName of wasmFiles.values()) {\n if (chunk.code.includes(outputName)) {\n targetDirs.add(dirname(resolve(outDir, chunk.fileName)));\n }\n }\n }\n\n if (targetDirs.size === 0) return;\n\n const copies: Promise<void>[] = [];\n for (const dir of targetDirs) {\n await mkdir(dir, { recursive: true });\n for (const [absolutePath, outputName] of wasmFiles) {\n copies.push(copyFile(absolutePath, resolve(dir, outputName)));\n }\n }\n await Promise.all(copies);\n },\n };\n\n return [plugin];\n}\n","/**\n * timber-adapter-build — Invoke the adapter's buildOutput after vite build.\n *\n * After all environments are built and the RSC plugin has written its\n * asset manifests, calls `adapter.buildOutput()` to transform the output\n * into a deployable artifact (e.g., Cloudflare Workers entry + wrangler.jsonc).\n *\n * Uses a `buildApp` hook with `order: 'post'` so that Vite calls the\n * RSC plugin's buildApp (which orchestrates all environment builds and\n * writes asset manifests) first, then runs this handler after everything\n * is complete.\n *\n * Design docs: design/11-platform.md, design/25-production-deployments.md\n */\n\nimport type { Plugin } from 'vite';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport type { PluginContext } from '../plugin-context.js';\nimport type { TimberPlatformAdapter, TimberConfig } from '../adapters/types.js';\nimport type { BuildManifest } from '../server/build-manifest.js';\nimport { swallow } from '../server/logger.js';\n\nexport function timberAdapterBuild(ctx: PluginContext): Plugin {\n return {\n name: 'timber-adapter-build',\n\n // order: 'post' causes Vite to run configBuilder.buildApp() (which\n // includes the RSC plugin's buildApp) before calling this handler.\n // By the time we run, all environments are built and asset manifests\n // are written — safe to copy the output.\n buildApp: {\n order: 'post' as const,\n async handler() {\n if (ctx.dev) return;\n\n const adapter = ctx.config.adapter as TimberPlatformAdapter | undefined;\n if (!adapter || typeof adapter.buildOutput !== 'function') return;\n\n const buildDir = ctx.buildDir;\n\n // Merge per-route CSS and client reference JS from the RSC plugin's\n // assets manifest into the build manifest. This data enables\n // <link rel=\"stylesheet\"> and <link rel=\"modulepreload\"> tags in\n // <head> for server component routes (TIM-1014).\n if (ctx.buildManifest) {\n await mergeRscAssetsManifest(\n buildDir,\n ctx.root,\n ctx.buildManifest,\n ctx.routeClientRefKeys\n );\n }\n\n // Serialize the build manifest as a JS module that sets the global.\n // The adapter writes this as _timber-manifest-init.mjs and imports it\n // before the RSC handler, so globalThis.__TIMBER_BUILD_MANIFEST__ is\n // available when virtual:timber-build-manifest evaluates.\n let manifestInit: string | undefined;\n if (ctx.buildManifest) {\n // Strip JS/modulepreload from manifest when client JS is disabled —\n // those files aren't served, so hints for them are useless.\n const manifest = ctx.clientJavascript.disabled\n ? { ...ctx.buildManifest, js: {}, modulepreload: {} }\n : ctx.buildManifest;\n const json = JSON.stringify(manifest);\n manifestInit = `globalThis.__TIMBER_BUILD_MANIFEST__ = ${json};\\n`;\n\n // Embed the deployment ID for version skew detection (TIM-446).\n // The server reads this at startup via setDeploymentId().\n if (ctx.deploymentId) {\n manifestInit += `globalThis.__TIMBER_DEPLOYMENT_ID__ = ${JSON.stringify(ctx.deploymentId)};\\n`;\n }\n }\n\n // Strip JS from the RSC plugin's assets manifest when client JS\n // is disabled. The RSC plugin writes __vite_rsc_assets_manifest.js\n // with clientReferenceDeps containing JS URLs — used to inject\n // <link rel=\"modulepreload\"> tags. Must happen before the adapter\n // copies files to the output directory.\n if (ctx.clientJavascript.disabled) {\n await stripJsFromRscAssetsManifests(buildDir);\n }\n\n const adapterConfig: TimberConfig = {\n root: ctx.root,\n output: ctx.config.output ?? 'server',\n clientJavascriptDisabled: ctx.clientJavascript.disabled,\n manifestInit,\n };\n\n await adapter.buildOutput(adapterConfig, buildDir);\n },\n },\n };\n}\n\n/**\n * Parse the RSC assets manifest at `manifestPath`. Tries JSON.parse first\n * (fast path for plain-string manifests); falls back to a dynamic import()\n * for manifests that contain runtime expressions from renderBuiltUrl.\n * Returns null if both paths fail.\n */\nasync function parseRscManifest(\n manifestPath: string,\n content: string\n): Promise<Record<string, unknown> | null> {\n const jsonStr = content.replace(/^export default\\s*/, '').replace(/;?\\s*$/, '');\n try {\n return JSON.parse(jsonStr);\n } catch {\n // Not strict JSON — manifest likely contains renderBuiltUrl runtime\n // expressions. Fall back to evaluating the module directly.\n }\n\n // When renderBuiltUrl's runtime expressions reference external helpers\n // not defined in the manifest file, this import will fail. That's an\n // inherent limitation: runtime-computed URLs can't be resolved at build\n // time for <link> tag injection. The warning below provides observability.\n try {\n const url = pathToFileURL(manifestPath).href;\n const mod = await import(`${url}?t=${Date.now()}`);\n return mod.default ?? null;\n } catch (err) {\n swallow(err, `failed to evaluate RSC assets manifest: ${manifestPath}`, { level: 'warn' });\n return null;\n }\n}\n\n/**\n * Replace all `\"js\": [...]` array contents with `\"js\": []` using balanced\n * bracket matching. Handles nested brackets from runtime expressions like\n * `__rbu(\"path/to/[slug]/file.js\")`.\n */\nfunction clearJsArrays(src: string): string {\n const pattern = /\"js\"\\s*:\\s*\\[/g;\n let result = '';\n let lastEnd = 0;\n let match: RegExpExecArray | null;\n\n while ((match = pattern.exec(src)) !== null) {\n const arrayStart = match.index + match[0].length;\n let depth = 1;\n let i = arrayStart;\n while (i < src.length && depth > 0) {\n if (src[i] === '[') depth++;\n else if (src[i] === ']') depth--;\n i++;\n }\n result += src.slice(lastEnd, match.index) + '\"js\": []';\n lastEnd = i;\n }\n result += src.slice(lastEnd);\n return result;\n}\n\n/**\n * Replace `\"bootstrapScriptContent\": <value>` with an empty string. The\n * value may be a JS expression (e.g., concatenation with runtime helpers),\n * not a simple string literal. Scans forward from the colon, tracking\n * balanced parens and brackets, and stops at the next unbalanced `,` or `}`.\n */\nfunction clearBootstrapScriptContent(src: string): string {\n const key = '\"bootstrapScriptContent\"';\n const idx = src.indexOf(key);\n if (idx === -1) return src;\n\n // Find the colon after the key\n const colonIdx = src.indexOf(':', idx + key.length);\n if (colonIdx === -1) return src;\n\n // Skip whitespace after colon\n let valStart = colonIdx + 1;\n while (valStart < src.length && /\\s/.test(src[valStart])) valStart++;\n\n // Scan forward to find the end of the value expression\n let i = valStart;\n let depth = 0;\n let inString = false;\n let stringChar = '';\n\n while (i < src.length) {\n const ch = src[i];\n if (inString) {\n if (ch === '\\\\') {\n i += 2;\n continue;\n }\n if (ch === stringChar) inString = false;\n } else {\n if (ch === '\"' || ch === \"'\") {\n inString = true;\n stringChar = ch;\n } else if (ch === '(' || ch === '[') {\n depth++;\n } else if (ch === ')' || ch === ']') {\n depth--;\n } else if (depth === 0 && (ch === ',' || ch === '}' || ch === '\\n')) {\n break;\n }\n }\n i++;\n }\n\n return src.slice(0, idx) + '\"bootstrapScriptContent\": \"\"' + src.slice(i);\n}\n\n/**\n * Strip JS references from the RSC plugin's assets manifest files.\n *\n * The RSC plugin writes `__vite_rsc_assets_manifest.js` to rsc/ and ssr/\n * as standalone files (not Rollup chunks), so generateBundle can't\n * intercept them. This rewrites the files on disk after all builds\n * complete but before the adapter copies them to the output directory.\n */\n/**\n * Read the RSC plugin's assets manifest and merge per-route CSS and\n * per-route JS modulepreloads into the build manifest.\n *\n * CSS: `serverResources` maps server component paths to CSS URLs.\n * JS: `clientReferenceDeps` maps reference hashes to JS dep URLs.\n * Combined with `routeClientRefKeys` (from the RSC generateBundle\n * module graph walk) to produce per-route modulepreload entries.\n */\nexport async function mergeRscAssetsManifest(\n buildDir: string,\n root: string,\n buildManifest: BuildManifest,\n routeClientRefKeys?: Map<string, Set<string>>\n): Promise<void> {\n const manifestPath = join(buildDir, 'rsc', '__vite_rsc_assets_manifest.js');\n let content: string;\n try {\n content = await readFile(manifestPath, 'utf-8');\n } catch {\n return;\n }\n\n const manifest = await parseRscManifest(manifestPath, content);\n if (!manifest) return;\n\n // Merge serverResources CSS into buildManifest.css.\n // Keys in serverResources are root-relative (e.g., \"app/layout.tsx\" or\n // \"src/app/layout.tsx\"). Convert to absolute paths to match the runtime\n // route manifest's filePath values.\n const serverResources = manifest.serverResources as\n | Record<string, { js: string[]; css: string[] }>\n | undefined;\n if (serverResources) {\n for (const [relativePath, deps] of Object.entries(serverResources)) {\n if (deps.css && deps.css.length > 0) {\n const absolutePath = join(root, relativePath);\n buildManifest.css[absolutePath] = deps.css;\n }\n }\n }\n\n // Build per-route modulepreload entries from routeClientRefKeys +\n // clientReferenceDeps. Each route file's transitive client reference\n // keys (captured during RSC generateBundle) are mapped to their JS\n // chunk URLs via clientReferenceDeps.\n if (routeClientRefKeys && routeClientRefKeys.size > 0) {\n const clientReferenceDeps = manifest.clientReferenceDeps as\n | Record<string, { js: string[]; css: string[] }>\n | undefined;\n if (clientReferenceDeps) {\n for (const [filePath, refKeys] of routeClientRefKeys) {\n const jsUrls = new Set<string>();\n for (const key of refKeys) {\n const deps = clientReferenceDeps[key];\n if (deps?.js) {\n for (const url of deps.js) jsUrls.add(url);\n }\n }\n if (jsUrls.size > 0) {\n buildManifest.modulepreload[filePath] = Array.from(jsUrls);\n }\n }\n }\n }\n}\n\nexport async function stripJsFromRscAssetsManifests(buildDir: string): Promise<void> {\n const manifestName = '__vite_rsc_assets_manifest.js';\n const paths = [join(buildDir, 'rsc', manifestName), join(buildDir, 'ssr', manifestName)];\n\n for (const path of paths) {\n let content: string;\n try {\n content = await readFile(path, 'utf-8');\n } catch {\n continue;\n }\n\n // Try JSON.parse to check if we can safely re-serialize\n const jsonStr = content.replace(/^export default\\s*/, '').replace(/;?\\s*$/, '');\n let isStrictJson = true;\n let manifest: Record<string, unknown> | null = null;\n try {\n manifest = JSON.parse(jsonStr);\n } catch {\n isStrictJson = false;\n }\n\n if (!isStrictJson) {\n // Manifest contains renderBuiltUrl runtime expressions — cannot\n // safely re-serialize with JSON.stringify. Use targeted text\n // transforms to clear JS arrays and bootstrapScriptContent.\n let rewritten = content;\n rewritten = clearJsArrays(rewritten);\n rewritten = clearBootstrapScriptContent(rewritten);\n await writeFile(path, rewritten);\n continue;\n }\n\n // Clear JS from clientReferenceDeps — preserves CSS\n const deps = manifest?.clientReferenceDeps as\n | Record<string, { js: string[]; css: string[] }>\n | undefined;\n if (deps) {\n for (const entry of Object.values(deps)) {\n entry.js = [];\n }\n }\n\n if (manifest) manifest.bootstrapScriptContent = '';\n\n await writeFile(path, `export default ${JSON.stringify(manifest, null, 2)};\\n`);\n }\n}\n","/**\n * timber-build-report — Post-build route summary table.\n *\n * After a production build, logs a per-route table showing:\n * - Route type (○ static, λ dynamic, ƒ function)\n * - Route-specific client JS size\n * - First-load JS size (gzip) — route-specific + shared chunks\n *\n * Only active during production builds. Sizes are computed from the\n * already-generated Vite client bundle — no extra analysis passes.\n *\n * Design docs: 18-build-system.md §\"Build Pipeline\", 07-routing.md\n * Task: TIM-287\n */\n\nimport { readFileSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport { gzipSync } from 'node:zlib';\nimport type { Plugin, Logger } from 'vite';\nimport type { PluginContext } from '../plugin-context.js';\nimport type { SegmentNode, RouteTree } from '../routing/types.js';\nimport type { CaptureSummary } from '../server/prebuilt-builder.js';\nimport type { PrebuiltManifest } from '../server/prebuilt/payload-source.js';\nimport { collectLeafRoutes } from '../routing/walkers.js';\nimport { formatSize } from '../utils/format.js';\n\n// ─── Public types ─────────────────────────────────────────────────────────\n\nexport type RouteType = 'static' | 'dynamic' | 'function';\n\nexport interface RouteEntry {\n path: string;\n type: RouteType;\n /** Route-specific client JS size in bytes (raw). */\n size: number;\n /** Total first-load JS in bytes (gzip): route-specific + shared. */\n firstLoadSize: number;\n}\n\n// ─── Route classification ─────────────────────────────────────────────────\n\nconst ROUTE_TYPE_ICONS: Record<RouteType, string> = {\n static: '○',\n dynamic: 'λ',\n function: 'ƒ',\n};\n\n/**\n * Classify a route by its segment chain and output mode.\n *\n * In server mode (default), all pages are dynamic (rendered per-request).\n * In static mode, only pages with dynamic/catch-all segments are dynamic.\n * API routes (route.ts) are always classified as function.\n */\nexport function classifyRoute(\n segments: SegmentNode[],\n outputMode: 'server' | 'static' = 'server'\n): RouteType {\n const leaf = segments[segments.length - 1];\n if (leaf?.route) return 'function';\n if (outputMode === 'server') return 'dynamic';\n\n const isDynamic = segments.some(\n (s) =>\n s.segmentType === 'dynamic' ||\n s.segmentType === 'catch-all' ||\n s.segmentType === 'optional-catch-all'\n );\n return isDynamic ? 'dynamic' : 'static';\n}\n\n// ─── Size helpers ─────────────────────────────────────────────────────────\n\nexport { formatSize };\n\nfunction green(text: string): string {\n return `\\x1b[92m${text}\\x1b[39m`; // bright/light green (ANSI 92)\n}\n\n// ─── Route tree collection ────────────────────────────────────────────────\n\ninterface RouteInfo {\n path: string;\n segments: SegmentNode[];\n entryFilePath: string | null;\n}\n\n/**\n * Walk the route tree and collect all leaf routes (pages + API endpoints).\n *\n * Wraps the shared `collectLeafRoutes` walker (TIM-848). Parallel slots\n * (`@artists`, `@shows`, etc.) are intentionally skipped — they render\n * alongside the parent page at the same URL and are not separately\n * URL-addressable. Their JS is captured in shared/layout chunks.\n *\n * After collection, entries are deduplicated by URL path so that overlapping\n * route groups (e.g. `(browse)` and `(marketing)` both producing `/`) only\n * appear once. The entry with the longest segment chain (most specific\n * match) wins.\n */\nexport function collectRoutes(tree: RouteTree): RouteInfo[] {\n const leaves = collectLeafRoutes(tree.root);\n const routes: RouteInfo[] = leaves.map((leaf) => ({\n path: leaf.urlPath,\n segments: leaf.segments,\n entryFilePath: leaf.page?.filePath ?? leaf.route?.filePath ?? null,\n }));\n\n // Deduplicate entries with the same URL path (e.g. from overlapping route groups).\n // Keep the entry with the longest segment chain (most specific match).\n const seen = new Map<string, RouteInfo>();\n for (const route of routes) {\n const existing = seen.get(route.path);\n if (!existing || route.segments.length > existing.segments.length) {\n seen.set(route.path, route);\n }\n }\n return Array.from(seen.values());\n}\n\n// ─── Report formatting ────────────────────────────────────────────────────\n\n/** Produce formatted report lines for the Vite logger. */\nexport function buildRouteReport(entries: RouteEntry[], sharedSize: number): string[] {\n const sorted = [...entries].sort((a, b) => a.path.localeCompare(b.path));\n\n const header = 'Route (app)';\n const sizeHeader = 'Size';\n const firstLoadHeader = 'First Load JS';\n\n const pathW = Math.max(header.length + 2, ...sorted.map((e) => e.path.length + 6));\n const sizeW = Math.max(sizeHeader.length, 14);\n const flW = Math.max(firstLoadHeader.length, 10);\n const totalW = pathW + sizeW + flW + 4;\n const sep = '─'.repeat(totalW);\n\n const lines: string[] = [];\n\n // Header\n lines.push(\n `${pad(header, pathW)} ${pad(sizeHeader, sizeW, 'left')} ${pad(firstLoadHeader, flW, 'left')}`\n );\n lines.push(sep);\n\n // Routes\n for (const entry of sorted) {\n const icon = ROUTE_TYPE_ICONS[entry.type];\n const pathStr = ` ${icon} ${entry.path}`;\n const sizeStr = entry.size === 0 ? green('zero unique JS') : formatSize(entry.size);\n const flStr = formatSize(entry.firstLoadSize);\n lines.push(\n `${pad(pathStr, pathW)} ${pad(sizeStr, sizeW, 'left')} ${pad(flStr, flW, 'left')}`\n );\n }\n\n // Footer\n lines.push(sep);\n lines.push(\n `${pad(' Shared by all', pathW)} ${pad('', sizeW, 'left')} ${pad(formatSize(sharedSize), flW, 'left')}`\n );\n lines.push('');\n lines.push('○ (Static) λ (Dynamic) ƒ (Function)');\n\n return lines;\n}\n\n/** Check route entries against a First-Load-JS budget and return warning lines. */\nexport function buildWarnings(entries: RouteEntry[], budget?: { firstLoadJs?: number }): string[] {\n if (!budget?.firstLoadJs) return [];\n const limit = budget.firstLoadJs;\n const warnings: string[] = [];\n for (const entry of entries) {\n if (entry.firstLoadSize > limit) {\n warnings.push(\n `⚠ ${entry.path} first-load JS (${formatSize(entry.firstLoadSize)}) exceeds budget (${formatSize(limit)})`\n );\n }\n }\n return warnings;\n}\n\nfunction pad(str: string, width: number, align: 'left' | 'right' = 'right'): string {\n const gap = Math.max(0, width - stripAnsi(str).length);\n return align === 'left' ? ' '.repeat(gap) + str : str + ' '.repeat(gap);\n}\n\nfunction stripAnsi(str: string): string {\n // eslint-disable-next-line no-control-regex\n return str.replace(/\\u001b\\[\\d+m/g, '');\n}\n\n// ─── Prebuilt component stats ────────────────────────────────────────────\n\nexport interface PrebuiltComponentStats {\n componentId: string;\n entryCount: number;\n totalBytes: number;\n}\n\nexport interface PrebuiltReportData {\n components: PrebuiltComponentStats[];\n totalEntries: number;\n totalBytes: number;\n skippedCount: number;\n skippedReasons: Array<{ componentId: string; route: string; message: string }>;\n}\n\nexport function loadPrebuiltManifest(buildDir: string): PrebuiltManifest | null {\n try {\n const raw = readFileSync(join(buildDir, 'prebuilt', 'manifest.json'), 'utf-8');\n return JSON.parse(raw) as PrebuiltManifest;\n } catch {\n return null;\n }\n}\n\nexport function buildPrebuiltReportData(\n manifest: PrebuiltManifest | null,\n summary: CaptureSummary | undefined\n): PrebuiltReportData | null {\n const hasCaptures = summary && (summary.captured > 0 || summary.skipped.length > 0);\n if (!manifest && !hasCaptures) return null;\n\n const components: PrebuiltComponentStats[] = [];\n let totalEntries = 0;\n let totalBytes = 0;\n\n if (manifest) {\n for (const [componentId, component] of Object.entries(manifest)) {\n let entryCount = 0;\n let componentBytes = 0;\n for (const entry of Object.values(component.entries)) {\n entryCount++;\n componentBytes += entry.bytes ?? 0;\n }\n components.push({ componentId, entryCount, totalBytes: componentBytes });\n totalEntries += entryCount;\n totalBytes += componentBytes;\n }\n components.sort((a, b) => a.componentId.localeCompare(b.componentId));\n }\n\n const skippedCount = summary?.skipped.length ?? 0;\n const skippedReasons = (summary?.skipped ?? []).map((s) => ({\n componentId: s.componentId,\n route: s.routeUrlPath,\n message: s.message,\n }));\n\n return { components, totalEntries, totalBytes, skippedCount, skippedReasons };\n}\n\nexport function buildPrebuiltReport(data: PrebuiltReportData): string[] {\n const lines: string[] = [];\n\n const total = data.totalEntries + data.skippedCount;\n lines.push(\n `Prebuilt ${data.totalEntries}/${total} entries across ` +\n `${data.components.length} component${data.components.length !== 1 ? 's' : ''}` +\n (data.totalBytes > 0 ? ` (${formatSize(data.totalBytes)} total)` : '') +\n '.' +\n (data.skippedCount > 0 ? ` ${data.skippedCount} skipped due to errors.` : '')\n );\n\n if (data.components.length > 0) {\n lines.push('');\n const nameHeader = 'Component';\n const entriesHeader = 'Entries';\n const sizeHeader = 'Size';\n\n const nameW = Math.max(\n nameHeader.length + 2,\n ...data.components.map((c) => c.componentId.length + 4)\n );\n const entriesW = Math.max(entriesHeader.length, 8);\n const sizeW = Math.max(sizeHeader.length, 10);\n const totalW = nameW + entriesW + sizeW + 4;\n const sep = '─'.repeat(totalW);\n\n lines.push(\n `${pad(nameHeader, nameW)} ${pad(entriesHeader, entriesW, 'left')} ${pad(sizeHeader, sizeW, 'left')}`\n );\n lines.push(sep);\n\n for (const comp of data.components) {\n const nameStr = ` ◆ ${comp.componentId}`;\n const entriesStr = String(comp.entryCount);\n const sizeStr = formatSize(comp.totalBytes);\n lines.push(\n `${pad(nameStr, nameW)} ${pad(entriesStr, entriesW, 'left')} ${pad(sizeStr, sizeW, 'left')}`\n );\n }\n }\n\n if (data.skippedReasons.length > 0) {\n lines.push('');\n lines.push('Skipped entries:');\n for (const s of data.skippedReasons) {\n lines.push(` ⚠ ${s.componentId} (${s.route}) — ${s.message}`);\n }\n }\n\n return lines;\n}\n\n// ─── Bundle analysis ──────────────────────────────────────────────────────\n\ninterface ChunkSize {\n raw: number;\n gzip: number;\n}\n\ninterface OutputChunkLike {\n type: 'chunk' | 'asset';\n fileName: string;\n name?: string;\n code?: string;\n source?: string | Uint8Array;\n modules?: Record<string, unknown>;\n facadeModuleId?: string | null;\n}\n\n/** Measure raw + gzip sizes for all JS chunks and CSS assets in a bundle. */\nexport function collectChunkSizes(bundle: Record<string, OutputChunkLike>): Map<string, ChunkSize> {\n const sizes = new Map<string, ChunkSize>();\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type === 'chunk' && item.code) {\n sizes.set(fileName, measure(item.code));\n } else if (item.type === 'asset' && fileName.endsWith('.css') && item.source != null) {\n const src =\n typeof item.source === 'string' ? item.source : new TextDecoder().decode(item.source);\n sizes.set(fileName, measure(src));\n }\n }\n return sizes;\n}\n\nfunction measure(content: string): ChunkSize {\n const buf = new TextEncoder().encode(content);\n return { raw: buf.length, gzip: gzipSync(buf).length };\n}\n\n/** Find the output chunk that contains a given input file. */\nexport function findChunkForFile(\n filePath: string,\n bundle: Record<string, OutputChunkLike>\n): string | null {\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type !== 'chunk') continue;\n if (item.facadeModuleId === filePath) return fileName;\n if (item.modules && filePath in item.modules) return fileName;\n }\n return null;\n}\n\n// ─── Route → chunk group matching ────────────────────────────────────────\n\n/**\n * Derive the expected client chunk group prefix for a route.\n *\n * Mirrors the `clientChunkGroup` logic: extract the first non-group segment\n * from the route's file path under appDir. Routes at the root level or\n * without a matching segment return null (their JS is in client-shared).\n */\nfunction routeChunkGroupPrefix(entryFilePath: string, appDir: string, root: string): string | null {\n const appPrefix = relative(root, appDir).replace(/\\\\/g, '/') + '/';\n const relPath = relative(root, entryFilePath).replace(/\\\\/g, '/');\n if (!relPath.startsWith(appPrefix)) return null;\n\n const withinApp = relPath.slice(appPrefix.length);\n const segments = withinApp.split('/');\n for (const seg of segments) {\n if (seg.includes('.')) break;\n if (seg.startsWith('(') && seg.endsWith(')')) continue;\n return `client-${seg}`;\n }\n return null;\n}\n\n/**\n * Find all client bundle chunks belonging to a chunk group.\n *\n * Uses the chunk's `name` property (set by Rolldown from the `clientChunks`\n * callback's return value) for exact matching. The `name` is the group name\n * itself (e.g. `client-docs`), not the hashed filename.\n */\nexport function findChunksForGroup(\n groupName: string,\n chunkSizes: Map<string, ChunkSize>,\n bundle?: Record<string, OutputChunkLike>\n): string[] {\n if (!bundle) return [];\n const matched: string[] = [];\n for (const [fileName, item] of Object.entries(bundle)) {\n if (item.type !== 'chunk') continue;\n if (item.name === groupName && chunkSizes.has(fileName)) {\n matched.push(fileName);\n }\n }\n return matched;\n}\n\n// ─── Build route entries from collected data ──────────────────────────────\n\nfunction buildEntries(\n routeTree: RouteTree,\n chunkSizes: Map<string, ChunkSize>,\n bundle: Record<string, OutputChunkLike>,\n outputMode: 'server' | 'static',\n appDir?: string,\n root?: string\n): { entries: RouteEntry[]; sharedGzip: number } {\n const routeInfos = collectRoutes(routeTree);\n\n // Total gzip across all client chunks\n let totalGzip = 0;\n for (const s of chunkSizes.values()) totalGzip += s.gzip;\n\n // Per-route sizes. Track route-specific chunks to compute shared size.\n const routeChunkFiles = new Set<string>();\n const entries: RouteEntry[] = [];\n\n for (const info of routeInfos) {\n let raw = 0;\n let gzip = 0;\n\n if (info.entryFilePath) {\n // Try chunk group matching first (works for server component routes\n // whose client JS is in client-<segment> chunks, not in the route's\n // own page.tsx chunk). Falls back to direct chunk lookup.\n let matched = false;\n if (appDir && root) {\n const groupPrefix = routeChunkGroupPrefix(info.entryFilePath, appDir, root);\n if (groupPrefix) {\n const chunks = findChunksForGroup(groupPrefix, chunkSizes, bundle);\n for (const chunk of chunks) {\n const s = chunkSizes.get(chunk);\n if (s) {\n raw += s.raw;\n gzip += s.gzip;\n }\n routeChunkFiles.add(chunk);\n }\n if (chunks.length > 0) matched = true;\n }\n }\n\n if (!matched) {\n const chunk = findChunkForFile(info.entryFilePath, bundle);\n if (chunk) {\n const s = chunkSizes.get(chunk);\n if (s) {\n raw = s.raw;\n gzip = s.gzip;\n }\n routeChunkFiles.add(chunk);\n }\n }\n }\n\n entries.push({\n path: info.path,\n type: classifyRoute(info.segments, outputMode),\n size: raw,\n firstLoadSize: gzip, // route-specific gzip — shared added below\n });\n }\n\n // Shared = total gzip minus route-specific gzip\n let routeGzip = 0;\n for (const f of routeChunkFiles) routeGzip += chunkSizes.get(f)?.gzip ?? 0;\n const sharedGzip = totalGzip - routeGzip;\n\n for (const e of entries) e.firstLoadSize += sharedGzip;\n\n return { entries, sharedGzip };\n}\n\n// ─── Vite plugin ──────────────────────────────────────────────────────────\n\n/**\n * Suppress RSC/SSR per-chunk build log lines.\n *\n * Vite logs each output chunk via config.logger.info(). We wrap that method\n * to filter lines matching dist/rsc/ or dist/ssr/ paths. The regex is\n * non-anchored because Vite prepends ANSI color codes.\n */\nfunction suppressNonClientLogs(config: { command: string; logger: Logger }): void {\n if (config.command !== 'build') return;\n const orig = config.logger.info.bind(config.logger);\n config.logger.info = (msg: string, opts?: { timestamp?: boolean }) => {\n if (typeof msg === 'string' && /dist\\/(rsc|ssr)\\//.test(msg)) return;\n orig(msg, opts);\n };\n}\n\nexport function timberBuildReport(ctx: PluginContext): Plugin {\n let logger: Logger | null = null;\n let chunkSizes: Map<string, ChunkSize> | null = null;\n let clientBundle: Record<string, OutputChunkLike> | null = null;\n let reported = false;\n let deferReport = false;\n const buildStart = performance.now();\n\n return {\n name: 'timber-build-report',\n\n config(_cfg, { command }) {\n if (command !== 'build') return;\n return {\n environments: {\n rsc: { build: { reportCompressedSize: false } },\n ssr: { build: { reportCompressedSize: false } },\n },\n };\n },\n\n configResolved(config) {\n logger = config.logger;\n suppressNonClientLogs(config);\n },\n\n generateBundle(_options, bundle) {\n if (ctx.dev) return;\n if (this.environment?.name && this.environment.name !== 'client') return;\n\n chunkSizes = collectChunkSizes(bundle as Record<string, OutputChunkLike>);\n clientBundle = { ...bundle } as Record<string, OutputChunkLike>;\n deferReport = true; // skip client's closeBundle; emit after SSR's\n },\n\n closeBundle() {\n if (ctx.dev || reported) return;\n\n // The client build's closeBundle fires before SSR starts.\n // Defer one cycle so the report appears after all builds complete.\n if (deferReport) {\n deferReport = false;\n return;\n }\n if (!ctx.routeTree || !chunkSizes || !clientBundle || !logger) return;\n\n reported = true;\n const outputMode = ctx.config.output ?? 'server';\n const clientJsDisabled = ctx.clientJavascript.disabled;\n const { entries, sharedGzip } = clientJsDisabled\n ? {\n entries: collectRoutes(ctx.routeTree).map((info) => ({\n path: info.path,\n type: classifyRoute(info.segments, outputMode),\n size: 0,\n firstLoadSize: 0,\n })),\n sharedGzip: 0,\n }\n : buildEntries(ctx.routeTree, chunkSizes, clientBundle, outputMode, ctx.appDir, ctx.root);\n const elapsed = ((performance.now() - buildStart) / 1000).toFixed(2);\n const lines = buildRouteReport(entries, sharedGzip);\n\n logger.info('');\n for (const line of lines) logger.info(line);\n\n const warnings = buildWarnings(entries, ctx.config.budget);\n if (warnings.length > 0) {\n logger.info('');\n for (const w of warnings) logger.warn(w);\n }\n\n logger.info('');\n logger.info(\n `✓ built ${entries.length} routes for all three environments (rsc, ssr, client) in ${elapsed}s`\n );\n logger.info('');\n },\n\n buildApp: {\n order: 'post' as const,\n async handler() {\n if (ctx.dev || !logger) return;\n const manifest = loadPrebuiltManifest(ctx.buildDir);\n const prebuiltData = buildPrebuiltReportData(manifest, ctx.captureSummary);\n if (!prebuiltData) return;\n\n logger.info('');\n const prebuiltLines = buildPrebuiltReport(prebuiltData);\n for (const line of prebuiltLines) logger.info(line);\n logger.info('');\n },\n },\n };\n}\n","/**\n * Server action bound args encryption utilities.\n *\n * Provides key management for the RSC plugin's built-in bound args encryption.\n * The RSC plugin (@vitejs/plugin-rsc) handles the actual encrypt/decrypt via\n * AES-256-GCM — this module handles:\n *\n * 1. Key sourcing: auto-generated at build time (embedded in bundle), overridable\n * via env var for cross-build key sharing (rolling/blue-green deployments)\n * 2. Build-time key expression generation for the RSC plugin's `defineEncryptionKey`\n *\n * Encryption is always on in production. In dev mode, it's on by default\n * (matching the RSC plugin's behavior) but can be disabled for debugging.\n *\n * ## Known Security Considerations\n *\n * 1. **defineEncryptionKey is a raw JS expression.** The RSC plugin inlines it\n * verbatim into generated code. We only emit the hardcoded string\n * `process.env.TIMBER_ACTIONS_ENCRYPTION_KEY` — never user-controlled input.\n * If this function is ever extended to accept configurable env var names,\n * the expression MUST be validated against a safe pattern.\n *\n * 2. **Key material lives in GC-visible JS strings.** `atob()` decodes the key\n * into a regular JavaScript string on the V8 heap. JavaScript has no\n * `SecureString` or memory-zeroing primitive — this is an inherent platform\n * limitation. Acceptable for web server use; would need review for FIPS.\n *\n * 3. **TIMBER_ACTIONS_ENCRYPTION_KEY must be set at both build time and runtime.**\n * At build time, we validate the key format and emit a runtime expression.\n * If the env var is present at build time but missing at runtime, the server\n * will crash on first action invocation with an opaque `atob(undefined)` error.\n * If the env var is present at runtime but was absent at build time, the RSC\n * plugin will have generated its own key and the env var is silently ignored.\n *\n * See design/08-forms-and-actions.md §\"Security\"\n * See design/13-security.md\n */\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\n/** User-facing configuration for action bound args encryption. */\nexport interface ActionEncryptionConfig {\n /**\n * Disable encryption in dev mode for easier debugging.\n * Has no effect in production — encryption is always enabled.\n * Default: false (encryption is on in dev too).\n */\n disableInDev?: boolean;\n}\n\n// ─── Key Resolution ───────────────────────────────────────────────────────\n\n/**\n * Regex for safe `defineEncryptionKey` expressions.\n *\n * The RSC plugin inlines this expression verbatim into generated JavaScript.\n * We restrict it to `process.env.<UPPER_SNAKE_CASE>` to prevent code injection.\n * See \"Known Security Considerations\" at the top of this file.\n */\nconst SAFE_KEY_EXPR = /^process\\.env\\.[A-Z_][A-Z0-9_]*$/;\n\n/**\n * Build the `defineEncryptionKey` expression for the RSC plugin.\n *\n * The RSC plugin accepts a JavaScript expression string that will be\n * inlined into the encryption runtime module. At runtime, this expression\n * must evaluate to the base64-encoded encryption key.\n *\n * Priority:\n * 1. `TIMBER_ACTIONS_ENCRYPTION_KEY` env var (for cross-build key sharing\n * in rolling/blue-green deployments)\n * 2. Auto-generated at build time (RSC plugin default — embedded in bundle,\n * consistent across all instances of the same build)\n *\n * For env var keys, we generate a runtime expression that reads the env var.\n * For auto-generated keys, we return undefined and let the RSC plugin handle it.\n */\nexport function resolveEncryptionKeyExpression(): string | undefined {\n // Check for env var override — used for cross-build key sharing where\n // multiple builds must agree on the same encryption key.\n const envKey = process.env.TIMBER_ACTIONS_ENCRYPTION_KEY;\n if (envKey) {\n // Validate the key format (must be base64-encoded 32-byte key)\n validateKeyFormat(envKey);\n\n // Return a runtime expression that reads the env var at startup.\n // This ensures the key is read at runtime, not embedded in the build.\n const expr = 'process.env.TIMBER_ACTIONS_ENCRYPTION_KEY';\n\n // Defense-in-depth: validate the expression matches our safe pattern.\n // This is redundant today (hardcoded string), but protects against\n // future refactors that might make the expression configurable.\n if (!SAFE_KEY_EXPR.test(expr)) {\n throw new Error(`Unsafe encryption key expression: ${expr}`);\n }\n\n return expr;\n }\n\n // No override — let the RSC plugin auto-generate a per-build key\n return undefined;\n}\n\n/**\n * Determine whether action encryption should be enabled.\n *\n * Encryption is always enabled in production. In dev mode, it's enabled\n * by default but can be disabled via config for debugging.\n */\nexport function shouldEnableEncryption(isDev: boolean, config?: ActionEncryptionConfig): boolean {\n if (!isDev) return true; // Always on in production\n if (config?.disableInDev) return false; // Opt-out in dev\n return true; // On by default in dev too\n}\n\n// ─── Key Validation ───────────────────────────────────────────────────────\n\n/**\n * Validate that a key string is a valid base64-encoded 256-bit key.\n * Throws a descriptive error if the key is malformed.\n */\nexport function validateKeyFormat(key: string): void {\n // Decode base64 and check length (32 bytes = 256 bits)\n try {\n const decoded = atob(key);\n const bytes = decoded.length;\n if (bytes !== 32) {\n throw new Error(\n `TIMBER_ACTIONS_ENCRYPTION_KEY must be a base64-encoded 256-bit (32-byte) key. ` +\n `Got ${bytes} bytes. Generate one with: ` +\n `node -e \"console.log(require('crypto').randomBytes(32).toString('base64'))\"`\n );\n }\n } catch (error) {\n if (error instanceof Error && error.message.includes('TIMBER_ACTIONS_ENCRYPTION_KEY')) {\n throw error;\n }\n throw new Error(\n `TIMBER_ACTIONS_ENCRYPTION_KEY is not valid base64. ` +\n `Generate a key with: ` +\n `node -e \"console.log(require('crypto').randomBytes(32).toString('base64'))\"`\n );\n }\n}\n","/**\n * Dev holding server — serves a loading page while Vite initializes.\n *\n * When `timber dev` (or `vite dev`) starts, Vite takes several seconds\n * to initialize all plugins, scan routes, and boot the RSC environment.\n * During this window, the port is unbound and browsers get\n * ERR_CONNECTION_REFUSED.\n *\n * This module creates a lightweight HTTP server that binds the port\n * immediately and serves a branded holding page with auto-refresh.\n * Once Vite is ready, the holding server is closed and Vite's server\n * takes over the port.\n *\n * The holding server is started in rootSync's config() hook (the\n * earliest Vite plugin lifecycle point where we know the port) and\n * closed in timber-dev-server's configureServer() hook (the last\n * plugin, right before Vite calls server.listen()).\n *\n * Browser requests (Accept: text/html) get the HTML holding page.\n * API requests (Accept: application/json) get a 503 JSON response.\n * All responses include Retry-After: 1.\n *\n * See design/21-dev-server.md, TIM-665.\n */\n\nimport http from 'node:http';\n\n// ─── Types ────────────────────────────────────────────────────────────────\n\nexport interface HoldingServer {\n /**\n * Start listening on the given port.\n * Returns the actual bound port (useful when port is 0 for OS assignment).\n */\n listen(port: number): Promise<number>;\n\n /** Gracefully close the server and stop accepting connections. */\n close(): Promise<void>;\n}\n\n// ─── Holding Page HTML ────────────────────────────────────────────────────\n\n/**\n * Minimal self-contained HTML holding page.\n *\n * Matches the timber.js docs site theme:\n * - Light mode: warm stone/grain background, timber/bark text\n * - Dark mode: stone-900 background, stone-200 text\n * - 🪵 timber.js branding\n *\n * Uses meta-refresh (1s) for auto-reload — works without JavaScript.\n * Inline CSS only, no external dependencies.\n */\nconst HOLDING_PAGE_HTML = [\n '<!DOCTYPE html>',\n '<html lang=\"en\">',\n '<head>',\n ' <meta charset=\"utf-8\">',\n ' <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">',\n ' <meta http-equiv=\"refresh\" content=\"2\">',\n ' <title>timber — starting...</title>',\n ' <style>',\n ' *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }',\n ' body {',\n ' font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;',\n ' background: #fafaf9;',\n ' color: #44403c;',\n ' display: flex;',\n ' align-items: center;',\n ' justify-content: center;',\n ' min-height: 100vh;',\n ' -webkit-font-smoothing: antialiased;',\n ' }',\n ' @media (prefers-color-scheme: dark) {',\n ' body { background: #1c1917; color: #e7e5e4; }',\n ' .message { color: #a8a29e; }',\n ' .spinner { border-color: #57534e; border-top-color: #a1887f; }',\n ' .logo { color: #e7e5e4; }',\n ' }',\n ' .container { text-align: center; padding: 2rem; }',\n ' .logo {',\n ' font-size: 1.5rem;',\n ' font-weight: 700;',\n ' letter-spacing: -0.02em;',\n ' color: #5c3d2e;',\n ' margin-bottom: 1.5rem;',\n ' }',\n ' .message {',\n ' font-size: 0.95rem;',\n ' color: #78716c;',\n ' margin-bottom: 2rem;',\n ' }',\n ' .spinner {',\n ' width: 24px;',\n ' height: 24px;',\n ' border: 2.5px solid #d7ccc8;',\n ' border-top-color: #6d4c41;',\n ' border-radius: 50%;',\n ' animation: spin 0.8s linear infinite;',\n ' margin: 0 auto;',\n ' }',\n ' @keyframes spin { to { transform: rotate(360deg); } }',\n ' </style>',\n '</head>',\n '<body>',\n ' <div class=\"container\">',\n ' <div class=\"logo\">\\u{1FAB5} timber.js</div>',\n ' <p class=\"message\">Dev server starting…</p>',\n ' <div class=\"spinner\"></div>',\n ' </div>',\n '</body>',\n '</html>',\n].join('\\n');\n\n// ─── Factory ──────────────────────────────────────────────────────────────\n\n/**\n * Create a holding HTTP server that serves a loading page during startup.\n *\n * Usage (inside Vite plugin):\n * ```ts\n * // In config() hook — earliest point where port is known.\n * // Use bindWithBump() to honor the default-3000 + auto-bump policy\n * // (see ../server/port-resolution.ts and TIM-842).\n * const holding = createHoldingServer();\n * await bindWithBump((p) => holding.listen(p), { startPort: 3000, autoBump: true });\n *\n * // In last plugin's configureServer() — wrap listen for seamless handoff\n * const originalListen = server.listen.bind(server);\n * server.listen = async (...args) => {\n * await holding.close();\n * return originalListen(...args);\n * };\n * ```\n */\nexport function createHoldingServer(): HoldingServer {\n const server = http.createServer((req, res) => {\n const accept = req.headers.accept ?? '';\n\n // API requests: JSON 503\n if (accept.includes('application/json') && !accept.includes('text/html')) {\n res.writeHead(503, {\n 'Content-Type': 'application/json; charset=utf-8',\n 'Retry-After': '1',\n 'Cache-Control': 'no-store',\n });\n res.end(\n JSON.stringify({\n error: 'Service Unavailable',\n message: 'timber dev server is starting — please retry shortly',\n })\n );\n return;\n }\n\n // Browser and other requests: HTML holding page\n res.writeHead(503, {\n 'Content-Type': 'text/html; charset=utf-8',\n 'Retry-After': '1',\n 'Cache-Control': 'no-store',\n });\n res.end(HOLDING_PAGE_HTML);\n });\n\n return {\n listen(port: number): Promise<number> {\n return new Promise((resolve, reject) => {\n server.once('error', reject);\n server.listen(port, () => {\n server.removeListener('error', reject);\n const addr = server.address();\n const boundPort = typeof addr === 'object' && addr ? addr.port : port;\n resolve(boundPort);\n });\n });\n },\n\n close(): Promise<void> {\n return new Promise((resolve, reject) => {\n server.close((err) => {\n if (err) reject(err);\n else resolve();\n });\n });\n },\n };\n}\n","/**\n * Port resolution for the dev server, Vite preview, and the Node\n * production preview server.\n *\n * Behavior (see TIM-842):\n *\n * 1. Default port is **3000** for both dev and prod.\n * 2. If the user did NOT set an explicit port, auto-bump from 3000\n * until a free port is found (3000 → 3001 → 3002 → …).\n * 3. If the user DID set an explicit port (via `--port`, `PORT` env\n * var, or `vite.config.ts` `server.port`), use it as-is and let\n * the bind fail loudly on conflict (`strictPort: true`).\n *\n * The port-bump probe is performed by binding the **actual** server\n * (e.g. the dev holding server) — not a throwaway probe — so there is\n * no time-of-check / time-of-use race between probing and listening.\n *\n * Design doc: 21-dev-server.md §\"Default Port and Auto-Bump\".\n */\n\n/** Default port used by `timber dev` and `timber preview`. */\nexport const DEFAULT_PORT = 3000;\n\n/**\n * A function that attempts to bind to a given port.\n *\n * Resolves with the bound port on success. Rejects with an error\n * (typically with `code === 'EADDRINUSE'`) on failure.\n */\nexport type ListenFn = (port: number) => Promise<number>;\n\n// ── Pure resolution ────────────────────────────────────────────────────\n\nexport interface ResolvePortInput {\n /**\n * Port read from `vite.config.ts` `server.port` or the `--port` CLI\n * flag (Vite merges `--port` into `userConfig.server.port` before\n * plugins see it).\n */\n configPort?: number | undefined;\n /** Raw value of `process.env.PORT`. */\n envPort?: string | undefined;\n /** Default port to use when neither `configPort` nor `envPort` is set. */\n defaultPort?: number;\n}\n\nexport interface ResolvedPortInput {\n /** Port to start binding from. */\n port: number;\n /**\n * `true` if the port came from an explicit user override (config or\n * env). When `true`, callers must NOT auto-bump and must surface\n * `EADDRINUSE` to the user.\n */\n explicit: boolean;\n}\n\n/**\n * Pure: compute the starting port from config / env / defaults.\n *\n * Performs no I/O — pair with {@link bindWithBump} to actually listen.\n */\nexport function resolveStartPort(input: ResolvePortInput): ResolvedPortInput {\n const defaultPort = input.defaultPort ?? DEFAULT_PORT;\n\n // `configPort` wins over `envPort`. This matches Vite's behavior:\n // `vite --port 4000` overrides `PORT=5000` in the environment.\n if (typeof input.configPort === 'number' && Number.isFinite(input.configPort)) {\n return { port: input.configPort, explicit: true };\n }\n\n if (input.envPort != null && input.envPort !== '') {\n const parsed = Number(input.envPort);\n if (Number.isFinite(parsed) && parsed > 0) {\n return { port: parsed, explicit: true };\n }\n }\n\n return { port: defaultPort, explicit: false };\n}\n\n// ── Bind with auto-bump ────────────────────────────────────────────────\n\nexport interface BindWithBumpOptions {\n /** First port to attempt. */\n startPort: number;\n /**\n * If `true`, increment the port and retry on `EADDRINUSE`. If\n * `false`, attempt once and let the error propagate.\n */\n autoBump: boolean;\n /** Maximum number of port attempts when `autoBump` is `true`. */\n maxAttempts?: number;\n}\n\nexport interface BindWithBumpResult {\n /** Port that was actually bound. */\n port: number;\n /** `true` if the bound port differs from `startPort`. */\n bumped: boolean;\n}\n\n/**\n * Bind a server starting at `startPort`, optionally bumping the port\n * on `EADDRINUSE` until a free one is found.\n *\n * Use this with the actual server you intend to keep listening (e.g.\n * the dev holding server). Pairing the probe with the real listen\n * eliminates the TOCTOU race that a throwaway probe would introduce.\n */\nexport async function bindWithBump(\n listen: ListenFn,\n options: BindWithBumpOptions\n): Promise<BindWithBumpResult> {\n const maxAttempts = options.autoBump ? (options.maxAttempts ?? 100) : 1;\n let lastErr: unknown = null;\n\n for (let i = 0; i < maxAttempts; i++) {\n const port = options.startPort + i;\n try {\n const bound = await listen(port);\n return { port: bound, bumped: i > 0 };\n } catch (err) {\n lastErr = err;\n // Only retry on EADDRINUSE — other errors (EACCES, etc.) are\n // permanent and must surface immediately.\n if (!isAddrInUse(err)) throw err;\n }\n }\n\n throw lastErr ?? new Error(`Could not bind to a free port starting at ${options.startPort}`);\n}\n\n/** True if `err` is a Node `EADDRINUSE` error from `server.listen()`. */\nexport function isAddrInUse(err: unknown): boolean {\n return (\n typeof err === 'object' && err !== null && (err as { code?: string }).code === 'EADDRINUSE'\n );\n}\n\n// ── High-level helper used by the rootSync plugin ────────────────────\n\nexport interface StartDevServerPortInput {\n /** Resolved port from `userConfig.server?.port` (or `--port`), or undefined. */\n configPort: number | undefined;\n /** Raw `process.env.PORT` value. */\n envPort: string | undefined;\n /** ListenFn for the holding server (or any pre-bind probe target). */\n listen: ListenFn;\n /** Logger — defaults to `console`. Injected for tests. */\n log?: (msg: string) => void;\n warn?: (msg: string) => void;\n}\n\nexport interface StartDevServerPortResult {\n /** Port chosen for both the holding server and Vite's dev server. */\n port: number;\n /** True if the user explicitly set the port (=> Vite must `strictPort: true`). */\n explicit: boolean;\n /** True if the holding server actually bound the port. */\n bound: boolean;\n}\n\n/**\n * Run the full dev-server port resolution + holding-server bind sequence.\n *\n * Resolves the port from config / env / default, attempts to bind the\n * holding server (auto-bumping when the port came from the default),\n * and logs the chosen URL. On a clean failure for an explicit port, it\n * warns and falls back to the requested port so Vite can surface the\n * conflict via `strictPort: true`.\n *\n * Extracted from `index.ts` so the rootSync `config()` hook stays\n * focused on plugin assembly.\n */\nexport async function startDevServerPort(\n input: StartDevServerPortInput\n): Promise<StartDevServerPortResult> {\n const log = input.log ?? ((msg: string) => console.log(msg));\n const warn = input.warn ?? ((msg: string) => console.warn(msg));\n\n const start = resolveStartPort({\n configPort: input.configPort,\n envPort: input.envPort,\n defaultPort: DEFAULT_PORT,\n });\n\n try {\n const result = await bindWithBump(input.listen, {\n startPort: start.port,\n autoBump: !start.explicit,\n });\n if (result.bumped) {\n log(`\\n \\x1b[33m[timber]\\x1b[0m Port ${start.port} in use, using ${result.port}\\n`);\n }\n log(\n `\\n \\x1b[2m\\u{1FAB5} timber.js dev server starting at\\x1b[0m ` +\n `\\x1b[36mhttp://localhost:${result.port}\\x1b[0m\\n`\n );\n return { port: result.port, explicit: start.explicit, bound: true };\n } catch (err) {\n // Holding server failed to bind. For explicit ports we leave the\n // bound state false and let Vite fail loudly via strictPort: true.\n // For implicit ports this is essentially unreachable (auto-bump\n // tries 100 ports), but if we hit it we still want Vite to surface\n // the error.\n if (start.explicit && isAddrInUse(err)) {\n warn(\n `\\n \\x1b[33m[timber]\\x1b[0m Port ${start.port} is already in use. ` +\n `Set PORT (or remove the override) to pick another port.\\n`\n );\n }\n return { port: start.port, explicit: start.explicit, bound: false };\n }\n}\n","/**\n * @timber-js/app — Root entry point (public API).\n *\n * User-facing exports: timber(), defineConfig(), TimberUserConfig, Routes.\n *\n * Internal helpers (PluginContext, resolveAppDir, loadTimberConfigFile,\n * warnConfigConflicts, resolveClientJavascript) live in plugin-context.ts\n * and are NOT re-exported here. Sub-plugins import them via relative paths.\n *\n * Design doc: 18-build-system.md §\"Plugin Architecture\"\n */\n\nimport type { Plugin, PluginOption } from 'vite';\nimport { createLogger } from 'vite';\nimport { join, relative, resolve } from 'node:path';\nimport { createRequire } from 'node:module';\nimport react, { reactCompilerPreset } from '@vitejs/plugin-react';\nimport { timberContent } from './plugins/content';\nimport { timberDevServer } from './plugins/dev-server';\nimport { timberEntries } from './plugins/entries';\nimport { timberMdx } from './plugins/mdx';\nimport { timberRouting } from './plugins/routing';\nimport { timberShims } from './plugins/shims';\nimport { timberFonts } from './plugins/fonts';\nimport { timberStaticBuild } from './plugins/static-build';\nimport { timberBuildManifest } from './plugins/build-manifest';\nimport { timberDevLogs, originalConsole, wrapLoggerWithOriginalConsole } from './dev-tools/logs';\nimport { resolveForwardConsole } from './dev-tools/browser-logs';\nimport { timberReactProd } from './plugins/react-prod';\nimport { timberChunks } from './plugins/chunks';\nimport { clientChunkGroup } from './plugins/client-chunks';\nimport { timberServerBundle } from './plugins/server-bundle';\nimport { timberCacheTransform } from './plugins/cache';\nimport { timberRequestDep } from './plugins/request-dep';\nimport { timberPrebuilt } from './plugins/prebuilt';\nimport { timberPrerenderSugar } from './plugins/prerender-sugar';\nimport { timberCloudflareWasm } from './plugins/cloudflare-wasm';\nimport { timberAdapterBuild } from './plugins/adapter-build';\nimport { timberBuildReport } from './plugins/build-report';\nimport { createNoopTimer } from './utils/startup-timer';\nimport { resolveEncryptionKeyExpression, shouldEnableEncryption } from './server/action-encryption';\nimport { createHoldingServer } from './dev-tools/holding-server.js';\nimport { resolveStartPort, startDevServerPort } from './server/port-resolution.js';\nimport type { TimberUserConfig } from './config-types.js';\nimport type { PluginContext } from './plugin-context.js';\nimport {\n createPluginContext,\n loadTimberConfigFile,\n mergeFileConfig,\n resolveAppDir,\n resolveClientJavascript,\n resolveBuildDir,\n} from './plugin-context.js';\n\n// ── Public API ────────────────────────────────────────────────────────────\n\nexport type { TimberUserConfig } from './config-types.js';\n\n// Metadata route handler types — re-exported so user-authored metadata\n// route files (sitemap.ts, robots.ts, manifest.ts, icon.tsx, etc.) can\n// import them from the package root without reaching into ./server.\n// The canonical location for these types is '@timber-js/app/server'; this\n// root re-export is a convenience for typed metadata route handlers.\n// See design/16-metadata.md §\"Metadata Routes\".\nexport type { Metadata, MetadataRoute, MetadataHandler, MetadataResult } from './server/types.js';\n\n/**\n * Route map interface — augmented by the generated timber-routes.d.ts.\n *\n * Each key is a route path pattern. Values have:\n * segmentParams: shape of URL segment params (e.g. { id: string })\n * searchParams: parsed type from search-params.ts, or {} if none\n *\n * This interface is empty by default and populated via codegen.\n * See design/09-typescript.md §\"Typed Routes\".\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, typescript/no-empty-interface\nexport interface Routes {}\n\n/**\n * Type-safe helper for timber.config.ts files.\n *\n * A pass-through identity function that provides autocomplete and\n * type checking for timber configuration. No runtime validation —\n * purely a DX convenience (same pattern as Vite's defineConfig).\n *\n * @example\n * ```ts\n * // timber.config.ts\n * import { defineConfig } from '@timber-js/app';\n *\n * export default defineConfig({\n * output: 'server',\n * pageExtensions: ['tsx', 'ts', 'mdx'],\n * });\n * ```\n */\nexport function defineConfig(config: TimberUserConfig): TimberUserConfig {\n return config;\n}\n\n// ── Private helpers ───────────────────────────────────────────────────────\n\n/**\n * Resolve the React Compiler plugin via @rolldown/plugin-babel.\n *\n * Uses the `reactCompilerPreset` from @vitejs/plugin-react, which:\n * - Uses Babel ONLY for the compiler pass (OXC handles JSX)\n * - Automatically scopes to client environment via applyToEnvironmentHook\n * - Uses react/compiler-runtime built into React 19\n *\n * @rolldown/plugin-babel and babel-plugin-react-compiler are optional peer deps.\n * If either is missing, require() fails with a clear error message.\n */\nfunction resolveReactCompilerPlugin(\n config: true | { compilationMode?: string; target?: string },\n req: NodeJS.Require\n): PluginOption {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let babel: any;\n try {\n babel = req('@rolldown/plugin-babel');\n } catch {\n throw new Error(\n '[timber] reactCompiler requires @rolldown/plugin-babel. ' +\n 'Install it: pnpm add -D @rolldown/plugin-babel babel-plugin-react-compiler'\n );\n }\n const options = typeof config === 'object' ? config : {};\n const babelPlugin = babel.default ?? babel;\n return babelPlugin({\n presets: [reactCompilerPreset(options as Parameters<typeof reactCompilerPreset>[0])],\n }) as PluginOption;\n}\n\n/**\n * Build the options object for @vitejs/plugin-rsc.\n *\n * Uses a getter for `enableActionEncryption` so the RSC plugin reads\n * the value lazily — after ctx.dev is set in configResolved. This lets\n * `actionEncryption.disableInDev` work correctly even though the RSC\n * plugin is created before Vite resolves the command.\n */\nfunction createRscOptions(\n ctx: PluginContext,\n encryptionKeyExpr: string | undefined\n): Record<string, unknown> {\n const options: Record<string, unknown> = {\n serverHandler: false,\n customClientEntry: true,\n entries: {\n rsc: 'virtual:timber-rsc-entry',\n ssr: 'virtual:timber-ssr-entry',\n client: 'virtual:timber-browser-entry',\n },\n // Group client references by layout boundary to balance route-scoped code\n // splitting with HTTP request count. A constant group name ('client-refs')\n // would collapse all routes into one chunk — any page downloads every\n // client component. Per-serverChunk grouping creates many sub-500B files.\n // Layout-boundary grouping is the middle ground: components under the same\n // layout segment share a chunk. See design/27-chunking-strategy.md, TIM-440, TIM-499.\n clientChunks: (meta: { id: string; normalizedId: string; serverChunk: string }) =>\n clientChunkGroup(meta, ctx.appDir, ctx.root, ctx.sharedModuleFacades),\n };\n\n // Bound args encryption — AES-256-GCM authenticated encryption for\n // closure variables in 'use server' functions. Always on in production,\n // configurable in dev. See design/08-forms-and-actions.md §\"Bound Args Encryption\".\n //\n // Uses a getter so the RSC plugin reads the value lazily in its transform\n // hooks, after ctx.dev is set in configResolved. This lets disableInDev\n // work correctly — ctx.dev is false at construction time but true during\n // dev server transforms.\n Object.defineProperty(options, 'enableActionEncryption', {\n get() {\n return shouldEnableEncryption(ctx.dev, ctx.config.actionEncryption);\n },\n enumerable: true,\n });\n\n // When TIMBER_ACTIONS_ENCRYPTION_KEY is set, pass it as a runtime expression\n // so the RSC plugin uses it instead of auto-generating a per-build key.\n if (encryptionKeyExpr) {\n options.defineEncryptionKey = encryptionKeyExpr;\n }\n\n return options;\n}\n\n// NOTE: 'use cache' directive transform removed — future feature pending design doc.\n// The timber.cache() API (createCache) remains available for explicit caching.\n// See design/06-caching.md.\n\n// ── Main plugin factory ──────────────────────────────────────────────────\n\n/**\n * Create the timber Vite plugin array.\n *\n * Loads timber.config.ts and all dependencies synchronously before\n * constructing the plugin array. This ensures ALL plugins — including\n * the RSC plugin and React Compiler — see the fully merged config\n * (inline + file-based). No async, no deferred config, no stale reads.\n *\n * Requires Node >= 22.12 for synchronous require() of ESM modules\n * (@vitejs/plugin-rsc is ESM-only).\n *\n * Previous versions used async loading and deferred config merging,\n * causing file-based config for reactCompiler, actionEncryption, and\n * output mode to be silently ignored. See TIM-451.\n */\nexport function timber(config?: TimberUserConfig): PluginOption[] {\n const ctx = createPluginContext(config);\n\n // Resolve dependencies from the consumer's project (process.cwd()),\n // not from timber's own node_modules. This is critical for pnpm link:\n // when linked, timber's node_modules has a separate vite instance, and\n // the RSC plugin must use the same vite instance as the dev server.\n const consumerRequire = createRequire(join(process.cwd(), 'package.json'));\n\n // ── Step 1: Load @vitejs/plugin-rsc ─────────────────────────────────\n // Synchronous require() works for ESM modules on Node 22.12+.\n ctx.timer.start('rsc-plugin-import');\n const rscMod = consumerRequire('@vitejs/plugin-rsc');\n const vitePluginRsc = rscMod.default ?? rscMod;\n ctx.timer.end('rsc-plugin-import');\n\n // ── Step 2: Compute config-dependent options ────────────────────────\n // encryptionKeyExpr is env-based and doesn't depend on file config.\n const encryptionKeyExpr = resolveEncryptionKeyExpression();\n\n // ── Step 3: Pre-load file config for plugin resolution ──────────────\n // Load timber.config.ts eagerly from process.cwd() so we can resolve\n // plugins (like React Compiler) and add them to the top-level array.\n // Vite's config() hook return type is Omit<UserConfig, 'plugins'> —\n // plugins returned from config() are silently ignored. See TIM-632.\n //\n // The config() hook still loads from the correct Vite root (which may\n // differ from cwd in monorepo setups — see TIM-498), but only for\n // non-plugin config merging.\n const earlyFileConfig = loadTimberConfigFile(process.cwd());\n\n // ── Step 4: Build rootSync plugin ───────────────────────────────────\n // rootSync loads timber.config.ts from Vite's resolved root and merges\n // it into ctx.config. Plugin resolution is handled eagerly above — the\n // config() hook must NOT return a `plugins` field (Vite ignores it).\n const rootSync: Plugin = {\n name: 'timber-root-sync',\n async config(userConfig, { command, isPreview }) {\n // ── Load timber.config.ts from the correct root ───────────────\n // Vite's `config` hook fires before `configResolved`. The user's\n // `root` option (if set) tells us where the project lives.\n // `resolve()` mirrors Vite's own root resolution logic.\n const viteRoot = resolve(userConfig.root ?? process.cwd());\n ctx.timer.start('config-load');\n const fileConfig = loadTimberConfigFile(viteRoot);\n if (fileConfig) {\n ctx.config = mergeFileConfig(ctx.config, fileConfig);\n ctx.clientJavascript = resolveClientJavascript(ctx.config);\n }\n // Apply defaults AFTER merge so file-based config isn't overridden\n // by defaults that were baked into the inline config object.\n ctx.config.output ??= 'server';\n ctx.timer.end('config-load');\n\n // ── Resolve build output directory ─────────────────────────\n // Priority: timber.config.ts `buildDir` > Vite `build.outDir` > .timber/dist\n // Set Vite's build.outDir so the RSC plugin and all environment\n // builds write to the correct location.\n const viteOutDir = userConfig.build?.outDir;\n const timberBuildDir = ctx.config.buildDir;\n const resolvedRoot = resolve(userConfig.root ?? process.cwd());\n ctx.buildDir = resolveBuildDir(resolvedRoot, timberBuildDir, viteOutDir);\n\n // Warn if the Vite root differs from cwd and the re-loaded config\n // has reactCompiler but the early cwd-based load missed it. In this\n // edge case the user must move reactCompiler to inline config.\n if (viteRoot !== process.cwd()) {\n const hasCompilerInReloaded = !config?.reactCompiler && ctx.config.reactCompiler;\n const hadCompilerInEarly = !config?.reactCompiler && earlyFileConfig?.reactCompiler;\n if (hasCompilerInReloaded && !hadCompilerInEarly) {\n console.warn(\n '[timber] reactCompiler is set in timber.config.ts but could not be ' +\n 'registered because the config file is in a non-cwd root directory. ' +\n 'Move reactCompiler to the inline timber() config in vite.config.ts, or ' +\n 'run vite from the project root directory.'\n );\n }\n }\n\n // Force production JSX transform for builds.\n //\n // Vite determines dev vs prod JSX via `isProduction`, which checks\n // `process.env.NODE_ENV === 'production'`. If the shell has\n // NODE_ENV=development (common in dev toolchains), `vite build`\n // respects that and emits jsxDEV calls with fileName/lineNumber\n // args. This causes runtime crashes because the production React\n // jsx-runtime doesn't export jsxDEV, and also leaks file paths\n // into production bundles (security concern).\n //\n // We explicitly set `oxc.jsx.development: false` for builds so\n // the client bundle always uses jsx/jsxs from react/jsx-runtime,\n // regardless of the ambient NODE_ENV value.\n // ── Resolve dev/preview port (TIM-842) ───────────────────────\n // Default port is 3000 with auto-bump on conflict. Explicit user\n // overrides (`--port`, `PORT` env, `vite.config.ts` server.port)\n // are honored as-is and fail loudly via `strictPort: true`.\n //\n // For dev (`command === 'serve' && !isPreview`) we start the\n // holding server and use its `listen()` as the probe, pairing\n // the probe with the real bind to eliminate TOCTOU races.\n //\n // For `vite preview` (`command === 'serve' && isPreview`) we\n // resolve the config/env port but delegate the actual bind +\n // auto-bump to Vite's own preview server. Starting the holding\n // server in preview mode would self-conflict because the dev\n // plugin's `configureServer` handoff does not run for preview;\n // the holding server would keep the port occupied while Vite's\n // preview tried to bind the same port.\n //\n // See design/21-dev-server.md §\"Default Port and Auto-Bump\".\n let resolvedDevPort: number | null = null;\n let resolvedDevPortExplicit = false;\n if (command === 'serve' && !isPreview) {\n ctx.holdingServer = createHoldingServer();\n const holdingRef = ctx.holdingServer;\n const result = await startDevServerPort({\n configPort:\n typeof userConfig.server?.port === 'number' ? userConfig.server.port : undefined,\n envPort: process.env.PORT,\n listen: (p) => holdingRef.listen(p),\n });\n if (!result.bound) {\n // Holding server failed to bind. Drop the reference so the\n // dev-server plugin doesn't try to close a server that was\n // never listening.\n ctx.holdingServer = null;\n }\n if (result.bound || result.explicit) {\n // When bound, use the probed port with strictPort so Vite\n // doesn't re-bump. When unbound but explicit, still forward\n // the port so Vite surfaces the conflict via strictPort.\n // When unbound and implicit, skip — let Vite auto-bump.\n resolvedDevPort = result.port;\n resolvedDevPortExplicit = result.explicit;\n }\n } else if (command === 'serve' && isPreview) {\n // Preview mode: resolve the starting port from config/env/\n // default but do NOT probe. Vite's preview server handles the\n // bind itself, with `preview.strictPort` controlling whether\n // an in-use port auto-bumps (implicit) or errors (explicit).\n const previewConfigPort =\n typeof userConfig.preview?.port === 'number'\n ? userConfig.preview.port\n : typeof userConfig.server?.port === 'number'\n ? userConfig.server.port\n : undefined;\n const start = resolveStartPort({\n configPort: previewConfigPort,\n envPort: process.env.PORT,\n });\n resolvedDevPort = start.port;\n resolvedDevPortExplicit = start.explicit;\n }\n\n // Derive relative buildOutDir from the absolute ctx.buildDir (set above)\n // so Vite's config receives a root-relative path.\n const buildOutDir = relative(resolvedRoot, ctx.buildDir);\n\n // Set per-environment build.outDir so Vite's RSC plugin writes\n // each environment to the correct subdirectory under our buildDir.\n // Without this, the RSC plugin defaults to dist/<envName> instead\n // of <buildOutDir>/<envName>.\n const envOutDirs: Record<string, { build: { outDir: string } }> = {};\n for (const envName of ['rsc', 'ssr', 'client']) {\n envOutDirs[envName] = { build: { outDir: join(buildOutDir, envName) } };\n }\n\n // Exclude @timber-js/app packages from the dep optimizer.\n // The shims plugin intercepts @timber-js/app/* imports per-environment\n // (e.g. replacing @timber-js/app/server with a stub in the client env).\n // The dep optimizer runs before per-environment resolution, so it would\n // pre-bundle @timber-js/app/cookies with the real server code inlined,\n // pulling AsyncLocalStorage into the browser bundle.\n const timberOptimizeDepsExclude = [\n '@timber-js/app',\n '@timber-js/app/server',\n '@timber-js/app/client',\n '@timber-js/app/cookies',\n '@timber-js/app/cache',\n '@timber-js/app/search-params',\n '@timber-js/app/segment-params',\n '@timber-js/app/params',\n '@timber-js/app/codec',\n ];\n\n if (command === 'build') {\n return {\n build: { outDir: buildOutDir },\n environments: envOutDirs,\n optimizeDeps: { exclude: timberOptimizeDepsExclude },\n oxc: {\n jsx: {\n development: false,\n },\n },\n };\n }\n\n // Dev/preview mode: set outDir so dev-time references are\n // consistent, and surface the resolved port to Vite.\n //\n // For dev, we set strictPort: true so Vite uses exactly the port\n // the holding server probed for — without strictPort, Vite would\n // run its own auto-bump starting from `port`, which would skip\n // straight past whatever holding-server-bumped port we picked.\n //\n // For `vite preview`, we set `preview.strictPort` based on\n // whether the user explicitly set the port. Implicit (default)\n // preview uses strictPort: false so Vite's preview server can\n // auto-bump from 3000. Explicit preview uses strictPort: true\n // so conflicts fail loudly, matching the dev behavior and the\n // TIM-842 spec.\n const serverConfig: {\n port?: number;\n strictPort?: boolean;\n forwardConsole?: boolean | { unhandledErrors?: boolean; logLevels?: string[] };\n } = {};\n const previewConfig: { port?: number; strictPort?: boolean } = {};\n if (resolvedDevPort != null) {\n if (!isPreview) {\n serverConfig.port = resolvedDevPort;\n serverConfig.strictPort = true;\n }\n previewConfig.port = resolvedDevPort;\n previewConfig.strictPort = resolvedDevPortExplicit;\n }\n\n // Enable Vite 8's built-in browser→terminal console forwarding.\n // Vite defaults this OFF for non-agent dev; timber enables it based\n // on the devBrowserLogs config (default: 'warn'). See TIM-1152.\n serverConfig.forwardConsole = resolveForwardConsole(ctx.config.devBrowserLogs);\n\n // Provide a customLogger whose output routes through the pre-patched\n // console methods so Vite's forwardConsole output never re-enters our\n // server→browser patch. If the user supplied their own customLogger,\n // wrap it so its console calls also bypass patching.\n const customLogger = userConfig.customLogger\n ? wrapLoggerWithOriginalConsole(userConfig.customLogger)\n : createLogger(userConfig.logLevel ?? 'info', {\n allowClearScreen: userConfig.clearScreen ?? true,\n console: originalConsole as Console,\n });\n\n return {\n build: { outDir: buildOutDir },\n environments: envOutDirs,\n optimizeDeps: { exclude: timberOptimizeDepsExclude },\n customLogger,\n server: serverConfig,\n preview: previewConfig,\n };\n },\n configResolved(resolved) {\n ctx.root = resolved.root;\n ctx.appDir = resolveAppDir(resolved.root, ctx.config.appDir);\n ctx.dev = resolved.command === 'serve';\n\n // Register all timber config file candidates as Vite config file\n // dependencies so Vite's built-in restart-on-change handles them\n // (including atomic writes that emit unlink+add instead of change).\n // All candidates are registered — not just the one that exists — so\n // that creating a config file after server start also triggers a\n // restart. The watcher.add() call in dev-server.ts ensures all\n // candidates are in the watch set.\n // See design/21-dev-server.md §HMR Wiring.\n const configNames = ['timber.config.ts', 'timber.config.js', 'timber.config.mjs'];\n for (const name of configNames) {\n resolved.configFileDependencies.push(resolve(resolved.root, name));\n }\n\n // Sync buildDir from Vite's resolved build.outDir. Vite keeps\n // outDir as-is (may be relative), so resolve against root.\n ctx.buildDir = resolve(resolved.root, resolved.build.outDir);\n // In production builds, swap to a no-op timer to avoid overhead\n if (!ctx.dev) {\n ctx.timer = createNoopTimer();\n } else {\n // Start the overall dev server setup timer — ends in timber-dev-server\n ctx.timer.start('dev-server-setup');\n }\n\n // Validate config and check peer dependencies at startup.\n // Errors are logged to stderr but don't block startup — Vite may\n // still work partially, and the errors guide the user to fix things.\n /* eslint-disable no-var-requires -- sync require for startup validation */\n const { validateConfig, formatConfigErrors, checkPeerDependencies, formatMissingPeers } =\n require('./config-validation.js') as typeof import('./config-validation.js');\n /* eslint-enable no-var-requires */\n\n const configErrors = validateConfig(ctx.config);\n if (configErrors.length > 0) {\n process.stderr.write(`${formatConfigErrors(configErrors)}\\n\\n`);\n }\n\n const peerResults = checkPeerDependencies(ctx.root);\n const peerWarning = formatMissingPeers(peerResults);\n if (peerWarning) {\n process.stderr.write(`${peerWarning}\\n\\n`);\n }\n },\n };\n\n // ── Step 5: Resolve optional plugins ────────────────────────────────\n // React Compiler — resolved eagerly from either inline or file config.\n // Vite's config() hook return type is Omit<UserConfig, 'plugins'>, so\n // plugins MUST be in the top-level array — returning them from config()\n // silently drops them. See TIM-632.\n //\n // Inline config takes precedence. File config (from the early cwd-based\n // load) is used when inline config doesn't set reactCompiler.\n const reactCompilerPlugins: PluginOption[] = [];\n const effectiveReactCompiler = config?.reactCompiler ?? earlyFileConfig?.reactCompiler;\n if (effectiveReactCompiler) {\n reactCompilerPlugins.push(resolveReactCompilerPlugin(effectiveReactCompiler, consumerRequire));\n }\n\n // ── Step 6: Assemble plugin array ─────────────────────────────────────\n // @vitejs/plugin-rsc handles:\n // - RSC/SSR/client environment setup\n // - \"use client\" directive → client reference proxy transformation\n // - \"use server\" directive → server reference transformation\n // - Client reference tracking and module map generation\n //\n // serverHandler: false — timber has its own dev server (timber-dev-server)\n // entries — tells the RSC plugin about timber's virtual entry modules so\n // it correctly wires up the browser entry (needed for React Fast Refresh\n // preamble coordination with @vitejs/plugin-react)\n // customClientEntry: true — timber manages its own browser entry and\n // preloading; skips RSC plugin's default \"index\" client entry convention\n //\n // The RSC plugin's built-in buildApp handles the 5-step multi-environment\n // build sequence (analyze references → build RSC → build client → build SSR).\n // We do NOT set customBuildApp — the RSC plugin's orchestration is correct\n // and handles bundle ordering, asset manifest generation, and environment\n // imports manifest. See @vitejs/plugin-rsc's buildApp implementation.\n return [\n rootSync,\n timberReactProd(),\n // @vitejs/plugin-react provides React Fast Refresh (state-preserving HMR)\n // for client components via Babel transform. Placed before @vitejs/plugin-rsc\n // following Vinext's convention — the RSC plugin's virtual browser entry\n // coordinates with plugin-react via __vite_plugin_react_preamble_installed__.\n react(),\n ...reactCompilerPlugins,\n vitePluginRsc(createRscOptions(ctx, encryptionKeyExpr)),\n timberShims(ctx),\n timberRouting(ctx),\n timberEntries(ctx),\n timberBuildManifest(ctx),\n timberStaticBuild(ctx),\n timberFonts(ctx),\n timberMdx(ctx),\n timberRequestDep(ctx),\n timberCacheTransform(ctx),\n timberPrerenderSugar(ctx), // export const prerender → cache.component() desugaring\n timberPrebuilt(ctx), // cache.component() → __prebuilt() callsite rewrite\n timberContent(ctx),\n timberServerBundle(), // Bundle all deps in server environments for prod\n timberCloudflareWasm(ctx), // Externalize WASM for Cloudflare Workers\n timberChunks(ctx),\n timberBuildReport(ctx), // Post-build: route table with bundle sizes\n timberAdapterBuild(ctx), // Post-build: invoke adapter.buildOutput()\n timberDevLogs(ctx), // Dev-only: forward server console.* to browser console\n timberDevServer(ctx), // Must be last — configureServer post-hook runs after all watchers\n ];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