@verajs/renderer 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +757 -225
  2. package/dist/development/vera-renderer-elements.d.ts +39 -0
  3. package/dist/development/vera-renderer-elements.d.ts.map +1 -0
  4. package/dist/development/vera-renderer-elements.js +193 -0
  5. package/dist/development/vera-renderer-elements.js.map +1 -0
  6. package/dist/development/vera-renderer-hydrate-slots.d.ts +94 -0
  7. package/dist/development/vera-renderer-hydrate-slots.d.ts.map +1 -0
  8. package/dist/development/vera-renderer-hydrate-slots.js +325 -0
  9. package/dist/development/vera-renderer-hydrate-slots.js.map +1 -0
  10. package/dist/development/vera-renderer-hydration.d.ts +332 -0
  11. package/dist/development/vera-renderer-hydration.d.ts.map +1 -0
  12. package/dist/development/vera-renderer-hydration.js +902 -0
  13. package/dist/development/vera-renderer-hydration.js.map +1 -0
  14. package/dist/development/vera-renderer-keyed.d.ts +25 -8
  15. package/dist/development/vera-renderer-keyed.d.ts.map +1 -1
  16. package/dist/development/vera-renderer-keyed.js +843 -268
  17. package/dist/development/vera-renderer-keyed.js.map +1 -1
  18. package/dist/development/vera-renderer-multi-window.d.ts +5 -0
  19. package/dist/development/vera-renderer-multi-window.d.ts.map +1 -0
  20. package/dist/development/vera-renderer-multi-window.js +40 -0
  21. package/dist/development/vera-renderer-multi-window.js.map +1 -0
  22. package/dist/development/vera-renderer-namespaces.d.ts +64 -0
  23. package/dist/development/vera-renderer-namespaces.d.ts.map +1 -0
  24. package/dist/development/vera-renderer-namespaces.js +94 -0
  25. package/dist/development/vera-renderer-namespaces.js.map +1 -0
  26. package/dist/development/vera-renderer-native-elements.d.ts +13 -0
  27. package/dist/development/vera-renderer-native-elements.d.ts.map +1 -0
  28. package/dist/development/vera-renderer-native-elements.js +231 -0
  29. package/dist/development/vera-renderer-native-elements.js.map +1 -0
  30. package/dist/development/vera-renderer-portal.d.ts +29 -0
  31. package/dist/development/vera-renderer-portal.d.ts.map +1 -0
  32. package/dist/development/vera-renderer-portal.js +167 -0
  33. package/dist/development/vera-renderer-portal.js.map +1 -0
  34. package/dist/development/vera-renderer-profiler.d.ts +48 -96
  35. package/dist/development/vera-renderer-profiler.d.ts.map +1 -1
  36. package/dist/development/vera-renderer-profiler.js +2632 -2142
  37. package/dist/development/vera-renderer-profiler.js.map +1 -1
  38. package/dist/development/vera-renderer-slots.d.ts +88 -92
  39. package/dist/development/vera-renderer-slots.d.ts.map +1 -1
  40. package/dist/development/vera-renderer-slots.js +1834 -1237
  41. package/dist/development/vera-renderer-slots.js.map +1 -1
  42. package/dist/development/vera-renderer-spread.d.ts +7 -41
  43. package/dist/development/vera-renderer-spread.d.ts.map +1 -1
  44. package/dist/development/vera-renderer-spread.js +539 -477
  45. package/dist/development/vera-renderer-spread.js.map +1 -1
  46. package/dist/development/vera-renderer-tag.d.ts +12 -3
  47. package/dist/development/vera-renderer-tag.d.ts.map +1 -1
  48. package/dist/development/vera-renderer-tag.js +671 -513
  49. package/dist/development/vera-renderer-tag.js.map +1 -1
  50. package/dist/development/vera-renderer-until.d.ts +24 -0
  51. package/dist/development/vera-renderer-until.d.ts.map +1 -0
  52. package/dist/development/vera-renderer-until.js +83 -0
  53. package/dist/development/vera-renderer-until.js.map +1 -0
  54. package/dist/development/vera-renderer.d.ts +48 -96
  55. package/dist/development/vera-renderer.d.ts.map +1 -1
  56. package/dist/development/vera-renderer.js +2607 -2104
  57. package/dist/development/vera-renderer.js.map +1 -1
  58. package/dist/vera-renderer-elements.min.js +2 -0
  59. package/dist/vera-renderer-elements.min.js.map +1 -0
  60. package/dist/vera-renderer-hydrate-slots.min.js +2 -0
  61. package/dist/vera-renderer-hydrate-slots.min.js.map +1 -0
  62. package/dist/vera-renderer-hydration.min.js +3 -0
  63. package/dist/vera-renderer-hydration.min.js.map +1 -0
  64. package/dist/vera-renderer-keyed.min.js +1 -1
  65. package/dist/vera-renderer-keyed.min.js.map +1 -1
  66. package/dist/vera-renderer-multi-window.min.js +2 -0
  67. package/dist/vera-renderer-multi-window.min.js.map +1 -0
  68. package/dist/vera-renderer-namespaces.min.js +2 -0
  69. package/dist/vera-renderer-namespaces.min.js.map +1 -0
  70. package/dist/vera-renderer-native-elements.min.js +2 -0
  71. package/dist/vera-renderer-native-elements.min.js.map +1 -0
  72. package/dist/vera-renderer-portal.min.js +2 -0
  73. package/dist/vera-renderer-portal.min.js.map +1 -0
  74. package/dist/vera-renderer-slots.min.js +1 -1
  75. package/dist/vera-renderer-slots.min.js.map +1 -1
  76. package/dist/vera-renderer-spread.min.js +1 -1
  77. package/dist/vera-renderer-spread.min.js.map +1 -1
  78. package/dist/vera-renderer-tag.min.js +1 -1
  79. package/dist/vera-renderer-tag.min.js.map +1 -1
  80. package/dist/vera-renderer-until.min.js +2 -0
  81. package/dist/vera-renderer-until.min.js.map +1 -0
  82. package/dist/vera-renderer.min.js +1 -1
  83. package/dist/vera-renderer.min.js.map +1 -1
  84. package/package.json +52 -9
  85. package/dist/development/vera-renderer-hydrate.d.ts +0 -147
  86. package/dist/development/vera-renderer-hydrate.d.ts.map +0 -1
  87. package/dist/development/vera-renderer-hydrate.js +0 -3136
  88. package/dist/development/vera-renderer-hydrate.js.map +0 -1
  89. package/dist/vera-renderer-hydrate.min.js +0 -2
  90. package/dist/vera-renderer-hydrate.min.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"vera-renderer-keyed.js","sources":["../../src/keyed.ts"],"sourcesContent":["import type { Item, KeyedResult, ListStrategy } from './renderer.js';\n\n/**\n * Keyed list reconciliation, as its own entry.\n *\n * **This module imports nothing.** Every other renderer entry inlines `./renderer.js` and carries\n * its own template cache, so a module that imported one of them would be wrong for the others —\n * `hydrate` in particular. Like `spread`, this one talks to whatever renderer is present through a\n * mangling-exempt protocol, which is what makes it additive rather than a substitute.\n *\n * It also does not register. `keyed()` stamps `$r` onto the result it marks, so the algorithm\n * travels with the values that need it: importing the marker is the whole installation, and a list\n * always names the strategy that understands it. Two strategies therefore cannot disagree — there\n * is nothing to disagree about, because the decision is per value rather than per registry.\n */\n\n/**\n * The standard head/tail algorithm (as in lit's `repeat` and Vue): skip matching prefixes and\n * suffixes, detect the two swap shapes directly, and fall back to key maps for arbitrary moves,\n * removals and insertions.\n *\n * Everything before reconciliation — the mode switch, the empty list, the initial fill — has\n * already happened in the renderer and is passed in, so this function only ever runs against a\n * non-empty list that is already keyed.\n */\n/**\n * **Reconciliation for a list whose nodes no longer live where its markers do.**\n *\n * `@verajs/renderer/slots` distributes a light-DOM host's children by MOVING them into the\n * component's tree. A keyed list that renders those children therefore ends up split: the items are\n * inside the component, the part's own markers stay behind in the host. The two-ended diff below\n * positions against those markers and against `end`, so every move it makes asks the host to insert\n * before a reference that is somewhere else — `NotFoundError`, in both builds. Shadow DOM never hits\n * this because the platform PROJECTS rather than moves: the nodes stay children of the host.\n *\n * The way out is to stop looking for an anchor. Walking the new order in REVERSE, each item is\n * placed immediately before its successor **in its own container**, and the last item in each\n * container is left exactly where it is. That needs no end marker, no part boundary, and no\n * knowledge of slots — and it is what makes a list SPLIT ACROSS SLOTS come out right for free,\n * since items in different containers simply have different successors. Native does the same thing\n * for the same input: order within each slot follows the logical order.\n *\n * Items created here go into the host, not into a container, because distribution is the observer's\n * job and has not run yet. They are skipped by the placement pass for that render and land in slot\n * order when it does.\n */\nconst reconcileRelocated: ListStrategy = (part, newValues, items, parent, end) => {\n const count = newValues.length;\n const byKey = new Map<unknown, Item>();\n for (const item of items) if (item !== null) byKey.set(item.$k, item);\n\n const newItems: Item[] = new Array(count);\n for (let i = 0; i < count; i++) {\n const existing = byKey.get((newValues[i] as KeyedResult).key);\n if (existing !== undefined) {\n part.$u(existing, newValues[i]);\n newItems[i] = existing;\n byKey.delete((newValues[i] as KeyedResult).key);\n }\n }\n /** Whatever kept no key is gone. `$d` moves into a scratch fragment, so its parent is irrelevant. */\n for (const dropped of byKey.values()) part.$d(dropped);\n\n /**\n * **One reverse pass that both places and creates**, so an item's successor is already final when\n * it is needed — and it is needed twice. Placing reads it as the reference; CREATING reads the\n * container it lives in, which is the only way a new item can land among its logical neighbours.\n *\n * Creating in the host instead would be simpler and is wrong: the observer distributes it later\n * and appends it, so an insertion in the middle of a list arrives at the end. Creating it in the\n * successor's container puts it where native would — and if it names a DIFFERENT slot than its\n * neighbour, it is in the host's subtree with a `slot` attribute, which is exactly what the\n * observer is watching for, so that case corrects itself.\n *\n * `$m` short-circuits an item already in position, which is what keeps this from re-attaching a\n * whole list; re-attaching is not free, it blurs focus and restarts transitions.\n */\n const successorIn = new Map<Node, Node>();\n for (let i = count - 1; i >= 0; i--) {\n const item = newItems[i];\n if (item === undefined) continue; // created below, in forward order, once neighbours are final\n const container = part.$f(item).parentNode;\n if (container === null) continue;\n const successor = successorIn.get(container);\n if (successor !== undefined) part.$m(item, successor, container);\n successorIn.set(container, part.$f(item));\n }\n /**\n * **Creations run FORWARD, after every surviving item is in its final place.** Two reasons.\n * A new item belongs beside its logical successor, and the successor's position is only final\n * once the reverse pass above has run. And consecutive new rows must land in logical order:\n * created back-to-front they arrive in the host reversed, the observer captures them in\n * arrival order, and the list renders permuted.\n *\n * Created under the HOST, before `end` — the part's own boundary. Created straight into the\n * component's tree they would read as the component's own output and never be captured;\n * appended to the host's tail they would sit in the component's region, which is the same\n * mistake. Between the part's markers they are unambiguously the host's content, which the\n * observer captures with native semantics. A new item whose logical successor lives inside\n * the component is then moved beside it — a move, which the observer already reads correctly.\n */\n for (let i = 0; i < count; i++) {\n if (newItems[i] !== undefined) continue;\n const created = part.$c(newValues[i], parent, end);\n const following = i + 1 < count ? newItems[i + 1] : undefined;\n if (following !== undefined) {\n const first = part.$f(following);\n if (first.parentNode !== null && first.parentNode !== parent) part.$m(created, first, first.parentNode);\n }\n newItems[i] = created;\n }\n return newItems;\n};\n\nconst reconcile: ListStrategy = (part, newValues, items, parent, end) => {\n const count = newValues.length;\n\n /**\n * Zero-allocation fast path for the dominant case: same length, same key order — a pure in-place\n * update (a selection change, a field edit). No key array, no output array, no null checks. Falls\n * through to the full algorithm on the first mismatch; the items already updated re-verify there\n * as cheap no-op compares.\n */\n if (items.length === count) {\n let i = 0;\n while (i < count && items[i].$k === (newValues[i] as KeyedResult).key) {\n part.$u(items[i], newValues[i]);\n i++;\n }\n if (i === count) return items;\n }\n\n /**\n * **Has anything moved this list's nodes out from under its markers?**\n *\n * Only `@verajs/renderer/slots` does today, but the question is asked of the DOM rather than of\n * that module — keyed imports nothing, and a list does not need to know what moved its nodes to\n * know that they moved.\n *\n * Placed after the no-change fast path, so the dominant case (same keys, same order) never\n * reaches it. What remains is one `parentNode` read per item against a diff that already does far\n * more per item, and it breaks on the first mismatch, so the case it exists for costs exactly one.\n */\n for (let i = 0; i < items.length; i++)\n if (part.$f(items[i]).parentNode !== parent)\n return reconcileRelocated(part, newValues, items, parent, end);\n\n const oldItems: (Item | null)[] = items;\n const newKeys: unknown[] = new Array(count);\n for (let i = 0; i < count; i++) newKeys[i] = (newValues[i] as KeyedResult).key;\n /**\n * Said once, where it is nearly free: the general algorithm already walks every key, and a list\n * whose keys never move never reaches here at all. A duplicate key is a mistake that behaves\n * *correctly* in the common case and arbitrarily in the rest, which is the shape of bug that\n * survives a test suite.\n */\n if (__DEV__ && new Set(newKeys).size !== count) {\n const seen = new Set<unknown>();\n const repeated = newKeys.filter((key) => (seen.has(key) ? true : (seen.add(key), false)));\n console.warn(\n `[vera] keyed: the key ${String(repeated[0])} is used by more than one item in this list. ` +\n `A key identifies one item, so which of them keeps the existing DOM is not defined — ` +\n `the list still renders, but nothing about which node ends up where can be relied on.`\n );\n }\n const newItems: Item[] = new Array(count);\n let oldHead = 0;\n let oldTail = oldItems.length - 1;\n let newHead = 0;\n let newTail = count - 1;\n let newKeyToIndex: Map<unknown, number> | undefined;\n let oldKeyToIndex: Map<unknown, number> | undefined;\n const refAt = (i: number): Node | null =>\n i < count && newItems[i] !== undefined ? part.$f(newItems[i]) : end;\n\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldItems[oldHead] === null) oldHead++;\n else if (oldItems[oldTail] === null) oldTail--;\n else if (oldItems[oldHead]!.$k === newKeys[newHead]) {\n part.$u((newItems[newHead] = oldItems[oldHead]!), newValues[newHead]);\n oldHead++;\n newHead++;\n } else if (oldItems[oldTail]!.$k === newKeys[newTail]) {\n part.$u((newItems[newTail] = oldItems[oldTail]!), newValues[newTail]);\n oldTail--;\n newTail--;\n } else if (oldItems[oldHead]!.$k === newKeys[newTail]) {\n const item = oldItems[oldHead]!;\n part.$m(item, refAt(newTail + 1), parent);\n part.$u(item, newValues[newTail]);\n newItems[newTail] = item;\n oldHead++;\n newTail--;\n } else if (oldItems[oldTail]!.$k === newKeys[newHead]) {\n const item = oldItems[oldTail]!;\n part.$m(item, part.$f(oldItems[oldHead]!), parent);\n part.$u(item, newValues[newHead]);\n newItems[newHead] = item;\n oldTail--;\n newHead++;\n } else {\n if (newKeyToIndex === undefined) {\n newKeyToIndex = new Map();\n for (let i = newHead; i <= newTail; i++) newKeyToIndex.set(newKeys[i], i);\n oldKeyToIndex = new Map();\n for (let i = oldHead; i <= oldTail; i++) {\n if (oldItems[i] !== null) oldKeyToIndex.set(oldItems[i]!.$k, i);\n }\n }\n if (!newKeyToIndex.has(oldItems[oldHead]!.$k)) {\n part.$d(oldItems[oldHead]!);\n oldHead++;\n } else if (!newKeyToIndex.has(oldItems[oldTail]!.$k)) {\n part.$d(oldItems[oldTail]!);\n oldTail--;\n } else {\n const oldIndex = oldKeyToIndex!.get(newKeys[newHead]);\n /**\n * **`oldItems[oldIndex]` can be null, and reading it crashed the render.** The map holds one\n * index per key, so a list where a key appears twice finds, for the second one, the slot the\n * first already consumed and nulled. `part.$m(null, …)` then read `_element` of null and took\n * the whole render down with a `TypeError` naming the renderer's internals rather than\n * anything the caller wrote.\n *\n * Duplicate keys are documented as undefined behaviour and stay that way — which of the two\n * keeps the existing node is not specified. Undefined must still mean *a list*, though, not\n * an exception from three frames inside a private algorithm: the shapes that crash are\n * particular (a duplicate **and** a reorder **and** a new key, found by fuzzing over a\n * four-key alphabet), so this passes in development and takes the page down later.\n *\n * Two ways a slot can already be spoken for, and both have to be checked. The map nulls what\n * it consumes, so `oldItems[oldIndex] === null` catches one. The other is invisible: the map\n * is built once, and the head/tail branches above consume items by *moving the pointers*\n * without nulling anything — so an index that was live when the map was built can now sit\n * outside `[oldHead, oldTail]`. With unique keys that is unreachable, because a key is looked\n * up at most once; with a repeated key it hands the same item to two positions, and the list\n * then renders one item short of what it holds. Checking only for null fixed the crash and\n * left that, which is the worse of the two — nothing throws and the page is quietly wrong.\n *\n * Treating either as \"not found\" gives the second occurrence a fresh item, which is what the\n * branch below already does for a key that never existed.\n */\n const reusable =\n oldIndex === undefined || oldIndex < oldHead || oldIndex > oldTail\n ? null\n : oldItems[oldIndex];\n if (reusable === null) {\n newItems[newHead] = part.$c(newValues[newHead], parent, part.$f(oldItems[oldHead]!));\n } else {\n const item = reusable;\n part.$m(item, part.$f(oldItems[oldHead]!), parent);\n part.$u(item, newValues[newHead]);\n newItems[newHead] = item;\n oldItems[oldIndex!] = null;\n }\n newHead++;\n }\n }\n }\n /**\n * The trailing fill inserts every remaining item before the same reference — `refAt(newTail + 1)`\n * cannot move while the loop runs, because the loop itself only fills slots *below* it. Built\n * into a fragment and landed with one `insertBefore`, an append of 1 000 rows costs one live-DOM\n * insertion instead of 1 000 — the same batching the renderer's index-mode grow path has always\n * had, which this path silently lacked. A single item skips the fragment: one insert either way.\n */\n if (newHead < newTail) {\n const ref = refAt(newTail + 1);\n const fragment = parent.ownerDocument!.createDocumentFragment();\n while (newHead <= newTail) {\n newItems[newHead] = part.$c(newValues[newHead], fragment, null);\n newHead++;\n }\n parent.insertBefore(fragment, ref);\n } else if (newHead === newTail) {\n newItems[newHead] = part.$c(newValues[newHead], parent, refAt(newTail + 1));\n newHead++;\n }\n while (oldHead <= oldTail) {\n const item = oldItems[oldHead++];\n if (item !== null) part.$d(item);\n }\n return newItems;\n};\n\n/**\n * Marks a template result with a stable key so list reconciliation moves it instead of rewriting\n * it. Key all items in a list or none — mixing is undefined behaviour, as are duplicate keys.\n *\n * **Undefined means the list is arbitrary, not that the render fails.** With a repeated key, which\n * item keeps the existing node is unspecified; the render still completes and the DOM still holds\n * what the list holds. Development warns, once per render.\n *\n * ```js\n * import { keyed } from '@verajs/renderer/keyed';\n * rows.map((r) => keyed(r.id, html`<tr>...</tr>`))\n * ```\n */\nexport const keyed = <T>(key: unknown, result: T): T => {\n /**\n * Two arguments, and the second is the one that goes missing — `keyed(row.id)` instead of\n * `keyed(row.id, html\\`…\\`)`. It failed with `Cannot set properties of undefined (setting 'key')`,\n * which names this function's internals and not the call.\n */\n if (__DEV__ && (result === null || typeof result !== 'object'))\n throw new TypeError(\n `keyed: expected a template as the second argument and received ${String(result)}. ` +\n `It marks a template with a key — \\`keyed(row.id, html\\`<li>…</li>\\`)\\`.`\n );\n (result as KeyedResult).key = key;\n (result as KeyedResult).$r = reconcile;\n return result;\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;;;;;AAYG;AAEH;;;;;;;;AAQG;AACH;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,MAAM,kBAAkB,GAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAI;AAC/E,IAAA,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM;AAC9B,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAiB;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,IAAI,KAAK,IAAI;YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC;AAErE,IAAA,MAAM,QAAQ,GAAW,IAAI,KAAK,CAAC,KAAK,CAAC;AACzC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;AAC9B,QAAA,MAAM,QAAQ,GAAG,KAAK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A,OAAO,MAAM;AACf;;;;"}
