svelte-effect-runtime 4.0.1 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/.dist/chunks/{client-BrZka6DW.js → client-DbwVAMWm.js} +5 -5
  2. package/.dist/chunks/{client-BrZka6DW.js.map → client-DbwVAMWm.js.map} +1 -1
  3. package/.dist/chunks/{compiler-COVzgLYo.js → compiler-Dpyu4Owd.js} +2 -2
  4. package/.dist/chunks/{compiler-COVzgLYo.js.map → compiler-Dpyu4Owd.js.map} +1 -1
  5. package/.dist/chunks/{descriptors-B4otDlm1.js → descriptors-q909VWyR.js} +3 -3
  6. package/.dist/chunks/{descriptors-B4otDlm1.js.map → descriptors-q909VWyR.js.map} +1 -1
  7. package/.dist/chunks/{diagnostics-BDrky-Di.js → diagnostics-DLwwrBWb.js} +2 -2
  8. package/.dist/chunks/{diagnostics-BDrky-Di.js.map → diagnostics-DLwwrBWb.js.map} +1 -1
  9. package/.dist/chunks/{dispatcher-_x0MQZBS.js → dispatcher-CTWINW5I.js} +219 -16
  10. package/.dist/chunks/dispatcher-CTWINW5I.js.map +1 -0
  11. package/.dist/chunks/dispatcher-pZPzarul.js +23 -0
  12. package/.dist/chunks/dispatcher-pZPzarul.js.map +1 -0
  13. package/.dist/chunks/{errors-CLsbGjIa.js → errors-qhcbUH6o.js} +19 -2
  14. package/.dist/chunks/{errors-CLsbGjIa.js.map → errors-qhcbUH6o.js.map} +1 -1
  15. package/.dist/chunks/{live-BundLSoY.js → live-BW7xZKjb.js} +2 -2
  16. package/.dist/chunks/{live-BundLSoY.js.map → live-BW7xZKjb.js.map} +1 -1
  17. package/.dist/chunks/{runtime-HDTlEnzp.js → runtime-CPosEhGl.js} +3 -3
  18. package/.dist/chunks/{runtime-HDTlEnzp.js.map → runtime-CPosEhGl.js.map} +1 -1
  19. package/.dist/chunks/{server-BNrA1I-u.js → server-yQrNoiCR.js} +2 -2
  20. package/.dist/chunks/{server-BNrA1I-u.js.map → server-yQrNoiCR.js.map} +1 -1
  21. package/.dist/chunks/{source-scan-9pZxnfct.js → source-scan-cSawCvsg.js} +2 -2
  22. package/.dist/chunks/source-scan-cSawCvsg.js.map +1 -0
  23. package/.dist/chunks/{transform-BXyYUAez.js → transform-D7TTlPpK.js} +75 -27
  24. package/.dist/chunks/transform-D7TTlPpK.js.map +1 -0
  25. package/.dist/compiler.js +1 -1
  26. package/.dist/dispatcher/index.d.ts +49 -0
  27. package/.dist/dispatcher/scope.d.ts +36 -0
  28. package/.dist/dispatcher.d.ts +2 -1
  29. package/.dist/dispatcher.js +2 -2
  30. package/.dist/errors.d.ts +14 -0
  31. package/.dist/generated/dispatcher.d.ts +6 -1
  32. package/.dist/generators.d.ts +1 -0
  33. package/.dist/internal/generators.js +4 -4
  34. package/.dist/internal/remote-client.js +1 -1
  35. package/.dist/internal/remote-server.js +1 -1
  36. package/.dist/markup/promise.js +1 -1
  37. package/.dist/markup/run.js +1 -1
  38. package/.dist/markup/transform/apply.d.ts +4 -3
  39. package/.dist/markup/transform/constants.d.ts +1 -0
  40. package/.dist/markup/transform/types.d.ts +16 -0
  41. package/.dist/markup/transform.js +1 -1
  42. package/.dist/markup/value.js +1 -1
  43. package/.dist/mod.d.ts +1 -1
  44. package/.dist/mod.js +5 -5
  45. package/.dist/mod.js.map +1 -1
  46. package/.dist/remote/client.js +1 -1
  47. package/.dist/remote/server.js +1 -1
  48. package/.dist/runtime/transform.js +26 -12
  49. package/.dist/runtime/transform.js.map +1 -1
  50. package/.dist/script-transform/imports.d.ts +3 -1
  51. package/.dist/script-transform/index.d.ts +2 -0
  52. package/.dist/script-transform/types.d.ts +8 -0
  53. package/.dist/server.js +5 -5
  54. package/package.json +2 -2
  55. package/.dist/chunks/dispatcher-BA0PLQhA.js +0 -16
  56. package/.dist/chunks/dispatcher-BA0PLQhA.js.map +0 -1
  57. package/.dist/chunks/dispatcher-_x0MQZBS.js.map +0 -1
  58. package/.dist/chunks/source-scan-9pZxnfct.js.map +0 -1
  59. package/.dist/chunks/transform-BXyYUAez.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatcher-_x0MQZBS.js","names":["#notify_value_cells","#runtime","#emit_markup_value","#emit_markup_promise","#emit_markup_run","#disposed","#next_fiber_id","#fibers","#make_value_cache_key","#value_ids","#subscribe_value_cells","#value_cells","#interrupt_cached_fiber","#clear_pending_value_cell","#should_start_value_fiber","#start_value_fiber","#make_promise_cache_key","#promise_ids","#promise_values","#start_promise_fiber","#is_server_render","#clear_value_cells","#hash_deps","#is_current_fiber","#set_value_cell","#complete_fiber","#publish_value_success","#publish_value_failure","#delete_value_cell"],"sources":["../../../modules/svelte-effect-runtime/src/dispatcher/fibers.ts","../../../modules/svelte-effect-runtime/src/dispatcher/deps.ts","../../../modules/svelte-effect-runtime/src/dispatcher/types.ts","../../../modules/svelte-effect-runtime/src/dispatcher/index.ts"],"sourcesContent":["import type { Fiber as FiberType } from \"effect/Fiber\";\nimport { Cause, Effect, Exit, Fiber } from \"effect\";\n\nexport interface FiberWatchCallbacks<A> {\n\ton_complete?: () => void;\n\ton_success?: (value: A) => void;\n\ton_failure?: (error: unknown) => void;\n\tsurface_failure?: boolean;\n}\n\nexport const InterruptFiber = (fiber: FiberType<unknown, unknown>) =>\n\tEffect.gen(function* () {\n\t\tyield* Fiber.interrupt(fiber);\n\t});\n\n/** Observes fiber completion and surfaces failures without taking ownership of the fiber. */\nexport const WatchFiberExit = <A>(\n\toptions: { fiber: FiberType<unknown, unknown> } & FiberWatchCallbacks<A>,\n) => {\n\tconst { fiber, on_complete, on_success, on_failure, surface_failure = true } = options;\n\n\treturn Effect.gen(function* () {\n\t\tconst exit = yield* Fiber.await(fiber);\n\n\t\tyield* Effect.sync(() => {\n\t\t\tif (Exit.isSuccess(exit)) {\n\t\t\t\ton_success?.(exit.value as A);\n\t\t\t\ton_complete?.();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!Cause.hasInterruptsOnly(exit.cause)) {\n\t\t\t\tconst error = Cause.squash(exit.cause);\n\n\t\t\t\ton_failure?.(error);\n\n\t\t\t\tif (surface_failure) {\n\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ton_complete?.();\n\t\t});\n\t});\n};\n","/** Assigns stable identities to object dependencies while hashing value dependencies. */\nexport type DependencyHasher = (deps: readonly unknown[]) => string;\n\nexport function make_dependency_hasher(): DependencyHasher {\n\tconst object_dep_ids = new WeakMap<object, number>();\n\tconst symbol_dep_ids = new Map<symbol, number>();\n\n\tlet next_object_dep_id = 0;\n\tlet next_symbol_dep_id = 0;\n\n\tconst hash_symbol_dep = (dep: symbol): string => {\n\t\tlet id = symbol_dep_ids.get(dep);\n\n\t\tif (id === undefined) {\n\t\t\tnext_symbol_dep_id += 1;\n\t\t\tid = next_symbol_dep_id;\n\t\t\tsymbol_dep_ids.set(dep, id);\n\t\t}\n\n\t\treturn `y:${id}`;\n\t};\n\n\tconst hash_object_dep = (dep: object): string => {\n\t\tlet id = object_dep_ids.get(dep);\n\n\t\tif (id === undefined) {\n\t\t\tnext_object_dep_id += 1;\n\t\t\tid = next_object_dep_id;\n\t\t\tobject_dep_ids.set(dep, id);\n\t\t}\n\n\t\treturn `o:${id}`;\n\t};\n\n\tconst hash_dep = (dep: unknown): string | readonly [\"s\", string] => {\n\t\tif (dep === null) {\n\t\t\treturn \"l:null\";\n\t\t}\n\n\t\tif (dep === undefined) {\n\t\t\treturn \"u:undefined\";\n\t\t}\n\n\t\tconst type = typeof dep;\n\n\t\tif (type === \"string\") {\n\t\t\treturn [\"s\", dep as string];\n\t\t}\n\n\t\tif (type === \"number\") {\n\t\t\treturn `n:${Object.is(dep, -0) ? \"-0\" : String(dep)}`;\n\t\t}\n\n\t\tif (type === \"bigint\") {\n\t\t\treturn `b:${dep}`;\n\t\t}\n\n\t\tif (type === \"boolean\") {\n\t\t\treturn dep ? \"t:true\" : \"f:false\";\n\t\t}\n\n\t\tif (type === \"symbol\") {\n\t\t\treturn hash_symbol_dep(dep as symbol);\n\t\t}\n\n\t\treturn hash_object_dep(dep as object);\n\t};\n\n\tconst hash_deps = (deps: readonly unknown[]): string => JSON.stringify(deps.map(hash_dep));\n\n\treturn hash_deps;\n}\n","import type { Effect } from \"effect\";\n\nexport const Code = {\n\tMarkup: {\n\t\tPromise: \"MarkupPromise\",\n\t\tRun: \"MarkupRun\",\n\t\tValue: \"MarkupValue\",\n\t},\n} as const;\n\nexport interface MarkupPromiseOptions {\n\t/** Keep the SSR promise pending so Svelte renders an await block fallback. */\n\tssr?: \"pending\";\n}\n\nexport type Dispose = () => void;\n\nexport interface ValueOptions<A> {\n\t/** Stable cache key for this value block. */\n\tid: string;\n\tdeps: readonly unknown[];\n\t/** Value returned synchronously while the effect is running or during SSR. */\n\tfallback: A;\n\tfactory: () => Effect.gen.Return<A, unknown, unknown>;\n}\n\nexport interface PromiseOptions<A> {\n\t/** Stable cache key for this promise block. */\n\tid: string;\n\tdeps: readonly unknown[];\n\tfactory: () => Effect.gen.Return<A, unknown, unknown>;\n}\n\nexport interface MarkupValueEvent<A, F> {\n\ttype: typeof Code.Markup.Value;\n\t/** Stable identifier generated from the expression's source position. */\n\tid: string;\n\tdeps: readonly unknown[];\n\t/** Value returned synchronously while the effect is pending. */\n\tfallback: F;\n\tfn: () => Effect.gen.Return<A, unknown, unknown>;\n}\n\nexport interface MarkupPromiseEvent<A> {\n\ttype: typeof Code.Markup.Promise;\n\t/** Stable identifier generated from the expression's source position. */\n\tid: string;\n\tdeps: readonly unknown[];\n\tfn: () => Effect.gen.Return<A, unknown, unknown>;\n\t/** Value resolved during SSR when a fallback is required. */\n\tssr_fallback?: A;\n\t/** Optional SSR behavior for await blocks and similar contexts. */\n\toptions?: MarkupPromiseOptions;\n}\n\nexport interface MarkupRunEvent<A> {\n\ttype: typeof Code.Markup.Run;\n\tfn: () => Effect.gen.Return<A, unknown, unknown>;\n}\n\nexport type DispatcherEvent<A, F = A> =\n\t| MarkupPromiseEvent<A>\n\t| MarkupRunEvent<A>\n\t| MarkupValueEvent<A, F>;\n","import type {\n\tDispatcherEvent,\n\tDispose,\n\tMarkupPromiseEvent,\n\tMarkupRunEvent,\n\tMarkupValueEvent,\n\tPromiseOptions,\n\tValueOptions,\n} from \"./types.ts\";\nimport { RuntimeAlreadyInitializedError, DispatcherDisposedError } from \"$/errors.ts\";\nimport type { ManagedRuntime as ManagedRuntimeType } from \"effect/ManagedRuntime\";\nimport { Cause, Effect, Exit, Fiber, Layer, ManagedRuntime } from \"effect\";\nimport { InterruptFiber, WatchFiberExit } from \"./fibers.ts\";\nimport type { Fiber as FiberType } from \"effect/Fiber\";\nimport { createSubscriber } from \"svelte/reactivity\";\nimport { make_dependency_hasher } from \"./deps.ts\";\nimport { isRedirect } from \"@sveltejs/kit\";\nimport { Code } from \"./types.ts\";\n\nexport { Code } from \"./types.ts\";\nexport type { Dispose, PromiseOptions, ValueOptions } from \"./types.ts\";\n\ntype ValueCell<A> =\n\t| {\n\t\t\treadonly status: \"pending\";\n\t\t\treadonly fiber: FiberType<unknown, unknown>;\n\t }\n\t| {\n\t\t\treadonly status: \"success\";\n\t\t\treadonly value: A;\n\t }\n\t| {\n\t\t\treadonly status: \"failure\";\n\t\t\treadonly error: unknown;\n\t };\n\nexport class Dispatcher {\n\t#runtime: ManagedRuntimeType<unknown, unknown>;\n\t#fibers = new Map<string, FiberType<unknown, unknown>>();\n\t#value_cells = new Map<string, ValueCell<unknown>>();\n\t#notify_value_cells = (): void => {};\n\t#subscribe_value_cells = createSubscriber((update) => {\n\t\tthis.#notify_value_cells = update;\n\n\t\treturn () => {\n\t\t\tif (this.#notify_value_cells !== update) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.#notify_value_cells = (): void => {};\n\t\t};\n\t});\n\t#promise_values = new Map<string, Promise<unknown>>();\n\t#value_ids = new Map<string, string>();\n\t#promise_ids = new Map<string, string>();\n\t#hash_deps = make_dependency_hasher();\n\t#disposed = false;\n\t#next_fiber_id = 0;\n\n\tstatic make<R = never>(layer?: Layer.Layer<R>): Dispatcher {\n\t\tif (current_dispatcher) {\n\t\t\tthrow new RuntimeAlreadyInitializedError(\"ClientRuntime\");\n\t\t}\n\n\t\tconst runtime = ManagedRuntime.make(layer ?? (Layer.empty as unknown as Layer.Layer<R>));\n\n\t\tconst dispatcher = new Dispatcher(runtime as ManagedRuntimeType<unknown, unknown>);\n\t\tcurrent_dispatcher = dispatcher;\n\n\t\treturn dispatcher;\n\t}\n\n\tconstructor(runtime?: ManagedRuntimeType<unknown, unknown>) {\n\t\tthis.#runtime =\n\t\t\truntime ??\n\t\t\t(ManagedRuntime.make(Layer.empty) as unknown as ManagedRuntimeType<unknown, unknown>);\n\t}\n\n\temit<A, F>(event: MarkupValueEvent<A, F>): A | F;\n\temit<A>(event: MarkupPromiseEvent<A>): Promise<A>;\n\temit<A>(event: MarkupRunEvent<A>): Promise<A>;\n\temit<A, F>(event: DispatcherEvent<A, F>): A | F | Promise<A>;\n\temit<A, F>(event: DispatcherEvent<A, F>): A | F | Promise<A> {\n\t\tswitch (event.type) {\n\t\t\tcase Code.Markup.Value:\n\t\t\t\treturn this.#emit_markup_value(event);\n\n\t\t\tcase Code.Markup.Promise:\n\t\t\t\treturn this.#emit_markup_promise(event);\n\n\t\t\tcase Code.Markup.Run:\n\t\t\t\treturn this.#emit_markup_run(event);\n\t\t}\n\t}\n\n\tfork<A, E, R>(effect: Effect.Effect<A, E, R>): Dispose {\n\t\tif (this.#disposed) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst fiber = this.#runtime.runFork(effect as Effect.Effect<unknown, unknown, unknown>);\n\t\tconst key = `fork:${this.#next_fiber_id}`;\n\n\t\tthis.#next_fiber_id += 1;\n\t\tthis.#fibers.set(key, fiber);\n\t\tthis.#runtime.runFork(\n\t\t\tWatchFiberExit({\n\t\t\t\tfiber,\n\t\t\t\ton_complete: () => this.#fibers.delete(key),\n\t\t\t}),\n\t\t);\n\n\t\tlet disposed = false;\n\n\t\treturn (): void => {\n\t\t\tif (disposed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdisposed = true;\n\t\t\tthis.#runtime.runFork(InterruptFiber(fiber));\n\t\t};\n\t}\n\n\tvalue<A>(options: ValueOptions<A>): A {\n\t\tif (this.#disposed) {\n\t\t\treturn options.fallback;\n\t\t}\n\n\t\tconst cache_key = this.#make_value_cache_key(options.id, options.deps);\n\t\tconst old_key = this.#value_ids.get(options.id);\n\n\t\tthis.#subscribe_value_cells();\n\n\t\tconst cell = this.#value_cells.get(cache_key);\n\n\t\tif (old_key !== undefined && old_key !== cache_key) {\n\t\t\tconst old_fiber = this.#interrupt_cached_fiber(old_key);\n\n\t\t\tthis.#clear_pending_value_cell(old_key, old_fiber);\n\t\t}\n\n\t\tthis.#value_ids.set(options.id, cache_key);\n\n\t\tif (this.#should_start_value_fiber(cache_key, cell)) {\n\t\t\tthis.#start_value_fiber(cache_key, options);\n\t\t}\n\n\t\tif (cell?.status === \"success\") {\n\t\t\treturn cell.value as A;\n\t\t}\n\n\t\tif (cell?.status === \"failure\") {\n\t\t\tthrow cell.error;\n\t\t}\n\n\t\treturn options.fallback;\n\t}\n\n\tpromise<A>(options: PromiseOptions<A>): Promise<A> {\n\t\tif (this.#disposed) {\n\t\t\treturn Promise.reject(new DispatcherDisposedError());\n\t\t}\n\n\t\tconst cache_key = this.#make_promise_cache_key(options.id, options.deps);\n\t\tconst old_key = this.#promise_ids.get(options.id);\n\n\t\tif (old_key !== undefined && old_key !== cache_key) {\n\t\t\tthis.#interrupt_cached_fiber(old_key);\n\t\t\tthis.#promise_values.delete(old_key);\n\t\t}\n\n\t\tthis.#promise_ids.set(options.id, cache_key);\n\n\t\tconst existing = this.#promise_values.get(cache_key);\n\n\t\tif (existing) {\n\t\t\treturn existing as Promise<A>;\n\t\t}\n\n\t\tconst promise = this.#start_promise_fiber(cache_key, options);\n\n\t\tthis.#promise_values.set(cache_key, promise);\n\n\t\treturn promise;\n\t}\n\n\trun<A, E, R>(effect: Effect.Effect<A, E, R>): Promise<A> {\n\t\tif (this.#disposed) {\n\t\t\treturn Promise.reject(new DispatcherDisposedError());\n\t\t}\n\n\t\tconst Program = Effect.gen(function* () {\n\t\t\tconst result = yield* Effect.exit(effect);\n\n\t\t\tif (Exit.isSuccess(result)) {\n\t\t\t\treturn result.value;\n\t\t\t}\n\n\t\t\tif (Cause.hasInterruptsOnly(result.cause)) {\n\t\t\t\treturn undefined as A;\n\t\t\t}\n\n\t\t\tconst error = Cause.squash(result.cause);\n\n\t\t\tif (isRedirect(error)) {\n\t\t\t\treturn undefined as A;\n\t\t\t}\n\n\t\t\tyield* Effect.sync(() => {\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn yield* Effect.fail(error);\n\t\t});\n\n\t\treturn this.#runtime.runPromise(Program as Effect.Effect<A, unknown, unknown>);\n\t}\n\n\t#emit_markup_value<A, F>(event: MarkupValueEvent<A, F>): A | F {\n\t\tif (this.#is_server_render()) {\n\t\t\treturn event.fallback;\n\t\t}\n\n\t\treturn this.value<A | F>({\n\t\t\tid: event.id,\n\t\t\tdeps: event.deps,\n\t\t\tfallback: event.fallback,\n\t\t\tfactory: event.fn,\n\t\t});\n\t}\n\n\t#emit_markup_promise<A>(event: MarkupPromiseEvent<A>): Promise<A> {\n\t\tif (this.#is_server_render()) {\n\t\t\tif (event.options?.ssr === \"pending\") {\n\t\t\t\treturn new Promise<A>(() => {});\n\t\t\t}\n\n\t\t\tif (\"ssr_fallback\" in event) {\n\t\t\t\treturn Promise.resolve(event.ssr_fallback as A);\n\t\t\t}\n\t\t}\n\n\t\treturn this.promise({\n\t\t\tid: event.id,\n\t\t\tdeps: event.deps,\n\t\t\tfactory: event.fn,\n\t\t});\n\t}\n\n\t#emit_markup_run<A>(event: MarkupRunEvent<A>): Promise<A> {\n\t\tconst Program = Effect.gen(event.fn);\n\n\t\treturn this.run(Program);\n\t}\n\n\tdispose(): void {\n\t\tthis.#disposed = true;\n\n\t\tfor (const fiber of this.#fibers.values()) {\n\t\t\tthis.#runtime.runFork(InterruptFiber(fiber));\n\t\t}\n\n\t\tthis.#fibers.clear();\n\t\tthis.#clear_value_cells();\n\t\tthis.#promise_values.clear();\n\t\tthis.#value_ids.clear();\n\t\tthis.#promise_ids.clear();\n\n\t\tvoid this.#runtime.dispose().catch((error: unknown) => {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t});\n\t}\n\n\t#make_value_cache_key(id: string, deps: readonly unknown[]): string {\n\t\treturn `value:${id}::${this.#hash_deps(deps)}`;\n\t}\n\n\t#make_promise_cache_key(id: string, deps: readonly unknown[]): string {\n\t\treturn `promise:${id}::${this.#hash_deps(deps)}`;\n\t}\n\n\t#is_server_render(): boolean {\n\t\treturn typeof document === \"undefined\";\n\t}\n\n\t#interrupt_cached_fiber(cache_key: string): FiberType<unknown, unknown> | undefined {\n\t\tconst old_fiber = this.#fibers.get(cache_key);\n\n\t\tif (!old_fiber) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis.#runtime.runFork(InterruptFiber(old_fiber));\n\t\tthis.#fibers.delete(cache_key);\n\n\t\treturn old_fiber;\n\t}\n\n\t#should_start_value_fiber(cache_key: string, cell: ValueCell<unknown> | undefined): boolean {\n\t\treturn !this.#disposed && !this.#fibers.has(cache_key) && cell === undefined;\n\t}\n\n\t#start_value_fiber<A>(cache_key: string, options: ValueOptions<A>): void {\n\t\tconst Program = Effect.gen(function* () {\n\t\t\tconst result = yield* Effect.gen(options.factory);\n\n\t\t\treturn result;\n\t\t});\n\t\tconst fiber = this.#runtime.runFork(Program as Effect.Effect<unknown, unknown, unknown>);\n\n\t\tthis.#fibers.set(cache_key, fiber);\n\n\t\tqueueMicrotask(() => {\n\t\t\tif (!this.#is_current_fiber(cache_key, fiber)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.#value_cells.has(cache_key)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.#set_value_cell(cache_key, {\n\t\t\t\tstatus: \"pending\",\n\t\t\t\tfiber,\n\t\t\t});\n\t\t});\n\n\t\tthis.#runtime.runFork(\n\t\t\tWatchFiberExit({\n\t\t\t\tfiber,\n\t\t\t\tsurface_failure: false,\n\t\t\t\ton_complete: () => this.#complete_fiber(cache_key, fiber),\n\t\t\t\ton_success: (value) => this.#publish_value_success(cache_key, fiber, value),\n\t\t\t\ton_failure: (error) => this.#publish_value_failure(cache_key, fiber, error),\n\t\t\t}),\n\t\t);\n\t}\n\n\t#start_promise_fiber<A>(cache_key: string, options: PromiseOptions<A>): Promise<A> {\n\t\tconst Program = Effect.gen(function* () {\n\t\t\tconst result = yield* Effect.gen(options.factory);\n\n\t\t\treturn result;\n\t\t});\n\t\tconst fiber = this.#runtime.runFork(Program as Effect.Effect<unknown, unknown, unknown>);\n\t\tconst ReleaseFiber = Effect.sync(() => {\n\t\t\tif (!this.#is_current_fiber(cache_key, fiber)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.#fibers.delete(cache_key);\n\t\t\tthis.#promise_values.delete(cache_key);\n\n\t\t\tif (this.#promise_ids.get(options.id) === cache_key) {\n\t\t\t\tthis.#promise_ids.delete(options.id);\n\t\t\t}\n\t\t});\n\t\tconst AwaitFiber = Effect.gen(function* () {\n\t\t\tconst exit = yield* Fiber.await(fiber);\n\n\t\t\tyield* ReleaseFiber;\n\n\t\t\tif (Exit.isSuccess(exit)) {\n\t\t\t\treturn exit.value as A;\n\t\t\t}\n\n\t\t\treturn yield* Effect.fail(Cause.squash(exit.cause));\n\t\t});\n\n\t\tthis.#fibers.set(cache_key, fiber);\n\n\t\treturn this.#runtime.runPromise(AwaitFiber);\n\t}\n\n\t#clear_pending_value_cell(\n\t\tcache_key: string,\n\t\tfiber: FiberType<unknown, unknown> | undefined,\n\t): void {\n\t\tconst cell = this.#value_cells.get(cache_key);\n\n\t\tif (cell?.status !== \"pending\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif (fiber !== undefined && cell.fiber !== fiber) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#delete_value_cell(cache_key);\n\t}\n\n\t#complete_fiber(cache_key: string, fiber: FiberType<unknown, unknown>): void {\n\t\tif (!this.#is_current_fiber(cache_key, fiber)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#fibers.delete(cache_key);\n\t}\n\n\t#publish_value_success<A>(\n\t\tcache_key: string,\n\t\tfiber: FiberType<unknown, unknown>,\n\t\tvalue: A,\n\t): void {\n\t\tif (!this.#is_current_fiber(cache_key, fiber)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#set_value_cell(cache_key, {\n\t\t\tstatus: \"success\",\n\t\t\tvalue,\n\t\t});\n\t}\n\n\t#publish_value_failure(\n\t\tcache_key: string,\n\t\tfiber: FiberType<unknown, unknown>,\n\t\terror: unknown,\n\t): void {\n\t\tif (!this.#is_current_fiber(cache_key, fiber)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#set_value_cell(cache_key, {\n\t\t\tstatus: \"failure\",\n\t\t\terror,\n\t\t});\n\t}\n\n\t#set_value_cell(cache_key: string, cell: ValueCell<unknown>): void {\n\t\tthis.#value_cells.set(cache_key, cell);\n\t\tthis.#notify_value_cells();\n\t}\n\n\t#delete_value_cell(cache_key: string): void {\n\t\tconst deleted = this.#value_cells.delete(cache_key);\n\n\t\tif (!deleted) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#notify_value_cells();\n\t}\n\n\t#clear_value_cells(): void {\n\t\tif (this.#value_cells.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#value_cells.clear();\n\t\tthis.#notify_value_cells();\n\t}\n\n\t#is_current_fiber(cache_key: string, fiber: FiberType<unknown, unknown>): boolean {\n\t\treturn !this.#disposed && this.#fibers.get(cache_key) === fiber;\n\t}\n}\n\nlet current_dispatcher: Dispatcher | null = null;\n\nexport function get_dispatcher(): Dispatcher {\n\tcurrent_dispatcher ??= new Dispatcher();\n\n\treturn current_dispatcher;\n}\n\nexport function reset_dispatcher(): void {\n\tcurrent_dispatcher?.dispose();\n\tcurrent_dispatcher = null;\n}\n"],"mappings":";;;;;AAUA,MAAa,kBAAkB,UAC9B,OAAO,IAAI,aAAa;CACvB,OAAO,MAAM,UAAU,KAAK;AAC7B,CAAC;;AAGF,MAAa,kBACZ,YACI;CACJ,MAAM,EAAE,OAAO,aAAa,YAAY,YAAY,kBAAkB,SAAS;CAE/E,OAAO,OAAO,IAAI,aAAa;EAC9B,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;EAErC,OAAO,OAAO,WAAW;GACxB,IAAI,KAAK,UAAU,IAAI,GAAG;IACzB,aAAa,KAAK,KAAU;IAC5B,cAAc;IAEd;GACD;GAEA,IAAI,CAAC,MAAM,kBAAkB,KAAK,KAAK,GAAG;IACzC,MAAM,QAAQ,MAAM,OAAO,KAAK,KAAK;IAErC,aAAa,KAAK;IAElB,IAAI,iBACH,qBAAqB;KACpB,MAAM;IACP,CAAC;GAEH;GAEA,cAAc;EACf,CAAC;CACF,CAAC;AACF;;;AC5CA,SAAgB,yBAA2C;CAC1D,MAAM,iCAAiB,IAAI,QAAwB;CACnD,MAAM,iCAAiB,IAAI,IAAoB;CAE/C,IAAI,qBAAqB;CACzB,IAAI,qBAAqB;CAEzB,MAAM,mBAAmB,QAAwB;EAChD,IAAI,KAAK,eAAe,IAAI,GAAG;EAE/B,IAAI,OAAO,KAAA,GAAW;GACrB,sBAAsB;GACtB,KAAK;GACL,eAAe,IAAI,KAAK,EAAE;EAC3B;EAEA,OAAO,KAAK;CACb;CAEA,MAAM,mBAAmB,QAAwB;EAChD,IAAI,KAAK,eAAe,IAAI,GAAG;EAE/B,IAAI,OAAO,KAAA,GAAW;GACrB,sBAAsB;GACtB,KAAK;GACL,eAAe,IAAI,KAAK,EAAE;EA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AAQ;CAC5B,qBAAqB;AACtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-scan-9pZxnfct.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/compiler/source-scan.ts"],"sourcesContent":["import { type AST, parse } from \"svelte/compiler\";\n\nimport ts from \"typescript\";\n\nexport interface SourceRange {\n\t/** Inclusive start offset. */\n\tstart: number;\n\t/** Exclusive end offset. */\n\tend: number;\n}\n\nexport interface SourceAttribute extends SourceRange {\n\t/** Attribute name exactly as written in source. */\n\tname: string;\n\t/** Inclusive offset where the attribute name starts. */\n\tname_start: number;\n\t/** Exclusive offset where the attribute name ends. */\n\tname_end: number;\n\t/** Parsed string value when the attribute has one. */\n\tvalue?: string | undefined;\n}\n\nexport interface ScriptRegion extends SourceRange {\n\t/** Offset where the opening `<script` tag starts. */\n\topening_tag_start: number;\n\t/** Offset immediately after the opening tag's `>` character. */\n\topening_tag_end: number;\n\t/** Offset immediately after the `script` tag name. */\n\ttag_name_end: number;\n\t/** Offset where script content starts. */\n\tcontent_start: number;\n\t/** Offset where script content ends. */\n\tcontent_end: number;\n\t/** Offset where the closing `</script>` tag starts. */\n\tclosing_tag_start: number;\n\t/** Offset immediately after the closing `</script>` tag. */\n\tclosing_tag_end: number;\n\t/** Raw attribute text between `script` and `>`. */\n\tattributes_text: string;\n\t/** Parsed opening tag attributes. */\n\tattributes: readonly SourceAttribute[];\n\t/** Script content between the opening and closing tags. */\n\ttext: string;\n\t/** Whether this is a module script. */\n\tis_module: boolean;\n\t/** Whether the script has a `lang` attribute. */\n\thas_lang: boolean;\n\t/** Parsed `lang` value when present. */\n\tlang?: string | undefined;\n\t/** Whether this script should be parsed as TypeScript. */\n\tis_typescript: boolean;\n\t/** Whether this script has SER's `effect` attribute. */\n\thas_effect: boolean;\n\t/** Range of the `effect` attribute, including leading whitespace. */\n\teffect_attribute?: SourceRange | undefined;\n}\n\nexport interface MarkupBraceExpression {\n\t/** Offset of the opening `{`. */\n\topen: number;\n\t/** Offset of the closing `}`. */\n\tclose: number;\n\t/** Offset where the expression body starts. */\n\tinner_start: number;\n\t/** Offset where the expression body ends. */\n\tinner_end: number;\n\t/** Raw expression body between braces. */\n\tinner: string;\n\t/** Trimmed expression body. */\n\texpression_text: string;\n\t/** Attribute name when the expression is an attribute value. */\n\tattribute_name?: string | undefined;\n}\n\nexport interface BareConstDeclarationTag {\n\t/** Offset of the opening `{`. */\n\topen: number;\n\t/** Offset after `{` where `@` should be inserted. */\n\tinsert_position: number;\n\t/** Brace expression that contains the bare declaration. */\n\texpression: MarkupBraceExpression;\n}\n\nexport interface SvelteEffectSourceScan {\n\t/** Source filename used for diagnostics and debugging. */\n\tfilename: string;\n\t/** Full component source that was scanned. */\n\tsource: string;\n\t/** Complete root-level script regions in source order. */\n\tscripts: readonly ScriptRegion[];\n\t/** Complete root-level style tag ranges in source order. */\n\tstyles: readonly SourceRange[];\n\t/** HTML comment ranges in source order. */\n\tcomments: readonly SourceRange[];\n\t/** Merged ranges where markup brace scanning should not enter. */\n\texcluded_ranges: readonly SourceRange[];\n\t/** Markup brace expressions outside excluded ranges. */\n\tmarkup_expressions: readonly MarkupBraceExpression[];\n\t/** Lexical binding names introduced by markup blocks and directives. */\n\tmarkup_binding_names: readonly string[];\n\t/** Bare `{const ...}` tags outside excluded ranges. */\n\tbare_const_tags: readonly BareConstDeclarationTag[];\n\t/** First non-module script, if present. */\n\tinstance_script?: ScriptRegion | undefined;\n\t/** First non-module script with SER's `effect` attribute, if present. */\n\teffect_script?: ScriptRegion | undefined;\n}\n\ninterface SourceRegions {\n\tscripts: ScriptRegion[];\n\tstyles: SourceRange[];\n\tcomments: SourceRange[];\n\topaque_ranges: SourceRange[];\n\tattribute_names: ReadonlyMap<number, string>;\n\tmarkup_binding_names: ReadonlySet<string>;\n}\n\ninterface ParserDiagnostic {\n\tcode?: unknown;\n\tposition?: unknown;\n}\n\ninterface ParsedSourceFile extends ts.SourceFile {\n\tparseDiagnostics?: readonly ts.Diagnostic[];\n}\n\ntype MarkupBindingPattern = NonNullable<AST.EachBlock[\"context\"]>;\n\ninterface LocatedRawTag extends SourceRange {\n\tname: \"script\" | \"style\";\n\tcontent_start: number;\n\tcontent_end: number;\n}\n\nlet latest_scan: SvelteEffectSourceScan | undefined;\n\nfunction parse_svelte_source(source: string): AST.Root | undefined {\n\tlet parse_source = source;\n\tconst yield_count = source.match(/\\byield\\s*\\*/g)?.length ?? 0;\n\tconst max_attempts = yield_count + 1;\n\n\tfor (let attempt = 0; attempt < max_attempts; attempt += 1) {\n\t\ttry {\n\t\t\treturn parse(parse_source, { modern: true, loose: true });\n\t\t} catch (error) {\n\t\t\tconst normalized = normalize_parser_error(parse_source, error);\n\n\t\t\tif (!normalized || normalized === parse_source) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tparse_source = normalized;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction normalize_parser_error(source: string, error: unknown): string | undefined {\n\tif (!is_parser_diagnostic(error) || !is_parser_position(error.position)) {\n\t\treturn undefined;\n\t}\n\n\tconst [start, end] = error.position;\n\n\tif (error.code === \"js_parse_error\") {\n\t\tconst match = source.slice(start).match(/^yield\\s*\\*/);\n\n\t\tif (!match) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn replace_range(source, start, start + match[0].length, blank_source(match[0]));\n\t}\n\n\tif (error.code !== \"render_tag_invalid_expression\") {\n\t\treturn undefined;\n\t}\n\n\tconst expression = source.slice(start, end);\n\tconst yield_index = expression.search(/\\byield\\s*\\*/);\n\n\tif (yield_index === -1) {\n\t\treturn undefined;\n\t}\n\n\treturn normalize_render_yield_expressions(source);\n}\n\nfunction normalize_render_yield_expressions(source: string): string {\n\tconst replacements: Array<SourceRange & { text: string }> = [];\n\tlet cursor = 0;\n\n\twhile (cursor < source.length) {\n\t\tconst open = source.indexOf(\"{@render\", cursor);\n\n\t\tif (open === -1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst close = find_closing_brace(source, open);\n\n\t\tif (close === -1) {\n\t\t\tcursor = open + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst tag = source.slice(open + 1, close);\n\t\tconst prefix = tag.match(/^@render\\b\\s*/)?.[0];\n\t\tconst expression_start = prefix ? open + 1 + prefix.length : -1;\n\t\tconst expression = expression_start === -1 ? \"\" : source.slice(expression_start, close);\n\n\t\tif (/\\byield\\s*\\*/.test(expression)) {\n\t\t\tconst blanked = blank_source(expression);\n\n\t\t\treplacements.push({\n\t\t\t\tstart: expression_start,\n\t\t\t\tend: close,\n\t\t\t\ttext: \"x()\" + blanked.slice(3),\n\t\t\t});\n\t\t}\n\n\t\tcursor = close + 1;\n\t}\n\n\tif (replacements.length === 0) {\n\t\treturn source;\n\t}\n\n\tconst parts: string[] = [];\n\tlet source_cursor = 0;\n\n\tfor (const replacement of replacements) {\n\t\tparts.push(source.slice(source_cursor, replacement.start), replacement.text);\n\t\tsource_cursor = replacement.end;\n\t}\n\n\tparts.push(source.slice(source_cursor));\n\n\treturn parts.join(\"\");\n}\n\nfunction is_parser_diagnostic(error: unknown): error is ParserDiagnostic {\n\treturn typeof error === \"object\" && error !== null;\n}\n\nfunction is_parser_position(position: unknown): position is [number, number] {\n\treturn (\n\t\tArray.isArray(position) &&\n\t\tposition.length === 2 &&\n\t\tposition.every((offset) => typeof offset === \"number\")\n\t);\n}\n\nfunction replace_range(source: string, start: number, end: number, replacement: string): string {\n\treturn source.slice(0, start) + replacement + source.slice(end);\n}\n\nfunction blank_source(source: string): string {\n\treturn source.replace(/[^\\r\\n]/g, \" \");\n}\n\nexport function scan_svelte_effect_source(\n\tsource: string,\n\tfilename = \"unknown.svelte\",\n): SvelteEffectSourceScan {\n\tif (latest_scan?.source === source && latest_scan.filename === filename) {\n\t\treturn latest_scan;\n\t}\n\n\tconst scan = scan_svelte_effect_source_uncached(source, filename);\n\n\tlatest_scan = scan;\n\n\treturn scan;\n}\n\nfunction scan_svelte_effect_source_uncached(\n\tsource: string,\n\tfilename: string,\n): SvelteEffectSourceScan {\n\tconst fast_regions = collect_fast_source_regions(source);\n\n\tif (fast_regions) {\n\t\treturn make_source_scan(source, filename, fast_regions);\n\t}\n\n\tconst parse_source = make_svelte_parse_shadow(source);\n\tconst ast = parse_svelte_source(parse_source);\n\n\tif (!ast) {\n\t\treturn make_opaque_scan(source, filename);\n\t}\n\n\tconst regions = collect_source_regions(source, ast);\n\n\treturn make_source_scan(source, filename, regions);\n}\n\nfunction make_source_scan(\n\tsource: string,\n\tfilename: string,\n\tregions: SourceRegions,\n): SvelteEffectSourceScan {\n\tconst scripts = regions.scripts;\n\tconst styles = regions.styles;\n\tconst comments = regions.comments;\n\tconst excluded_ranges = merge_ranges([...comments, ...regions.opaque_ranges]);\n\tconst markup_expressions = collect_scanned_markup_expressions(\n\t\tsource,\n\t\texcluded_ranges,\n\t\tregions.attribute_names,\n\t);\n\tconst bare_const_tags = markup_expressions.flatMap((expression) =>\n\t\tmake_bare_const_tag(expression),\n\t);\n\tconst instance_script = scripts.find((script) => !script.is_module);\n\tconst effect_script = scripts.find((script) => !script.is_module && script.has_effect);\n\n\treturn {\n\t\tfilename,\n\t\tsource,\n\t\tscripts,\n\t\tstyles,\n\t\tcomments,\n\t\texcluded_ranges,\n\t\tmarkup_expressions,\n\t\tmarkup_binding_names: [...regions.markup_binding_names],\n\t\tbare_const_tags,\n\t\tinstance_script,\n\t\teffect_script,\n\t};\n}\n\nfunction make_opaque_scan(source: string, filename: string): SvelteEffectSourceScan {\n\treturn {\n\t\tfilename,\n\t\tsource,\n\t\tscripts: [],\n\t\tstyles: [],\n\t\tcomments: [],\n\t\texcluded_ranges: source.length === 0 ? [] : [{ start: 0, end: source.length }],\n\t\tmarkup_expressions: [],\n\t\tmarkup_binding_names: [],\n\t\tbare_const_tags: [],\n\t\tinstance_script: undefined,\n\t\teffect_script: undefined,\n\t};\n}\n\n/** Reuses scan offsets after bare-const normalization inserts characters. */\nexport function shift_scan_after_at_insertions(\n\tscan: SvelteEffectSourceScan,\n\tnormalized_source: string,\n\tinsert_positions: readonly number[],\n): SvelteEffectSourceScan {\n\tconst inserts = [...insert_positions].sort((left, right) => left - right);\n\tconst shift = (offset: number) => offset + count_insertions_at_or_before(inserts, offset);\n\n\tconst shift_range = <T extends SourceRange>(range: T): T => ({\n\t\t...range,\n\t\tstart: shift(range.start),\n\t\tend: shift(range.end),\n\t});\n\n\tconst shift_attribute = (attribute: SourceAttribute): SourceAttribute => ({\n\t\t...shift_range(attribute),\n\t\tname: attribute.name,\n\t\tname_start: shift(attribute.name_start),\n\t\tname_end: shift(attribute.name_end),\n\t\tvalue: attribute.value,\n\t});\n\n\tconst shift_script = (script: ScriptRegion): ScriptRegion => {\n\t\tconst shifted = {\n\t\t\t...shift_range(script),\n\t\t\topening_tag_start: shift(script.opening_tag_start),\n\t\t\topening_tag_end: shift(script.opening_tag_end),\n\t\t\ttag_name_end: shift(script.tag_name_end),\n\t\t\tcontent_start: shift(script.content_start),\n\t\t\tcontent_end: shift(script.content_end),\n\t\t\tclosing_tag_start: shift(script.closing_tag_start),\n\t\t\tclosing_tag_end: shift(script.closing_tag_end),\n\t\t\tattributes_text: normalized_source.slice(\n\t\t\t\tshift(script.tag_name_end),\n\t\t\t\tshift(script.opening_tag_end) - 1,\n\t\t\t),\n\t\t\tattributes: script.attributes.map(shift_attribute),\n\t\t\ttext: normalized_source.slice(shift(script.content_start), shift(script.content_end)),\n\t\t\tis_module: script.is_module,\n\t\t\thas_lang: script.has_lang,\n\t\t\tlang: script.lang,\n\t\t\tis_typescript: script.is_typescript,\n\t\t\thas_effect: script.has_effect,\n\t\t\teffect_attribute: script.effect_attribute\n\t\t\t\t? shift_range(script.effect_attribute)\n\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn shifted;\n\t};\n\n\tconst shift_expression = (expression: MarkupBraceExpression): MarkupBraceExpression => {\n\t\tconst open = shift(expression.open);\n\t\tconst close = shift(expression.close);\n\t\tconst inner_start = shift(expression.inner_start);\n\t\tconst inner_end = shift(expression.inner_end);\n\t\tconst inner = normalized_source.slice(inner_start, inner_end);\n\n\t\treturn {\n\t\t\topen,\n\t\t\tclose,\n\t\t\tinner_start,\n\t\t\tinner_end,\n\t\t\tinner,\n\t\t\texpression_text: inner.trim(),\n\t\t\tattribute_name: expression.attribute_name,\n\t\t};\n\t};\n\n\tconst scripts = scan.scripts.map(shift_script);\n\n\treturn {\n\t\tfilename: scan.filename,\n\t\tsource: normalized_source,\n\t\tscripts,\n\t\tstyles: scan.styles.map(shift_range),\n\t\tcomments: scan.comments.map(shift_range),\n\t\texcluded_ranges: scan.excluded_ranges.map(shift_range),\n\t\tmarkup_expressions: scan.markup_expressions.map(shift_expression),\n\t\tmarkup_binding_names: scan.markup_binding_names,\n\t\tbare_const_tags: [],\n\t\tinstance_script: scan.instance_script ? shift_script(scan.instance_script) : undefined,\n\t\teffect_script: scan.effect_script ? shift_script(scan.effect_script) : undefined,\n\t};\n}\n\nfunction count_insertions_at_or_before(\n\tinsert_positions: readonly number[],\n\toffset: number,\n): number {\n\tlet low = 0;\n\tlet high = insert_positions.length;\n\n\twhile (low < high) {\n\t\tconst middle = Math.floor((low + high) / 2);\n\n\t\tif ((insert_positions[middle] ?? Infinity) <= offset) {\n\t\t\tlow = middle + 1;\n\t\t} else {\n\t\t\thigh = middle;\n\t\t}\n\t}\n\n\treturn low;\n}\n\nfunction collect_fast_source_regions(source: string): SourceRegions | undefined {\n\tconst element_stack: string[] = [];\n\tconst scripts: ScriptRegion[] = [];\n\tconst styles: SourceRange[] = [];\n\tconst comments: SourceRange[] = [];\n\tconst opaque_ranges: SourceRange[] = [];\n\tlet optional_element_count = 0;\n\tlet cursor = 0;\n\n\twhile (cursor < source.length) {\n\t\tif (source.startsWith(\"<!--\", cursor)) {\n\t\t\tconst close = source.indexOf(\"-->\", cursor + 4);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst comment = { start: cursor, end: close + 3 };\n\n\t\t\tcomments.push(comment);\n\t\t\tcursor = comment.end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"&\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (char === \"{\") {\n\t\t\tconst close = find_fast_closing_brace(source, cursor);\n\n\t\t\tif (close === -1 || /^\\s*[#/:@]/.test(source.slice(cursor + 1, close))) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char !== \"<\") {\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst raw_name = read_raw_opening_name(source, cursor);\n\n\t\tif (raw_name) {\n\t\t\tif (element_stack.length > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst raw_tag = locate_raw_tag(source, cursor, raw_name);\n\n\t\t\tif (!raw_tag || !is_fast_raw_opening(source, raw_tag)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (raw_name === \"script\") {\n\t\t\t\tif (scripts.length > 0) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tscripts.push(make_fast_script_region(source, raw_tag));\n\t\t\t} else {\n\t\t\t\tif (styles.length > 0) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tstyles.push({ start: raw_tag.start, end: raw_tag.end });\n\t\t\t}\n\n\t\t\topaque_ranges.push({ start: raw_tag.start, end: raw_tag.end });\n\t\t\tcursor = raw_tag.end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst tag = read_fast_ordinary_tag(source, cursor);\n\n\t\tif (!tag) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (tag.is_closing) {\n\t\t\tif (fast_void_tag_names.has(tag.name) || element_stack.at(-1) !== tag.name) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\telement_stack.pop();\n\n\t\t\tif (fast_optional_end_tag_names.has(tag.name)) {\n\t\t\t\toptional_element_count -= 1;\n\t\t\t}\n\t\t} else if (!tag.is_self_closing && !fast_void_tag_names.has(tag.name)) {\n\t\t\tif (optional_element_count > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\telement_stack.push(tag.name);\n\n\t\t\tif (fast_optional_end_tag_names.has(tag.name)) {\n\t\t\t\toptional_element_count += 1;\n\t\t\t}\n\t\t}\n\n\t\tcursor = tag.end;\n\t}\n\n\tif (element_stack.length > 0) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tscripts,\n\t\tstyles,\n\t\tcomments,\n\t\topaque_ranges,\n\t\tattribute_names: new Map(),\n\t\tmarkup_binding_names: new Set(),\n\t};\n}\n\nconst fast_void_tag_names = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nconst fast_optional_end_tag_names = new Set([\n\t\"colgroup\",\n\t\"dd\",\n\t\"dt\",\n\t\"li\",\n\t\"optgroup\",\n\t\"option\",\n\t\"p\",\n\t\"rp\",\n\t\"rt\",\n\t\"tbody\",\n\t\"td\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"tr\",\n]);\n\nfunction read_fast_ordinary_tag(\n\tsource: string,\n\tstart: number,\n): { name: string; end: number; is_closing: boolean; is_self_closing: boolean } | undefined {\n\tlet cursor = start + 1;\n\tconst is_closing = source[cursor] === \"/\";\n\n\tif (is_closing) {\n\t\tcursor += 1;\n\t}\n\n\tconst name_start = cursor;\n\n\tif (!/[a-z]/.test(source[cursor] ?? \"\")) {\n\t\treturn undefined;\n\t}\n\n\twhile (/[a-z0-9-]/.test(source[cursor] ?? \"\")) {\n\t\tcursor += 1;\n\t}\n\n\tconst name = source.slice(name_start, cursor);\n\n\twhile (/\\s/.test(source[cursor] ?? \"\")) {\n\t\tcursor += 1;\n\t}\n\n\tconst is_self_closing = !is_closing && source[cursor] === \"/\";\n\n\tif (is_self_closing) {\n\t\tcursor += 1;\n\t}\n\n\tif (source[cursor] !== \">\") {\n\t\treturn undefined;\n\t}\n\n\treturn { name, end: cursor + 1, is_closing, is_self_closing };\n}\n\nfunction find_fast_closing_brace(source: string, open: number): number {\n\tlet depth = 1;\n\tlet cursor = open + 1;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tconst close = skip_quoted_string(source, cursor, char);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"`\" || char === \"/\") {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (char === \"{\") {\n\t\t\tdepth += 1;\n\t\t} else if (char === \"}\") {\n\t\t\tdepth -= 1;\n\n\t\t\tif (depth === 0) {\n\t\t\t\treturn cursor;\n\t\t\t}\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction read_raw_opening_name(source: string, start: number): \"script\" | \"style\" | undefined {\n\tfor (const name of [\"script\", \"style\"] as const) {\n\t\tconst name_end = start + name.length + 1;\n\n\t\tif (\n\t\t\tsource.startsWith(`<${name}`, start) &&\n\t\t\t(source[name_end] === \">\" || /\\s/.test(source[name_end] ?? \"\"))\n\t\t) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction locate_raw_tag(\n\tsource: string,\n\tstart: number,\n\tname: \"script\" | \"style\",\n): LocatedRawTag | undefined {\n\tconst content_start = find_static_opening_tag_end(source, start, name);\n\n\tif (content_start === -1) {\n\t\treturn undefined;\n\t}\n\n\tconst opening_tag = source.slice(start, content_start);\n\tconst is_preprocessor_style = name === \"style\" && has_style_lang_attribute(opening_tag);\n\tconst parsed_style_end =\n\t\tname === \"style\"\n\t\t\t? find_style_closing_tag(source, content_start, is_preprocessor_style)\n\t\t\t: undefined;\n\tconst content_end =\n\t\tname === \"script\"\n\t\t\t? find_raw_closing_tag(source, content_start, name)\n\t\t\t: (parsed_style_end ??\n\t\t\t\t(is_preprocessor_style\n\t\t\t\t\t? find_raw_closing_tag(source, content_start, name)\n\t\t\t\t\t: undefined));\n\n\tif (!content_end) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tname,\n\t\tstart,\n\t\tend: content_end.end,\n\t\tcontent_start,\n\t\tcontent_end: content_end.start,\n\t};\n}\n\nfunction has_style_lang_attribute(opening_tag: string): boolean {\n\ttry {\n\t\tconst ast = parse(`${opening_tag}</style>`, { modern: true, loose: true });\n\n\t\treturn (\n\t\t\tast.css?.attributes.some((attribute) => attribute.name.toLowerCase() === \"lang\") ??\n\t\t\tfalse\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction find_raw_closing_tag(\n\tsource: string,\n\tstart: number,\n\tname: \"script\" | \"style\",\n): SourceRange | undefined {\n\tlet cursor = start;\n\n\twhile (cursor < source.length) {\n\t\tconst closing_start = source.indexOf(`</${name}`, cursor);\n\n\t\tif (closing_start === -1) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst closing_end = find_closing_tag_end_at(source, closing_start, name, false);\n\n\t\tif (closing_end !== undefined) {\n\t\t\treturn { start: closing_start, end: closing_end };\n\t\t}\n\n\t\tcursor = closing_start + name.length + 2;\n\t}\n\n\treturn undefined;\n}\n\nfunction find_static_opening_tag_end(\n\tsource: string,\n\tstart: number,\n\tname: \"script\" | \"style\",\n): number {\n\tlet cursor = start + name.length + 1;\n\tlet quote: string | undefined;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (quote) {\n\t\t\tif (char === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '\"' || char === \"'\") {\n\t\t\tquote = char;\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tchar === \"{\" ||\n\t\t\tchar === \"}\" ||\n\t\t\tchar === \"<\" ||\n\t\t\tsource.startsWith(\"/*\", cursor) ||\n\t\t\tsource.startsWith(\"//\", cursor)\n\t\t) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (char === \">\") {\n\t\t\treturn source.slice(start, cursor).trimEnd().endsWith(\"/\") ? -1 : cursor + 1;\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction find_style_closing_tag(\n\tsource: string,\n\tstart: number,\n\tskip_line_comments: boolean,\n): SourceRange | undefined {\n\tlet cursor = start;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\t\tconst identifier_end = skip_line_comments\n\t\t\t? find_css_identifier_end(source, cursor)\n\t\t\t: undefined;\n\n\t\tif (identifier_end !== undefined) {\n\t\t\tconst url_end = skip_css_url(source, cursor, identifier_end);\n\n\t\t\tif (url_end === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = url_end === undefined ? identifier_end : url_end + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '\"' || char === \"'\") {\n\t\t\tconst close = skip_quoted_string(source, cursor, char);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (source.startsWith(\"/*\", cursor)) {\n\t\t\tconst close = skip_block_comment(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (skip_line_comments && source.startsWith(\"//\", cursor)) {\n\t\t\tcursor = skip_line_comment(source, cursor) + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst closing_end = find_closing_tag_end_at(source, cursor, \"style\", false);\n\n\t\tif (closing_end !== undefined) {\n\t\t\treturn { start: cursor, end: closing_end };\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn undefined;\n}\n\nfunction find_css_identifier_end(source: string, start: number): number | undefined {\n\tconst first = source[start];\n\n\tif (!is_css_identifier_start(first)) {\n\t\treturn undefined;\n\t}\n\n\tlet cursor = start;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (is_css_identifier_character(char)) {\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tcursor = skip_css_escape(source, cursor);\n\t\t\tcontinue;\n\t\t}\n\n\t\tbreak;\n\t}\n\n\treturn cursor;\n}\n\nfunction skip_css_url(source: string, start: number, identifier_end: number): number | undefined {\n\tif (source.slice(start, identifier_end).toLowerCase() !== \"url\") {\n\t\treturn undefined;\n\t}\n\n\tlet cursor = skip_css_whitespace(source, identifier_end);\n\n\tif (source[cursor] !== \"(\") {\n\t\treturn undefined;\n\t}\n\n\tcursor = skip_css_whitespace(source, cursor + 1);\n\n\tconst quote = source[cursor];\n\n\tif (quote === '\"' || quote === \"'\") {\n\t\tconst close = skip_quoted_string(source, cursor, quote);\n\n\t\tif (close === -1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tcursor = skip_css_url_trivia(source, close + 1);\n\n\t\tif (cursor === -1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn source[cursor] === \")\" ? cursor : -1;\n\t}\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"\\\\\") {\n\t\t\tcursor = skip_css_escape(source, cursor);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \")\") {\n\t\t\treturn cursor;\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction skip_css_whitespace(source: string, start: number): number {\n\tlet cursor = start;\n\n\twhile (cursor < source.length && /[\\t\\n\\f\\r ]/.test(source[cursor] ?? \"\")) {\n\t\tcursor += 1;\n\t}\n\n\treturn cursor;\n}\n\nfunction skip_css_url_trivia(source: string, start: number): number {\n\tlet cursor = start;\n\n\twhile (cursor < source.length) {\n\t\tcursor = skip_css_whitespace(source, cursor);\n\n\t\tif (!source.startsWith(\"/*\", cursor)) {\n\t\t\treturn cursor;\n\t\t}\n\n\t\tconst close = skip_block_comment(source, cursor);\n\n\t\tif (close === -1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tcursor = close + 1;\n\t}\n\n\treturn cursor;\n}\n\nfunction skip_css_escape(source: string, start: number): number {\n\treturn Math.min(start + 2, source.length);\n}\n\nfunction is_css_identifier_start(char: string | undefined): boolean {\n\treturn (\n\t\tchar !== undefined &&\n\t\t(/[A-Za-z_-]/.test(char) || char === \"\\\\\" || char.charCodeAt(0) >= 0x80)\n\t);\n}\n\nfunction is_css_identifier_character(char: string | undefined): boolean {\n\treturn char !== undefined && (/[A-Za-z0-9_-]/.test(char) || char.charCodeAt(0) >= 0x80);\n}\n\nfunction is_fast_raw_opening(source: string, raw_tag: LocatedRawTag): boolean {\n\tconst opening = source.slice(raw_tag.start, raw_tag.content_start);\n\n\tif (raw_tag.name === \"script\") {\n\t\treturn opening === \"<script>\";\n\t}\n\n\treturn /^<style(?:\\s+lang=(?:\"[A-Za-z0-9_-]+\"|'[A-Za-z0-9_-]+'|[A-Za-z0-9_-]+))?\\s*>$/.test(\n\t\topening,\n\t);\n}\n\nfunction make_fast_script_region(source: string, raw_tag: LocatedRawTag): ScriptRegion {\n\treturn {\n\t\tstart: raw_tag.start,\n\t\tend: raw_tag.end,\n\t\topening_tag_start: raw_tag.start,\n\t\topening_tag_end: raw_tag.content_start,\n\t\ttag_name_end: raw_tag.start + \"<script\".length,\n\t\tcontent_start: raw_tag.content_start,\n\t\tcontent_end: raw_tag.content_end,\n\t\tclosing_tag_start: raw_tag.content_end,\n\t\tclosing_tag_end: raw_tag.end,\n\t\tattributes_text: \"\",\n\t\tattributes: [],\n\t\ttext: source.slice(raw_tag.content_start, raw_tag.content_end),\n\t\tis_module: false,\n\t\thas_lang: false,\n\t\tlang: undefined,\n\t\tis_typescript: false,\n\t\thas_effect: false,\n\t\teffect_attribute: undefined,\n\t};\n}\n\nfunction make_svelte_parse_shadow(source: string): string {\n\tconst raw_tags = collect_shadow_raw_tags(source);\n\n\tif (!raw_tags) {\n\t\treturn source;\n\t}\n\n\tconst parts: string[] = [];\n\tlet cursor = 0;\n\n\tfor (const raw_tag of raw_tags) {\n\t\tparts.push(source.slice(cursor, raw_tag.content_start));\n\t\tparts.push(blank_source(source.slice(raw_tag.content_start, raw_tag.content_end)));\n\t\tcursor = raw_tag.content_end;\n\t}\n\n\tparts.push(source.slice(cursor));\n\n\treturn normalize_markup_yield_operators(parts.join(\"\"));\n}\n\nfunction normalize_markup_yield_operators(source: string): string {\n\tconst replacements: Array<SourceRange & { text: string }> = [];\n\tlet cursor = 0;\n\n\twhile (cursor < source.length) {\n\t\tconst open = source.indexOf(\"{\", cursor);\n\n\t\tif (open === -1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst close = find_closing_brace(source, open);\n\n\t\tif (close === -1) {\n\t\t\tcursor = open + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst inner = source.slice(open + 1, close);\n\t\tconst trimmed = inner.trimStart();\n\n\t\tif (!/\\byield\\s*\\*/.test(inner) || /^@debug\\b/.test(trimmed)) {\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst render_prefix = inner.match(/^(\\s*@render\\b\\s*)/)?.[0];\n\t\tconst text = render_prefix\n\t\t\t? render_prefix + \"x()\" + blank_source(inner.slice(render_prefix.length)).slice(3)\n\t\t\t: inner.replace(/\\byield\\s*\\*/g, blank_source);\n\n\t\treplacements.push({ start: open + 1, end: close, text });\n\t\tcursor = close + 1;\n\t}\n\n\tif (replacements.length === 0) {\n\t\treturn source;\n\t}\n\n\tconst parts: string[] = [];\n\tlet source_cursor = 0;\n\n\tfor (const replacement of replacements) {\n\t\tparts.push(source.slice(source_cursor, replacement.start), replacement.text);\n\t\tsource_cursor = replacement.end;\n\t}\n\n\tparts.push(source.slice(source_cursor));\n\n\treturn parts.join(\"\");\n}\n\nfunction collect_shadow_raw_tags(source: string): LocatedRawTag[] | undefined {\n\tconst raw_tags: LocatedRawTag[] = [];\n\tlet cursor = 0;\n\n\twhile (cursor < source.length) {\n\t\tif (source.startsWith(\"<!--\", cursor)) {\n\t\t\tconst close = source.indexOf(\"-->\", cursor + 4);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 3;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"{\") {\n\t\t\tconst close = find_closing_brace(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char !== \"<\") {\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst rcdata_name = read_rcdata_opening_name(source, cursor);\n\n\t\tif (rcdata_name) {\n\t\t\tconst content_start = find_markup_tag_end(source, cursor);\n\t\t\tconst closing_tag =\n\t\t\t\tcontent_start === -1\n\t\t\t\t\t? undefined\n\t\t\t\t\t: find_rcdata_closing_tag(source, content_start, rcdata_name);\n\n\t\t\tif (!closing_tag) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = closing_tag.end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst raw_name = read_raw_opening_name(source, cursor);\n\n\t\tif (raw_name) {\n\t\t\tconst raw_tag = locate_raw_tag(source, cursor, raw_name);\n\n\t\t\tif (!raw_tag) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\traw_tags.push(raw_tag);\n\t\t\tcursor = raw_tag.end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst tag_end = find_markup_tag_end(source, cursor);\n\n\t\tif (tag_end === -1) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tcursor = tag_end;\n\t}\n\n\treturn raw_tags;\n}\n\nfunction read_rcdata_opening_name(source: string, start: number): \"textarea\" | \"title\" | undefined {\n\tfor (const name of [\"textarea\", \"title\"] as const) {\n\t\tconst name_end = start + name.length + 1;\n\t\tconst opening_name = source.slice(start, name_end).toLowerCase();\n\n\t\tif (\n\t\t\topening_name === `<${name}` &&\n\t\t\t(source[name_end] === \">\" || /\\s/.test(source[name_end] ?? \"\"))\n\t\t) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction find_rcdata_closing_tag(\n\tsource: string,\n\tstart: number,\n\tname: \"textarea\" | \"title\",\n): SourceRange | undefined {\n\tlet cursor = start;\n\n\twhile (cursor < source.length) {\n\t\tif (source[cursor] === \"{\") {\n\t\t\tconst close = find_closing_brace(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst closing_end = find_closing_tag_end_at(source, cursor, name, true);\n\n\t\tif (closing_end !== undefined) {\n\t\t\treturn { start: cursor, end: closing_end };\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn undefined;\n}\n\nfunction find_closing_tag_end_at(\n\tsource: string,\n\tstart: number,\n\tname: string,\n\tcase_insensitive: boolean,\n): number | undefined {\n\tif (source[start] !== \"<\") {\n\t\treturn undefined;\n\t}\n\n\tconst prefix = source.slice(start, start + name.length + 2);\n\tconst expected = `</${name}`;\n\tconst matches = case_insensitive ? prefix.toLowerCase() === expected : prefix === expected;\n\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet cursor = start + expected.length;\n\n\twhile (/\\s/.test(source[cursor] ?? \"\")) {\n\t\tcursor += 1;\n\t}\n\n\treturn source[cursor] === \">\" ? cursor + 1 : undefined;\n}\n\nfunction find_markup_tag_end(source: string, start: number): number {\n\tlet cursor = start + 1;\n\tlet quote: string | undefined;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (quote) {\n\t\t\tif (char === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '\"' || char === \"'\") {\n\t\t\tquote = char;\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"{\") {\n\t\t\tconst close = find_closing_brace(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (source.startsWith(\"/*\", cursor)) {\n\t\t\tconst close = skip_block_comment(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (source.startsWith(\"//\", cursor)) {\n\t\t\tcursor = skip_line_comment(source, cursor) + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \">\") {\n\t\t\treturn cursor + 1;\n\t\t}\n\n\t\tif (char === \"<\") {\n\t\t\treturn -1;\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction collect_source_regions(source: string, ast: AST.Root): SourceRegions {\n\tconst scripts = [ast.module, ast.instance]\n\t\t.filter((script): script is AST.Script => script != null)\n\t\t.map((script) => make_ast_script_region(source, script))\n\t\t.sort((left, right) => left.start - right.start);\n\tconst styles = ast.css ? [{ start: ast.css.start, end: ast.css.end }] : [];\n\tconst comments: SourceRange[] = [];\n\tconst opaque_ranges: SourceRange[] = [\n\t\t...scripts.map(({ start, end }) => ({ start, end })),\n\t\t...styles,\n\t\t...ast.comments.map(({ start, end }) => ({ start, end })),\n\t];\n\tconst attribute_names = new Map<number, string>();\n\tconst markup_binding_names = new Set<string>();\n\n\tcollect_fragment_regions(\n\t\tsource,\n\t\tast.fragment,\n\t\tcomments,\n\t\topaque_ranges,\n\t\tattribute_names,\n\t\tmarkup_binding_names,\n\t);\n\n\treturn {\n\t\tscripts,\n\t\tstyles,\n\t\tcomments,\n\t\topaque_ranges,\n\t\tattribute_names,\n\t\tmarkup_binding_names,\n\t};\n}\n\nfunction collect_fragment_regions(\n\tsource: string,\n\tfragment: AST.Fragment,\n\tcomments: SourceRange[],\n\topaque_ranges: SourceRange[],\n\tattribute_names: Map<number, string>,\n\tmarkup_binding_names: Set<string>,\n): void {\n\tfor (const node of fragment.nodes) {\n\t\tif (node.type === \"Comment\") {\n\t\t\tcomments.push({ start: node.start, end: node.end });\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node.type === \"RegularElement\" && (node.name === \"script\" || node.name === \"style\")) {\n\t\t\topaque_ranges.push({ start: node.start, end: node.end });\n\t\t\tcontinue;\n\t\t}\n\n\t\tcollect_node_markup_binding_names(node, markup_binding_names);\n\t\tcollect_node_attribute_names(source, node, attribute_names, markup_binding_names);\n\t\tcollect_node_fragments(\n\t\t\tsource,\n\t\t\tnode,\n\t\t\tcomments,\n\t\t\topaque_ranges,\n\t\t\tattribute_names,\n\t\t\tmarkup_binding_names,\n\t\t);\n\t}\n}\n\nfunction collect_node_markup_binding_names(\n\tnode: AST.Fragment[\"nodes\"][number],\n\tmarkup_binding_names: Set<string>,\n): void {\n\tswitch (node.type) {\n\t\tcase \"EachBlock\":\n\t\t\tif (node.context) {\n\t\t\t\tcollect_markup_binding_pattern_names(node.context, markup_binding_names);\n\t\t\t}\n\n\t\t\tif (node.index) {\n\t\t\t\tmarkup_binding_names.add(node.index);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"AwaitBlock\":\n\t\t\tfor (const pattern of [node.value, node.error]) {\n\t\t\t\tif (pattern) {\n\t\t\t\t\tcollect_markup_binding_pattern_names(pattern, markup_binding_names);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"SnippetBlock\":\n\t\t\tmarkup_binding_names.add(node.expression.name);\n\n\t\t\tfor (const parameter of node.parameters) {\n\t\t\t\tcollect_markup_binding_pattern_names(parameter, markup_binding_names);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"ConstTag\":\n\t\tcase \"DeclarationTag\":\n\t\t\tfor (const declaration of node.declaration.declarations) {\n\t\t\t\tcollect_markup_binding_pattern_names(declaration.id, markup_binding_names);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tdefault:\n\t\t\treturn;\n\t}\n}\n\nfunction collect_markup_binding_pattern_names(\n\tpattern: MarkupBindingPattern,\n\tmarkup_binding_names: Set<string>,\n): void {\n\tswitch (pattern.type) {\n\t\tcase \"Identifier\":\n\t\t\tmarkup_binding_names.add(pattern.name);\n\t\t\treturn;\n\n\t\tcase \"ArrayPattern\":\n\t\t\tfor (const element of pattern.elements) {\n\t\t\t\tif (element) {\n\t\t\t\t\tcollect_markup_binding_pattern_names(element, markup_binding_names);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"ObjectPattern\":\n\t\t\tfor (const property of pattern.properties) {\n\t\t\t\tconst value = property.type === \"RestElement\" ? property.argument : property.value;\n\n\t\t\t\tcollect_markup_binding_pattern_names(value, markup_binding_names);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"RestElement\":\n\t\t\tcollect_markup_binding_pattern_names(pattern.argument, markup_binding_names);\n\t\t\treturn;\n\n\t\tcase \"AssignmentPattern\":\n\t\t\tcollect_markup_binding_pattern_names(pattern.left, markup_binding_names);\n\t\t\treturn;\n\n\t\tcase \"MemberExpression\":\n\t\t\treturn;\n\t}\n}\n\nfunction collect_node_fragments(\n\tsource: string,\n\tnode: AST.Fragment[\"nodes\"][number],\n\tcomments: SourceRange[],\n\topaque_ranges: SourceRange[],\n\tattribute_names: Map<number, string>,\n\tmarkup_binding_names: Set<string>,\n): void {\n\tif (\"fragment\" in node) {\n\t\tcollect_fragment_regions(\n\t\t\tsource,\n\t\t\tnode.fragment,\n\t\t\tcomments,\n\t\t\topaque_ranges,\n\t\t\tattribute_names,\n\t\t\tmarkup_binding_names,\n\t\t);\n\t}\n\n\tswitch (node.type) {\n\t\tcase \"IfBlock\":\n\t\t\tcollect_fragment_regions(\n\t\t\t\tsource,\n\t\t\t\tnode.consequent,\n\t\t\t\tcomments,\n\t\t\t\topaque_ranges,\n\t\t\t\tattribute_names,\n\t\t\t\tmarkup_binding_names,\n\t\t\t);\n\n\t\t\tif (node.alternate) {\n\t\t\t\tcollect_fragment_regions(\n\t\t\t\t\tsource,\n\t\t\t\t\tnode.alternate,\n\t\t\t\t\tcomments,\n\t\t\t\t\topaque_ranges,\n\t\t\t\t\tattribute_names,\n\t\t\t\t\tmarkup_binding_names,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"EachBlock\":\n\t\t\tcollect_fragment_regions(\n\t\t\t\tsource,\n\t\t\t\tnode.body,\n\t\t\t\tcomments,\n\t\t\t\topaque_ranges,\n\t\t\t\tattribute_names,\n\t\t\t\tmarkup_binding_names,\n\t\t\t);\n\n\t\t\tif (node.fallback) {\n\t\t\t\tcollect_fragment_regions(\n\t\t\t\t\tsource,\n\t\t\t\t\tnode.fallback,\n\t\t\t\t\tcomments,\n\t\t\t\t\topaque_ranges,\n\t\t\t\t\tattribute_names,\n\t\t\t\t\tmarkup_binding_names,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"AwaitBlock\":\n\t\t\tfor (const branch of [node.pending, node.then, node.catch]) {\n\t\t\t\tif (branch) {\n\t\t\t\t\tcollect_fragment_regions(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tbranch,\n\t\t\t\t\t\tcomments,\n\t\t\t\t\t\topaque_ranges,\n\t\t\t\t\t\tattribute_names,\n\t\t\t\t\t\tmarkup_binding_names,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\n\t\tcase \"SnippetBlock\":\n\t\t\tcollect_fragment_regions(\n\t\t\t\tsource,\n\t\t\t\tnode.body,\n\t\t\t\tcomments,\n\t\t\t\topaque_ranges,\n\t\t\t\tattribute_names,\n\t\t\t\tmarkup_binding_names,\n\t\t\t);\n\t\t\treturn;\n\n\t\tdefault:\n\t\t\treturn;\n\t}\n}\n\nfunction collect_node_attribute_names(\n\tsource: string,\n\tnode: AST.Fragment[\"nodes\"][number],\n\tattribute_names: Map<number, string>,\n\tmarkup_binding_names: Set<string>,\n): void {\n\tif (!(\"attributes\" in node)) {\n\t\treturn;\n\t}\n\n\tfor (const attribute of node.attributes) {\n\t\tif (attribute.type === \"LetDirective\" && attribute.expression === null) {\n\t\t\tmarkup_binding_names.add(attribute.name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (attribute.type === \"Attribute\") {\n\t\t\tcollect_attribute_value_names(attribute.value, attribute.name, attribute_names);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (attribute.type === \"StyleDirective\") {\n\t\t\tconst source_name = read_source_attribute_name(source, attribute.start, attribute.end);\n\n\t\t\tif (source_name) {\n\t\t\t\tcollect_attribute_value_names(attribute.value, source_name, attribute_names);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!(\"expression\" in attribute) || !attribute.expression) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst open = source.indexOf(\"{\", attribute.start);\n\n\t\tif (open < attribute.start || open >= attribute.end) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst source_name = read_source_attribute_name(source, attribute.start, attribute.end);\n\n\t\tif (source_name && source.slice(attribute.start, open).includes(\"=\")) {\n\t\t\tattribute_names.set(open, source_name);\n\t\t}\n\t}\n}\n\nfunction collect_attribute_value_names(\n\tvalue: AST.Attribute[\"value\"],\n\tattribute_name: string,\n\tattribute_names: Map<number, string>,\n): void {\n\tif (value === true) {\n\t\treturn;\n\t}\n\n\tconst parts = Array.isArray(value) ? value : [value];\n\tconst expression = parts.length === 1 ? parts[0] : undefined;\n\n\tif (expression?.type !== \"ExpressionTag\") {\n\t\treturn;\n\t}\n\n\tattribute_names.set(expression.start, attribute_name);\n}\n\nfunction read_source_attribute_name(\n\tsource: string,\n\tstart: number,\n\tend: number,\n): string | undefined {\n\treturn source.slice(start, end).match(/^[^\\s=]+/)?.[0];\n}\n\nfunction make_ast_script_region(source: string, script: AST.Script): ScriptRegion {\n\tconst tag_name_end = script.start + \"<script\".length;\n\tconst attributes = collect_ast_script_attributes(source, script, tag_name_end);\n\tconst content_start = get_program_offset(script.content, \"start\");\n\tconst content_end = get_program_offset(script.content, \"end\");\n\tconst lang = get_attribute(attributes, \"lang\")?.value?.toLowerCase();\n\tconst effect_attribute = get_attribute(attributes, \"effect\");\n\n\treturn {\n\t\tstart: script.start,\n\t\tend: script.end,\n\t\topening_tag_start: script.start,\n\t\topening_tag_end: content_start,\n\t\ttag_name_end,\n\t\tcontent_start,\n\t\tcontent_end,\n\t\tclosing_tag_start: content_end,\n\t\tclosing_tag_end: script.end,\n\t\tattributes_text: source.slice(tag_name_end, content_start - 1),\n\t\tattributes,\n\t\ttext: source.slice(content_start, content_end),\n\t\tis_module: script.context === \"module\",\n\t\thas_lang: get_attribute(attributes, \"lang\") !== undefined,\n\t\tlang,\n\t\tis_typescript: lang === \"ts\" || lang === \"typescript\",\n\t\thas_effect: effect_attribute !== undefined,\n\t\teffect_attribute: effect_attribute\n\t\t\t? { start: effect_attribute.start, end: effect_attribute.end }\n\t\t\t: undefined,\n\t};\n}\n\nfunction get_program_offset(program: AST.Script[\"content\"], key: \"start\" | \"end\"): number {\n\tif (key === \"start\" && \"start\" in program && typeof program.start === \"number\") {\n\t\treturn program.start;\n\t}\n\n\tif (key === \"end\" && \"end\" in program && typeof program.end === \"number\") {\n\t\treturn program.end;\n\t}\n\n\tthrow new Error(`Svelte script content has no ${key} offset`);\n}\n\nfunction collect_ast_script_attributes(\n\tsource: string,\n\tscript: AST.Script,\n\ttag_name_end: number,\n): SourceAttribute[] {\n\tlet previous_end = tag_name_end;\n\n\treturn script.attributes.map((attribute) => {\n\t\tconst name_start = attribute.start;\n\t\tconst source_name = read_source_attribute_name(source, attribute.start, attribute.end);\n\t\tconst name_end = name_start + (source_name?.length ?? attribute.name.length);\n\t\tlet start = attribute.start;\n\n\t\twhile (start > previous_end && /\\s/.test(source[start - 1] ?? \"\")) {\n\t\t\tstart -= 1;\n\t\t}\n\n\t\tprevious_end = attribute.end;\n\n\t\treturn {\n\t\t\tname: source_name ?? attribute.name,\n\t\t\tstart,\n\t\t\tend: attribute.end,\n\t\t\tname_start,\n\t\t\tname_end,\n\t\t\tvalue: get_static_attribute_value(attribute.value),\n\t\t};\n\t});\n}\n\nfunction get_static_attribute_value(value: AST.Attribute[\"value\"]): string | undefined {\n\tif (value === true) {\n\t\treturn undefined;\n\t}\n\n\tconst parts = Array.isArray(value) ? value : [value];\n\n\tif (!parts.every((part): part is AST.Text => part.type === \"Text\")) {\n\t\treturn undefined;\n\t}\n\n\treturn parts.map((part) => part.data).join(\"\");\n}\n\nfunction collect_scanned_markup_expressions(\n\tsource: string,\n\texcluded_ranges: readonly SourceRange[],\n\tattribute_names: ReadonlyMap<number, string>,\n): MarkupBraceExpression[] {\n\tconst expressions: MarkupBraceExpression[] = [];\n\tlet cursor = 0;\n\n\twhile (cursor < source.length) {\n\t\tconst open = source.indexOf(\"{\", cursor);\n\n\t\tif (open === -1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst excluded_range = find_range_containing(excluded_ranges, open);\n\n\t\tif (excluded_range) {\n\t\t\tcursor = excluded_range.end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst close = find_closing_brace(source, open);\n\n\t\tif (close === -1) {\n\t\t\tcursor = open + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst inner_start = open + 1;\n\t\tconst inner_end = close;\n\t\tconst inner = source.slice(inner_start, inner_end);\n\n\t\texpressions.push({\n\t\t\topen,\n\t\t\tclose,\n\t\t\tinner_start,\n\t\t\tinner_end,\n\t\t\tinner,\n\t\t\texpression_text: inner.trim(),\n\t\t\tattribute_name: attribute_names.get(open),\n\t\t});\n\n\t\tcursor = close + 1;\n\t}\n\n\treturn expressions;\n}\n\nfunction find_range_containing(\n\tranges: readonly SourceRange[],\n\tposition: number,\n): SourceRange | undefined {\n\tlet low = 0;\n\tlet high = ranges.length - 1;\n\n\twhile (low <= high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tconst range = ranges[mid];\n\n\t\tif (position < range.start) {\n\t\t\thigh = mid - 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (position >= range.end) {\n\t\t\tlow = mid + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn range;\n\t}\n\n\treturn undefined;\n}\n\nfunction make_bare_const_tag(\n\texpression: MarkupBraceExpression,\n): readonly BareConstDeclarationTag[] {\n\tif (!/^(\\s*)const\\s/.test(expression.inner)) {\n\t\treturn [];\n\t}\n\n\treturn [\n\t\t{\n\t\t\topen: expression.open,\n\t\t\tinsert_position: expression.open + 1,\n\t\t\texpression,\n\t\t},\n\t];\n}\n\nfunction merge_ranges(ranges: SourceRange[]): SourceRange[] {\n\tconst sorted = [...ranges].sort((a, b) => a.start - b.start);\n\tconst merged: SourceRange[] = [];\n\n\tfor (const range of sorted) {\n\t\tconst previous = merged.at(-1);\n\n\t\tif (!previous || range.start > previous.end) {\n\t\t\tmerged.push({ ...range });\n\t\t\tcontinue;\n\t\t}\n\n\t\tprevious.end = Math.max(previous.end, range.end);\n\t}\n\n\treturn merged;\n}\n\nfunction get_attribute(\n\tattributes: readonly SourceAttribute[],\n\tname: string,\n): SourceAttribute | undefined {\n\tconst normalized_name = name.toLowerCase();\n\n\treturn attributes.find((attribute) => attribute.name.toLowerCase() === normalized_name);\n}\n\nfunction find_closing_brace(source: string, open: number): number {\n\tconst closing_directive = source\n\t\t.slice(open + 1)\n\t\t.match(/^\\s*\\/(?:if|each|await|key|snippet)\\s*}/);\n\n\tif (closing_directive) {\n\t\treturn open + 1 + closing_directive[0].lastIndexOf(\"}\");\n\t}\n\n\tlet depth = 1;\n\tlet cursor = open + 1;\n\n\twhile (cursor < source.length) {\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tconst close = skip_quoted_string(source, cursor, char);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"`\") {\n\t\t\tconst close = skip_template_literal(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"/\" && source[cursor + 1] === \"/\") {\n\t\t\tcursor = skip_line_comment(source, cursor) + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"/\" && source[cursor + 1] === \"*\") {\n\t\t\tconst close = skip_block_comment(source, cursor);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"/\") {\n\t\t\treturn find_closing_brace_with_typescript(source, open, cursor);\n\t\t}\n\n\t\tif (char === \"{\") {\n\t\t\tdepth += 1;\n\t\t} else if (char === \"}\") {\n\t\t\tdepth -= 1;\n\n\t\t\tif (depth === 0) {\n\t\t\t\treturn cursor;\n\t\t\t}\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction find_closing_brace_with_typescript(source: string, open: number, slash: number): number {\n\tlet candidate = source.indexOf(\"}\", slash + 1);\n\tlet candidate_index = 0;\n\tlet next_probe_index = 0;\n\tlet last_candidate = -1;\n\tlet last_probed_candidate = -1;\n\n\twhile (candidate !== -1) {\n\t\tlast_candidate = candidate;\n\n\t\tif (candidate_index === next_probe_index) {\n\t\t\tconst resolved = resolve_closing_brace_probe(source, open, slash, candidate);\n\n\t\t\tif (resolved !== -1) {\n\t\t\t\treturn resolved;\n\t\t\t}\n\n\t\t\tlast_probed_candidate = candidate;\n\t\t\tnext_probe_index = next_probe_index * 2 + 1;\n\t\t}\n\n\t\tcandidate_index += 1;\n\t\tcandidate = source.indexOf(\"}\", candidate + 1);\n\t}\n\n\tif (last_candidate !== last_probed_candidate) {\n\t\treturn resolve_closing_brace_probe(source, open, slash, last_candidate);\n\t}\n\n\treturn -1;\n}\n\nfunction resolve_closing_brace_probe(\n\tsource: string,\n\topen: number,\n\tslash: number,\n\tcandidate: number,\n): number {\n\tif (candidate === -1) {\n\t\treturn -1;\n\t}\n\n\tconst probe = parse_closing_brace_probe(source, open, candidate);\n\n\tif (probe.is_exact) {\n\t\treturn candidate;\n\t}\n\n\tif (probe.close < slash || probe.close >= candidate || source[probe.close] !== \"}\") {\n\t\treturn -1;\n\t}\n\n\tconst exact_probe = parse_closing_brace_probe(source, open, probe.close);\n\n\treturn exact_probe.is_exact ? probe.close : -1;\n}\n\nfunction parse_closing_brace_probe(\n\tsource: string,\n\topen: number,\n\tcandidate: number,\n): { close: number; is_exact: boolean } {\n\tconst generator_prefix = \"function* __SER__(){\";\n\tconst boundary_name = \"__SER___expression_boundary\";\n\tconst boundary_statement = `\\nconst ${boundary_name} = 0;`;\n\tconst tail = adapt_svelte_directive_tail(source.slice(open + 1, candidate + 1));\n\tconst source_file = ts.createSourceFile(\n\t\t\"svelte-expression.ts\",\n\t\tgenerator_prefix + tail + boundary_statement,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t) as ParsedSourceFile;\n\tconst declaration = source_file.statements[0];\n\tconst boundary = source_file.statements[1];\n\tconst boundary_declaration =\n\t\tboundary && ts.isVariableStatement(boundary)\n\t\t\t? boundary.declarationList.declarations[0]\n\t\t\t: undefined;\n\tconst has_boundary =\n\t\tboundary_declaration?.name !== undefined &&\n\t\tts.isIdentifier(boundary_declaration.name) &&\n\t\tboundary_declaration.name.text === boundary_name;\n\tconst has_unterminated_regex = source_file.parseDiagnostics?.some(\n\t\t(diagnostic) => diagnostic.code === 1161,\n\t);\n\n\tif (!declaration || !ts.isFunctionDeclaration(declaration) || !declaration.body) {\n\t\treturn { close: -1, is_exact: false };\n\t}\n\n\tconst close = open + declaration.body.end - generator_prefix.length;\n\n\treturn {\n\t\tclose,\n\t\tis_exact: close === candidate && has_boundary && !has_unterminated_regex,\n\t};\n}\n\nfunction adapt_svelte_directive_tail(tail: string): string {\n\tconst const_directive = tail.match(/^(\\s*)@(?=const\\b)/);\n\n\tif (const_directive) {\n\t\tconst at = const_directive[1].length;\n\n\t\treturn tail.slice(0, at) + \" \" + tail.slice(at + 1);\n\t}\n\n\tconst prefix = tail.match(\n\t\t/^\\s*(?:(?:#(?:if|each|await|key|snippet)|@(?:render|html|debug|attach)|:(?:else\\s+if|else|then|catch))\\b\\s*|\\.\\.\\.\\s*)/,\n\t)?.[0];\n\n\tif (!prefix) {\n\t\treturn tail;\n\t}\n\n\treturn blank_source(prefix) + tail.slice(prefix.length);\n}\n\nfunction skip_quoted_string(source: string, start: number, quote: string): number {\n\tfor (let cursor = start + 1; cursor < source.length; cursor += 1) {\n\t\tif (source[cursor] === \"\\\\\") {\n\t\t\tcursor += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (source[cursor] === quote) {\n\t\t\treturn cursor;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nfunction skip_template_literal(source: string, start: number): number {\n\tlet cursor = start + 1;\n\n\twhile (cursor < source.length) {\n\t\tif (source[cursor] === \"\\\\\") {\n\t\t\tcursor += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (source[cursor] === \"`\") {\n\t\t\treturn cursor;\n\t\t}\n\n\t\tif (source[cursor] === \"$\" && source[cursor + 1] === \"{\") {\n\t\t\tconst close = find_closing_brace(source, cursor + 1);\n\n\t\t\tif (close === -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tcursor = close + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tcursor += 1;\n\t}\n\n\treturn -1;\n}\n\nfunction skip_line_comment(source: string, start: number): number {\n\tfor (let cursor = start + 2; cursor < source.length; cursor += 1) {\n\t\tconst char = source[cursor];\n\n\t\tif (char === \"\\n\" || char === \"\\r\" || char === \"\\u2028\" || char === \"\\u2029\") {\n\t\t\treturn cursor;\n\t\t}\n\t}\n\n\treturn source.length;\n}\n\nfunction skip_block_comment(source: string, start: number): number {\n\tconst close = source.indexOf(\"*/\", start + 2);\n\n\treturn close === -1 ? -1 : close + 1;\n}\n"],"mappings":";;;AAsIA,IAAI;AAEJ,SAAS,oBAAoB,QAAsC;CAClE,IAAI,eAAe;CAEnB,MAAM,gBADc,OAAO,MAAM,eAAe,CAAC,EAAE,UAAU,KAC1B;CAEnC,KAAK,IAAI,UAAU,GAAG,UAAU,cAAc,WAAW,GACxD,IAAI;EACH,OAAO,MAAM,cAAc;GAAE,QAAQ;GAAM,OAAO;EAAK,CAAC;CACzD,SAAS,OAAO;EACf,MAAM,aAAa,uBAAuB,cAAc,KAAK;EAE7D,IAAI,CAAC,cAAc,eAAe,cACjC;EAGD,eAAe;CAChB;AAIF;AAEA,SAAS,uBAAuB,QAAgB,OAAoC;CACnF,IAAI,CAAC,qBAAqB,KAAK,KAAK,CAAC,mBAAmB,MAAM,QAAQ,GACrE;CAGD,MAAM,CAAC,OAAO,OAAO,MAAM;CAE3B,IAAI,MAAM,SAAS,kBAAkB;EACpC,MAAM,QAAQ,OAAO,MAAM,KAAK,CAAC,CAAC,MAAM,aAAa;EAErD,IAAI,CAAC,OACJ;EAGD,OAAO,cAAc,QAAQ,OAAO,QAAQ,MAAM,EAAE,CAAC,QAAQ,aAAa,MAAM,EAAE,CAAC;CACpF;CAEA,IAAI,MAAM,SAAS,iCAClB;CAMD,IAHmB,OAAO,MAAM,OAAO,GACV,CAAC,CAAC,OAAO,cAExB,MAAM,IACnB;CAGD,OAAO,mCAAmC,MAAM;AACjD;AAEA,SAAS,mCAAmC,QAAwB;CACnE,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C;CAE5C,OAAO,UAAU,KAAK,KAAK,QAAQ;AACpC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-BXyYUAez.js","names":["create_source_map","is_yield_star_expression","create_source_map"],"sources":["../../../modules/svelte-effect-runtime/src/script-transform/imports.ts","../../../modules/svelte-effect-runtime/src/compiler/markup-identifiers.ts","../../../modules/svelte-effect-runtime/src/markup/transform/constants.ts","../../../modules/svelte-effect-runtime/src/markup/transform/apply.ts","../../../modules/svelte-effect-runtime/src/markup/transform/effect-bindings.ts","../../../modules/svelte-effect-runtime/src/markup/event-attributes.ts","../../../modules/svelte-effect-runtime/src/markup/transform/classify.ts","../../../modules/svelte-effect-runtime/src/markup/transform/expressions.ts","../../../modules/svelte-effect-runtime/src/markup/transform/effect-callbacks.ts","../../../modules/svelte-effect-runtime/src/script-transform/ast.ts","../../../modules/svelte-effect-runtime/src/markup/transform/emit.ts","../../../modules/svelte-effect-runtime/src/script-transform/source.ts","../../../modules/svelte-effect-runtime/src/script-transform/runes.ts","../../../modules/svelte-effect-runtime/src/markup/transform/scan.ts","../../../modules/svelte-effect-runtime/src/markup/transform/index.ts"],"sourcesContent":["import type { RuntimeImportBindings } from \"./types.ts\";\n\nimport ts from \"typescript\";\n\ninterface RuntimeImportOptions {\n\tneeds_dispatcher?: boolean;\n\tneeds_effect?: boolean;\n\tneeds_untrack?: boolean;\n\tneeds_yield_success?: boolean;\n\tneeds_yieldable?: boolean;\n}\n\nexport function make_imports(\n\thas_effect_import: boolean,\n\thas_dispatcher_import: boolean,\n\thas_untrack_import: boolean,\n\tbindings: RuntimeImportBindings = {\n\t\tcancel: \"__SER___cancel\",\n\t\tdispatcher: \"get_dispatcher\",\n\t\tdispatcher_value: \"__SER___dispatcher\",\n\t\teffect: \"Effect\",\n\t\tprogram: \"__SER___program\",\n\t\tuntrack: \"untrack\",\n\t\tyield_success: \"YieldSuccess\",\n\t\tyieldable: \"ToEffect\",\n\t},\n\toptions: RuntimeImportOptions = {},\n): string {\n\tconst needs_dispatcher = options.needs_dispatcher ?? true;\n\tconst needs_effect = options.needs_effect ?? true;\n\tconst needs_untrack = options.needs_untrack ?? true;\n\tconst needs_yield_success = options.needs_yield_success ?? false;\n\tconst needs_yieldable = options.needs_yieldable ?? false;\n\n\tconst generator_import = make_generator_import(\n\t\tbindings,\n\t\tneeds_dispatcher && !has_dispatcher_import,\n\t\tneeds_yieldable,\n\t\tneeds_yield_success,\n\t);\n\n\tconst untrack_import =\n\t\tbindings.untrack === \"untrack\"\n\t\t\t? `import { untrack } from \"svelte\";`\n\t\t\t: `import { untrack as ${bindings.untrack} } from \"svelte\";`;\n\n\tconst effect_import = has_effect_import\n\t\t? false\n\t\t: bindings.effect === \"Effect\"\n\t\t\t? `import { Effect } from \"effect\";`\n\t\t\t: `import { Effect as ${bindings.effect} } from \"effect\";`;\n\n\treturn [\n\t\tgenerator_import,\n\t\tneeds_untrack && !has_untrack_import && untrack_import,\n\t\tneeds_effect && effect_import,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\"\\n\");\n}\n\nfunction make_generator_import(\n\tbindings: RuntimeImportBindings,\n\tneeds_dispatcher: boolean,\n\tneeds_yieldable: boolean,\n\tneeds_yield_success: boolean,\n): string | false {\n\tconst specifiers = [\n\t\tneeds_dispatcher && make_named_import(\"get_dispatcher\", bindings.dispatcher),\n\t\tneeds_yieldable && make_named_import(\"ToEffect\", bindings.yieldable),\n\t\tneeds_yield_success && make_named_import(\"YieldSuccess\", bindings.yield_success, true),\n\t].filter((specifier): specifier is string => specifier !== false);\n\n\tif (specifiers.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn `import { ${specifiers.join(\", \")} } from \"svelte-effect-runtime/internal/generators\";`;\n}\n\nfunction make_named_import(imported_name: string, local_name: string, type_only = false): string {\n\tconst prefix = type_only ? \"type \" : \"\";\n\n\treturn imported_name === local_name\n\t\t? `${prefix}${imported_name}`\n\t\t: `${prefix}${imported_name} as ${local_name}`;\n}\n\nexport function has_local_import_binding(\n\tsource_file: ts.SourceFile,\n\tmodule_name: string,\n\tlocal_name: string,\n): boolean {\n\treturn source_file.statements.some((stmt) => {\n\t\tif (\n\t\t\t!ts.isImportDeclaration(stmt) ||\n\t\t\t!ts.isStringLiteral(stmt.moduleSpecifier) ||\n\t\t\tstmt.moduleSpecifier.text !== module_name\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst clause = stmt.importClause;\n\n\t\tif (!clause || clause.isTypeOnly) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (clause.name?.text === local_name) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst named_bindings = clause.namedBindings;\n\n\t\tif (!named_bindings) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (ts.isNamespaceImport(named_bindings)) {\n\t\t\treturn named_bindings.name.text === local_name;\n\t\t}\n\n\t\treturn named_bindings.elements.some(\n\t\t\t(element) => !element.isTypeOnly && element.name.text === local_name,\n\t\t);\n\t});\n}\n\nexport function collect_top_level_binding_names(source_file: ts.SourceFile): string[] {\n\treturn source_file.statements.flatMap(collect_statement_binding_names);\n}\n\nfunction collect_statement_binding_names(stmt: ts.Statement): string[] {\n\tif (ts.isImportDeclaration(stmt)) {\n\t\treturn collect_import_binding_names(stmt);\n\t}\n\n\tif (ts.isVariableStatement(stmt)) {\n\t\treturn stmt.declarationList.declarations.flatMap((decl) =>\n\t\t\tcollect_binding_name_text(decl.name),\n\t\t);\n\t}\n\n\tif (\n\t\tts.isFunctionDeclaration(stmt) ||\n\t\tts.isClassDeclaration(stmt) ||\n\t\tts.isInterfaceDeclaration(stmt) ||\n\t\tts.isTypeAliasDeclaration(stmt) ||\n\t\tts.isEnumDeclaration(stmt) ||\n\t\tts.isModuleDeclaration(stmt)\n\t) {\n\t\treturn stmt.name ? [stmt.name.text] : [];\n\t}\n\n\treturn [];\n}\n\nfunction collect_import_binding_names(stmt: ts.ImportDeclaration): string[] {\n\tconst clause = stmt.importClause;\n\n\tif (!clause) {\n\t\treturn [];\n\t}\n\n\treturn [\n\t\tclause.name?.text,\n\t\tclause.namedBindings && ts.isNamespaceImport(clause.namedBindings)\n\t\t\t? clause.namedBindings.name.text\n\t\t\t: undefined,\n\t\tclause.namedBindings && ts.isNamedImports(clause.namedBindings)\n\t\t\t? clause.namedBindings.elements.map((element) => element.name.text)\n\t\t\t: undefined,\n\t]\n\t\t.flat()\n\t\t.filter((name): name is string => name !== undefined);\n}\n\nfunction collect_binding_name_text(name: ts.BindingName): string[] {\n\tif (ts.isIdentifier(name)) {\n\t\treturn [name.text];\n\t}\n\n\treturn name.elements.flatMap((element) => {\n\t\tif (ts.isOmittedExpression(element)) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn collect_binding_name_text(element.name);\n\t});\n}\n","import type { SvelteEffectSourceScan } from \"./source-scan.ts\";\n\nimport ts from \"typescript\";\n\nconst wrapper_name = \"__SER___markup_identifiers\";\nconst identifier_names_by_scan = new WeakMap<SvelteEffectSourceScan, ReadonlySet<string>>();\n\nexport function collect_markup_identifier_names(\n\tsource_scan: SvelteEffectSourceScan,\n): ReadonlySet<string> {\n\tconst cached_names = identifier_names_by_scan.get(source_scan);\n\n\tif (cached_names) {\n\t\treturn cached_names;\n\t}\n\n\tconst names = new Set(source_scan.markup_binding_names);\n\n\tfor (const expression of source_scan.markup_expressions) {\n\t\tconst source_file = ts.createSourceFile(\n\t\t\t\"markup-identifiers.ts\",\n\t\t\tmake_identifier_parse_source(expression.inner),\n\t\t\tts.ScriptTarget.Latest,\n\t\t\ttrue,\n\t\t\tts.ScriptKind.TS,\n\t\t);\n\n\t\tcollect_source_file_identifier_names(source_file, names);\n\t}\n\n\tnames.delete(wrapper_name);\n\tidentifier_names_by_scan.set(source_scan, names);\n\n\treturn names;\n}\n\nfunction make_identifier_parse_source(expression: string): string {\n\tconst snippet = expression.match(/^(\\s*)#snippet\\s+([\\s\\S]*)$/);\n\n\tif (snippet) {\n\t\treturn `function* ${wrapper_name}() { ${snippet[1]}function ${snippet[2]} {} }`;\n\t}\n\n\treturn `function* ${wrapper_name}() { ${expression} }`;\n}\n\nfunction collect_source_file_identifier_names(\n\tsource_file: ts.SourceFile,\n\tnames: Set<string>,\n): void {\n\tconst visit = (node: ts.Node): void => {\n\t\tif (ts.isIdentifier(node) && !is_non_runtime_property_name(node)) {\n\t\t\tnames.add(node.text);\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n}\n\nfunction is_non_runtime_property_name(identifier: ts.Identifier): boolean {\n\tconst parent = identifier.parent;\n\n\treturn (\n\t\tis_within_type_node(identifier) ||\n\t\t(ts.isPropertyAccessExpression(parent) && parent.name === identifier) ||\n\t\t(ts.isPropertyAssignment(parent) && parent.name === identifier) ||\n\t\t(ts.isPropertySignature(parent) && parent.name === identifier) ||\n\t\t(ts.isMethodDeclaration(parent) && parent.name === identifier) ||\n\t\t(ts.isMethodSignature(parent) && parent.name === identifier) ||\n\t\t(ts.isGetAccessorDeclaration(parent) && parent.name === identifier) ||\n\t\t(ts.isSetAccessorDeclaration(parent) && parent.name === identifier) ||\n\t\t(ts.isPropertyDeclaration(parent) && parent.name === identifier) ||\n\t\t(ts.isEnumMember(parent) && parent.name === identifier) ||\n\t\t(ts.isBindingElement(parent) && parent.propertyName === identifier)\n\t);\n}\n\nfunction is_within_type_node(identifier: ts.Identifier): boolean {\n\tlet ancestor: ts.Node | undefined = identifier.parent;\n\n\twhile (ancestor) {\n\t\tif (ts.isTypeNode(ancestor)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tancestor = ancestor.parent;\n\t}\n\n\treturn false;\n}\n","export const default_helper_bindings = {\n\tcodes: \"Code\",\n\tdispatcher: \"Dispatcher\",\n\tyieldable: \"ToEffect\",\n} as const;\n","import type {\n\tHelperDeclaration,\n\tInsertion,\n\tMarkupHelperBindings,\n\tMarkupRelocation,\n\tPendingRelocation,\n\tReplacement,\n} from \"./types.ts\";\nimport type { SvelteEffectSourceScan } from \"$/compiler/source-scan.ts\";\nimport { collect_top_level_binding_names } from \"$/script-transform/imports.ts\";\nimport { collect_markup_identifier_names } from \"$/compiler/markup-identifiers.ts\";\nimport { default_helper_bindings } from \"./constants.ts\";\n\nimport type MagicString from \"magic-string\";\nimport ts from \"typescript\";\n\nexport function create_source_map(magic: MagicString, filename: string): Record<string, unknown> {\n\tconst map = magic.generateMap({\n\t\thires: true,\n\t\tincludeContent: true,\n\t\tsource: filename,\n\t});\n\n\treturn map as unknown as Record<string, unknown>;\n}\n\nexport function inject_helpers(\n\tmagic: MagicString,\n\tsource_scan: SvelteEffectSourceScan,\n\thelpers: HelperDeclaration[] = [],\n\tbindings: MarkupHelperBindings = default_helper_bindings,\n): Insertion | undefined {\n\tconst import_helpers = unique_import_helpers(helpers);\n\tconst local_helpers = helpers.filter((helper) => !is_import_helper(helper));\n\n\tconst helper_segments: Array<{\n\t\ttext: string;\n\t\trelocation?: PendingRelocation;\n\t}> = [make_dispatcher_import(bindings), ...import_helpers, ...local_helpers]\n\t\t.filter((helper): helper is string | HelperDeclaration => helper !== undefined)\n\t\t.map((helper) => (typeof helper === \"string\" ? { text: helper } : helper));\n\n\tif (helper_segments.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst helper_block = helper_segments.map((segment) => segment.text).join(\"\\n\");\n\n\tconst instance_script = source_scan.instance_script;\n\n\tif (instance_script) {\n\t\tconst text = `\\n${helper_block}\\n`;\n\n\t\tmagic.appendLeft(instance_script.content_end, text);\n\n\t\treturn {\n\t\t\tstart: instance_script.content_end,\n\t\t\ttext,\n\t\t\trelocations: make_insertion_relocations(helper_segments, \"\\n\"),\n\t\t};\n\t} else {\n\t\tconst text = `<script>\\n${helper_block}\\n</script>\\n\\n`;\n\n\t\tmagic.prepend(text);\n\n\t\treturn {\n\t\t\tstart: 0,\n\t\t\ttext,\n\t\t\trelocations: make_insertion_relocations(helper_segments, \"<script>\\n\"),\n\t\t};\n\t}\n}\n\nexport function make_markup_helper_bindings(source_scan: SvelteEffectSourceScan): {\n\tbindings: MarkupHelperBindings;\n\tname_allocator: { reserve(name: string): string };\n} {\n\tconst script_binding_names = source_scan.scripts.flatMap((script) =>\n\t\tcollect_script_binding_names(script.text),\n\t);\n\tconst markup_identifier_names = collect_markup_identifier_names(source_scan);\n\tconst name_allocator = make_name_allocator([\n\t\t...script_binding_names,\n\t\t...markup_identifier_names,\n\t]);\n\n\treturn {\n\t\tbindings: {\n\t\t\tcodes: name_allocator.reserve(default_helper_bindings.codes),\n\t\t\tdispatcher: name_allocator.reserve(default_helper_bindings.dispatcher),\n\t\t\tyieldable: name_allocator.reserve(default_helper_bindings.yieldable),\n\t\t},\n\t\tname_allocator,\n\t};\n}\n\nexport function create_relocations(\n\treplacements: Replacement[],\n\thelper_insertion: Insertion | undefined,\n): MarkupRelocation[] {\n\tconst ordered_replacements = [...replacements].sort((left, right) => left.start - right.start);\n\tconst replacement_deltas = new Map<Replacement, number>();\n\tlet accumulated_delta = 0;\n\tlet replacement_delta_before_helper = 0;\n\tlet cursor = 0;\n\n\twhile (cursor < ordered_replacements.length) {\n\t\tconst start = ordered_replacements[cursor]?.start;\n\t\tlet group_end = cursor;\n\t\tlet group_delta = 0;\n\n\t\twhile (ordered_replacements[group_end]?.start === start) {\n\t\t\tconst replacement = ordered_replacements[group_end];\n\n\t\t\tif (replacement) {\n\t\t\t\treplacement_deltas.set(replacement, accumulated_delta);\n\t\t\t\tgroup_delta += replacement.text.length - (replacement.end - replacement.start);\n\t\t\t}\n\n\t\t\tgroup_end += 1;\n\t\t}\n\n\t\tif (helper_insertion && start !== undefined && start < helper_insertion.start) {\n\t\t\treplacement_delta_before_helper += group_delta;\n\t\t}\n\n\t\taccumulated_delta += group_delta;\n\t\tcursor = group_end;\n\t}\n\n\tconst replacement_relocations = replacements.flatMap((replacement) => {\n\t\tif (!replacement.relocation) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst replacement_delta_before = replacement_deltas.get(replacement) ?? 0;\n\t\tconst helper_insertion_delta =\n\t\t\thelper_insertion && helper_insertion.start <= replacement.start\n\t\t\t\t? helper_insertion.text.length\n\t\t\t\t: 0;\n\t\tconst delta_before = replacement_delta_before + helper_insertion_delta;\n\t\tconst generated_start = replacement.start + delta_before;\n\n\t\treturn [\n\t\t\t{\n\t\t\t\toriginalStart: replacement.relocation.originalStart,\n\t\t\t\toriginalEnd: replacement.relocation.originalEnd,\n\t\t\t\tgeneratedStart:\n\t\t\t\t\tgenerated_start + replacement.relocation.generatedStartInReplacement,\n\t\t\t\tgeneratedEnd: generated_start + replacement.relocation.generatedEndInReplacement,\n\t\t\t},\n\t\t];\n\t});\n\n\tconst helper_generated_start = (helper_insertion?.start ?? 0) + replacement_delta_before_helper;\n\tconst helper_relocations =\n\t\thelper_insertion?.relocations?.map((relocation) => ({\n\t\t\toriginalStart: relocation.originalStart,\n\t\t\toriginalEnd: relocation.originalEnd,\n\t\t\tgeneratedStart: helper_generated_start + relocation.generatedStartInReplacement,\n\t\t\tgeneratedEnd: helper_generated_start + relocation.generatedEndInReplacement,\n\t\t})) ?? [];\n\n\treturn [...replacement_relocations, ...helper_relocations];\n}\n\nfunction make_dispatcher_import(bindings: MarkupHelperBindings): string {\n\tconst dispatcher = make_import_specifier(\n\t\tdefault_helper_bindings.dispatcher,\n\t\tbindings.dispatcher,\n\t);\n\tconst codes = make_import_specifier(default_helper_bindings.codes, bindings.codes);\n\tconst yieldable = make_import_specifier(default_helper_bindings.yieldable, bindings.yieldable);\n\n\treturn `import { ${dispatcher}, ${codes}, ${yieldable} } from \"svelte-effect-runtime/internal/generators\";`;\n}\n\nfunction make_import_specifier(imported_name: string, local_name: string): string {\n\tif (imported_name === local_name) {\n\t\treturn imported_name;\n\t}\n\n\treturn `${imported_name} as ${local_name}`;\n}\n\nfunction make_insertion_relocations(\n\tsegments: Array<{\n\t\ttext: string;\n\t\trelocation?: PendingRelocation;\n\t}>,\n\tprefix: string,\n): PendingRelocation[] {\n\tconst relocations: PendingRelocation[] = [];\n\tlet offset = prefix.length;\n\n\tfor (const segment of segments) {\n\t\tif (segment.relocation) {\n\t\t\trelocations.push({\n\t\t\t\toriginalStart: segment.relocation.originalStart,\n\t\t\t\toriginalEnd: segment.relocation.originalEnd,\n\t\t\t\tgeneratedStartInReplacement:\n\t\t\t\t\toffset + segment.relocation.generatedStartInReplacement,\n\t\t\t\tgeneratedEndInReplacement: offset + segment.relocation.generatedEndInReplacement,\n\t\t\t});\n\t\t}\n\n\t\toffset += segment.text.length + 1;\n\t}\n\n\treturn relocations;\n}\n\nfunction unique_import_helpers(helpers: HelperDeclaration[]): HelperDeclaration[] {\n\tconst seen = new Set<string>();\n\n\treturn helpers.filter((helper) => {\n\t\tif (!is_import_helper(helper)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (seen.has(helper.text)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tseen.add(helper.text);\n\n\t\treturn true;\n\t});\n}\n\nfunction is_import_helper(helper: HelperDeclaration): boolean {\n\treturn helper.text.trimStart().startsWith(\"import \");\n}\n\nfunction collect_script_binding_names(script_content: string): string[] {\n\tconst source_file = ts.createSourceFile(\n\t\t\"markup-script.ts\",\n\t\tscript_content,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\n\treturn collect_top_level_binding_names(source_file);\n}\n\nfunction make_name_allocator(initial_names: readonly string[]): {\n\treserve(name: string): string;\n} {\n\tconst used_names = new Set(initial_names);\n\n\treturn {\n\t\treserve(name: string): string {\n\t\t\tlet candidate = name;\n\t\t\tlet suffix = 1;\n\n\t\t\twhile (used_names.has(candidate)) {\n\t\t\t\tcandidate = `${name}_${suffix}`;\n\t\t\t\tsuffix += 1;\n\t\t\t}\n\n\t\t\tused_names.add(candidate);\n\n\t\t\treturn candidate;\n\t\t},\n\t};\n}\n","import type { ScriptRegion } from \"$/compiler/source-scan.ts\";\nimport type { HelperDeclaration } from \"./types.ts\";\n\nimport ts from \"typescript\";\n\nconst effect_package_module = \"effect\";\nconst effect_direct_module = \"effect/Effect\";\nconst generated_effect_name = \"__SER___Effect\";\n\nexport interface EffectCallbackRewriteContext {\n\t/** Local names imported as the Effect object, such as `Effect` or `E`. */\n\teffect_object_names: ReadonlySet<string>;\n\t/** Namespace names imported from `effect/Effect`, such as `E.flatMap`. */\n\teffect_module_names: ReadonlySet<string>;\n\t/** Package namespace names imported from `effect`, such as `Fx.Effect`. */\n\teffect_package_names: ReadonlySet<string>;\n\t/** Direct `effect/Effect` imports mapped from local name to exported name. */\n\tdirect_members: ReadonlyMap<string, string>;\n\t/** Expression used for generated `gen`, `sync`, and upgraded direct calls. */\n\twrapper_expression: string;\n\t/** Import inserted when generated code needs a fresh Effect binding. */\n\twrapper_import: HelperDeclaration | undefined;\n}\n\ninterface EffectBindingState {\n\teffect_object_names: string[];\n\teffect_module_names: string[];\n\teffect_package_names: string[];\n\tdirect_members: Map<string, string>;\n\tlocal_names: Set<string>;\n\timplicit_effect_import: boolean;\n}\n\nexport function collect_effect_callback_bindings(\n\tscripts: readonly ScriptRegion[],\n): EffectCallbackRewriteContext {\n\tconst state = make_effect_binding_state();\n\n\tfor (const script of scripts) {\n\t\tconst source_file = ts.createSourceFile(\n\t\t\t\"component-script.ts\",\n\t\t\tscript.text,\n\t\t\tts.ScriptTarget.Latest,\n\t\t\ttrue,\n\t\t\tts.ScriptKind.TS,\n\t\t);\n\n\t\tcollect_source_file_bindings(source_file, state);\n\t}\n\n\tensure_implicit_effect_binding(state);\n\n\tconst wrapper = choose_effect_wrapper(state);\n\n\treturn {\n\t\teffect_object_names: new Set(state.effect_object_names),\n\t\teffect_module_names: new Set(state.effect_module_names),\n\t\teffect_package_names: new Set(state.effect_package_names),\n\t\tdirect_members: new Map(state.direct_members),\n\t\twrapper_expression: wrapper.expression,\n\t\twrapper_import: wrapper.import_text ? { text: wrapper.import_text } : undefined,\n\t};\n}\n\nfunction make_effect_binding_state(): EffectBindingState {\n\treturn {\n\t\teffect_object_names: [],\n\t\teffect_module_names: [],\n\t\teffect_package_names: [],\n\t\tdirect_members: new Map(),\n\t\tlocal_names: new Set(),\n\t\timplicit_effect_import: false,\n\t};\n}\n\nfunction collect_source_file_bindings(source_file: ts.SourceFile, state: EffectBindingState): void {\n\tfor (const statement of source_file.statements) {\n\t\tcollect_statement_binding(statement, state);\n\t}\n}\n\nfunction collect_statement_binding(statement: ts.Statement, state: EffectBindingState): void {\n\tif (ts.isImportDeclaration(statement)) {\n\t\tcollect_import_binding(statement, state);\n\t\treturn;\n\t}\n\n\tif (ts.isImportEqualsDeclaration(statement)) {\n\t\tstate.local_names.add(statement.name.text);\n\t\treturn;\n\t}\n\n\tif (ts.isVariableStatement(statement)) {\n\t\tfor (const declaration of statement.declarationList.declarations) {\n\t\t\tcollect_binding_name(declaration.name, state.local_names);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (\n\t\tts.isFunctionDeclaration(statement) ||\n\t\tts.isClassDeclaration(statement) ||\n\t\tts.isInterfaceDeclaration(statement) ||\n\t\tts.isTypeAliasDeclaration(statement) ||\n\t\tts.isEnumDeclaration(statement) ||\n\t\tts.isModuleDeclaration(statement)\n\t) {\n\t\tif (statement.name) {\n\t\t\tstate.local_names.add(statement.name.text);\n\t\t}\n\t}\n}\n\nfunction collect_import_binding(statement: ts.ImportDeclaration, state: EffectBindingState): void {\n\tif (!ts.isStringLiteral(statement.moduleSpecifier)) {\n\t\treturn;\n\t}\n\n\tconst module_name = statement.moduleSpecifier.text;\n\tconst clause = statement.importClause;\n\n\tif (!clause) {\n\t\treturn;\n\t}\n\n\tif (clause.name) {\n\t\tstate.local_names.add(clause.name.text);\n\t}\n\n\tconst named_bindings = clause.namedBindings;\n\n\tif (!named_bindings) {\n\t\treturn;\n\t}\n\n\tif (ts.isNamespaceImport(named_bindings)) {\n\t\tcollect_namespace_import_binding(module_name, named_bindings.name.text, state);\n\t\treturn;\n\t}\n\n\tfor (const element of named_bindings.elements) {\n\t\tcollect_named_import_binding(module_name, element, state);\n\t}\n}\n\nfunction collect_namespace_import_binding(\n\tmodule_name: string,\n\tlocal_name: string,\n\tstate: EffectBindingState,\n): void {\n\tstate.local_names.add(local_name);\n\n\tif (module_name === effect_direct_module) {\n\t\tadd_ordered_name(state.effect_module_names, local_name);\n\t\treturn;\n\t}\n\n\tif (module_name === effect_package_module) {\n\t\tadd_ordered_name(state.effect_package_names, local_name);\n\t}\n}\n\nfunction collect_named_import_binding(\n\tmodule_name: string,\n\telement: ts.ImportSpecifier,\n\tstate: EffectBindingState,\n): void {\n\tconst imported_name = element.propertyName?.text ?? element.name.text;\n\tconst local_name = element.name.text;\n\n\tstate.local_names.add(local_name);\n\n\tif (module_name === effect_package_module && imported_name === \"Effect\") {\n\t\tadd_ordered_name(state.effect_object_names, local_name);\n\t\treturn;\n\t}\n\n\tif (module_name === effect_direct_module) {\n\t\tstate.direct_members.set(local_name, imported_name);\n\t}\n}\n\nfunction collect_binding_name(name: ts.BindingName, local_names: Set<string>): void {\n\tif (ts.isIdentifier(name)) {\n\t\tlocal_names.add(name.text);\n\t\treturn;\n\t}\n\n\tfor (const element of name.elements) {\n\t\tif (ts.isOmittedExpression(element)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tcollect_binding_name(element.name, local_names);\n\t}\n}\n\nfunction ensure_implicit_effect_binding(state: EffectBindingState): void {\n\tif (has_effect_binding(state) || state.local_names.has(\"Effect\")) {\n\t\treturn;\n\t}\n\n\tadd_ordered_name(state.effect_object_names, \"Effect\");\n\tstate.implicit_effect_import = true;\n}\n\nfunction has_effect_binding(state: EffectBindingState): boolean {\n\treturn (\n\t\tstate.effect_object_names.length > 0 ||\n\t\tstate.effect_module_names.length > 0 ||\n\t\tstate.effect_package_names.length > 0 ||\n\t\tstate.direct_members.size > 0\n\t);\n}\n\nfunction choose_effect_wrapper(state: EffectBindingState): {\n\texpression: string;\n\timport_text?: string;\n} {\n\tconst effect_object = state.effect_object_names[0];\n\n\tif (effect_object) {\n\t\treturn state.implicit_effect_import\n\t\t\t? {\n\t\t\t\t\texpression: effect_object,\n\t\t\t\t\timport_text: `import { Effect } from \"effect\";`,\n\t\t\t\t}\n\t\t\t: { expression: effect_object };\n\t}\n\n\tconst effect_module = state.effect_module_names[0];\n\n\tif (effect_module) {\n\t\treturn { expression: effect_module };\n\t}\n\n\tconst effect_package = state.effect_package_names[0];\n\n\tif (effect_package) {\n\t\treturn { expression: `${effect_package}.Effect` };\n\t}\n\n\tconst generated_name = make_generated_effect_name(state.local_names);\n\n\treturn {\n\t\texpression: generated_name,\n\t\timport_text: `import { Effect as ${generated_name} } from \"effect\";`,\n\t};\n}\n\nfunction make_generated_effect_name(local_names: ReadonlySet<string>): string {\n\tif (!local_names.has(generated_effect_name)) {\n\t\treturn generated_effect_name;\n\t}\n\n\tlet index = 1;\n\n\twhile (local_names.has(`${generated_effect_name}_${index}`)) {\n\t\tindex += 1;\n\t}\n\n\treturn `${generated_effect_name}_${index}`;\n}\n\nfunction add_ordered_name(names: string[], name: string): void {\n\tif (names.includes(name)) {\n\t\treturn;\n\t}\n\n\tnames.push(name);\n}\n","export function is_svelte_event_attribute(attribute: {\n\ttype: string;\n\tname?: string;\n\tvalue?: unknown;\n}): boolean {\n\tif (attribute.type !== \"Attribute\" || !attribute.name?.startsWith(\"on\")) {\n\t\treturn false;\n\t}\n\n\tconst value = attribute.value;\n\n\treturn (\n\t\t(value !== true && !Array.isArray(value)) ||\n\t\t(Array.isArray(value) && value.length === 1 && value[0]?.type === \"ExpressionTag\")\n\t);\n}\n\nexport function normalize_event_attribute_name(name: string): string {\n\tif (name.startsWith(\"on:\")) {\n\t\treturn `on:${name.slice(3).toLowerCase()}`;\n\t}\n\n\treturn name.toLowerCase();\n}\n","import { is_svelte_event_attribute, normalize_event_attribute_name } from \"../event-attributes.ts\";\nimport type { MarkupCandidate, TagKind } from \"./types.ts\";\nimport type { AST } from \"svelte/compiler\";\n\ninterface ClassifiedCandidate {\n\tcandidate: MarkupCandidate;\n\tkind: TagKind;\n\tattribute_name_replacement: AttributeNameReplacement | undefined;\n}\n\ninterface AttributeNameReplacement {\n\tstart: number;\n\tend: number;\n\ttext: string;\n}\n\nexport function classify_candidates(\n\tast: AST.Root,\n\tcandidates: MarkupCandidate[],\n): ClassifiedCandidate[] {\n\tconst by_placeholder = new Map(\n\t\tcandidates.map((candidate) => [candidate.placeholder, candidate]),\n\t);\n\n\tconst classified: ClassifiedCandidate[] = [];\n\tconst matched = new Set<string>();\n\n\twalk_ast(ast.fragment, by_placeholder, matched, classified);\n\n\treturn classified;\n}\n\nfunction walk_ast(\n\tfragment: AST.Fragment,\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n): void {\n\tfor (const node of fragment.nodes) {\n\t\tvisit_ast_node(node, candidates, matched, classified);\n\t}\n}\n\nfunction visit_ast_node(\n\tnode: AST.Fragment[\"nodes\"][number],\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n): void {\n\tswitch (node.type) {\n\t\tcase \"ExpressionTag\":\n\t\t\tclassify_expression(node.expression, \"plain\", candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"IfBlock\":\n\t\t\tclassify_expression(node.test, \"plain\", candidates, matched, classified);\n\t\t\twalk_ast(node.consequent, candidates, matched, classified);\n\t\t\tif (node.alternate) {\n\t\t\t\twalk_ast(node.alternate, candidates, matched, classified);\n\t\t\t}\n\t\t\treturn;\n\n\t\tcase \"EachBlock\":\n\t\t\tclassify_expression(node.expression, \"each\", candidates, matched, classified);\n\t\t\twalk_ast(node.body, candidates, matched, classified);\n\t\t\tif (node.fallback) {\n\t\t\t\twalk_ast(node.fallback, candidates, matched, classified);\n\t\t\t}\n\t\t\treturn;\n\n\t\tcase \"AwaitBlock\":\n\t\t\tclassify_expression(node.expression, \"await\", candidates, matched, classified);\n\t\t\tif (node.pending) {\n\t\t\t\twalk_ast(node.pending, candidates, matched, classified);\n\t\t\t}\n\t\t\tif (node.then) walk_ast(node.then, candidates, matched, classified);\n\t\t\tif (node.catch) walk_ast(node.catch, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"RenderTag\":\n\t\t\tclassify_expression(node.expression, \"render\", candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"HtmlTag\":\n\t\t\tclassify_expression(node.expression, \"html\", candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"DebugTag\":\n\t\t\tclassify_debug_tag(node, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"ConstTag\":\n\t\tcase \"DeclarationTag\":\n\t\t\tclassify_declaration_tag(node, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"KeyBlock\":\n\t\t\tclassify_expression(node.expression, \"plain\", candidates, matched, classified);\n\t\t\twalk_ast(node.fragment, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"SnippetBlock\":\n\t\t\twalk_ast(node.body, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"SvelteElement\":\n\t\t\tclassify_expression(\n\t\t\t\tnode.tag as ExpressionLike,\n\t\t\t\t\"plain\",\n\t\t\t\tcandidates,\n\t\t\t\tmatched,\n\t\t\t\tclassified,\n\t\t\t);\n\t\t\tvisit_element_attributes(node, candidates, matched, classified);\n\t\t\twalk_ast(node.fragment, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tcase \"RegularElement\":\n\t\tcase \"Component\":\n\t\tcase \"TitleElement\":\n\t\tcase \"SlotElement\":\n\t\tcase \"SvelteBody\":\n\t\tcase \"SvelteBoundary\":\n\t\tcase \"SvelteComponent\":\n\t\tcase \"SvelteDocument\":\n\t\tcase \"SvelteFragment\":\n\t\tcase \"SvelteHead\":\n\t\tcase \"SvelteSelf\":\n\t\tcase \"SvelteWindow\":\n\t\t\tvisit_element_attributes(node, candidates, matched, classified);\n\t\t\twalk_ast(node.fragment, candidates, matched, classified);\n\t\t\treturn;\n\n\t\tdefault:\n\t\t\treturn;\n\t}\n}\n\nfunction classify_debug_tag(\n\t_node: Extract<AST.Fragment[\"nodes\"][number], { type: \"DebugTag\" }>,\n\t_candidates: Map<string, MarkupCandidate>,\n\t_matched: Set<string>,\n\t_classified: ClassifiedCandidate[],\n): void {\n\treturn;\n}\n\nfunction classify_declaration_tag(\n\tnode: Extract<AST.Fragment[\"nodes\"][number], { type: \"ConstTag\" | \"DeclarationTag\" }>,\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n): void {\n\tfor (const decl of node.declaration.declarations) {\n\t\tclassify_expression(decl as ExpressionLike, \"plain\", candidates, matched, classified);\n\t}\n}\n\ninterface ElementLikeNode {\n\ttype: string;\n\tattributes: Array<{\n\t\ttype: string;\n\t\tstart?: number;\n\t\tname?: string;\n\t\tvalue?: unknown;\n\t\texpression?: unknown;\n\t}>;\n\tfragment: AST.Fragment;\n}\n\nfunction visit_element_attributes(\n\tnode: ElementLikeNode,\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n): void {\n\tfor (const attr of node.attributes) {\n\t\tif (is_svelte_event_attribute(attr)) {\n\t\t\tconst attribute_name_replacement = make_attribute_name_replacement(node, attr);\n\n\t\t\tvisit_attribute_value(\n\t\t\t\tattr.value as true | AST.ExpressionTag | Array<AST.Text | AST.ExpressionTag>,\n\t\t\t\t\"event\",\n\t\t\t\tcandidates,\n\t\t\t\tmatched,\n\t\t\t\tclassified,\n\t\t\t\tattribute_name_replacement,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (attr.type === \"OnDirective\" && attr.expression) {\n\t\t\tconst attribute_name_replacement = make_directive_name_replacement(node, attr);\n\n\t\t\tclassify_expression(\n\t\t\t\tattr.expression as ExpressionLike,\n\t\t\t\t\"event\",\n\t\t\t\tcandidates,\n\t\t\t\tmatched,\n\t\t\t\tclassified,\n\t\t\t\tattribute_name_replacement,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t}\n}\n\nfunction make_attribute_name_replacement(\n\tnode: ElementLikeNode,\n\tattr: { start?: number; name?: string },\n): AttributeNameReplacement | undefined {\n\tif (!attr.name || !should_normalize_event_attribute_name(node) || attr.start === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst normalized_name = normalize_event_attribute_name(attr.name);\n\n\tif (normalized_name === attr.name) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tstart: attr.start,\n\t\tend: attr.start + attr.name.length,\n\t\ttext: normalized_name,\n\t};\n}\n\nfunction make_directive_name_replacement(\n\tnode: ElementLikeNode,\n\tattr: { start?: number; name?: string },\n): AttributeNameReplacement | undefined {\n\tif (!attr.name || !should_normalize_event_attribute_name(node) || attr.start === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst original_name = `on:${attr.name}`;\n\tconst normalized_name = normalize_event_attribute_name(original_name);\n\n\tif (normalized_name === original_name) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tstart: attr.start,\n\t\tend: attr.start + original_name.length,\n\t\ttext: normalized_name,\n\t};\n}\n\nfunction should_normalize_event_attribute_name(node: ElementLikeNode): boolean {\n\treturn (\n\t\tnode.type !== \"Component\" && node.type !== \"SvelteComponent\" && node.type !== \"SvelteSelf\"\n\t);\n}\n\nfunction visit_attribute_value(\n\tvalue: true | AST.ExpressionTag | Array<AST.Text | AST.ExpressionTag>,\n\tkind: TagKind,\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n\tattribute_name_replacement?: AttributeNameReplacement,\n): void {\n\tif (value === true) {\n\t\treturn;\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tfor (const part of value) {\n\t\t\tif (part.type === \"ExpressionTag\") {\n\t\t\t\tclassify_expression(\n\t\t\t\t\tpart.expression,\n\t\t\t\t\tkind,\n\t\t\t\t\tcandidates,\n\t\t\t\t\tmatched,\n\t\t\t\t\tclassified,\n\t\t\t\t\tattribute_name_replacement,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\n\tclassify_expression(\n\t\tvalue.expression,\n\t\tkind,\n\t\tcandidates,\n\t\tmatched,\n\t\tclassified,\n\t\tattribute_name_replacement,\n\t);\n}\n\ntype ExpressionLike = {\n\ttype: string;\n\tname?: string;\n\tcallee?: { type: string; name?: string };\n};\n\nfunction classify_expression(\n\texpression: ExpressionLike | null | undefined,\n\tkind: TagKind,\n\tcandidates: Map<string, MarkupCandidate>,\n\tmatched: Set<string>,\n\tclassified: ClassifiedCandidate[],\n\tattribute_name_replacement?: AttributeNameReplacement,\n): void {\n\tif (!expression) {\n\t\treturn;\n\t}\n\n\tconst found_candidates = find_candidates(expression, candidates);\n\n\tfor (const candidate of found_candidates) {\n\t\tif (matched.has(candidate.placeholder)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tmatched.add(candidate.placeholder);\n\t\tclassified.push({\n\t\t\tcandidate,\n\t\t\tkind: resolve_candidate_kind(candidate, kind),\n\t\t\tattribute_name_replacement,\n\t\t});\n\t}\n}\n\nfunction resolve_candidate_kind(candidate: MarkupCandidate, context_kind: TagKind): TagKind {\n\tif (candidate.key === \"render_argument\") {\n\t\treturn \"render_argument\";\n\t}\n\n\treturn context_kind;\n}\n\nfunction find_candidates(\n\texpression: ExpressionLike,\n\tcandidates: Map<string, MarkupCandidate>,\n): MarkupCandidate[] {\n\tconst found: MarkupCandidate[] = [];\n\tconst seen_nodes = new Set<unknown>();\n\tconst seen_placeholders = new Set<string>();\n\n\tvisit_expression_value(expression, candidates, seen_nodes, seen_placeholders, found);\n\n\treturn found;\n}\n\nfunction visit_expression_value(\n\tvalue: unknown,\n\tcandidates: Map<string, MarkupCandidate>,\n\tseen_nodes: Set<unknown>,\n\tseen_placeholders: Set<string>,\n\tfound: MarkupCandidate[],\n): void {\n\tif (Array.isArray(value)) {\n\t\tfor (const item of value) {\n\t\t\tvisit_expression_value(item, candidates, seen_nodes, seen_placeholders, found);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (!is_record(value) || seen_nodes.has(value)) {\n\t\treturn;\n\t}\n\n\tseen_nodes.add(value);\n\n\tif (value.type === \"Identifier\" && typeof value.name === \"string\") {\n\t\tconst candidate = candidates.get(value.name);\n\n\t\tif (candidate && !seen_placeholders.has(candidate.placeholder)) {\n\t\t\tseen_placeholders.add(candidate.placeholder);\n\t\t\tfound.push(candidate);\n\t\t}\n\t}\n\n\tfor (const child of Object.values(value)) {\n\t\tvisit_expression_value(child, candidates, seen_nodes, seen_placeholders, found);\n\t}\n}\n\nfunction is_record(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n","import ts from \"typescript\";\n\nexport function strip_arrow_function(expr: string): {\n\tparams: string;\n\tbody: string;\n\tbody_start: number;\n\tbody_end: number;\n} {\n\tconst arrow_idx = expr.indexOf(\"=>\");\n\n\tif (arrow_idx === -1) {\n\t\treturn { params: \"()\", body: expr, body_start: 0, body_end: expr.length };\n\t}\n\n\tconst params = expr.slice(0, arrow_idx).trim();\n\tconst raw_body = expr.slice(arrow_idx + 2);\n\tconst leading_ws = raw_body.length - raw_body.trimStart().length;\n\tlet body_start = arrow_idx + 2 + leading_ws;\n\tlet body_end = expr.length - (raw_body.length - raw_body.trimEnd().length);\n\tlet body = expr.slice(body_start, body_end);\n\n\tif (body.startsWith(\"{\") && body.endsWith(\"}\")) {\n\t\tbody_start += 1;\n\t\tbody_end -= 1;\n\t\tbody = body.slice(1, -1);\n\t}\n\n\tconst body_leading_ws = body.length - body.trimStart().length;\n\tconst body_trailing_ws = body.length - body.trimEnd().length;\n\n\tbody_start += body_leading_ws;\n\tbody_end -= body_trailing_ws;\n\tbody = body.trim();\n\n\tif (body.endsWith(\";\")) {\n\t\tbody = body.slice(0, -1);\n\t\tbody_end -= 1;\n\t}\n\n\treturn { params, body, body_start, body_end };\n}\n\nexport function is_callback_function_expression(expr: string): boolean {\n\tconst wrapped = `const __SER___callback = ${expr};`;\n\tconst sf = ts.createSourceFile(\n\t\t\"callback.ts\",\n\t\twrapped,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst stmt = sf.statements[0];\n\n\tif (!ts.isVariableStatement(stmt)) {\n\t\treturn false;\n\t}\n\n\tconst initializer = stmt.declarationList.declarations[0]?.initializer;\n\n\treturn (\n\t\tinitializer !== undefined &&\n\t\t(ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer))\n\t);\n}\n\nexport function analyze_event_body_yield_star(body: string): {\n\thas_top_level_yield_star: boolean;\n\thas_nested_invalid_yield_star: boolean;\n} {\n\tconst wrapped = `function* __SER___event() { ${body}; }`;\n\tconst sf = ts.createSourceFile(\n\t\t\"event.ts\",\n\t\twrapped,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst stmt = sf.statements[0];\n\n\tif (!ts.isFunctionDeclaration(stmt) || !stmt.body) {\n\t\treturn {\n\t\t\thas_top_level_yield_star: false,\n\t\t\thas_nested_invalid_yield_star: /\\byield\\s*\\*/.test(body),\n\t\t};\n\t}\n\n\tconst result = {\n\t\thas_top_level_yield_star: false,\n\t\thas_nested_invalid_yield_star: false,\n\t};\n\n\tvisit_event_body(stmt.body, \"top_level\", result);\n\n\treturn result;\n}\n\nexport function collect_free_identifiers(expr_text: string): string[] {\n\tconst wrapped = `function* __SER___w() { return (${expr_text}); }`;\n\tlet sf: ts.SourceFile;\n\n\ttry {\n\t\tsf = ts.createSourceFile(\n\t\t\t\"expr.ts\",\n\t\t\twrapped,\n\t\t\tts.ScriptTarget.Latest,\n\t\t\ttrue,\n\t\t\tts.ScriptKind.TS,\n\t\t);\n\t} catch {\n\t\treturn [];\n\t}\n\n\tconst fn = sf.statements[0];\n\n\tif (!ts.isFunctionDeclaration(fn) || !fn.body) {\n\t\treturn [];\n\t}\n\n\tconst ids: string[] = [];\n\tconst locals = new Set<string>();\n\tconst seen = new Set<string>();\n\n\tvisit_ids(fn.body, locals, seen, ids);\n\n\treturn ids;\n}\n\nfunction visit_ids(node: ts.Node, locals: Set<string>, seen: Set<string>, ids: string[]): void {\n\tif (\n\t\tts.isArrowFunction(node) ||\n\t\tts.isFunctionExpression(node) ||\n\t\tts.isFunctionDeclaration(node)\n\t) {\n\t\tconst scoped = new Set(locals);\n\n\t\tif (ts.isFunctionDeclaration(node) && node.name) {\n\t\t\tscoped.add(node.name.text);\n\t\t}\n\n\t\tfor (const parameter of node.parameters) {\n\t\t\tadd_binding_names(parameter.name, scoped);\n\t\t}\n\n\t\tif (node.body) {\n\t\t\tvisit_ids(node.body, scoped, seen, ids);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (ts.isVariableDeclaration(node)) {\n\t\tif (node.initializer) {\n\t\t\tvisit_ids(node.initializer, locals, seen, ids);\n\t\t}\n\n\t\tadd_binding_names(node.name, locals);\n\n\t\treturn;\n\t}\n\n\tif (ts.isTypeReferenceNode(node)) {\n\t\treturn;\n\t}\n\n\tif (ts.isIdentifier(node)) {\n\t\tif (\n\t\t\tnode.text === \"yield\" ||\n\t\t\tnode.text === \"undefined\" ||\n\t\t\tnode.text === \"null\" ||\n\t\t\tnode.text === \"true\" ||\n\t\t\tnode.text === \"false\" ||\n\t\t\tnode.text === \"this\"\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (is_property_access_name(node)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!locals.has(node.text) && !seen.has(node.text)) {\n\t\t\tseen.add(node.text);\n\t\t\tids.push(node.text);\n\t\t}\n\t\treturn;\n\t}\n\n\tnode.forEachChild((child) => visit_ids(child, locals, seen, ids));\n}\n\nfunction add_binding_names(name: ts.BindingName, locals: Set<string>): void {\n\tif (ts.isIdentifier(name)) {\n\t\tlocals.add(name.text);\n\t\treturn;\n\t}\n\n\tfor (const element of name.elements) {\n\t\tif (ts.isOmittedExpression(element)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tadd_binding_names(element.name, locals);\n\t}\n}\n\ntype EventYieldContext = \"top_level\" | \"nested_generator\" | \"nested_invalid\";\n\ninterface EventYieldAnalysis {\n\thas_top_level_yield_star: boolean;\n\thas_nested_invalid_yield_star: boolean;\n}\n\nfunction visit_event_body(\n\tnode: ts.Node,\n\tcontext: EventYieldContext,\n\tresult: EventYieldAnalysis,\n): void {\n\tif (is_yield_star_expression(node)) {\n\t\tif (context === \"top_level\") {\n\t\t\tresult.has_top_level_yield_star = true;\n\t\t} else if (context === \"nested_invalid\") {\n\t\t\tresult.has_nested_invalid_yield_star = true;\n\t\t}\n\n\t\tnode.forEachChild((child) => visit_event_body(child, context, result));\n\t\treturn;\n\t}\n\n\tif (is_nested_function_boundary(node)) {\n\t\tconst next_context = is_generator_function_boundary(node)\n\t\t\t? \"nested_generator\"\n\t\t\t: \"nested_invalid\";\n\n\t\tnode.forEachChild((child) => visit_event_body(child, next_context, result));\n\t\treturn;\n\t}\n\n\tnode.forEachChild((child) => visit_event_body(child, context, result));\n}\n\nfunction is_nested_function_boundary(node: ts.Node): boolean {\n\treturn (\n\t\tts.isArrowFunction(node) ||\n\t\tts.isFunctionExpression(node) ||\n\t\tts.isFunctionDeclaration(node) ||\n\t\tts.isMethodDeclaration(node) ||\n\t\tts.isGetAccessorDeclaration(node) ||\n\t\tts.isSetAccessorDeclaration(node)\n\t);\n}\n\nfunction is_generator_function_boundary(node: ts.Node): boolean {\n\treturn (\n\t\t(ts.isFunctionExpression(node) ||\n\t\t\tts.isFunctionDeclaration(node) ||\n\t\t\tts.isMethodDeclaration(node)) &&\n\t\tnode.asteriskToken !== undefined\n\t);\n}\n\nfunction is_yield_star_expression(node: ts.Node): boolean {\n\tif (ts.isYieldExpression(node)) {\n\t\treturn node.asteriskToken !== undefined;\n\t}\n\n\treturn (\n\t\tts.isBinaryExpression(node) &&\n\t\tnode.operatorToken.kind === ts.SyntaxKind.AsteriskToken &&\n\t\tts.isIdentifier(node.left) &&\n\t\tnode.left.text === \"yield\"\n\t);\n}\n\nfunction is_property_access_name(node: ts.Identifier): boolean {\n\tconst parent = node.parent;\n\n\treturn (\n\t\t(ts.isPropertyAccessExpression(parent) && parent.name === node) ||\n\t\t(ts.isPropertyAssignment(parent) && parent.name === node) ||\n\t\t(ts.isBindingElement(parent) && parent.propertyName === node) ||\n\t\tts.isImportSpecifier(parent) ||\n\t\tts.isExportSpecifier(parent)\n\t);\n}\n","import type { EffectCallbackRewriteContext } from \"./effect-bindings.ts\";\nimport { contains_top_level_yield_star } from \"$/detect.ts\";\nimport type { HelperDeclaration } from \"./types.ts\";\n\nimport MagicString from \"magic-string\";\nimport ts from \"typescript\";\n\nconst match_effect_members = new Map([\n\t[\"match\", \"matchEffect\"],\n\t[\"matchCause\", \"matchCauseEffect\"],\n]);\n\nconst effectful_callback_members = new Set([\n\t\"andThen\",\n\t\"catchAll\",\n\t\"catchAllCause\",\n\t\"catchCause\",\n\t\"catchTag\",\n\t\"flatMap\",\n\t\"forEach\",\n\t\"tap\",\n\t\"tapError\",\n\t\"tapErrorCause\",\n]);\n\nconst effectful_handler_members = new Set([\"matchCauseEffect\", \"matchEffect\", \"tapBoth\"]);\n\nconst effectful_handler_property_names = new Set([\"onFailure\", \"onSuccess\"]);\n\ninterface RewriteContext {\n\tsource_file: ts.SourceFile;\n\tsource_text: string;\n\tmagic: MagicString;\n\toffset: number;\n\tbindings: EffectCallbackRewriteContext;\n\tchanged: boolean;\n\tuses_wrapper: boolean;\n}\n\ninterface EffectMember {\n\tname: string;\n\tname_start: number;\n\tname_end: number;\n\tdirect: boolean;\n}\n\ntype EffectWrapperMember = \"gen\" | \"sync\";\n\nexport function normalize_effect_callback_yields(\n\texpr_text: string,\n\tbindings: EffectCallbackRewriteContext,\n): { expr_text: string; helpers: HelperDeclaration[] } {\n\tconst prefix = \"const __SER___expression = \";\n\tconst source_text = `${prefix}${expr_text};`;\n\tconst source_file = ts.createSourceFile(\n\t\t\"event-expression.ts\",\n\t\tsource_text,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst statement = source_file.statements[0];\n\tconst magic = new MagicString(expr_text);\n\tconst context: RewriteContext = {\n\t\tsource_file,\n\t\tsource_text,\n\t\tmagic,\n\t\toffset: prefix.length,\n\t\tbindings,\n\t\tchanged: false,\n\t\tuses_wrapper: false,\n\t};\n\n\tif (!ts.isVariableStatement(statement)) {\n\t\treturn { expr_text, helpers: [] };\n\t}\n\n\tconst expression = statement.declarationList.declarations[0]?.initializer;\n\n\tif (!expression) {\n\t\treturn { expr_text, helpers: [] };\n\t}\n\n\tvisit_expression(expression, context);\n\n\tif (!context.changed) {\n\t\treturn { expr_text, helpers: [] };\n\t}\n\n\tconst helpers =\n\t\tcontext.uses_wrapper && bindings.wrapper_import ? [bindings.wrapper_import] : [];\n\n\treturn {\n\t\texpr_text: magic.toString(),\n\t\thelpers,\n\t};\n}\n\nfunction visit_expression(node: ts.Node, context: RewriteContext): void {\n\tif (is_non_generator_callback_with_top_level_yield(node)) {\n\t\treturn;\n\t}\n\n\tif (ts.isCallExpression(node)) {\n\t\trewrite_match_call(node, context);\n\t\trewrite_effectful_handler_call(node, context);\n\t\trewrite_effectful_callback_arguments(node, context);\n\t}\n\n\tnode.forEachChild((child) => {\n\t\tvisit_expression(child, context);\n\t});\n}\n\nfunction rewrite_match_call(call: ts.CallExpression, context: RewriteContext): void {\n\tconst member = get_effect_member(call.expression, context);\n\tconst upgraded_name = member && match_effect_members.get(member.name);\n\tconst options = get_last_object_argument(call);\n\n\tif (!member || !upgraded_name || !options) {\n\t\treturn;\n\t}\n\n\tconst handlers = get_handler_properties(options);\n\tconst should_upgrade = handlers.some(\n\t\t(handler) =>\n\t\t\thandler.callback && is_non_generator_callback_with_top_level_yield(handler.callback),\n\t);\n\n\tif (!should_upgrade) {\n\t\treturn;\n\t}\n\n\trewrite_effect_member_name(member, upgraded_name, context);\n\tcontext.changed = true;\n\n\tfor (const handler of handlers) {\n\t\tif (!handler.callback) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (is_non_generator_callback_with_top_level_yield(handler.callback)) {\n\t\t\trewrite_callback_to_effect_gen(handler.callback, context);\n\t\t} else {\n\t\t\trewrite_callback_to_effect_sync(handler.callback, context);\n\t\t}\n\t}\n}\n\nfunction rewrite_effectful_handler_call(call: ts.CallExpression, context: RewriteContext): void {\n\tconst member = get_effect_member(call.expression, context);\n\tconst options = get_last_object_argument(call);\n\n\tif (!member || !effectful_handler_members.has(member.name) || !options) {\n\t\treturn;\n\t}\n\n\tfor (const handler of get_handler_properties(options)) {\n\t\tif (handler.callback && is_non_generator_callback_with_top_level_yield(handler.callback)) {\n\t\t\trewrite_callback_to_effect_gen(handler.callback, context);\n\t\t}\n\t}\n}\n\nfunction rewrite_effectful_callback_arguments(\n\tcall: ts.CallExpression,\n\tcontext: RewriteContext,\n): void {\n\tconst member = get_effect_member(call.expression, context);\n\n\tif (!member || !effectful_callback_members.has(member.name)) {\n\t\treturn;\n\t}\n\n\tfor (const argument of call.arguments) {\n\t\tif (\n\t\t\tis_callback_expression(argument) &&\n\t\t\tis_non_generator_callback_with_top_level_yield(argument)\n\t\t) {\n\t\t\trewrite_callback_to_effect_gen(argument, context);\n\t\t}\n\t}\n}\n\nfunction rewrite_callback_to_effect_gen(\n\tcallback: ts.ArrowFunction | ts.FunctionExpression,\n\tcontext: RewriteContext,\n): void {\n\tif (is_async_function(callback)) {\n\t\treturn;\n\t}\n\n\tif (ts.isArrowFunction(callback)) {\n\t\trewrite_arrow_callback(callback, \"gen\", context);\n\t\treturn;\n\t}\n\n\trewrite_function_body(callback, \"gen\", context);\n}\n\nfunction rewrite_callback_to_effect_sync(\n\tcallback: ts.ArrowFunction | ts.FunctionExpression,\n\tcontext: RewriteContext,\n): void {\n\tif (is_async_function(callback)) {\n\t\treturn;\n\t}\n\n\tif (ts.isArrowFunction(callback)) {\n\t\trewrite_arrow_callback(callback, \"sync\", context);\n\t\treturn;\n\t}\n\n\trewrite_function_body(callback, \"sync\", context);\n}\n\nfunction rewrite_arrow_callback(\n\tcallback: ts.ArrowFunction,\n\twrapper: EffectWrapperMember,\n\tcontext: RewriteContext,\n): void {\n\tconst start = to_expr_pos(callback.getStart(context.source_file), context);\n\tconst end = to_expr_pos(callback.end, context);\n\tconst params_text = context.source_text\n\t\t.slice(\n\t\t\tcallback.getStart(context.source_file),\n\t\t\tcallback.equalsGreaterThanToken.getStart(context.source_file),\n\t\t)\n\t\t.trim();\n\tconst body_text = get_body_text(callback.body, context);\n\tconst rewritten_body = make_effect_body(callback.body, body_text, wrapper, context);\n\tconst replacement = `${params_text} => ${rewritten_body}`;\n\n\tcontext.magic.overwrite(start, end, replacement);\n\tcontext.changed = true;\n}\n\nfunction rewrite_function_body(\n\tcallback: ts.FunctionExpression,\n\twrapper: EffectWrapperMember,\n\tcontext: RewriteContext,\n): void {\n\tconst body_start = to_expr_pos(callback.body.getStart(context.source_file), context);\n\tconst body_end = to_expr_pos(callback.body.end, context);\n\tconst body_text = get_body_text(callback.body, context);\n\tconst rewritten_body = make_effect_body(callback.body, body_text, wrapper, context);\n\n\tcontext.magic.overwrite(body_start, body_end, `{ return ${rewritten_body}; }`);\n\tcontext.changed = true;\n}\n\nfunction make_effect_body(\n\tbody: ts.ConciseBody,\n\tbody_text: string,\n\twrapper: EffectWrapperMember,\n\tcontext: RewriteContext,\n): string {\n\tconst wrapper_access = make_effect_access(wrapper, context);\n\n\tif (wrapper === \"gen\") {\n\t\tif (ts.isBlock(body)) {\n\t\t\treturn `${wrapper_access}(function* () ${body_text})`;\n\t\t}\n\n\t\treturn `${wrapper_access}(function* () { return (${body_text}); })`;\n\t}\n\n\tif (ts.isBlock(body)) {\n\t\treturn `${wrapper_access}(() => ${body_text})`;\n\t}\n\n\treturn `${wrapper_access}(() => (${body_text}))`;\n}\n\nfunction get_body_text(body: ts.ConciseBody, context: RewriteContext): string {\n\treturn context.source_text.slice(body.getStart(context.source_file), body.end).trim();\n}\n\nfunction get_handler_properties(object_literal: ts.ObjectLiteralExpression): Array<{\n\tcallback: ts.ArrowFunction | ts.FunctionExpression | undefined;\n}> {\n\treturn object_literal.properties.flatMap((property) => {\n\t\tif (!ts.isPropertyAssignment(property)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst name = get_property_name(property.name);\n\n\t\tif (!name || !effectful_handler_property_names.has(name)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst callback = is_callback_expression(property.initializer)\n\t\t\t? property.initializer\n\t\t\t: undefined;\n\n\t\treturn [{ callback }];\n\t});\n}\n\nfunction get_last_object_argument(call: ts.CallExpression): ts.ObjectLiteralExpression | undefined {\n\tconst last_argument = call.arguments[call.arguments.length - 1];\n\n\tif (!last_argument || !ts.isObjectLiteralExpression(last_argument)) {\n\t\treturn undefined;\n\t}\n\n\treturn last_argument;\n}\n\nfunction get_effect_member(\n\texpression: ts.Expression,\n\tcontext: RewriteContext,\n): EffectMember | undefined {\n\tif (ts.isIdentifier(expression)) {\n\t\tconst direct_member = context.bindings.direct_members.get(expression.text);\n\n\t\tif (!direct_member) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tname: direct_member,\n\t\t\tname_start: to_expr_pos(expression.getStart(context.source_file), context),\n\t\t\tname_end: to_expr_pos(expression.end, context),\n\t\t\tdirect: true,\n\t\t};\n\t}\n\n\tif (!ts.isPropertyAccessExpression(expression)) {\n\t\treturn undefined;\n\t}\n\n\tif (!is_effect_namespace_expression(expression.expression, context)) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tname: expression.name.text,\n\t\tname_start: to_expr_pos(expression.name.getStart(context.source_file), context),\n\t\tname_end: to_expr_pos(expression.name.end, context),\n\t\tdirect: false,\n\t};\n}\n\nfunction rewrite_effect_member_name(\n\tmember: EffectMember,\n\tupgraded_name: string,\n\tcontext: RewriteContext,\n): void {\n\tif (member.direct) {\n\t\tcontext.magic.overwrite(\n\t\t\tmember.name_start,\n\t\t\tmember.name_end,\n\t\t\tmake_effect_access(upgraded_name, context),\n\t\t);\n\n\t\treturn;\n\t}\n\n\tcontext.magic.overwrite(member.name_start, member.name_end, upgraded_name);\n}\n\nfunction make_effect_access(member_name: string, context: RewriteContext): string {\n\tcontext.uses_wrapper = true;\n\n\treturn `${context.bindings.wrapper_expression}.${member_name}`;\n}\n\nfunction is_effect_namespace_expression(\n\texpression: ts.Expression,\n\tcontext: RewriteContext,\n): boolean {\n\tif (ts.isIdentifier(expression)) {\n\t\treturn (\n\t\t\tcontext.bindings.effect_object_names.has(expression.text) ||\n\t\t\tcontext.bindings.effect_module_names.has(expression.text)\n\t\t);\n\t}\n\n\tif (!ts.isPropertyAccessExpression(expression)) {\n\t\treturn false;\n\t}\n\n\tif (expression.name.text !== \"Effect\") {\n\t\treturn false;\n\t}\n\n\tif (!ts.isIdentifier(expression.expression)) {\n\t\treturn false;\n\t}\n\n\treturn context.bindings.effect_package_names.has(expression.expression.text);\n}\n\nfunction get_property_name(name: ts.PropertyName): string | undefined {\n\tif (ts.isIdentifier(name) || ts.isStringLiteral(name)) {\n\t\treturn name.text;\n\t}\n\n\treturn undefined;\n}\n\nfunction is_callback_expression(node: ts.Node): node is ts.ArrowFunction | ts.FunctionExpression {\n\treturn ts.isArrowFunction(node) || ts.isFunctionExpression(node);\n}\n\nfunction is_non_generator_callback_with_top_level_yield(\n\tnode: ts.Node,\n): node is ts.ArrowFunction | ts.FunctionExpression {\n\tif (!is_callback_expression(node)) {\n\t\treturn false;\n\t}\n\n\tif (ts.isFunctionExpression(node) && node.asteriskToken) {\n\t\treturn false;\n\t}\n\n\treturn contains_top_level_yield_star(node.body);\n}\n\nfunction is_async_function(node: ts.ArrowFunction | ts.FunctionExpression): boolean {\n\treturn (\n\t\tnode.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword) ?? false\n\t);\n}\n\nfunction to_expr_pos(pos: number, context: RewriteContext): number {\n\treturn pos - context.offset;\n}\n","import ts from \"typescript\";\n\nexport function is_yield_star_expression(node: ts.Node): boolean {\n\treturn (\n\t\tts.isBinaryExpression(node) &&\n\t\tnode.operatorToken.kind === ts.SyntaxKind.AsteriskToken &&\n\t\tts.isIdentifier(node.left) &&\n\t\tnode.left.text === \"yield\"\n\t);\n}\n\nfunction is_function_boundary_node(node: ts.Node): boolean {\n\treturn (\n\t\tts.isArrowFunction(node) ||\n\t\tts.isFunctionDeclaration(node) ||\n\t\tts.isFunctionExpression(node) ||\n\t\tts.isMethodDeclaration(node) ||\n\t\tts.isGetAccessorDeclaration(node) ||\n\t\tts.isSetAccessorDeclaration(node)\n\t);\n}\n\nexport function contains_top_level_await(node: ts.Node): boolean {\n\tif (ts.isAwaitExpression(node)) {\n\t\treturn true;\n\t}\n\n\treturn node\n\t\t.getChildren()\n\t\t.some((child) => !is_function_boundary_node(child) && contains_top_level_await(child));\n}\n\nexport function collect_yield_star_nodes(node: ts.Node, on_found: (node: ts.Node) => void): void {\n\tif (is_function_boundary_node(node)) {\n\t\treturn;\n\t}\n\n\tif (is_yield_star_expression(node)) {\n\t\ton_found(node);\n\t\treturn;\n\t}\n\n\tnode.forEachChild((child) => {\n\t\tcollect_yield_star_nodes(child, on_found);\n\t});\n}\n\nexport function find_yield_star_node(node: ts.Node, on_found: (node: ts.Node) => void): void {\n\tif (is_function_boundary_node(node)) {\n\t\treturn;\n\t}\n\n\tif (is_yield_star_expression(node)) {\n\t\ton_found(node);\n\t\treturn;\n\t}\n\n\tnode.forEachChild((child) => {\n\t\tfind_yield_star_node(child, on_found);\n\t});\n}\n","import type {\n\tHelperDeclaration,\n\tMarkupCandidate,\n\tMarkupHelperBindings,\n\tMarkupNameAllocator,\n\tMarkupTransformTarget,\n\tPendingRelocation,\n\tReplacement,\n\tTagKind,\n} from \"./types.ts\";\nimport {\n\tanalyze_event_body_yield_star,\n\tcollect_free_identifiers,\n\tis_callback_function_expression,\n} from \"./expressions.ts\";\nimport { AsyncEffectInEventCallbackError, YieldStarInEventCallbackError } from \"$/errors.ts\";\nimport type { EffectCallbackRewriteContext } from \"./effect-bindings.ts\";\nimport { normalize_effect_callback_yields } from \"./effect-callbacks.ts\";\nimport { collect_yield_star_nodes } from \"$/script-transform/ast.ts\";\n\nimport ts from \"typescript\";\n\ninterface ClassifiedCandidate {\n\tcandidate: MarkupCandidate;\n\tkind: TagKind;\n\tattribute_name_replacement: AttributeNameReplacement | undefined;\n}\n\ninterface AttributeNameReplacement {\n\tstart: number;\n\tend: number;\n\ttext: string;\n}\n\ntype ExpressionRelocation = {\n\toriginalStart: number;\n\toriginalEnd: number;\n\tgeneratedStart: number;\n\tgeneratedEnd: number;\n};\n\nexport function emit_replacements(\n\tclassified: ClassifiedCandidate[],\n\teffect_context: EffectCallbackRewriteContext,\n\thelper_bindings: MarkupHelperBindings,\n\tname_allocator: MarkupNameAllocator,\n\ttarget: MarkupTransformTarget,\n): Replacement[] {\n\tconst expression_replacements = classified.map(({ candidate, kind }) =>\n\t\temit_replacement(candidate, kind, effect_context, helper_bindings, name_allocator, target),\n\t);\n\tconst attribute_replacements = unique_attribute_name_replacements(classified).map(\n\t\t(replacement) => ({\n\t\t\tstart: replacement.start,\n\t\t\tend: replacement.end,\n\t\t\ttext: replacement.text,\n\t\t}),\n\t);\n\n\treturn [...attribute_replacements, ...expression_replacements];\n}\n\nfunction unique_attribute_name_replacements(\n\tclassified: ClassifiedCandidate[],\n): AttributeNameReplacement[] {\n\tconst seen = new Set<string>();\n\n\treturn classified\n\t\t.map((entry) => entry.attribute_name_replacement)\n\t\t.filter((replacement): replacement is AttributeNameReplacement => {\n\t\t\tif (!replacement) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst key = `${replacement.start}:${replacement.end}:${replacement.text}`;\n\n\t\t\tif (seen.has(key)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tseen.add(key);\n\n\t\t\treturn true;\n\t\t});\n}\n\nfunction emit_replacement(\n\tcandidate: MarkupCandidate,\n\tkind: TagKind,\n\teffect_context: EffectCallbackRewriteContext,\n\thelper_bindings: MarkupHelperBindings,\n\tname_allocator: MarkupNameAllocator,\n\ttarget: MarkupTransformTarget,\n): Replacement {\n\tconst normalized = normalize_effect_callback_yields(candidate.expr_text, effect_context);\n\tconst normalized_candidate = {\n\t\t...candidate,\n\t\texpr_text: normalized.expr_text,\n\t};\n\tconst id = make_cache_id(candidate);\n\tconst id_text = JSON.stringify(id);\n\tconst helper_name = make_helper_name(candidate, name_allocator);\n\tconst is_server_target = target === \"server\";\n\n\tlet replacement_text: string;\n\tlet helpers: HelperDeclaration[];\n\tlet relocation: PendingRelocation | undefined;\n\n\tif (kind === \"await\") {\n\t\tconst effect = make_effect_helper(normalized_candidate, helper_name, helper_bindings);\n\n\t\treplacement_text = emit_promise_expression(\n\t\t\tid_text,\n\t\t\teffect,\n\t\t\thelper_bindings,\n\t\t\t\"undefined\",\n\t\t\t`{ ssr: \"pending\" }`,\n\t\t);\n\t\thelpers = [...normalized.helpers, effect.helper];\n\t} else if (kind === \"render\") {\n\t\tconst effect = make_effect_helper(normalized_candidate, helper_name, helper_bindings);\n\n\t\treplacement_text = emit_render_expression(\n\t\t\tid_text,\n\t\t\teffect,\n\t\t\tcandidate,\n\t\t\thelper_bindings,\n\t\t\tis_server_target,\n\t\t);\n\t\thelpers = [...normalized.helpers, effect.helper];\n\t} else if (kind === \"render_argument\") {\n\t\tconst effect = make_effect_helper(normalized_candidate, helper_name, helper_bindings);\n\n\t\treplacement_text = emit_await_expression(\n\t\t\tid_text,\n\t\t\teffect,\n\t\t\thelper_bindings,\n\t\t\tserver_fallback(is_server_target, \"undefined\"),\n\t\t);\n\t\thelpers = [...normalized.helpers, effect.helper];\n\t} else if (kind === \"each\") {\n\t\tconst effect = make_effect_helper(normalized_candidate, helper_name, helper_bindings);\n\n\t\treplacement_text = emit_await_expression(\n\t\t\tid_text,\n\t\t\teffect,\n\t\t\thelper_bindings,\n\t\t\tserver_fallback(is_server_target, \"[]\"),\n\t\t);\n\t\thelpers = [...normalized.helpers, effect.helper];\n\t} else if (kind === \"event\") {\n\t\tconst event = make_event_handler(normalized_candidate, helper_bindings);\n\n\t\treplacement_text = event.text;\n\t\thelpers = normalized.helpers;\n\t\trelocation = make_pending_relocation(\n\t\t\tcandidate,\n\t\t\treplacement_text,\n\t\t\tevent.expr_text,\n\t\t\tevent.relocation,\n\t\t);\n\t} else if (kind === \"html\") {\n\t\tconst effect = make_inline_effect(normalized_candidate, helper_bindings);\n\n\t\treplacement_text = emit_await_expression(id_text, effect, helper_bindings);\n\t\thelpers = normalized.helpers;\n\t\trelocation = make_pending_relocation(\n\t\t\tcandidate,\n\t\t\treplacement_text,\n\t\t\teffect.effect_text,\n\t\t\teffect.relocation,\n\t\t);\n\t} else {\n\t\tconst effect = make_effect_helper(normalized_candidate, helper_name, helper_bindings);\n\n\t\treplacement_text = emit_await_expression(\n\t\t\tid_text,\n\t\t\teffect,\n\t\t\thelper_bindings,\n\t\t\tserver_fallback(is_server_target, \"undefined\"),\n\t\t);\n\t\thelpers = [...normalized.helpers, effect.helper];\n\t}\n\n\treturn {\n\t\tstart: candidate.start,\n\t\tend: candidate.end,\n\t\ttext: replacement_text,\n\t\thelpers,\n\t\t...(relocation ? { relocation } : {}),\n\t};\n}\n\nfunction make_event_handler(\n\tcandidate: MarkupCandidate,\n\thelper_bindings: MarkupHelperBindings,\n): { text: string; expr_text: string; relocation: ExpressionRelocation | undefined } {\n\tconst expr_text = candidate.expr_text;\n\n\tif (is_callback_function_expression(expr_text)) {\n\t\tthrow new YieldStarInEventCallbackError(candidate.filename, expr_text);\n\t}\n\n\tconst analysis = analyze_event_body_yield_star(expr_text);\n\n\tif (analysis.has_nested_invalid_yield_star) {\n\t\tthrow new AsyncEffectInEventCallbackError(candidate.filename, expr_text);\n\t}\n\n\tconst wrapped_expr_text = wrap_yield_stars(expr_text, helper_bindings);\n\n\treturn {\n\t\texpr_text: wrapped_expr_text,\n\t\trelocation: make_yield_operand_relocation(expr_text, wrapped_expr_text, helper_bindings),\n\t\ttext: `(event) => { ${helper_bindings.dispatcher}.emit({ type: ${helper_bindings.codes}.Markup.Run, fn: function* () { ${wrapped_expr_text}; } }); }`,\n\t};\n}\n\nfunction emit_promise_expression(\n\tid_text: string,\n\teffect: EffectHelper,\n\thelper_bindings: MarkupHelperBindings,\n\tssr_fallback?: string,\n\toptions?: string,\n): string {\n\tconst properties = [\n\t\t`type: ${helper_bindings.codes}.Markup.Promise`,\n\t\t`id: ${id_text}`,\n\t\t`deps: ${effect.deps_text}`,\n\t\t`fn: () => ${effect.call}`,\n\t\tssr_fallback !== undefined && `ssr_fallback: ${ssr_fallback}`,\n\t\toptions !== undefined && `options: ${options}`,\n\t].filter((property): property is string => property !== false);\n\n\treturn `${helper_bindings.dispatcher}.emit({ ${properties.join(\", \")} })`;\n}\n\nfunction emit_render_expression(\n\tid_text: string,\n\teffect: EffectHelper,\n\tcandidate: MarkupCandidate,\n\thelper_bindings: MarkupHelperBindings,\n\tis_server_target: boolean,\n): string {\n\tconst expression = emit_promise_expression(\n\t\tid_text,\n\t\teffect,\n\t\thelper_bindings,\n\t\tserver_fallback(is_server_target, `() => undefined`),\n\t);\n\n\tif (/^\\s*yield\\s*\\*/.test(candidate.expr_text)) {\n\t\treturn `(await ${expression})()`;\n\t}\n\n\treturn `await ${expression}`;\n}\n\nfunction emit_await_expression(\n\tid_text: string,\n\teffect: EffectHelper,\n\thelper_bindings: MarkupHelperBindings,\n\tssr_fallback?: string,\n): string {\n\treturn `await ${emit_promise_expression(id_text, effect, helper_bindings, ssr_fallback)}`;\n}\n\nfunction server_fallback(is_server_target: boolean, fallback: string): string | undefined {\n\treturn is_server_target ? fallback : undefined;\n}\n\ninterface EffectHelper {\n\tcall: string;\n\tdeps_text: string;\n}\n\ninterface DeclaredEffectHelper extends EffectHelper {\n\thelper: HelperDeclaration;\n}\n\ninterface InlineEffectHelper extends EffectHelper {\n\teffect_text: string;\n\trelocation: ExpressionRelocation | undefined;\n}\n\nfunction make_effect_helper(\n\tcandidate: MarkupCandidate,\n\thelper_name: string,\n\thelper_bindings: Pick<MarkupHelperBindings, \"yieldable\">,\n): DeclaredEffectHelper {\n\tconst deps = collect_free_identifiers(candidate.expr_text);\n\tconst args_text = deps.join(\", \");\n\tconst deps_text = deps.length === 0 ? \"[]\" : `[${args_text}]`;\n\tconst call = `${helper_name}()`;\n\tconst effect_text = wrap_yield_stars(candidate.expr_text, helper_bindings);\n\tconst text = `function* ${helper_name}() { return (${effect_text}); }`;\n\tconst generated_start = text.indexOf(effect_text);\n\tconst operand_relocation = make_yield_operand_relocation(\n\t\tcandidate.expr_text,\n\t\teffect_text,\n\t\thelper_bindings,\n\t);\n\tconst relocation =\n\t\toperand_relocation ??\n\t\t({\n\t\t\toriginalStart: 0,\n\t\t\toriginalEnd: candidate.expr_text.length,\n\t\t\tgeneratedStart: 0,\n\t\t\tgeneratedEnd: effect_text.length,\n\t\t} satisfies ExpressionRelocation);\n\n\treturn {\n\t\tcall,\n\t\tdeps_text,\n\t\thelper: {\n\t\t\ttext,\n\t\t\trelocation: {\n\t\t\t\toriginalStart: candidate.start + relocation.originalStart,\n\t\t\t\toriginalEnd: candidate.start + relocation.originalEnd,\n\t\t\t\tgeneratedStartInReplacement: generated_start + relocation.generatedStart,\n\t\t\t\tgeneratedEndInReplacement: generated_start + relocation.generatedEnd,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction make_inline_effect(\n\tcandidate: MarkupCandidate,\n\thelper_bindings: Pick<MarkupHelperBindings, \"yieldable\">,\n): InlineEffectHelper {\n\tconst deps = collect_free_identifiers(candidate.expr_text);\n\tconst deps_text = deps.length === 0 ? \"[]\" : `[${deps.join(\", \")}]`;\n\tconst effect_text = wrap_yield_stars(candidate.expr_text, helper_bindings);\n\tconst relocation = make_yield_operand_relocation(\n\t\tcandidate.expr_text,\n\t\teffect_text,\n\t\thelper_bindings,\n\t);\n\n\treturn {\n\t\tcall: `(function* () { return (${effect_text}); })()`,\n\t\tdeps_text,\n\t\teffect_text,\n\t\trelocation,\n\t};\n}\n\nfunction wrap_yield_stars(\n\ttext: string,\n\thelper_bindings: Pick<MarkupHelperBindings, \"yieldable\">,\n): string {\n\tconst source_file = ts.createSourceFile(\n\t\t\"markup-yield.ts\",\n\t\ttext,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst replacements: Array<{\n\t\tstart: number;\n\t\tend: number;\n\t\ttext: string;\n\t}> = [];\n\n\tcollect_yield_star_nodes(source_file, (node) => {\n\t\tconst yield_text = text.slice(node.getStart(source_file), node.end).trim();\n\n\t\treplacements.push({\n\t\t\tstart: node.getStart(source_file),\n\t\t\tend: node.end,\n\t\t\ttext: `yield* ${helper_bindings.yieldable}(${strip_yield_star(yield_text)})`,\n\t\t});\n\t});\n\n\tif (replacements.length === 0) {\n\t\treturn text;\n\t}\n\n\treplacements.sort((a, b) => b.start - a.start);\n\n\tlet output = text;\n\n\tfor (const replacement of replacements) {\n\t\toutput =\n\t\t\toutput.slice(0, replacement.start) + replacement.text + output.slice(replacement.end);\n\t}\n\n\treturn output;\n}\n\nfunction strip_yield_star(yield_text: string): string {\n\treturn yield_text.replace(/^yield\\s*\\*\\s*/, \"\");\n}\n\nfunction make_yield_operand_relocation(\n\toriginal_text: string,\n\tgenerated_text: string,\n\thelper_bindings: Pick<MarkupHelperBindings, \"yieldable\">,\n): ExpressionRelocation | undefined {\n\tconst source_file = ts.createSourceFile(\n\t\t\"markup-yield-relocation.ts\",\n\t\toriginal_text,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tlet yield_node: ts.Node | undefined;\n\n\tcollect_yield_star_nodes(source_file, (node) => {\n\t\tyield_node ??= node;\n\t});\n\n\tif (!yield_node || !ts.isBinaryExpression(yield_node)) {\n\t\treturn undefined;\n\t}\n\n\tconst operand = yield_node.right;\n\tconst original_start = operand.getStart(source_file);\n\tconst original_end = operand.end;\n\tconst operand_text = original_text.slice(original_start, original_end).trim();\n\tconst wrapper_text = `${helper_bindings.yieldable}(${operand_text})`;\n\tconst wrapper_start = generated_text.indexOf(wrapper_text);\n\n\tif (wrapper_start === -1) {\n\t\treturn undefined;\n\t}\n\n\tconst generated_start = wrapper_start + wrapper_text.indexOf(operand_text);\n\n\treturn {\n\t\toriginalStart: original_start,\n\t\toriginalEnd: original_end,\n\t\tgeneratedStart: generated_start,\n\t\tgeneratedEnd: generated_start + operand_text.length,\n\t};\n}\n\nfunction make_cache_id(candidate: MarkupCandidate): string {\n\tconst normalized_filename = candidate.filename.replace(/[?#].*$/, \"\");\n\n\treturn `${normalized_filename}:${candidate.start}:${candidate.end}`;\n}\n\nfunction make_helper_name(candidate: MarkupCandidate, name_allocator: MarkupNameAllocator): string {\n\treturn name_allocator.reserve(`__SER___markup_effect_${candidate.start}_${candidate.end}`);\n}\n\nfunction make_pending_relocation(\n\tcandidate: MarkupCandidate,\n\treplacement_text: string,\n\texpression_text: string,\n\trelocation: ExpressionRelocation | undefined,\n): PendingRelocation | undefined {\n\tif (!relocation) {\n\t\treturn undefined;\n\t}\n\n\tconst generated_start = replacement_text.indexOf(expression_text);\n\n\tif (generated_start === -1) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\toriginalStart: candidate.start + relocation.originalStart,\n\t\toriginalEnd: candidate.start + relocation.originalEnd,\n\t\tgeneratedStartInReplacement: generated_start + relocation.generatedStart,\n\t\tgeneratedEndInReplacement: generated_start + relocation.generatedEnd,\n\t};\n}\n","import type MagicString from \"magic-string\";\nimport type ts from \"typescript\";\n\nexport function create_source_map(magic: MagicString, filename: string): Record<string, unknown> {\n\tconst map = magic.generateMap({\n\t\thires: true,\n\t\tincludeContent: true,\n\t\tsource: filename,\n\t});\n\n\treturn map as unknown as Record<string, unknown>;\n}\n\nexport function slice(content: string, node: ts.Node): string {\n\treturn content.slice(node.getFullStart(), node.end);\n}\n\nexport function slice_start(content: string, node: ts.Node): string {\n\treturn content.slice(node.getStart(), node.end);\n}\n","import { contains_top_level_yield_star } from \"$/detect.ts\";\nimport { AsyncEffectInSyncRuneError } from \"$/errors.ts\";\nimport { slice } from \"./source.ts\";\n\nimport ts from \"typescript\";\n\nconst async_expression_runes = new Set([\n\t\"$derived\",\n\t\"$state\",\n\t\"$state.raw\",\n\t\"$state.snapshot\",\n\t\"$bindable\",\n]);\n\nconst callback_runes = new Set([\"$derived.by\", \"$effect\", \"$effect.pre\", \"$effect.root\"]);\n\nexport function validate_rune_yield_usage(node: ts.Node, content: string, filename: string): void {\n\tvisit_rune_yield_usage(node, content, filename);\n}\n\nfunction visit_rune_yield_usage(node: ts.Node, content: string, filename: string): void {\n\tif (ts.isCallExpression(node)) {\n\t\tvalidate_call_expression(node, content, filename);\n\t}\n\n\tnode.forEachChild((child) => {\n\t\tvisit_rune_yield_usage(child, content, filename);\n\t});\n}\n\nfunction validate_call_expression(\n\tcall: ts.CallExpression,\n\tcontent: string,\n\tfilename: string,\n): void {\n\tconst rune_name = get_rune_name(call.expression);\n\n\tif (!rune_name) {\n\t\treturn;\n\t}\n\n\tif (!async_expression_runes.has(rune_name) && contains_top_level_yield_star(call)) {\n\t\tthrow new AsyncEffectInSyncRuneError(rune_name, slice(content, call), filename);\n\t}\n\n\tif (!callback_runes.has(rune_name)) {\n\t\treturn;\n\t}\n\n\tconst callback = call.arguments[0];\n\n\tif (!callback || !callback_has_top_level_yield_star(callback)) {\n\t\treturn;\n\t}\n\n\tthrow new AsyncEffectInSyncRuneError(rune_name, slice(content, call), filename);\n}\n\nfunction callback_has_top_level_yield_star(node: ts.Expression): boolean {\n\tif ((ts.isArrowFunction(node) || ts.isFunctionExpression(node)) && node.body !== undefined) {\n\t\treturn contains_top_level_yield_star(node.body);\n\t}\n\n\treturn contains_top_level_yield_star(node);\n}\n\nfunction get_rune_name(expr: ts.Expression): string | undefined {\n\tif (ts.isIdentifier(expr) && is_rune_root(expr.text)) {\n\t\treturn expr.text;\n\t}\n\n\tif (!ts.isPropertyAccessExpression(expr)) {\n\t\treturn undefined;\n\t}\n\n\tconst root_name = get_rune_name(expr.expression);\n\n\tif (!root_name) {\n\t\treturn undefined;\n\t}\n\n\treturn `${root_name}.${expr.name.text}`;\n}\n\nfunction is_rune_root(name: string): boolean {\n\treturn (\n\t\tname === \"$bindable\" ||\n\t\tname === \"$derived\" ||\n\t\tname === \"$effect\" ||\n\t\tname === \"$host\" ||\n\t\tname === \"$inspect\" ||\n\t\tname === \"$props\" ||\n\t\tname === \"$state\"\n\t);\n}\n","import { analyze_event_body_yield_star, strip_arrow_function } from \"./expressions.ts\";\nimport { validate_rune_yield_usage } from \"$/script-transform/runes.ts\";\nimport type { SvelteEffectSourceScan } from \"$/compiler/source-scan.ts\";\nimport { collect_yield_star_nodes } from \"$/script-transform/ast.ts\";\nimport { contains_top_level_yield_star } from \"$/detect.ts\";\nimport type { MarkupCandidate, TagKind } from \"./types.ts\";\nimport { default_helper_bindings } from \"./constants.ts\";\n\nimport MagicString from \"magic-string\";\nimport ts from \"typescript\";\n\ninterface SanitizeResult {\n\tparse_code: string;\n\tcandidates: MarkupCandidate[];\n}\n\ninterface DeclarationYieldExpression {\n\tstart: number;\n\tend: number;\n\texpr_text: string;\n}\n\nexport function sanitize_markup(source_scan: SvelteEffectSourceScan): SanitizeResult {\n\tconst content = source_scan.source;\n\tconst filename = source_scan.filename;\n\tconst candidates: MarkupCandidate[] = [];\n\tconst magic = new MagicString(content);\n\tlet helper_index = 0;\n\n\tfor (const expression of source_scan.markup_expressions) {\n\t\tconst open = expression.open;\n\t\tconst close = expression.close;\n\t\tconst inner = expression.inner;\n\t\tconst trimmed = inner.trimStart();\n\t\tconst leading_ws = inner.length - trimmed.length;\n\t\tconst tag_info = get_tag_info(trimmed);\n\t\tconst declaration_yields = collect_declaration_yield_expressions(\n\t\t\tcontent,\n\t\t\topen,\n\t\t\tleading_ws,\n\t\t\ttrimmed,\n\t\t\tfilename,\n\t\t);\n\n\t\tif (declaration_yields.length > 0) {\n\t\t\tfor (const declaration_yield of declaration_yields) {\n\t\t\t\tconst placeholder = `__SER___markup_placeholder_${helper_index}`;\n\t\t\t\thelper_index += 1;\n\n\t\t\t\tcandidates.push({\n\t\t\t\t\tplaceholder,\n\t\t\t\t\tstart: declaration_yield.start,\n\t\t\t\t\tend: declaration_yield.end,\n\t\t\t\t\texpr_text: declaration_yield.expr_text,\n\t\t\t\t\tfilename,\n\t\t\t\t\tkey: \"plain\",\n\t\t\t\t});\n\n\t\t\t\tmagic.overwrite(declaration_yield.start, declaration_yield.end, placeholder);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet expr_body = trimmed.slice(tag_info.prefix_length);\n\n\t\t/** For @const, only use the RHS after `=` as the expression body. */\n\t\tconst equal_idx =\n\t\t\ttag_info.kind === \"plain\" && trimmed.startsWith(\"@const \")\n\t\t\t\t? expr_body.indexOf(\"=\")\n\t\t\t\t: -1;\n\n\t\t/** Check if this is a callback handler containing yield*. */\n\t\tconst is_event_callback = is_event_callback_expression(inner);\n\n\t\t/** Determine if this brace contains yield* that needs lowering. */\n\t\tconst event_yield = is_event_callback ? analyze_event_yield(inner) : undefined;\n\t\tconst has_yield =\n\t\t\tevent_yield?.has_top_level_yield_star ?? contains_yield_star_in_text(expr_body);\n\n\t\tif (!has_yield) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/** The expression starts after the tag prefix. For @const, after the `=`. */\n\t\tlet extra_prefix = 0;\n\n\t\tif (equal_idx !== -1) {\n\t\t\tconst after_eq_raw = expr_body.slice(equal_idx + 1);\n\t\t\texpr_body = after_eq_raw.trimStart();\n\t\t\textra_prefix = equal_idx + 1 + (after_eq_raw.length - expr_body.length);\n\t\t}\n\n\t\tconst expr_start = open + 1 + leading_ws + tag_info.prefix_length + extra_prefix;\n\n\t\t/** For each/await, the expression ends before ` as ` or ` then `/` catch `. */\n\t\tlet expr_end = close;\n\n\t\tconst key = tag_info.kind;\n\n\t\tif (key === \"each\") {\n\t\t\tconst as_idx = expr_body.lastIndexOf(\" as \");\n\t\t\tif (as_idx !== -1) expr_end = expr_start + as_idx;\n\t\t}\n\n\t\tif (key === \"await\") {\n\t\t\tconst then_idx = expr_body.indexOf(\" then \");\n\t\t\tconst catch_idx = expr_body.indexOf(\" catch \");\n\t\t\tconst boundary = Math.min(\n\t\t\t\tthen_idx === -1 ? Infinity : then_idx,\n\t\t\t\tcatch_idx === -1 ? Infinity : catch_idx,\n\t\t\t);\n\t\t\tif (boundary !== Infinity) expr_end = expr_start + boundary;\n\t\t}\n\n\t\tconst expr_text = content.slice(expr_start, expr_end).trim();\n\n\t\tif (expr_text.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalidate_expression_yield_usage(expr_text, filename);\n\n\t\tif (key === \"render\" && !/^\\s*yield\\s*\\*/.test(expr_text)) {\n\t\t\tconst render_arg_yields = collect_expression_yield_expressions(\n\t\t\t\tcontent,\n\t\t\t\texpr_start,\n\t\t\t\texpr_text,\n\t\t\t\tfilename,\n\t\t\t);\n\n\t\t\tif (render_arg_yields.length > 0) {\n\t\t\t\tfor (const render_arg_yield of render_arg_yields) {\n\t\t\t\t\tconst placeholder = `__SER___markup_placeholder_${helper_index}`;\n\t\t\t\t\thelper_index += 1;\n\n\t\t\t\t\tcandidates.push({\n\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\tstart: render_arg_yield.start,\n\t\t\t\t\t\tend: render_arg_yield.end,\n\t\t\t\t\t\texpr_text: render_arg_yield.expr_text,\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkey: \"render_argument\",\n\t\t\t\t\t});\n\n\t\t\t\t\tmagic.overwrite(render_arg_yield.start, render_arg_yield.end, placeholder);\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/** Create a placeholder and replace the expression (preserving tag prefixes). */\n\t\tconst placeholder = `__SER___markup_placeholder_${helper_index}`;\n\t\thelper_index += 1;\n\n\t\tcandidates.push({\n\t\t\tplaceholder,\n\t\t\tstart: expr_start,\n\t\t\tend: expr_end,\n\t\t\texpr_text,\n\t\t\tfilename,\n\t\t\tkey,\n\t\t});\n\n\t\tmagic.overwrite(expr_start, expr_end, key === \"render\" ? `${placeholder}()` : placeholder);\n\t}\n\n\tif (candidates.length === 0) {\n\t\treturn { parse_code: content, candidates };\n\t}\n\n\tfor (const region of source_scan.scripts) {\n\t\tconst region_source = content.slice(region.start, region.end);\n\n\t\tmagic.overwrite(\n\t\t\tregion.start,\n\t\t\tregion.end,\n\t\t\tblank_script_region(region_source, region.is_module, region.is_typescript),\n\t\t);\n\t}\n\n\tfor (const region of source_scan.styles) {\n\t\tconst region_source = content.slice(region.start, region.end);\n\n\t\tmagic.overwrite(region.start, region.end, blank_source_region(region_source));\n\t}\n\n\treturn { parse_code: magic.toString(), candidates };\n}\n\nfunction blank_source_region(source: string): string {\n\treturn source.replace(/[^\\r\\n]/g, \" \");\n}\n\nfunction blank_script_region(source: string, is_module: boolean, is_typescript: boolean): string {\n\tconst module_attribute = is_module ? \" module\" : \"\";\n\tconst lang_attribute = is_typescript ? \" lang=ts\" : \"\";\n\tconst scaffold = `<script${module_attribute}${lang_attribute}></script>`;\n\n\treturn scaffold + blank_source_region(source.slice(scaffold.length));\n}\n\nfunction collect_expression_yield_expressions(\n\tcontent: string,\n\texpr_start: number,\n\texpr_text: string,\n\tfilename: string,\n): DeclarationYieldExpression[] {\n\tconst source_file = ts.createSourceFile(\n\t\t\"markup-expression.ts\",\n\t\t`const __SER___expr = ${expr_text};`,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst stmt = source_file.statements[0];\n\n\tif (!stmt || !ts.isVariableStatement(stmt)) {\n\t\treturn [];\n\t}\n\n\tvalidate_rune_yield_usage(stmt, source_file.text, filename);\n\n\tconst initializer = stmt.declarationList.declarations[0]?.initializer;\n\n\tif (!initializer || !contains_top_level_yield_star(initializer)) {\n\t\treturn [];\n\t}\n\n\tconst prefix_length = source_file.text.indexOf(expr_text);\n\tconst expressions: DeclarationYieldExpression[] = [];\n\n\tcollect_yield_star_nodes(initializer, (yield_node) => {\n\t\tconst start = expr_start + yield_node.getStart(source_file) - prefix_length;\n\t\tconst end = expr_start + yield_node.end - prefix_length;\n\t\tconst yielded_text = content.slice(start, end).trim();\n\n\t\texpressions.push({\n\t\t\tstart,\n\t\t\tend,\n\t\t\texpr_text: yielded_text,\n\t\t});\n\t});\n\n\treturn expressions;\n}\n\ninterface TagInfo {\n\tkind: TagKind;\n\tprefix_length: number;\n}\n\nfunction get_tag_info(trimmed: string): TagInfo {\n\tif (trimmed.startsWith(\"#each \")) {\n\t\treturn { kind: \"each\", prefix_length: \"#each \".length };\n\t}\n\tif (trimmed.startsWith(\"#await \")) {\n\t\treturn { kind: \"await\", prefix_length: \"#await \".length };\n\t}\n\tif (trimmed.startsWith(\"@render \")) {\n\t\treturn { kind: \"render\", prefix_length: \"@render \".length };\n\t}\n\n\t/** Strip prefix-only tags — the expression starts after the tag keyword. */\n\tif (trimmed.startsWith(\"@attach \")) {\n\t\treturn { kind: \"plain\", prefix_length: \"@attach \".length };\n\t}\n\tif (trimmed.startsWith(\"#if \")) {\n\t\treturn { kind: \"plain\", prefix_length: \"#if \".length };\n\t}\n\tif (trimmed.startsWith(\":else if \")) {\n\t\treturn { kind: \"plain\", prefix_length: \":else if \".length };\n\t}\n\tif (trimmed.startsWith(\"#key \")) {\n\t\treturn { kind: \"plain\", prefix_length: \"#key \".length };\n\t}\n\tif (trimmed.startsWith(\"@const \")) {\n\t\treturn { kind: \"plain\", prefix_length: \"@const \".length };\n\t}\n\tif (trimmed.startsWith(\"@html \")) {\n\t\treturn { kind: \"html\", prefix_length: \"@html \".length };\n\t}\n\tif (trimmed.startsWith(\"@debug \")) {\n\t\treturn { kind: \"plain\", prefix_length: \"@debug \".length };\n\t}\n\tif (trimmed.startsWith(\"...\")) {\n\t\treturn { kind: \"plain\", prefix_length: \"...\".length };\n\t}\n\n\treturn { kind: \"plain\", prefix_length: 0 };\n}\n\nfunction collect_declaration_yield_expressions(\n\tcontent: string,\n\topen: number,\n\tleading_ws: number,\n\ttrimmed: string,\n\tfilename: string,\n): DeclarationYieldExpression[] {\n\tif (!is_declaration_tag_text(trimmed)) {\n\t\treturn [];\n\t}\n\n\tconst source_text = `${trimmed};`;\n\tconst source_file = ts.createSourceFile(\n\t\t\"declaration-tag.ts\",\n\t\tsource_text,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\n\tconst stmt = source_file.statements[0];\n\n\tif (!stmt || !ts.isVariableStatement(stmt)) {\n\t\treturn [];\n\t}\n\n\tvalidate_rune_yield_usage(stmt, source_text, filename);\n\n\tconst tag_start = open + 1 + leading_ws;\n\n\treturn stmt.declarationList.declarations.flatMap((decl) => {\n\t\tconst expressions: DeclarationYieldExpression[] = [];\n\n\t\tcollect_yield_star_nodes(decl, (yield_node) => {\n\t\t\tconst start = tag_start + yield_node.getStart(source_file);\n\t\t\tconst end = tag_start + yield_node.end;\n\t\t\tconst expr_text = content.slice(start, end).trim();\n\n\t\t\texpressions.push({\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\texpr_text,\n\t\t\t});\n\t\t});\n\n\t\treturn expressions;\n\t});\n}\n\nfunction is_declaration_tag_text(trimmed: string): boolean {\n\treturn /^(?:const|let)\\s/.test(trimmed);\n}\n\nfunction validate_expression_yield_usage(expr_text: string, filename: string): void {\n\tconst source_text = `const __SER___expr = ${expr_text};`;\n\tconst source_file = ts.createSourceFile(\n\t\t\"markup-expression.ts\",\n\t\tsource_text,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS,\n\t);\n\tconst stmt = source_file.statements[0];\n\n\tif (!stmt) {\n\t\treturn;\n\t}\n\n\tvalidate_rune_yield_usage(stmt, source_text, filename);\n}\n\nfunction is_event_callback_expression(inner: string): boolean {\n\tconst trimmed = inner.trimStart();\n\n\treturn (\n\t\t/^(?:async\\s+)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>/.test(trimmed) ||\n\t\t/^(?:async\\s+)?function\\b/.test(trimmed)\n\t);\n}\n\nfunction analyze_event_yield(inner: string): {\n\thas_top_level_yield_star: boolean;\n} {\n\tconst event = strip_arrow_function(inner);\n\tconst analysis = analyze_event_body_yield_star(event.body);\n\tconst generated_run = new RegExp(\n\t\t`${default_helper_bindings.dispatcher}(?:_\\\\d+)?\\\\.emit\\\\(\\\\{\\\\s*type:\\\\s*${default_helper_bindings.codes}(?:_\\\\d+)?\\\\.Markup\\\\.Run`,\n\t);\n\n\tif (generated_run.test(event.body)) {\n\t\treturn {\n\t\t\thas_top_level_yield_star: false,\n\t\t};\n\t}\n\n\treturn {\n\t\thas_top_level_yield_star:\n\t\t\tanalysis.has_top_level_yield_star ||\n\t\t\tanalysis.has_nested_invalid_yield_star ||\n\t\t\t/\\byield\\s*\\*/.test(event.body),\n\t};\n}\n\nfunction contains_yield_star_in_text(text: string): boolean {\n\tif (!/\\byield\\s*\\*/.test(text)) return false;\n\n\ttry {\n\t\tconst sf = ts.createSourceFile(\n\t\t\t\"expr.ts\",\n\t\t\t`const x = ${text};`,\n\t\t\tts.ScriptTarget.Latest,\n\t\t\ttrue,\n\t\t\tts.ScriptKind.TS,\n\t\t);\n\t\tconst stmt = sf.statements[0];\n\t\tif (!ts.isVariableStatement(stmt)) return false;\n\t\tconst decl = stmt.declarationList.declarations[0];\n\t\tif (!decl?.initializer) return false;\n\t\treturn contains_top_level_yield_star(decl.initializer);\n\t} catch {\n\t\treturn true;\n\t}\n}\n\n/** Free identifier collection helpers for generated closures. */\n","import {\n\tcreate_relocations,\n\tcreate_source_map,\n\tinject_helpers,\n\tmake_markup_helper_bindings,\n} from \"./apply.ts\";\nimport type { MarkupTransformOptions, MarkupTransformResult } from \"./types.ts\";\nimport { collect_effect_callback_bindings } from \"./effect-bindings.ts\";\nimport { scan_svelte_effect_source } from \"$/compiler/source-scan.ts\";\nimport { UnsupportedMarkupEffectPositionError } from \"$/errors.ts\";\nimport { classify_candidates } from \"./classify.ts\";\nimport { type AST, parse } from \"svelte/compiler\";\nimport { emit_replacements } from \"./emit.ts\";\nimport { sanitize_markup } from \"./scan.ts\";\n\nimport MagicString from \"magic-string\";\n\nexport type {\n\tMarkupRelocation,\n\tMarkupTransformOptions,\n\tMarkupTransformResult,\n\tMarkupTransformTarget,\n} from \"./types.ts\";\n\n/**\n * Transforms Svelte markup containing `{yield* expr}` brace expressions\n * into generated dispatcher events.\n *\n * Strategy: first find all brace expressions containing `yield*` via\n * character scanning, replace them with placeholder identifiers, then\n * parse the sanitized markup with Svelte's AST to determine the correct\n * context for each placeholder (plain expression, #each, #await, event\n * handler, etc.).\n *\n * @example\n * ```ts\n * const result = transform_markup_effect(\n * \"<button onclick={yield* save()}>Save</button>\",\n * \"SaveButton.svelte\",\n * );\n * ```\n *\n * @since 2.0.0\n * @param content - The raw `.svelte` file content.\n * @param filename - The source filename, used in error messages.\n * @param options - Optional transform target configuration.\n * @returns The transformed markup and a flag indicating whether yield* was\n * found.\n */\nexport function transform_markup_effect(\n\tcontent: string,\n\tfilename: string,\n\toptions: MarkupTransformOptions = {},\n): MarkupTransformResult {\n\tif (!/\\byield\\s*\\*/.test(content)) {\n\t\treturn { code: content, has_yield: false };\n\t}\n\n\tconst source_scan = scan_svelte_effect_source(content, filename);\n\n\t/** Find all brace expressions containing yield* and replace with placeholders. */\n\tconst work = sanitize_markup(source_scan);\n\n\tif (work.candidates.length === 0) {\n\t\treturn { code: content, has_yield: false };\n\t}\n\n\tconst effect_context = collect_effect_callback_bindings(source_scan.scripts);\n\tconst helper_context = make_markup_helper_bindings(source_scan);\n\n\t/** Parse the sanitized markup with Svelte's AST. */\n\tconst ast = parse(work.parse_code, { filename, modern: true }) as AST.Root;\n\n\t/** Match placeholders to their AST context and build replacements. */\n\tconst classified = classify_candidates(ast, work.candidates);\n\tconst matched = new Set(classified.map(({ candidate }) => candidate.placeholder));\n\tconst unmatched = work.candidates.find((candidate) => !matched.has(candidate.placeholder));\n\n\tif (unmatched) {\n\t\tthrow new UnsupportedMarkupEffectPositionError(filename, unmatched.expr_text);\n\t}\n\n\tconst replacements = emit_replacements(\n\t\tclassified,\n\t\teffect_context,\n\t\thelper_context.bindings,\n\t\thelper_context.name_allocator,\n\t\toptions.target ?? \"client\",\n\t);\n\tconst helpers = replacements.flatMap((replacement) => replacement.helpers ?? []);\n\n\tconst magic = new MagicString(content);\n\n\treplacements.sort((a, b) => b.start - a.start);\n\n\tfor (const r of replacements) {\n\t\tmagic.overwrite(r.start, r.end, r.text);\n\t}\n\n\tconst helper_insertion = inject_helpers(magic, source_scan, helpers, helper_context.bindings);\n\tconst relocations = create_relocations(replacements, helper_insertion);\n\n\treturn {\n\t\tcode: magic.toString(),\n\t\thas_yield: true,\n\t\tmap: create_source_map(magic, filename),\n\t\trelocations,\n\t};\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,aACf,mBACA,uBACA,oBACA,WAAkC;CACjC,QAAQ;CACR,YAAY;CACZ,kBAAkB;CAClB,QAAQ;CACR,SAAS;CACT,SAAS;CACT,eAAe;CACf,WAAW;AACZ,GACA,UAAgC,CAAC,GACxB;CACT,MAAM,mBAAmB,QAAQ,oBAAoB;CACrD,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,MAAM,gBAAgB,QAAQ,iBAAiB;CAC/C,MAAM,sBAAsB,QAAQ,uBAAuB;CAC3D,MAAM,kBAAkB,QAAQ,mBAAmB;CAEnD,MAAM,mBAAmB,sBACxB,UACA,oBAAoB,CAAC,uBACrB,iBACA,mBACD;CAEA,MAAM,iBACL,SAAS,YAAY,YAClB,sCACA,uBAAuB,SAAS,QAAQ;CAE5C,MAAM,gBAAgB,oBACnB,QACA,SAAS,WAAW,WACnB,qCACA,sBAAsB,SAAS,OAAO;CAE1C,OAAO;EACN;EACA,iBAAiB,CAAC,sBAAsB;EACxC,gBAAgB;CACjB,CAAC,CACC,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;AACZ;AAEA,SAAS,sBACR,UACA,kBACA,iBACA,qBACiB;CACjB,MAAM,aAAa;EAClB,o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