1
+ {"version":3,"file":"vera-renderer-keyed.js","sources":["../../../shared-utils/src/diagnostic.ts","../../src/keyed-diagnostics.ts","../../src/keyed.ts"],"sourcesContent":["/**\n * **Where every diagnostic code is explained.** The URL is permanent: a released bundle is immutable, so every version\n * published points here for ever — the domain cannot lapse and `/e/` cannot be reorganized without breaking links in\n * code nobody can edit; the docs site redirects instead. `scripts/sync-diagnostics.mjs` imports this constant, so the\n * pages and the bundles can never disagree about where they are.\n */\nexport const DOCS = 'https://verajs.dev/e/';\n\n/**\n * **What this copy of the framework has already said** (Brian's ruling, 2026-11-12): the ONE memory behind `warnOnce`, `errorOnce`\n * and `hasWarned`, for DEVELOPMENT-ONLY warnings. It replaced the hand-written once-flags every package kept\n * (`saidLists`, `warnedDrop`, per-element WeakSets, per-key Sets: two naming styles, Brian: no names). **A warning that\n * ships to production keeps its memory at its site** (bytes, measured 2026-11-12: the shared memory costs +80–145 B gz\n * per bundle); development-only warnings use warnOnce. Module state by necessity, since \"once\" spans every call on the\n * page. One per BUNDLE COPY, exactly the scope each flag had, because this package is inlined into every bundle.\n * A code, or `code key` for a string key, in a Set. An object key (an element, a setup function) in a WeakMap, so its\n * entry goes with the object. Marked pure, so a bundle that never prints once drops both.\n */\nconst printed = /* @__PURE__ */ new Set<string>();\nconst printedOn = /* @__PURE__ */ new WeakMap<object, Map<string, Set<unknown>>>();\n/**\n * A once's KEY: none (once per page), a string (once per that string), an object (once per that object: an element, a\n * class, a setup function), or the PAIR `[object, value]`, a value key on that object (a store write: the object and its\n * property; a keyed list: the list and the duplicate key, compared as the list compares them, by value, so `1` and `'1'`\n * stay apart). A pair is the only array a key may be.\n */\ntype OnceKey = string | object | readonly [object, unknown];\n/** Where an object key's (code, value) lives: the value set for that code on that object, made on demand. */\nconst valuesOn = (on: object, code: string, make: boolean): Set<unknown> | undefined => {\n let codes = printedOn.get(on);\n if (codes === undefined) {\n if (!make) return undefined;\n printedOn.set(on, (codes = new Map()));\n }\n let values = codes.get(code);\n if (values === undefined && make) codes.set(code, (values = new Set()));\n return values;\n};\n/** The object and value of an object or pair key. */\nconst split = (key: object): readonly [object, unknown] => (Array.isArray(key) ? (key as unknown as readonly [object, unknown]) : [key, undefined]);\n/** Whether (code, key) is new, recording it if so. */\nconst firstTime = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') {\n const entry = key === undefined ? code : `${code} ${key}`;\n if (printed.has(entry)) return false;\n printed.add(entry);\n return true;\n }\n const [on, sub] = split(key);\n const values = valuesOn(on, code, true)!;\n if (values.has(sub)) return false;\n values.add(sub);\n return true;\n};\n\n/**\n * **One shape for every diagnostic the framework prints** — the short line production keeps, the whole sentence\n * development adds — so a package converting its messages writes a table and a call, never its own format.\n *\n * production `[vera] hydration: element: found <i> — https://verajs.dev/e/hydration-fallback`\n * development `[vera] hydration: element: found <i> — fell back to a client render: … (hydration-fallback)`\n *\n * `subject` is the free information — what the code already has at hand, naming the problem area — the same in both\n * builds. `prose` is development only: the package's table entry (`Prose`), called behind `__DEV__` at the call site so\n * the table goes unreferenced in production and rollup drops it whole. Production prints the code inside the link, so\n * the reader is one click from the explanation, which `scripts/sync-diagnostics.mjs` publishes from the same tables.\n *\n * **Every production message is coded** (Brian, 2026-11-11; this supersedes \"convert where smaller\", 2026-10-02):\n * consistency over a few bytes, so no package keeps a hand-written production line beside its table.\n */\n/*\n * The parameter names are deliberately unlike anything a caller holds: terser will not inline a function whose\n * parameter shadows a name at the call site (measured 2026-10-02 — directives passes its own `code`, and a parameter\n * called `code` left `((e,t,n)=>`…`)(0,t,n)` in its bundle, +8 B; renamed, the call folds to the bare template).\n */\n/**\n * **A misused API, named by its function** — the thrown-error twin of `diagnostic()`: `untrack: expected a function …\n * (untrack-not-function)`, function-first because a stack already names the source and the sweep reads that shape. The\n * prose comes from a package's table, behind `__DEV__`, so a development-only guard costs production nothing.\n */\nexport const misuse = (forName: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${DOCS}${withCode}`;\n\n/**\n * **A misused API and what it was misused ABOUT** — `misuse()` with a subject, in `diagnostic()`'s ` — ` separator:\n * `parseFrontmatter: line 3 — https://verajs.dev/e/cms-frontmatter-unsupported`. The subject is the free information\n * (a line, a URL and its status) and prints in both builds. A sibling rather than an optional parameter on `misuse()`,\n * because `misuse()` is inlined into every bundle that throws and a conditional subject would tax all of them for a\n * shape few need; a sibling is tree-shaken where unused.\n */\nexport const misuseAbout = (forName: string, aboutSubject: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${aboutSubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${aboutSubject} — ${DOCS}${withCode}`;\n\nexport const diagnostic = (\n inArea: string,\n bySubject: string,\n withCode: string,\n andProse?: false | readonly [string, string?]\n) =>\n /** `__DEV__` HERE as well as at the call: production folds this to the one-line form, branch and all. */\n __DEV__ && andProse\n ? `[vera] ${inArea}: ${bySubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `[vera] ${inArea}: ${bySubject} — ${DOCS}${withCode}`;\n\n/**\n * **Text from outside — a file path, a YAML key, a URL, an error's message — quoted before it reaches a line.** A log is a\n * pipeline, and such text can be shaped by an author or a request: a newline in it forges a line, an ESC sequence hides\n * one (log injection). `JSON.stringify` escapes both; cut to 80 characters so one value cannot fill the log. @verajs/ssr\n * keeps a twin (it cannot import this), held equal by tests/ssr-coded-diagnostics.\n */\n/**\n * `max` caps the length (80 by default); `Infinity` keeps the whole text for a value worth reading in full — a site\n * owner's own path — which is still ESCAPED: truncation and escaping are separate jobs, and a path is not free of control\n * characters just because its owner wrote it (2026-10-09).\n */\nexport const quoted = (text: string, max = 80): string => JSON.stringify(text.length > max ? `${text.slice(0, max)}…` : text);\n\n/**\n * **The errors a package constructs, marked as its own** — so a wrapper that reports an inner refusal (cms's\n * `generateManifest` around a frontmatter line) carries it as it is: already formatted, its outside text already\n * quoted. Anything else is foreign, and quoted. Identity, never a shape test: a message can imitate ours, an identity\n * cannot. @verajs/ssr keeps a twin (it cannot import this).\n */\nconst ours = /* @__PURE__ */ new WeakSet<object>();\nexport const own = <E extends Error>(error: E): E => {\n ours.add(error);\n return error;\n};\nexport const isOwn = (error: unknown): boolean => typeof error === 'object' && error !== null && ours.has(error);\n\n/**\n * **Whether this copy has already said `code` (for `key`)**: for a GUARD only, where deciding to warn costs work worth\n * skipping once the warning is out (development's whole-tree walk for unwired directive attributes, an event-name\n * guess over every property of an element). A site that only prints calls `warnOnce`. Asks, never records.\n */\nexport const hasWarned = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') return printed.has(key === undefined ? code : `${code} ${key}`);\n const [on, sub] = split(key);\n return valuesOn(on, code, false)?.has(sub) === true;\n};\n\ntype Detail = false | readonly [string, string?] | (() => readonly [string, string?] | undefined);\n/**\n * The printer behind both, on one level. `andDetail` is `diagnostic()`'s prose, or a function returning it where building\n * the sentence costs something: it is called only the first time. `...andMore` rides beside the line behind '%s' (an\n * element, a thrown error), never inside it, so text from outside cannot forge a line. The console method is read at the\n * call, so a test that replaces `console.warn` sees it.\n */\nconst sayOnce =\n (level: 'warn' | 'error') =>\n (inArea: string, bySubject: string, withCode: string, andDetail?: Detail, forKey?: OnceKey, ...andMore: unknown[]): void => {\n if (!firstTime(withCode, forKey)) return;\n const line = diagnostic(inArea, bySubject, withCode, typeof andDetail === 'function' ? andDetail() : andDetail);\n if (andMore.length) console[level]('%s', line, ...andMore);\n else console[level](line);\n };\n/**\n * **A diagnostic said once per page** (per key, where one is given: a string, or an object such as the element it is\n * about): `diagnostic()`'s arguments, then the key, then what rides beside the line. Coded in production exactly as\n * `diagnostic()` is, because it IS `diagnostic()`. `errorOnce` is its twin on `console.error`, for a refusal a page should\n * not miss.\n */\nexport const warnOnce = /* @__PURE__ */ sayOnce('warn');\nexport const errorOnce = /* @__PURE__ */ sayOnce('error');\n","/** **`@verajs/renderer/keyed`'s diagnostics — DEVELOPMENT ONLY.** Its bundle's own table, merged into the renderer's json. */\nimport type { Prose } from '@verajs/shared-utils';\n\nexport const PROSE: Record<string, Prose> = {\n 'keyed-duplicate-key': (key) => [\n `the key ${key} is used by more than one item in this list. A key identifies one item, so which of them keeps the existing DOM is not defined — the list still renders, but nothing about which node ends up where can be relied on.`,\n 'Give every item a key of its own — an id, not an index or a value two items share.',\n ],\n 'selector-not-wired': () => [\n 'createSelector needs the keyed module wired, and it was not.',\n 'Wire it once at your entry — `wire([renderer, lists])` — before a component creates a selector.',\n ],\n 'keyed-not-template': (received) => [\n `expected a template as the second argument and received ${received}.`,\n 'It marks a template with a key — `keyed(row.id, html`<li>…</li>`)`.',\n ],\n};\n","import { misuse, warnOnce } from '@verajs/shared-utils';\nimport { PROSE } from './keyed-diagnostics.js';\n/**\n * @verajs/renderer/keyed — key-based list reconciliation, loaded by the values that need it.\n *\n * `keyed()` stamps a result with its key and with the strategy that reconciles it (`$r`), so importing\n * the marker is what loads the algorithm: nothing registers, and a list names its own strategy. It\n * imports nothing at runtime and reaches the renderer only through the `$`-named list protocol on the\n * part (`$c` create, `$u` update, `$f` first node, `$m` move, `$d` remove) and each item's `$k`, which\n * is what lets it sit beside any renderer entry, hydrate included.\n */\nimport type { Item, KeyedResult, ListStrategy } from './renderer.js';\nimport type { CrossBundleHook } from '@verajs/core';\n\nconst reconcile: ListStrategy = (part, values, items, parent, end) => {\n const count = values.length;\n /** A `null` item is unkeyed, as the renderer's `$c` already treats it — never a throw on the second render. */\n const key = (i: number) => (values[i] as KeyedResult | null)?.key;\n let start = 0;\n let oldEnd = items.length - 1;\n let newEnd = count - 1;\n\n /**\n * The unchanged run at each end, matched without allocating. When what remains between them is only\n * removals (a row deleted) or only insertions (rows appended, prepended, inserted), it is settled here;\n * a same-order update is the case where nothing remains at all.\n */\n /** A row whose value is the result committed last time (a list row that did not re-render) is not even asked. */\n while (start <= oldEnd && start <= newEnd && items[start].$k === key(start)) {\n const value = values[start];\n if (value === undefined || value !== (items[start] as { $j?: unknown }).$j) items[start] = part.$u(items[start], value);\n start++;\n }\n while (start <= oldEnd && start <= newEnd && items[oldEnd].$k === key(newEnd)) {\n const value = values[newEnd];\n if (value === undefined || value !== (items[oldEnd] as { $j?: unknown }).$j) items[oldEnd] = part.$u(items[oldEnd], value);\n oldEnd--;\n newEnd--;\n }\n /**\n * A repeated key, said where it can have arisen: only when the new list has items between the end scans (inserted\n * or moved) — a same-order update and a pure removal cannot create one, and never pay for the check. It behaves\n * correctly in the common case and arbitrarily in the rest — the shape of bug that survives a test suite.\n * Development only; the keys are gathered only here.\n */\n if (__DEV__ && start <= newEnd) {\n const seen = new Set<unknown>();\n for (let i = 0; i < count; i++) {\n const k = key(i);\n if (seen.has(k)) {\n /** Once per (list, key): the same duplicate on every reconcile is noise; a NEW duplicate key is news. */\n warnOnce('keyed', 'a keyed list', 'keyed-duplicate-key', __DEV__ && (() => PROSE['keyed-duplicate-key'](String(k))), [part, k]);\n break;\n }\n seen.add(k);\n }\n }\n if (start > newEnd) {\n for (let i = start; i <= oldEnd; i++) part.$d(items[i]);\n items.splice(start, oldEnd - start + 1);\n return items;\n }\n /** Joined with `concat`, never spread into `splice`: an engine caps a call's arguments (JavaScriptCore at 65 536). */\n const ref = start < items.length ? part.$f(items[start]) : end;\n const added: Item[] = [];\n if (start > oldEnd) {\n for (let i = start; i <= newEnd; i++) added.push(part.$c(values[i], parent, ref));\n return items.slice(0, start).concat(added, items.slice(start));\n }\n\n /**\n * A genuine reorder: two-ended from where the scans stopped, with a key map of the old middle built only\n * when both ends miss. An old item the new list no longer holds stays until the final sweep removes it.\n */\n const old: (Item | null)[] = items;\n const next: Item[] = items.slice(0, start).concat(new Array(newEnd - start + 1), items.slice(oldEnd + 1));\n const before = (i: number): Node | null => (i < count ? part.$f(next[i]) : end);\n let map: Map<unknown, number> | undefined;\n /** The new middle's keys, built with `map`: what tells a removed old end from a moved one. */\n let fresh: Set<unknown> | undefined;\n let oldHead = start;\n let newHead = start;\n while (oldHead <= oldEnd && newHead <= newEnd) {\n const head = old[oldHead];\n const tail = old[oldEnd];\n if (head === null) oldHead++;\n else if (tail === null) oldEnd--;\n else if (head.$k === key(newHead)) {\n next[newHead] = part.$u(head, values[newHead]);\n oldHead++;\n newHead++;\n } else if (tail.$k === key(newEnd)) {\n next[newEnd] = part.$u(tail, values[newEnd]);\n oldEnd--;\n newEnd--;\n } else if (head.$k === key(newEnd)) {\n part.$m(head, before(newEnd + 1), parent);\n next[newEnd] = part.$u(head, values[newEnd]);\n oldHead++;\n newEnd--;\n } else if (tail.$k === key(newHead)) {\n part.$m(tail, part.$f(head), parent);\n next[newHead] = part.$u(tail, values[newHead]);\n oldEnd--;\n newHead++;\n } else {\n if (map === undefined) {\n map = new Map();\n for (let i = oldHead; i <= oldEnd; i++) if (old[i] !== null) map.set(old[i]!.$k, i);\n fresh = new Set();\n for (let i = newHead; i <= newEnd; i++) fresh.add(key(i));\n }\n /**\n * **An old end the new list no longer holds is REMOVED, not worked around** (2026-10-20): a push and a middle\n * splice in one flush left no unchanged run at either end, and the walk moved every row past the removed one —\n * 999 `insertBefore` on 1000 rows, where 2 DOM operations are right (`auto-moves.mjs`).\n */\n if (!fresh!.has(head.$k)) {\n part.$d(head);\n old[oldHead++] = null;\n continue;\n }\n if (!fresh!.has(tail.$k)) {\n part.$d(tail);\n old[oldEnd--] = null;\n continue;\n }\n /**\n * A slot the map points at may already be spoken for when a key repeats: nulled by an earlier reuse,\n * or consumed by the two-ended branches (which move pointers without nulling). Either is treated as\n * \"not found\" and gets a fresh item — duplicate keys are undefined behavior, but undefined must still\n * mean a list, never a throw or a row rendered twice.\n */\n const at = map.get(key(newHead));\n const reusable = at === undefined || at < oldHead || at > oldEnd ? null : old[at];\n if (reusable === null) next[newHead] = part.$c(values[newHead], parent, part.$f(head));\n else {\n part.$m(reusable, part.$f(head), parent);\n next[newHead] = part.$u(reusable, values[newHead]);\n old[at!] = null;\n }\n newHead++;\n }\n }\n const fill = before(newEnd + 1);\n for (; newHead <= newEnd; newHead++) next[newHead] = part.$c(values[newHead], parent, fill);\n for (; oldHead <= oldEnd; oldHead++) if (old[oldHead] !== null) part.$d(old[oldHead]!);\n return next;\n};\n\n/**\n * Marks a template result with a stable key, so list reconciliation moves it instead of rewriting it.\n * Key all items in a list or none. A repeated key is undefined behavior: which item keeps the existing\n * node is unspecified, but the render completes and the DOM holds what the list holds.\n *\n * ```js\n * import { keyed } from '@verajs/renderer/keyed';\n * rows.map((r) => keyed(r.id, html`<tr>…</tr>`))\n * ```\n */\nexport const keyed = <T>(key: unknown, result: T): T => {\n /**\n * The second argument is the one that goes missing — `keyed(row.id)`. It failed with `Cannot set properties of\n * undefined (setting 'key')`, which names this function's internals and not the call.\n */\n if (__DEV__ && (result === null || typeof result !== 'object'))\n throw new TypeError(misuse('keyed', 'keyed-not-template', __DEV__ && PROSE['keyed-not-template'](String(result))));\n (result as KeyedResult).key = key;\n (result as KeyedResult).$r = reconcile;\n return result;\n};\n\n/**\n * **Rows that track themselves** (PROBE P1, 2026-10-18; its `each(items, key, row)` API RETIRED 2026-10-21, Brian: the\n * automatic `.map` below replaced it, nothing documented or used it, and it carried its own reconcile and key cache):\n * core's hook machinery gives each row its own subscriber, and the renderer's list part does the walk and the moves. A\n * write a row read wakes exactly that row, which re-commits itself in place through `part.$u`.\n */\ntype Owner = { _$g$: number; _$x$: boolean; _$h$?: unknown[]; localName: string; readonly isConnected: boolean; readonly ownerDocument: Document };\n/** The row's hook, as core's `$q` hands it back: the record itself, run through its `$n` (a `$`-name: survives mangling). */\ntype RowHook = { $n(signal?: unknown, init?: boolean): void };\ntype EachPart = { $p(value: unknown): void; $u(item: Item, value: unknown): Item; $i?: Item[] };\n\n/** Core's queued-hook factory (`$q`) and retire (`$z`), handed over by `lists` when it is wired: a row's subscriber. */\nlet hook: ((owner: Owner, callback: (signal?: unknown, init?: boolean) => void) => RowHook) | undefined;\n/** Core's bare row hook (`$qb`), its direct retire (`$zh`) and the hook → owner read (`$ow`): one object fewer and no closure per row. */\nlet bareHook: ((owner: Owner, callback: (this: RowHook, signal?: unknown, init?: boolean) => void) => RowHook) | undefined;\nlet retireHook: ((hook: RowHook) => void) | undefined;\nlet ownerOf: ((hook: RowHook) => Owner) | undefined;\n/** Core's run ownership (`$own`). */\nlet own: ((hook: unknown, item: List) => void) | undefined;\n/** Core's settle (`$so`): a row that owns lists settles them where its run ends, or disposes them as it drops. */\nlet settle: ((hook: unknown, all?: boolean) => void) | undefined;\n/**\n * **How many live lists a ROW owns** (a `.map` inside a row's render), page-wide: while it is 0 — every page without\n * nested lists — a row's run and its drop pay one module read for ownership, and no lookup (what (e′) paid per row).\n */\nlet nested = 0;\n/** Every row's callback, ONE function: core calls it as a method of the row's hook, which leads back to the row. */\nfunction rowCb(this: RowHook, signal?: unknown, init?: boolean) {\n rowRun.call(ownerOf!(this) as Row, signal, init);\n}\n/** Core's retire (`$z`): what releases a row's subscriptions. */\nlet retire: ((owner: Owner) => void) | undefined;\n/** Core's raw walk of a store array (`$w`), when core is wired; otherwise the list walks itself. */\nlet walk: ((list: unknown, visit: (raw: unknown, item: unknown) => void, from?: number, to?: number) => boolean) | undefined;\n/** Core's raw read of a store array WITHOUT subscribing (`$wr`): what the list compares its unchanged ends on. */\nlet rawOf: ((list: unknown) => unknown[] | undefined) | undefined;\n/** The render counter: a row stamped with this render's `t` was met in it; one not met is swept (`eachValue`). */\nlet tick = 0;\n\n/**\n * A row's template result, ready for the list part: its `key` (what reconcile matches on), `$r` (the keyed strategy, so\n * the part reconciles by key) and `_$same$` (opts the result into the identity skip: the renderer may do nothing when\n * the SAME result object comes back, which a list row returns when it did not re-render).\n */\nconst stamp = (rec: Row) => {\n const r = rec.row(rec.item) as KeyedResult & { _$same$?: number };\n /** An automatic `.map` row may return a string or a number (`.map((t) => t.name).join(', ')`): nothing to stamp. */\n if (r === null || typeof r !== 'object') return r;\n r.key = rec.key;\n r.$r = reconcile;\n r._$same$ = 1;\n return r;\n};\n/**\n * **A row: its record AND its hook's OWNER, one object; the hook is core's BARE row hook (`$qb`: never in the owner's hook list, retired directly), held in `h`, run through the one shared `rowCb`.** (An earlier version made the row\n * its own hook, a subclass of core's hook class across the bundle boundary: one object per row instead of two. It bought\n * nothing — a Chrome profile of create10k showed the two identical, and two races put it 4–6% SLOWER at Chrome 10k\n * creation — and the cross-bundle subclass cost two mangling bugs; REVERTED, Brian 2026-10-20.) As the owner it carries\n * what core's hooks read of an owner: `_$g$` its generation (bumped by `drop`, which retires the hook), `_$x$` /\n * `localName`, `_$h$` the hook list core keeps on it (declared, so its first write is no shape change), `isConnected` (core\n * skips a disconnected owner's writes; the row is connected while its rendered node is) and `ownerDocument` (the\n * scheduler uses the element's own window). As the record: `part` its list part, `list` its automatic list, `key`,\n * `item` / `row` what it renders from, `result` its last template result, `inst` the instance that result was committed\n * into, `seen` the render that last met it.\n */\nclass Row {\n /**\n * `declare`d and ASSIGNED in the constructor, in one order — as core's `HookState` is — never class-field initializers\n * (a define-semantics field is a property DEFINITION per instance).\n */\n declare _$g$: number;\n declare _$x$: boolean;\n declare _$h$: unknown[] | undefined;\n declare localName: string;\n declare h: RowHook;\n declare part: EachPart | undefined;\n /** The automatic `.map` list this row belongs to (the only kind of row since `each` was retired, 2026-10-21). */\n declare list: List | undefined;\n declare result: KeyedResult | null;\n declare inst: Item | undefined;\n declare key: unknown;\n declare item: unknown;\n /** The RAW slot value the row was last met as: the list's cheap \"same row, same place\" test compares it. */\n declare src: unknown;\n declare row: (item: unknown) => unknown;\n declare seen: number;\n constructor(p: EachPart | undefined, k: unknown, item: unknown, row: (item: unknown) => unknown, t: number, list: List | undefined, src: unknown) {\n this._$g$ = 1;\n this._$x$ = false;\n this._$h$ = undefined;\n this.localName = 'each-row';\n this.h = undefined as unknown as RowHook;\n this.part = p;\n this.list = list;\n this.result = null;\n this.inst = undefined;\n this.key = k;\n this.item = item;\n this.src = src;\n this.row = row;\n this.seen = t;\n }\n get isConnected() {\n const node = (this.inst as { $R?: Node } | undefined)?.$R;\n return node === undefined || node.isConnected;\n }\n get ownerDocument() {\n return (this.inst as { $R?: Node } | undefined)?.$R?.ownerDocument ?? document;\n }\n}\n/**\n * The row's run: a write the row's render read wakes exactly this row. It re-stamps and commits its new result into its\n * OWN instance in place (`part.$u`); if the instance had to be replaced (the row's shape changed), the list part's item\n * array is patched to point at the new one.\n */\nfunction rowRun(this: Row, _signal?: unknown, init?: boolean) {\n const list = this.list;\n /** An automatic list the parent's latest run no longer reached: its rows go with it. */\n if (!init && list !== undefined && list.mapped !== list.parent.$runs) return orphan(list);\n const r = stamp(this);\n this.result = r;\n /** The row's render returned: a nested list it hid this time goes now (core's ownership, settled here — (e″)). */\n if (nested !== 0) settle!(this.h);\n /**\n * A run its LIST asked for (`init`: created, or re-run in the list's walk) only records its result — the list hands it\n * to the renderer. Only a write the row heard commits or wakes anything: a walk-time run that woke the parent made the\n * parent re-run its rows, which woke it again (a loop, measured 2026-10-20).\n */\n if (init) return;\n /**\n * An automatic list's row commits in place only while the page shows what the parent's LATEST run mapped (`committed`);\n * otherwise the map's result was used as a value (summed, joined, chained), so the parent re-renders with it.\n */\n if (list !== undefined && list.committed !== list.parent.$runs) return list.parent.$n();\n if (this.inst !== undefined) {\n const part = this.part!;\n const out = part.$u(this.inst, r);\n if (out !== this.inst) {\n const items = part.$i!;\n items[items.indexOf(this.inst)] = out;\n this.inst = out;\n }\n }\n}\nconst makeRow = (part: EachPart | undefined, k: unknown, item: unknown, row: (item: unknown) => unknown, list: List | undefined, src: unknown): Row => {\n const rec = new Row(part, k, item, row, tick, list, src);\n rec.h = bareHook!(rec, rowCb);\n /** `init`: a hook's first run is immediate (a queued hook's write-time run would only enqueue it). */\n rec.h.$n(undefined, true);\n return rec;\n};\n/** A row that left the list: its generation moves on (it goes inert) and core retires it (a self-owned hook: directly). */\nconst drop = (rec: Row) => {\n rec._$g$++;\n retireHook!(rec.h);\n if (nested !== 0) settle!(rec.h, true);\n /** A row owns exactly one hook today; if anything ever registers another on it, the full retire still runs. */\n if (rec._$h$ !== undefined) retire!(rec);\n};\n/**\n * **Automatic `.map`** (Brian 2026-10-20: every `.map` on a store array inside a render is\n * a keyed list, with no rule and nothing to learn). Core's array handler hands `state.todos.map(fn)` here when it runs in\n * a render (`$M`). The result is a REAL array of the row results — `.map(i => i.name).join(', ')` still works — and each\n * `fn(item)` runs once, under its ROW's hook, so the parent never subscribes to row fields: a write to\n * one item re-renders that row. A LIST (below) owns the rows and, as its own hook, the array's shape (`ITEMS`): a push\n * or a splice re-runs the list, not the parent.\n *\n * **The stale-value rule, decided by WHICH hook ran** (signals-readiness constraint 4: no change information is read):\n * the parent's run called `.map` → every row re-runs with the new `fn` (fresh parent values, exactly as a plain map); the\n * list's own hook ran alone → only the shape changed, so unchanged rows are skipped.\n *\n * **Keys:** an item's own `id`, else the item itself — what lets a refetch (`state.todos = await …`) keep the rows of\n * unchanged ids, and their DOM. A repeated `id` turns the list to identity keys for good (development warns,\n * `keyed-duplicate-key`); the same object twice gets a fresh row per occurrence. **A plain map instead** when `fn`\n * declares an index (`(t, i) => …`: a row would show a stale position after a reorder) or the array holds primitives.\n *\n * **Lists are matched to calls by ORDER within the parent's run**, as hooks are: the parent's k-th `.map` is the k-th\n * list. A list the parent's latest run did not reach is an orphan; its next wake retires it with its rows.\n */\nclass List {\n declare _$g$: number;\n declare _$x$: boolean;\n declare _$h$: unknown[] | undefined;\n declare localName: string;\n declare h: RowHook;\n /** Its parent hook, read across the bundle boundary (`CrossBundleHook`). */\n declare parent: CrossBundleHook;\n declare owner: Node & { readonly isConnected: boolean };\n declare fn: (item: unknown) => unknown;\n declare items: ArrayLike<unknown>;\n declare cache: Map<unknown, Row>;\n declare recs: Row[];\n declare values: unknown[];\n declare part: EachPart | undefined;\n declare mapped: number;\n declare committed: number;\n declare all: boolean;\n declare ident: boolean;\n declare dead: boolean;\n /** The array this list last mapped (a list is found by its array first: see the matching below). */\n declare raw: unknown[] | undefined;\n /** The ownership contract core reads (`$`-named): the parent run that last claimed it, its owning hook. */\n declare $r: number;\n declare $h: unknown;\n constructor(parent: List['parent'], owner: List['owner']) {\n this._$g$ = 1;\n this._$x$ = false;\n this._$h$ = undefined;\n this.localName = 'each-list';\n this.h = undefined as unknown as RowHook;\n this.parent = parent;\n this.owner = owner;\n this.fn = undefined as unknown as List['fn'];\n this.items = [];\n this.cache = new Map();\n this.recs = [];\n this.values = [];\n this.part = undefined;\n this.mapped = 0;\n this.committed = -1;\n this.all = true;\n this.ident = false;\n this.dead = false;\n this.raw = undefined;\n this.$r = -1;\n this.$h = undefined;\n }\n /** Disposed by core when the parent's run ends without claiming it, or the parent hook retires. */\n $d() {\n orphan(this);\n }\n /** Connected while the component that mapped it is. */\n get isConnected() {\n return this.owner.isConnected !== false;\n }\n get ownerDocument() {\n return this.owner.ownerDocument ?? document;\n }\n}\n/** The mark on a map's result: the list that made it. A Symbol private to this module copy. */\nconst AUTO = Symbol();\n/**\n * The marked array this module is committing right now, so the renderer's own list path takes THAT array — and only\n * it: a row built during the commit carries its own nested list, which must still reach `commitList` (a plain flag\n * turned every nested list away, so every inner write re-ran its outer row — measured 2026-10-20).\n */\nlet committing: unknown[] | undefined;\n/**\n * **Only a map whose rows are TEMPLATES becomes a list** (option C, Brian 2026-10-20 — measured first without the rule:\n * a `map → reduce` over 10k items in a render cost +29% Chrome / +30% Firefox on its first render and twice the heap,\n * 5.63 vs 2.85 MB, for rows nothing renders). A call site's first item decides, ONCE: its row run untracked; a result\n * that is not an object marks the call site `PLAIN` for good, and it maps natively from then on.\n */\nconst PLAIN = 0;\n/** Per parent hook: the run its lists were last counted in, how many it has reached this run, and the lists. */\ntype ListsState = {\n v: number;\n n: number;\n lists: (List | typeof PLAIN)[];\n /** This run's count of maps per array, and each array's slots by occurrence. */\n occ: Map<unknown, number>;\n byRaw: WeakMap<object, (List | typeof PLAIN | undefined)[]>;\n};\nconst listsOf = new WeakMap<object, ListsState>();\n/** Core's `untracked` (`$t`): the deciding run of a call site's first item subscribes nothing. */\nlet untracked: (<R>(fn: () => R) => R) | undefined;\n/** A list the parent no longer reaches: its rows and its own hook retire. */\nconst orphan = (list: List) => {\n /**\n * ONCE: a second orphan would count a row-owned list out of `nested` twice, and a count driven to 0 while nested\n * lists live turns their settling off — the leak (e″) closes, silently. Unreachable today (an orphaned list's hooks and\n * rows move generation, so nothing queued runs them again), kept as the invariant.\n */\n if (list.dead) return;\n list.dead = true;\n if (ownerOf!(list.parent as unknown as RowHook) instanceof Row) nested--;\n for (let i = 0; i < list.recs.length; i++) drop(list.recs[i]);\n list.recs = [];\n list.cache.clear();\n /**\n * A disposed list may stay RECORDED (in the per-array history), so it lets go of everything else: its last\n * results (a hidden 10k list's 10 000 template results), its render's callback, its array and its part (Brian 2026-10-20:\n * \"is there any risk with references getting held with the tables?\").\n */\n list.values = [];\n list.fn = undefined as unknown as List['fn'];\n list.items = [];\n list.part = undefined;\n list._$g$++;\n retire!(list);\n};\n/** The list's result committed into `part` by the renderer's own list path; then each row learns its instance and part. */\nconst commitList = (list: List, part: EachPart) => {\n const outer = committing;\n committing = list.values;\n try {\n part.$p(list.values);\n } finally {\n committing = outer;\n }\n /**\n * Marked committed only once the commit SUCCEEDED: a commit that threw left the list \"committed\" with its\n * rows' instances stale, and the next row write patched an instance the part no longer held (`items[-1]`). Unmarked,\n * a row write wakes the parent instead, which re-renders and commits again.\n */\n list.part = part;\n list.committed = list.parent.$runs;\n const its = part.$i;\n const recs = list.recs;\n if (its !== undefined)\n for (let i = 0; i < recs.length; i++) {\n recs[i].inst = its[i];\n recs[i].part = part;\n }\n};\n/**\n * The row last met as raw slot `value` is met again unchanged: the same raw object AND the same key (`id` written in\n * place re-keys the row, as a full walk would; a row keyed by identity has `key === src`).\n */\nconst same = (rec: Row, value: unknown) =>\n rec.src === value && (rec.key === value || (value !== null && typeof value === 'object' && (value as { id?: unknown }).id === rec.key));\n/** The list's run: walk the array (subscribing the list to its shape), reuse / create / sweep rows, mark the result. */\nfunction listRun(this: List): void {\n const all = this.all;\n this.all = false;\n if (!all && this.mapped !== this.parent.$runs) return orphan(this);\n const t = ++tick;\n const fn = this.fn;\n const cache = this.cache;\n const prev = this.recs;\n const n = this.items.length;\n const recs: Row[] = new Array(n);\n const values: unknown[] = new Array(n);\n let i = 0;\n let restart = false;\n /**\n * **The unchanged ends, settled on RAW slots before any key is resolved** (the reconcile's two-ends idea, one level\n * up). A swap or a splice changes a few slots and re-ran this whole walk — a Map lookup, an `hasOwn`, a proxy read per\n * row, 63% of a Chrome swap (2026-10-23). Off when every row must re-run (`all`), and off unless core can hand the raw\n * slots (`rawOf`: a plain store array) — the fallback below reads through the proxy, whose per-index reads are links.\n * Every row kept here is stamped `seen` BEFORE the middle runs, so a middle item repeating its key is still a duplicate.\n */\n let front = 0;\n let back = 0;\n const raw = all ? undefined : rawOf?.(this.items);\n if (raw !== undefined) {\n const m = prev.length;\n const lim = n < m ? n : m;\n while (front < lim && same(prev[front], raw[front])) front++;\n while (back < lim - front && same(prev[m - 1 - back], raw[n - 1 - back])) back++;\n for (let j = 0; j < front; j++) {\n const rec = prev[j];\n rec.seen = t;\n recs[j] = rec;\n values[j] = rec.result;\n }\n for (let j = 1; j <= back; j++) {\n const rec = prev[m - j];\n rec.seen = t;\n recs[n - j] = rec;\n values[n - j] = rec.result;\n }\n i = front;\n }\n const visit = (source: unknown, item: unknown) => {\n if (restart) return;\n /** The row last run at this position, met again as the same raw slot: no key to resolve (a swap's untouched middle). */\n const at = raw === undefined ? undefined : prev[i];\n let rec: Row | undefined;\n let k: unknown;\n if (at !== undefined && at.seen !== t && same(at, source)) {\n rec = at;\n k = at.key;\n } else {\n k = this.ident || !Object.hasOwn(source as object, 'id') ? source : (source as { id: unknown }).id;\n rec = cache.get(k);\n }\n if (rec !== undefined && rec.seen === t) {\n if (!this.ident) {\n /** A repeated id: identity keys from now on, and this run again from the start. Said once per list. */\n if (__DEV__) warnOnce('keyed', 'an automatic .map list', 'keyed-duplicate-key', __DEV__ && (() => PROSE['keyed-duplicate-key'](String(k))), this);\n this.ident = true;\n restart = true;\n return;\n }\n /** The same object twice under identity keys: a row of its own, never cached. */\n rec = makeRow(undefined, {}, item, fn, this, source);\n } else if (rec === undefined) {\n rec = makeRow(undefined, k, item, fn, this, source);\n cache.set(k, rec);\n } else if (all || rec.item !== item) {\n /** Through the row's OWN hook: what it reads subscribes the row, never the list or the parent. */\n rec.item = item;\n rec.row = fn;\n rec.h.$n(undefined, true);\n }\n rec.seen = t;\n rec.src = source;\n recs[i] = rec;\n values[i++] = rec.result;\n };\n if (!walk!(this.items, visit, front, n - back))\n for (let j = 0; j < n; j++) {\n const item = this.items[j];\n visit(item, item);\n }\n if (restart) {\n /** Identity keys now: every row is made again by a full walk, then this run's commit decision still applies. */\n for (const rec of cache.values()) drop(rec);\n cache.clear();\n this.recs = [];\n this.all = true;\n listRun.call(this);\n if (all) return;\n if (this.committed === this.parent.$runs && this.part !== undefined) commitList(this, this.part);\n else this.parent.$n();\n return;\n }\n /** Last run's rows this run did not meet: swept (each drops its own subscriptions). The kept ends were all met. */\n for (let j = front; j < prev.length - back; j++) {\n const rec = prev[j];\n if (rec.seen !== t) {\n if (cache.get(rec.key) === rec) cache.delete(rec.key);\n drop(rec);\n }\n }\n this.recs = recs;\n (values as unknown as Record<symbol, List>)[AUTO] = this;\n this.values = values;\n if (all) return;\n /** The shape changed alone: commit where the page shows the parent's latest result, or re-render the parent. */\n if (this.committed === this.parent.$runs && this.part !== undefined) commitList(this, this.part);\n else this.parent.$n();\n}\n/** Core's `$M`: `state.todos.map(fn)` inside a render. `raw` is the array behind `proxy`; `method` the native `map`. */\nconst automap = (\n proxy: ArrayLike<unknown>,\n raw: unknown[],\n fn: (item: unknown) => unknown,\n parent: List['parent'],\n owner: List['owner'],\n method: (this: unknown, fn: unknown) => unknown[],\n) => {\n let state = listsOf.get(parent);\n if (state === undefined) listsOf.set(parent, (state = { v: parent.$runs, n: 0, lists: [], occ: new Map(), byRaw: new WeakMap() }));\n else if (state.v !== parent.$runs) {\n state.v = parent.$runs;\n state.n = 0;\n state.occ.clear();\n }\n /**\n * EVERY `.map` call in a render takes its place in the order, whatever path it takes (one rule). An index or\n * non-function callback needs no memory — its arity is known at every call — so it takes the place WITHOUT writing\n * PLAIN: writing it could overwrite a live list unretired, and turn a list that slid onto this place into a plain map.\n */\n if (typeof fn !== 'function' || fn.length > 1) {\n state.n++;\n return method.call(proxy, fn);\n }\n /**\n * **A list is found by (ARRAY, its occurrence in this run) first** (2026-10-20): a conditional `.map` before\n * another no longer slides the later one onto its list — a hidden map shifts only other maps over the SAME array. A new\n * array (a refetch) falls back to the list at this call's place in order, but only one whose own array is not mapped in\n * this run, so it never takes another site's list. A PLAIN decision is found only by its exact array (a refetched plain\n * site decides again: one untracked call).\n */\n const k = state.occ.get(raw) ?? 0;\n state.occ.set(raw, k + 1);\n const slots = state.byRaw.get(raw);\n let list: List | typeof PLAIN | undefined = slots?.[k];\n /** Dead, or already claimed by another call this run (a list serves ONE call per run): not this call's. */\n if (list !== undefined && list !== PLAIN && (list.dead || list.mapped === parent.$runs)) list = undefined;\n /**\n * The order fallback is for a REFETCH only — a brand-new array, with no history of its own. An array that has history is\n * a RETURNING one (a list shown again): falling back would hand it another array's list, and that array's own call would\n * then share it (measured: auto-cond, both lists rendered from one).\n */\n if (list === undefined && slots === undefined) {\n const at = state.lists[state.n];\n if (at !== undefined && at !== PLAIN && !at.dead && at.mapped !== parent.$runs && !state.occ.has(at.raw)) list = at;\n }\n const st = state;\n const put = (v: List | typeof PLAIN) => {\n st.lists[st.n] = v;\n let mine = st.byRaw.get(raw);\n if (mine === undefined) st.byRaw.set(raw, (mine = []));\n mine[k] = v;\n if (v !== PLAIN) v.raw = raw;\n };\n if (list === PLAIN) {\n state.n++;\n return method.call(proxy, fn);\n }\n /**\n * **A call site with a live list ALWAYS runs it — an empty array included** (2026-10-20): the empty case took the plain\n * path, so clearing a list never swept its rows — 10 000 rows stayed alive and subscribed after `state.rows = []`\n * (Chrome: 12.22 MB retained after a clear vs the earlier idiom's 4.50, `perrow.mjs`), each create ran beside the last one's\n * rows (twice the live heap: Firefox's extra major GC), and the empty call did not count its place in the parent's\n * order, so a later `.map` slid into this one's list. With no list yet, an empty or primitive array maps natively, and\n * still takes its place (an empty one stays undecided; a primitive one is PLAIN for good).\n */\n if (list === undefined || list.dead) {\n if (raw.length === 0) {\n state.n++;\n return method.call(proxy, fn);\n }\n if (raw[0] === null || typeof raw[0] !== 'object') {\n put(PLAIN);\n state.n++;\n return method.call(proxy, fn);\n }\n }\n if (list === undefined) {\n const first = untracked!(() => fn(proxy[0]));\n /**\n * A list only when the first row is a TEMPLATE result — the renderer's OWN definition, `strings !== undefined`\n * (`isTemplateResult`, renderer.ts; a DELIBERATE twin, since this module imports nothing at runtime: change both\n * together), so a hand-built `{ strings, values }` the renderer accepts is a list here too —\n * not any object: a computational map returning plain objects (`items.map((i) => ({ ...i, label }))`, a directives\n * query) became a tracked list and broke `directives-query` (2026-10-20).\n */\n if (first === null || typeof first !== 'object' || (first as { strings?: unknown }).strings === undefined) {\n put(PLAIN);\n state.n++;\n return method.call(proxy, fn);\n }\n }\n if (list === undefined || list.dead) {\n const made = new List(parent, owner);\n made.h = hook!(made, () => listRun.call(made));\n if (ownerOf!(parent as unknown as RowHook) instanceof Row) nested++;\n list = made;\n }\n put(list);\n state.n++;\n /**\n * **Owned by the parent's run** (core's `$own`): when a parent run ENDS without claiming this list — its\n * render hid it, or no longer reaches it — core disposes it (`$d`, an orphan's retirement) at once, `.map` call or not.\n */\n own!(parent, list);\n list.fn = fn;\n list.items = proxy;\n list.mapped = parent.$runs;\n list.all = true;\n list.h.$n(undefined, true);\n return list.values;\n};\nconst eachValue = (part: object, value: unknown, adopted?: object) => {\n if (value === null || typeof value !== 'object') return false;\n /** An automatic `.map` result: committed by its list, which then knows the part its rows live in. */\n if (Array.isArray(value)) {\n const list = (value as unknown as Record<symbol, List | undefined>)[AUTO];\n if (list === undefined || value === committing) return false;\n /**\n * **Hydrating: the list ADOPTS the server's rows** (2026-10-22). The base adopted one instance per row FROM THESE\n * ROWS' OWN results — same count, same templates, same keys, by construction — so the list only takes ownership\n * (`ADOPTED`, 2) and the base's queued commits patch any stale value in place, as for every adopted instance. It used\n * to claim, which rebuilt every row. Any other shape (no adopted items, a count that differs) builds, as before.\n */\n const items = (adopted as EachPart | undefined)?.$i;\n if (items !== undefined && items.length === list.recs.length) {\n list.part = part as EachPart;\n list.committed = list.parent.$runs;\n for (let i = 0; i < items.length; i++) {\n list.recs[i].inst = items[i];\n list.recs[i].part = part as EachPart;\n }\n return 2;\n }\n commitList(list, part as EachPart);\n return true;\n }\n return false;\n};\n/**\n * **`createSelector(source)` → `isSelected(key)`** (2026-10-20): selection that wakes\n * exactly the rows whose answer changed. `isSelected(key)` subscribes the running hook to ONE cell per key (core's store\n * kit, `$k`, on a private target), and a hook watching `source` wakes only the previous and the new key's cells when it\n * changes — so a select re-renders 2 rows, not every row that compared against `state.selected`.\n *\n * ```js\n * const isSelected = createSelector(() => state.selected);\n * state.rows.map((r) => html`<tr class=${isSelected(r.id) ? 'selected' : ''}>…</tr>`)\n * ```\n *\n * Made in a component's setup, it is that component's (its watcher retires with it); with no component being set up it\n * THROWS, as every hook does. Its watcher runs inside the write (an immediate hook), so the woken rows render in the same flush.\n * Its keys are bounded: cells no row reads any more are pruned on an amortized budget (below).\n */\nlet kit: { track(obj: object, key: unknown): void; trigger(obj: object, key: unknown, value: unknown, prev: unknown): void } | undefined;\nlet makeHook: ((hook: { callback: () => void; priority: number }) => ((signal?: unknown, init?: boolean) => void) | undefined) | undefined;\nexport const createSelector = <K>(source: () => K): ((key: K) => boolean) => {\n if (kit === undefined || makeHook === undefined) throw new Error(misuse('createSelector', 'selector-not-wired', __DEV__ && PROSE['selector-not-wired']()));\n const target = {};\n const k = kit;\n let current: K | typeof target = target;\n const run = makeHook({\n callback: () => {\n const next = source();\n if (next === current) return;\n const prev = current;\n current = next;\n if (prev !== target) k.trigger(target, prev, false, true);\n k.trigger(target, next, true, false);\n },\n priority: 0,\n });\n run?.(undefined, true);\n /**\n * **Keys are bounded by core**: every big key map is swept as it grows (createProxy's `sweepIfDue`) — the cells no\n * row reads any more go, so a list whose ids only increase (a feed, a log) keeps only about twice its live keys. (This\n * selector had its own budgeted prune until core generalized it, 2026-10-23.)\n */\n return (key: K) => {\n k.track(target, key);\n return current === key;\n };\n};\n\n/**\n * Wire it: `wire([renderer, lists])`. A CONNECTOR (a function `wire` hands the registry): core's registry carries the\n * hook machinery (`$q`, `$z`) and the raw walk (`$w`); automatic `.map` results are recognized on the renderer's `'value'` insert.\n */\nexport const lists = (registry: { $q?: unknown; $qb?: unknown; $zh?: unknown; $ow?: unknown; $own?: unknown; $so?: unknown; $z?: unknown; $w?: unknown; $wr?: unknown; $M?: unknown; $t?: unknown; $k?: unknown; $s?: unknown }, w: (item: unknown) => void) => {\n hook = registry.$q as typeof hook;\n bareHook = registry.$qb as typeof bareHook;\n retireHook = registry.$zh as typeof retireHook;\n ownerOf = registry.$ow as typeof ownerOf;\n own = registry.$own as typeof own;\n settle = registry.$so as typeof settle;\n /** Core's array handler asks `$M` for a store array's `.map` inside a render: automatic lists. */\n (registry as { $M?: unknown }).$M = automap;\n retire = registry.$z as typeof retire;\n untracked = registry.$t as typeof untracked;\n kit = registry.$k as typeof kit;\n makeHook = (registry.$s as unknown[] | undefined)?.[2] as typeof makeHook;\n walk = registry.$w as typeof walk;\n rawOf = registry.$wr as typeof rawOf;\n w({ on: 'value', fn: eachValue, priority: 50 });\n};\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,IAAI,GAAG,uBAAuB;AAE3C;;;;;;;;;AASG;AACH,MAAM,OAAO,mBAAmB,IAAI,GAAG,EAAU;AACjD,MAAM,SAAS,mBAAmB,IAAI,OAAO,EAAqC;AAQlF;AACA,MAAM,QAAQ,GAAG,CAA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AAG,CAAC;QACpB,OAAO,OAAO,KAAK,GAAG;AACxB,IAAA,CAAC;AACH;AAEA;;;AAGG;MACU,KAAK,GAAG,CAAC,QAAyM,EAAE,CAA0B,KAAI;AAC7P,IAAA,IAAI,GAAG,QAAQ,CAAC,EAAiB;AACjC,IAAA,QAAQ,GAAG,QAAQ,CAAC,GAAsB;AAC1C,IAAA,UAAU,GAAG,QAAQ,CAAC,GAAwB;AAC9C,IAAA,OAAO,GAAG,QAAQ,CAAC,GAAqB;AACxC,IAAA,GAAG,GAAG,QAAQ,CAAC,IAAkB;AACjC,IAAA,MAAM,GAAG,QAAQ,CAAC,GAAoB;;AAErC,IAAA,QAA6B,CAAC,EAAE,GAAG,OAAO;AAC3C,IAAA,MAAM,GAAG,QAAQ,CAAC,EAAmB;AACrC,IAAA,SAAS,GAAG,QAAQ,CAAC,EAAsB;AAC3C,IAAA,GAAG,GAAG,QAAQ,CAAC,EAAgB;IAC/B,QAAQ,GAAI,QAAQ,CAAC,EAA4B,GAAG,CAAC,CAAoB;AACzE,IAAA,IAAI,GAAG,QAAQ,CAAC,EAAiB;AACjC,IAAA,KAAK,GAAG,QAAQ,CAAC,GAAmB;AACpC,IAAA,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACjD;;;;"}
@@ -0,0 +1,5 @@
1
+ type Wire = (item: never) => void;
2
+ declare const multiWindow: (registry: object, w: Wire) => void;
3
+
4
+ export { multiWindow };
5
+ //# sourceMappingURL=vera-renderer-multi-window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vera-renderer-multi-window.d.ts","sources":["../../src/multi-window.ts"],"mappings":"AAyBA,KAAA;cACY,WAAuB,wBAAC,IAAA;;;;","names":[]}
@@ -0,0 +1,40 @@
1
+ const multiWindow = (registry, w) => {
2
+ const core = registry;
3
+ const watched = new WeakSet();
4
+ /** This realm's window: its timers run; a dead window's never fire. */
5
+ const home = globalThis;
6
+ const release = (dead) => {
7
+ const teardown = core.$td, mine = core.$m;
8
+ if (teardown === undefined || mine === undefined)
9
+ return;
10
+ const walk = (root) => {
11
+ for (const el of root.querySelectorAll('*')) {
12
+ const inner = el.shadowRoot ?? el._$r$;
13
+ if (inner)
14
+ walk(inner);
15
+ if (el[mine] !== undefined && el.ownerDocument === dead)
16
+ teardown(el);
17
+ }
18
+ };
19
+ walk(dead);
20
+ };
21
+ const watch = (element) => {
22
+ const view = element.ownerDocument.defaultView;
23
+ if (view === null || view === home || watched.has(view))
24
+ return;
25
+ watched.add(view);
26
+ view.addEventListener('pagehide', (event) => {
27
+ if (event.persisted)
28
+ return;
29
+ const dead = view.document;
30
+ home.setTimeout(() => release(dead), 0);
31
+ });
32
+ };
33
+ w([
34
+ { name: '@verajs/renderer/multi-window', on: 'adopted', fn: watch, priority: 60 },
35
+ { name: '@verajs/renderer/multi-window', on: 'init', fn: (element) => { watch(element); }, priority: 60 },
36
+ ]);
37
+ };
38
+
39
+ export { multiWindow };
40
+ //# sourceMappingURL=vera-renderer-multi-window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vera-renderer-multi-window.js","sources":["../../src/multi-window.ts"],"sourcesContent":["/**\n * **`multiWindow` — components in the windows your page opens or embeds** (`@verajs/renderer/multi-window`; Brian\n * 2026-10-26). `wire([renderer, multiWindow])`. A component moved into a pop-out (`window.open`, an auxiliary browsing\n * context) or an iframe (a child navigable) is KEPT by core already; this module releases the ones LEFT there when\n * that window goes away for good. Without it, a component left behind stays subscribed to this window's stores, alive and\n * running, for the life of the page.\n *\n * - **Which windows.** One a component of this core is ADOPTED into (core's `'adopted'` insert: moved there, or resumed\n * there) or first CONNECTED in (an `'init'` insert: appended there directly). Each is watched once, in a WeakSet, so a\n * dead window is never held.\n * - **When.** At that window's final `pagehide` (not `persisted`: a back/forward cached page comes back), on THIS realm's\n * next task, so the app's own `pagehide` handlers run first, and moving a panel back home is what they do.\n * - **What.** The dead document is walked, shadow roots included (`_$r$` holds the closed ones core made), and every\n * component of THIS core still in it is retired through core's own teardown (`$td`). Recognized by core's per-copy mark\n * (`$m`), so two copies of core on one page never retire each other's components — in PRODUCTION, where each copy has\n * its own registry. In development two copies share one registry (core keeps `@verajs/inserts` external there), so `$m`\n * is whichever copy loaded last: two cores in development is the known mis-resolution trap, not a supported setup, and\n * the two-copies row runs in production only. A component moved back before the release is no longer there,\n * and survives.\n * - **A connector**, as `@verajs/hot` is: each core it is wired into gets its own watch and release, against its own\n * teardown and mark. It imports nothing.\n */\ntype Registry = { $td?: (element: Element) => void; $m?: symbol };\ntype Wire = (item: never) => void;\n\nexport const multiWindow = (registry: object, w: Wire) => {\n const core = registry as Registry;\n const watched = new WeakSet<object>();\n /** This realm's window: its timers run; a dead window's never fire. */\n const home = globalThis;\n const release = (dead: Document) => {\n const teardown = core.$td, mine = core.$m;\n if (teardown === undefined || mine === undefined) return;\n const walk = (root: ParentNode) => {\n for (const el of root.querySelectorAll('*')) {\n const inner = el.shadowRoot ?? (el as { _$r$?: ShadowRoot })._$r$;\n if (inner) walk(inner);\n if ((el as unknown as Record<symbol, unknown>)[mine] !== undefined && el.ownerDocument === dead) teardown(el);\n }\n };\n walk(dead);\n };\n const watch = (element: Element) => {\n const view = element.ownerDocument.defaultView;\n if (view === null || view === (home as unknown) || watched.has(view)) return;\n watched.add(view);\n view.addEventListener('pagehide', (event) => {\n if ((event as PageTransitionEvent).persisted) return;\n const dead = view.document;\n home.setTimeout(() => release(dead), 0);\n });\n };\n w([\n { name: '@verajs/renderer/multi-window', on: 'adopted', fn: watch, priority: 60 },\n { name: '@verajs/renderer/multi-window', on: 'init', fn: (element: Element) => { watch(element); }, priority: 60 },\n ] as never);\n};\n"],"names":[],"mappings":"MAyBa,WAAW,GAAG,CAAC,QAAgB,EAAE,CAAO,KAAI;IACvD,MAAM,IAAI,GAAG,QAAoB;AACjC,IAAA,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU;;IAErC,MAAM,IA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EAAE,IAAI,EAAE,+BAA+B,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;QACjF,EAAE,IAAI,EAAE,+BAA+B,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAgB,KAAI,EAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC1G,KAAA,CAAC;AACb;;;;"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The renderer's cross-file and public types — one `types.ts` at the import-graph root, per
3
+ * CODE-PRINCIPLES §1.
4
+ *
5
+ * **What is here and what deliberately is not.** Everything in this file is a pure data shape: it
6
+ * names no runtime value, so it can sit upstream of every module in the package and nothing here
7
+ * can pull a class into the import graph. The renderer's remaining cross-file types — `Item`,
8
+ * `ListStrategy`, `KeyedResult` — name the `Instance` and `ChildPart` CLASSES in their definitions,
9
+ * which puts them structurally downstream of `renderer.ts`; they stay beside those classes, and
10
+ * §1's "one file at the import-graph root" records that limit rather than pretending otherwise.
11
+ * Restating a class's shape here to satisfy the letter of the rule would create exactly the twin
12
+ * §1 forbids.
13
+ *
14
+ * Moving `ProfileReport` and `OverlayOptions` here dissolved a real cycle: `profiler.ts` imported
15
+ * `OverlayOptions` from `overlay.ts` while `overlay.ts` imported `ProfileReport` back from
16
+ * `profiler.ts`. Type-only, so it was erased and never a runtime cycle — but it is the shape this
17
+ * file's position in the graph exists to make impossible.
18
+ */
19
+ /**
20
+ * What a template tag (`html`, `svg`, `mathml`) produces — the compiled shape every renderer entry
21
+ * point accepts, and the one type a consumer normally names.
22
+ *
23
+ * `strings` is the template literal's own `strings` array and is the TEMPLATE'S IDENTITY: the
24
+ * engine interns it per call site, so two literals with identical text are two templates and
25
+ * rendering one after the other is a teardown, not an update. Anything building these by hand must
26
+ * hand back the same array to get an update.
27
+ */
28
+ type TemplateResult = {
29
+ /** 1 = html, 2 = svg, 3 = mathml — the markers core's built-in tags produce. */
30
+ _$litType$?: number;
31
+ strings: TemplateStringsArray;
32
+ values: unknown[];
33
+ /** Set by `keyed()`; drives keyed list reconciliation. */
34
+ key?: unknown;
35
+ };
36
+
37
+ /**
38
+ * **`@verajs/renderer/namespaces` — a template is parsed in the namespace of the position it lands in.**
39
+ *
40
+ * `wire([renderer, namespaces])`, and `` html`<path/>` `` committed inside an `<svg>` is built as SVG — as the
41
+ * platform's fragment parser treats markup given a context element — so a component's children cross a function
42
+ * boundary without anyone choosing `svg\`…\`` for them. `@verajs/jsx` wires it for every module it compiles, because
43
+ * JSX cannot write `svg\`…\``. An app that does not wire it pays nothing.
44
+ *
45
+ * It imports nothing: the renderer reaches it through the `'template'` insert, and it answers through the
46
+ * sigil-named `_$at$` (which template to build at a position) and `_$ns$` (a template's own namespace), which
47
+ * mangling leaves alone. **The child namespace is asked of the PARSER**, not written down — integration points
48
+ * (`<foreignObject>`, `<annotation-xml>`, MathML's text elements) answer as the engine answers — with one exception
49
+ * the engines disagree about.
50
+ */
51
+
52
+ declare const namespaces: {
53
+ name: string;
54
+ on: "template";
55
+ priority: number;
56
+ /**
57
+ * Typed as the `'template'` insert declares it — the renderer hands its template as an `object` — so
58
+ * `wire([renderer, namespaces])` type-checks for a consumer; the sigil-named members are this module's view of it.
59
+ */
60
+ fn: (built: object, result: Pick<TemplateResult, "_$litType$" | "strings">, readScope: () => unknown) => void;
61
+ };
62
+
63
+ export { namespaces };
64
+ //# sourceMappingURL=vera-renderer-namespaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vera-renderer-namespaces.d.ts","sources":["../../src/types.ts","../../src/namespaces.ts"],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBG;;;;;;;;;;;;;;;;;;;ACDH;AACA;AACA;AACA;AASA;;;;;;;;;;;AAWA,cAAa,UAAqE;AAClF;AACE;AAAkC;AAClC;;;;AAIG,gCAAA,IAAA,CAAA,cAAA;AACH;;;;","names":[]}
@@ -0,0 +1,94 @@
1
+ /** The three namespaces — fixed by the specifications, so written rather than read off a probe element. */
2
+ const HTML = 'http://www.w3.org/1999/xhtml';
3
+ const SVG = 'http://www.w3.org/2000/svg';
4
+ const MATHML = 'http://www.w3.org/1998/Math/MathML';
5
+ /**
6
+ * **The namespace a `tag` takes as a child of `parent`** (`null` for HTML), asked of the parser: a shallow clone of
7
+ * the parent is handed that child through `innerHTML`, which runs the fragment parser with it as the context. Cached
8
+ * by the parent's KIND — namespace and name — and the tag, because nothing else decides it: one probe per kind of
9
+ * parent for the life of the page, and no DOM node held. Nested objects rather than a joined key: building the key
10
+ * cost more than the lookup, on a path walked once per instance.
11
+ *
12
+ * **The tag decides only under a MathML parent**: `<svg>` in `<annotation-xml>` is SVG where any other child is
13
+ * MathML, and `<mglyph>`/`<malignmark>` stay MathML inside `<mi>`/`<mo>`/`<mn>`/`<ms>`/`<mtext>` where any other child
14
+ * is HTML. Every other parent is asked with a stand-in tag, since its answer is the same for all.
15
+ */
16
+ const answers = {};
17
+ const childOf = (parent, tag) => {
18
+ if (parent.namespaceURI === HTML)
19
+ return null;
20
+ /**
21
+ * The one context the probe cannot answer: the engines DISAGREE about `<annotation-xml>` as a fragment parser's
22
+ * context — Chromium reads its `encoding`, Firefox does not — while all agree in full markup, where the `encoding`
23
+ * on its start tag decides. So the attribute is read, and the answer is not cached (a binding can change it).
24
+ */
25
+ if (parent.localName === 'annotation-xml') {
26
+ const encoding = parent.getAttribute('encoding')?.toLowerCase();
27
+ if (encoding === 'text/html' || encoding === 'application/xhtml+xml')
28
+ return null;
29
+ }
30
+ const byTag = ((answers[parent.namespaceURI] ??= {})[parent.localName] ??= {});
31
+ let answer = byTag[tag];
32
+ if (answer === undefined) {
33
+ const probe = parent.cloneNode(false);
34
+ probe.innerHTML = `<${tag}></${tag}>`;
35
+ const ns = probe.firstChild?.namespaceURI ?? null;
36
+ byTag[tag] = answer = ns === HTML ? null : ns;
37
+ }
38
+ return answer;
39
+ };
40
+ /**
41
+ * **A parent element's answer, cached ON it** under a Symbol — the fast path: every row of a list shares one parent,
42
+ * and once this is wired EVERY `html` instance asks, so the common case must be one property read, not the
43
+ * `namespaceURI`/`localName` reads the kind cache needs. A string stored on the element holds nothing and dies with
44
+ * it (measured alternatives: a `WeakRef` to the last parent cost Firefox 8.7% on plain creation; a strong reference
45
+ * would keep a removed subtree alive). Invisible to `Object.keys` and `for…in`. Not used under a MathML parent, whose
46
+ * answer depends on the tag.
47
+ */
48
+ const ANSWER = Symbol();
49
+ const namespaces = {
50
+ name: '@verajs/renderer/namespaces',
51
+ on: 'template',
52
+ priority: 50,
53
+ /**
54
+ * Typed as the `'template'` insert declares it — the renderer hands its template as an `object` — so
55
+ * `wire([renderer, namespaces])` type-checks for a consumer; the sigil-named members are this module's view of it.
56
+ */
57
+ fn: (built, result, readScope) => {
58
+ const template = built;
59
+ const type = result._$litType$ ?? 1;
60
+ /** An `svg\`…\``/`mathml\`…\`` template — or a variant this module built — is in its namespace already. */
61
+ if (type !== 1) {
62
+ template._$ns$ = type === 2 ? SVG : MATHML;
63
+ return;
64
+ }
65
+ /**
66
+ * The template's first ELEMENT's tag — past leading text, comments and expressions (`<!--c--><svg>`, `label <svg>`,
67
+ * `${x}<svg>`), `x` when it has none — which is what a MathML parent's answer depends on.
68
+ */
69
+ const tag = /<([a-zA-Z][^\s/>]*)/.exec(result.strings.join('').replace(/<!--(?:-?>|[\s\S]*?--!?>)/g, ''))?.[1] ?? 'x';
70
+ /** Its SVG and MathML builds, made the first time one is needed — the renderer's own constructor, so every
71
+ * construction-time decision (every refusal) is made again there, never copied. */
72
+ let svg;
73
+ let mathml;
74
+ const pick = (ns) => ns === null
75
+ ? template
76
+ : ns === SVG
77
+ ? (svg ??= new template.constructor({ _$litType$: 2, strings: result.strings }))
78
+ : (mathml ??= new template.constructor({ _$litType$: 3, strings: result.strings }));
79
+ template._$at$ = (parent) => {
80
+ const cached = parent[ANSWER];
81
+ if (cached !== undefined)
82
+ return pick(cached);
83
+ /** Still inside an instance's detached clone: the template being built answers, with its own namespace. */
84
+ if (parent.nodeType !== 1)
85
+ return pick(readScope()?._$ns$ ?? null);
86
+ if (parent.namespaceURI === MATHML)
87
+ return pick(childOf(parent, tag));
88
+ return pick((parent[ANSWER] = childOf(parent, 'x')));
89
+ };
90
+ },
91
+ };
92
+
93
+ export { namespaces };
94
+ //# sourceMappingURL=vera-renderer-namespaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vera-renderer-namespaces.js","sources":["../../src/namespaces.ts"],"sourcesContent":["/**\n * **`@verajs/renderer/namespaces` — a template is parsed in the namespace of the position it lands in.**\n *\n * `wire([renderer, namespaces])`, and `` html`<path/>` `` committed inside an `<svg>` is built as SVG — as the\n * platform's fragment parser treats markup given a context element — so a component's children cross a function\n * boundary without anyone choosing `svg\\`…\\`` for them. `@verajs/jsx` wires it for every module it compiles, because\n * JSX cannot write `svg\\`…\\``. An app that does not wire it pays nothing.\n *\n * It imports nothing: the renderer reaches it through the `'template'` insert, and it answers through the\n * sigil-named `_$at$` (which template to build at a position) and `_$ns$` (a template's own namespace), which\n * mangling leaves alone. **The child namespace is asked of the PARSER**, not written down — integration points\n * (`<foreignObject>`, `<annotation-xml>`, MathML's text elements) answer as the engine answers — with one exception\n * the engines disagree about.\n */\nimport type { TemplateResult } from './types.js';\n\n/** The three namespaces — fixed by the specifications, so written rather than read off a probe element. */\nconst HTML = 'http://www.w3.org/1999/xhtml';\nconst SVG = 'http://www.w3.org/2000/svg';\nconst MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n/** The renderer's template, as this module sees it: two sigil-named members and a way to build a variant. */\ntype Template = {\n _$at$?: (parent: Node) => Template;\n _$ns$?: string | null;\n constructor: new (result: { _$litType$: number; strings: TemplateStringsArray }) => Template;\n};\n\n/**\n * **The namespace a `tag` takes as a child of `parent`** (`null` for HTML), asked of the parser: a shallow clone of\n * the parent is handed that child through `innerHTML`, which runs the fragment parser with it as the context. Cached\n * by the parent's KIND — namespace and name — and the tag, because nothing else decides it: one probe per kind of\n * parent for the life of the page, and no DOM node held. Nested objects rather than a joined key: building the key\n * cost more than the lookup, on a path walked once per instance.\n *\n * **The tag decides only under a MathML parent**: `<svg>` in `<annotation-xml>` is SVG where any other child is\n * MathML, and `<mglyph>`/`<malignmark>` stay MathML inside `<mi>`/`<mo>`/`<mn>`/`<ms>`/`<mtext>` where any other child\n * is HTML. Every other parent is asked with a stand-in tag, since its answer is the same for all.\n */\nconst answers: Record<string, Record<string, Record<string, string | null>>> = {};\nconst childOf = (parent: Element, tag: string): string | null => {\n if (parent.namespaceURI === HTML) return null;\n /**\n * The one context the probe cannot answer: the engines DISAGREE about `<annotation-xml>` as a fragment parser's\n * context — Chromium reads its `encoding`, Firefox does not — while all agree in full markup, where the `encoding`\n * on its start tag decides. So the attribute is read, and the answer is not cached (a binding can change it).\n */\n if (parent.localName === 'annotation-xml') {\n const encoding = parent.getAttribute('encoding')?.toLowerCase();\n if (encoding === 'text/html' || encoding === 'application/xhtml+xml') return null;\n }\n const byTag = ((answers[parent.namespaceURI!] ??= {})[parent.localName] ??= {});\n let answer = byTag[tag];\n if (answer === undefined) {\n const probe = parent.cloneNode(false) as Element;\n probe.innerHTML = `<${tag}></${tag}>`;\n const ns = (probe.firstChild as Element | null)?.namespaceURI ?? null;\n byTag[tag] = answer = ns === HTML ? null : ns;\n }\n return answer;\n};\n\n/**\n * **A parent element's answer, cached ON it** under a Symbol — the fast path: every row of a list shares one parent,\n * and once this is wired EVERY `html` instance asks, so the common case must be one property read, not the\n * `namespaceURI`/`localName` reads the kind cache needs. A string stored on the element holds nothing and dies with\n * it (measured alternatives: a `WeakRef` to the last parent cost Firefox 8.7% on plain creation; a strong reference\n * would keep a removed subtree alive). Invisible to `Object.keys` and `for…in`. Not used under a MathML parent, whose\n * answer depends on the tag.\n */\nconst ANSWER = Symbol();\ntype Cached = Element & { [ANSWER]?: string | null };\n\nexport const namespaces = {\n name: '@verajs/renderer/namespaces',\n on: 'template' as const,\n priority: 50,\n /**\n * Typed as the `'template'` insert declares it — the renderer hands its template as an `object` — so\n * `wire([renderer, namespaces])` type-checks for a consumer; the sigil-named members are this module's view of it.\n */\n fn: (built: object, result: Pick<TemplateResult, '_$litType$' | 'strings'>, readScope: () => unknown): void => {\n const template = built as Template;\n const type = result._$litType$ ?? 1;\n /** An `svg\\`…\\``/`mathml\\`…\\`` template — or a variant this module built — is in its namespace already. */\n if (type !== 1) {\n template._$ns$ = type === 2 ? SVG : MATHML;\n return;\n }\n /**\n * The template's first ELEMENT's tag — past leading text, comments and expressions (`<!--c--><svg>`, `label <svg>`,\n * `${x}<svg>`), `x` when it has none — which is what a MathML parent's answer depends on.\n */\n const tag = /<([a-zA-Z][^\\s/>]*)/.exec(result.strings.join('').replace(/<!--(?:-?>|[\\s\\S]*?--!?>)/g, ''))?.[1] ?? 'x';\n /** Its SVG and MathML builds, made the first time one is needed — the renderer's own constructor, so every\n * construction-time decision (every refusal) is made again there, never copied. */\n let svg: Template | undefined;\n let mathml: Template | undefined;\n const pick = (ns: string | null): Template =>\n ns === null\n ? template\n : ns === SVG\n ? (svg ??= new template.constructor({ _$litType$: 2, strings: result.strings }))\n : (mathml ??= new template.constructor({ _$litType$: 3, strings: result.strings }));\n template._$at$ = (parent) => {\n const cached = (parent as Cached)[ANSWER];\n if (cached !== undefined) return pick(cached);\n /** Still inside an instance's detached clone: the template being built answers, with its own namespace. */\n if (parent.nodeType !== 1) return pick((readScope() as Template | null)?._$ns$ ?? null);\n if ((parent as Element).namespaceURI === MATHML) return pick(childOf(parent as Element, tag));\n return pick(((parent as Cached)[ANSWER] = childOf(parent as Element, 'x')));\n };\n },\n};\n"],"names":[],"mappings":"AAgBA;AACA,MAAM,IAAI,GAAG,8BAA8B;AAC3C,MAAM,GAAG,GAAG,4BAA4B;AACxC,MAAM,MAAM,GAAG,oCAAoC;AASnD;;;;;;;;;;AAUG;AACH,MAAM,OAAO,GAAkE,EAAE;AACjF,MAAM,OAAO,GAAG,CAAC,MAA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CAAC,GAAG,OAAO,CAAC,MAAiB,EAAE,GAAG,CAAC,EAAE;AAC7E,QAAA,CAAC;IACH,CAAC;;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Wire it: `wire([renderer, nativeElements])`. A CONNECTOR (`wire` hands it the registry): core's setup (`$in`) and
3
+ * teardown (`$td`) come off it, and `$ne` tells core's development check this module is wired.
4
+ */
5
+ /** The registry and `wire` as a connector is handed them — typed as slots' are, so a strict consumer's `wire([…])` takes it. */
6
+ type Registry = {
7
+ get(name: never): unknown;
8
+ };
9
+ type Wire = (item: never) => void;
10
+ declare const nativeElements: (registry: Registry, w: Wire) => void;
11
+
12
+ export { nativeElements };
13
+ //# sourceMappingURL=vera-renderer-native-elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vera-renderer-native-elements.d.ts","sources":["../../src/native-elements.ts"],"mappings":"AAAA;;;;;;;;;;;;;","names":[]}