marko 6.3.47 → 6.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/cheatsheet.md +19 -16
  2. package/dist/common/accessor.d.ts +0 -3
  3. package/dist/common/accessor.debug.d.ts +0 -3
  4. package/dist/common/constants/resume-symbol.d.ts +1 -0
  5. package/dist/debug/dom/catch.feat.js +1 -1
  6. package/dist/debug/dom/catch.feat.mjs +1 -1
  7. package/dist/debug/dom/controllable-input.feat.js +1 -1
  8. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  9. package/dist/debug/dom/controllable-open.feat.js +1 -1
  10. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  11. package/dist/debug/dom/controllable-select.feat.js +1 -1
  12. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  14. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  15. package/dist/debug/dom/controllable.feat.js +1 -1
  16. package/dist/debug/dom/controllable.feat.mjs +1 -1
  17. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  19. package/dist/debug/dom/placeholder.feat.js +1 -1
  20. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  21. package/dist/debug/{dom-BheMBjYT.js → dom-BAGeiafn.js} +31 -17
  22. package/dist/debug/{dom-DyBeisho.mjs → dom-C55iHvof.mjs} +26 -18
  23. package/dist/debug/dom.js +20 -24
  24. package/dist/debug/dom.mjs +20 -24
  25. package/dist/debug/html.js +76 -37
  26. package/dist/debug/html.mjs +76 -37
  27. package/dist/dom/catch.feat.js +1 -1
  28. package/dist/dom/catch.feat.mjs +1 -1
  29. package/dist/dom/controllable-input.feat.js +1 -1
  30. package/dist/dom/controllable-input.feat.mjs +1 -1
  31. package/dist/dom/controllable-open.feat.js +1 -1
  32. package/dist/dom/controllable-open.feat.mjs +1 -1
  33. package/dist/dom/controllable-select.feat.js +1 -1
  34. package/dist/dom/controllable-select.feat.mjs +1 -1
  35. package/dist/dom/controllable-textarea.feat.js +1 -1
  36. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  37. package/dist/dom/controllable.feat.js +1 -1
  38. package/dist/dom/controllable.feat.mjs +1 -1
  39. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  40. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  41. package/dist/dom/placeholder.feat.js +1 -1
  42. package/dist/dom/placeholder.feat.mjs +1 -1
  43. package/dist/{dom-DprILxYO.js → dom-BNmfm4st.js} +31 -26
  44. package/dist/{dom-BbknkVDz.mjs → dom-BsAS26Ze.mjs} +16 -16
  45. package/dist/dom.js +20 -20
  46. package/dist/dom.mjs +14 -14
  47. package/dist/html/inlined-runtimes.d.ts +2 -2
  48. package/dist/html/inlined-runtimes.debug.d.ts +2 -2
  49. package/dist/html/writer.d.ts +3 -1
  50. package/dist/html.js +46 -36
  51. package/dist/html.mjs +46 -36
  52. package/dist/translator/index.js +108 -82
  53. package/dist/translator/util/get-compile-stage.d.ts +2 -0
  54. package/dist/translator/util/references.d.ts +4 -2
  55. package/dist/translator/util/sections.d.ts +4 -1
  56. package/dist/translator/util/serialize-reasons.d.ts +3 -2
  57. package/package.json +4 -4
  58. package/dist/common/constants/load-signal-value.d.ts +0 -5
  59. package/dist/common/constants/load-signal-value.debug.d.ts +0 -5
package/cheatsheet.md CHANGED
@@ -4,20 +4,20 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
4
4
 
5
5
  ## Golden rules
6
6
 
7
- 1. Text interpolation: `${expr}` inside tag bodies. A bare line at the template root parses as a tag (concise mode): `Welcome aboard` fails to compile, but `p is a tag` compiles **silently** to `<p is a tag></p>`, since any line starting with a real tag name loses its words to attributes. Wrap text in an element (`<p>Welcome aboard</p>`) or prefix the line with `--` and a space (`-- Welcome ${name}`). Attributes take raw JS after `=` with no braces or quotes: `<div title=user.name data-n=1 + 1>`.
8
- 2. A top-level `>` hugging its operand in an attribute value **ends the tag** silently: `<button disabled=count>=8 onClick() {…}>More</button>` is `disabled=count` plus the text `=8 onClick() {…}>`, so the handler never binds. Space a `>=` (`disabled=count >= 8`), and parenthesize a bare `>` comparison (`hidden=(a > b)`) and a TS type argument `<let/s=(new Set<string>())>`. Do not move the type onto the tag variable instead: `<let/s:Set<string>=new Set()>` compiles but fails type-check with TS2322 (the annotation does not flow into the initializer). A `>` nested inside `(…)`/`{…}`/`[…]` is safe (`class={ big: n > 1 }`). `<` never closes a tag (`disabled=count<=1` is fine).
7
+ 1. Text interpolation: `${expr}` inside tag bodies. A bare line at the template root parses as a tag (concise mode): `Welcome aboard` fails to compile, but `p is a tag` compiles silently to `<p is a tag></p>`, since any line starting with a real tag name loses its words to attributes. Wrap text in an element (`<p>Welcome aboard</p>`) or prefix the line with `--` and a space (`-- Welcome ${name}`). Attributes take raw JS after `=` with no braces or quotes: `<div title=user.name data-n=1 + 1>`.
8
+ 2. A top-level `>` hugging its operand in an attribute value ends the tag silently: `<button disabled=count>=8 onClick() {…}>More</button>` is `disabled=count` plus the text `=8 onClick() {…}>`, so the handler never binds. Space a `>=` (`disabled=count >= 8`); parenthesize a bare `>` comparison (`hidden=(a > b)`) and a TS type argument (`<let/s=(new Set<string>())>`, else it parses as `new Set() < string`). Do not move the type onto the tag variable instead: `<let/s:Set<string>=new Set()>` compiles but fails type-check with TS2322 (the annotation does not flow into the initializer). A `>` nested inside `(…)`/`{…}`/`[…]` is safe (`class={ big: n > 1 }`). `<` never closes a tag (`disabled=count<=1` is fine).
9
9
  3. State: `<let/name=initial>` (slash then var name!). Update by plain assignment in an event handler: `count++`, `text = "hi"`. No setState, no hooks.
10
- 4. Derived values: `<const/total=items.length * price>` auto-recomputes. Never use an effect to derive state. A tag variable is whatever the tag returns, not the attribute you passed. `<let/draft=input.text>` re-runs on every `input.text` change but returns state it controls, so `draft` keeps your edits; only a controllable `<let>` (`valueChange=`, or `<let/draft:=input.text>`) takes the new value. Pick by intent: recomputes → `<const>`, seeds then diverges → `<let>`. A `<let>` you never assign is just a frozen `<const>`. Updates batch: mid-handler a reassigned `<let>` reads current but its derived `<const>` reads stale, so recompute from the `<let>`.
10
+ 4. Derived values: `<const/total=items.length * price>` auto-recomputes. Never use an effect to derive state. A tag variable is whatever the tag returns, not the attribute passed to it. `<let/draft=input.text>` re-runs on every `input.text` change but returns state it controls, so `draft` keeps its edits; only a controllable `<let>` (`valueChange=`, or `<let/draft:=input.text>`) takes the new value. Pick by intent: recomputes → `<const>`, seeds then diverges → `<let>`. A `<let>` that is never assigned is just a frozen `<const>`. Updates batch: mid-handler a reassigned `<let>` reads current but its derived `<const>` reads stale, so recompute from the `<let>`.
11
11
  5. Never mutate state in place: `items.push(x)` does not update the UI. Always reassign:
12
12
  - add: `items = items.concat(x)`
13
13
  - remove: `items = items.toSpliced(i, 1)`
14
14
  - update: `items = items.toSpliced(i, 1, { ...item, done: true })`
15
15
  - object: `user = { ...user, name }`
16
16
  6. Events: method shorthand `onClick() { ... }` or `onClick=fn`. Handlers receive `(event, element)`; delegation means the element is the second parameter, not `event.currentTarget`: `onSubmit(e) { e.preventDefault(); save() }`, `onClick(e, el) { el.focus() }`. Don't sync input values through `onInput`/`onChange`; that's what the change handlers below are for. Prefix with `async` to `await` in the body: `async onClick() { await save() }`.
17
- 7. Native inputs are uncontrolled by default: `value=` sets the default value later writes update what `form.reset()` restores, never a dirty field's display. Adding the matching `*Change` handler is what makes them controlled: `valueChange` on `<input>`/`<textarea>`/`<select>`, `checkedChange` on checkboxes/radios, `openChange` on `<details>`/`<dialog>`. `value:=text` is the shorthand for `value=text valueChange(v) { text = v }`. (`<textarea value:=text/>`: value attribute, not body.) `:=` differs by operand: on an identifier (`value:=text`) it assigns that variable; on a member expression (`<let/count:=input.count>` in a child) it wires `input.countChange`, so the child is controlled when the parent passes that handler and keeps its own state when it doesn't.
17
+ 7. Native inputs are uncontrolled by default: `value=` sets the default value. Later writes update what `form.reset()` restores, never a dirty field's display. Adding the matching `*Change` handler is what makes them controlled: `valueChange` on `<input>`/`<textarea>`/`<select>`, `checkedChange` on checkboxes/radios, `openChange` on `<details>`/`<dialog>`. `value:=text` is the shorthand for `value=text valueChange(v) { text = v }`. (`<textarea value:=text/>`: value attribute, not body.) `:=` differs by operand: on an identifier (`value:=text`) it assigns that variable; on a member expression (`<let/count:=input.count>` in a child) it wires `input.countChange`, so the child is controlled when the parent passes that handler and keeps its own state when it doesn't.
18
18
  8. Transform in the handler when needed; number inputs give strings: `<input type="number" value=n valueChange(v) { n = +v }>`, or `value:parseFloat:=n`. Uncommitted edits (debounce, commit on blur) never sync through a `<script>`; that is rule 4's derive-by-effect trap. Pair a controllable `<let/value:=input.value>` with `<let/pending=null>`, show `<const/draft=pending ?? value>`, collect with `valueChange(v) { pending = v }`, and commit by assigning `value = pending; pending = null`. Prefer that to calling `input.valueChange(...)`, which throws unless every caller controls the tag.
19
19
  9. Radio/checkbox groups: `checkedValue:=picked` on each input (shared var, distinct `value=`); the match is checked; array var for multi-checkbox. Dropdown: `<select value:=picked>`.
20
- 10. Module-level values, helpers and type aliases need `static`: `static const LIMIT = 10`, `static function fmt(n) {…}`, `static type Row = {…}`. Without it `function fmt(n) {` parses as a tag: ``Unable to find entry point for custom tag `<function>` ``, an error that points at `static`. Prefer it to `<const>` for anything that never changes: `<const/LIMIT=10>` emits a per-instance signal plus a `$setup` call. `server`/`client` narrow `static` to one platform (`client import { Chart } from "chart"`); the binding is `undefined` on the other, so read a `client` one only from `<script>`/handlers/`<lifecycle>` reading it while rendering throws `is not a function` during SSR.
20
+ 10. Module-level values, helpers and type aliases need `static`: `static const LIMIT = 10`, `static function fmt(n) {…}`, `static type Row = {…}`. Prefer it to `<const>` for anything that never changes: `<const/LIMIT=10>` runs per instance, `static` hoists it to a module constant. `server`/`client` narrow `static` to one platform (`client import { Chart } from "chart"`); the binding is `undefined` on the other, so read a `client` one only from `<script>`/handlers/`<lifecycle>`. Reading it while rendering throws `is not a function` during SSR.
21
21
 
22
22
  ## Canonical component
23
23
 
@@ -58,13 +58,14 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
58
58
  ## Control flow
59
59
 
60
60
  ```marko
61
- <if=(count > 10)> A </if> // parenthesize comparisons; a bare `>` ends the tag (rule 2)
61
+ <if=(count > 10)> A </if> // parenthesize comparisons; a hugging `>` ends the tag (rule 2)
62
62
  <else if=other> B </else>
63
63
  <else> C </else>
64
64
 
65
65
  <for|item, index| of=list by="id"> ${item.name} </for> // by keys the loop (no key= attr!)
66
- <for|city| of=cities by=(city) => city> ${city} </for> // primitives: by takes a function; the loop param is not in scope in by=, so by=city is an undefined variable
67
- <for|i| from=0 until=5> ${i} </for> // 0..4
66
+ <for|city| of=cities by=(city) => city> ${city} </for> // primitives: by takes a function, evaluated before the loop
67
+ <for|i| from=0 until=5> ${i} </for> // 0..4 (to= is inclusive, step= optional)
68
+ <for|key, value| in=obj> ${key}=${value} </for> // object entries
68
69
 
69
70
  <show=open> stays mounted, keeps state (form drafts) when hidden </show>
70
71
  ```
@@ -125,17 +126,20 @@ Don't fetch while rendering: start data loads early, pass the promise through th
125
126
  </div>
126
127
  ```
127
128
 
128
- - Repeated attr tags (many `<@tab ...>`) arrive as the singular prop `input.tab`, which is iterable but not an array: `input.tab[i]` and `input.tab.length` are undefined. To index or count, spread first: `<const/tabs=[...input.tab ?? []]>` then `tabs[active]`/`tabs.length`. Looping directly is fine: `<for|tab| of=input.tab>`.
129
+ - Repeated attr tags (many `<@tab ...>`) arrive as the singular prop `input.tab`: the first tab's attrs, made iterable, not an array: `input.tab[i]` and `input.tab.length` are undefined. To index or count, spread first: `<const/tabs=[...input.tab ?? []]>` then `tabs[active]`/`tabs.length`. Looping directly is fine: `<for|tab| of=input.tab>`.
130
+ - Text: `0` renders; `false`/`null`/`undefined`/`""`/`NaN` render nothing. `$!{html}` inserts raw HTML.
129
131
  - Conditional attrs: `false`/`null` attrs are omitted from HTML. `aria-selected` etc. want strings: `aria-selected=(i === active && "true")`.
130
- - `class=` / `style=` accept strings, objects, arrays: `class=["btn", { active }]`, `style={ color }` (single braces). `style=` keys are kebab-case CSS names (`{ "background-color": c }`), not camelCase.
132
+ - `class=` / `style=` accept strings, objects, arrays: `class=["btn", { active }]`, `style={ color }` (single braces). `style=` keys are kebab-case CSS names (`{ "background-color": c }`); camelCase keys are written verbatim. `...input` spreads attrs onto a tag; `content=` passes body content as an attr.
133
+ - `<define/Panel|input|>` declares a local tag inline; `<${Toolbar.Undo}/>` renders a dynamic tag (falsy name → content only).
134
+ - `<select value:=picked>`: every `<option>` needs `value=`; `multiple` binds an array.
131
135
  - `<id/x>` mints a collision-free id for label/input wiring (`<label for=x>`/`<input id=x>`); don't hardcode ids in reusable tags; `<id/x=input.id>` reuses a caller's.
132
136
  - Head tags render where written: a `<title>`/`<meta>`/`<link>` inside a nested component stays in the body, giving a second title or an inert canonical. `<head>` is already written by the time descendants render, so page meta has to be known before it: under @marko/run declare it in the route's `+meta.*` file and read `$global.meta` from the layout that owns `<head>`, otherwise pass it down or set it on `$global` at the render call.
133
137
 
134
138
  ## Sharing data (`$global`)
135
139
 
136
- - Read request-scoped `$global` from any template, no threading: `${$global.messages.title}`. Otherwise prop-drill through `input`; there is no provider/consumer context API.
140
+ - Read request-scoped `$global` from any template, no threading: `${$global.messages.title}`. Otherwise pass data down through `input`.
137
141
  - Populate at the render call: `template.render({ $global: { messages } })`. Under @marko/run a middleware's `return next({ messages })` merges into `$global.data`.
138
- - `$global` is not serialized to the client by default. Mark any key the browser itself evaluates, e.g. an event handler, a `<script>`, markup the browser (re)creates, or a `<const>` that recomputes from state: `$global.serializedGlobals = { messages: true }` at the render call (under @marko/run, `context.serializedGlobals.data = true`; it ships `params`/`url` already). What the server already rendered needs no opt-in.
142
+ - `$global` is not serialized to the client by default. Mark any key the browser itself evaluates, e.g. an event handler, a `<script>`, markup the browser (re)creates, or a `<const>` that recomputes from state: `$global.serializedGlobals = { messages: true }` at the render call (under @marko/run, `context.serializedGlobals.data = true`; it ships `params`/`url` already). What the server already rendered needs no opt-in; a debug build logs an unserialized key read in the browser.
139
143
 
140
144
  ## Client-side effects
141
145
 
@@ -166,7 +170,7 @@ Imperative libs (charts, maps) needing mount/update/destroy: use `<lifecycle>`,
166
170
 
167
171
  ## Lazy loading
168
172
 
169
- Defer a tag's JS into its own bundle until a trigger fires: `render`, `visible#sel`, `idle`, `media(...)`, `on-click#sel` (combine with `|`). Server HTML renders immediately; `<try>` shows a `@placeholder` while loading. Don't hand-roll an `IntersectionObserver`.
173
+ Defer a tag's JS into its own bundle until a trigger fires: `visible#sel`, `idle`, `media(...)`, `on-click#sel` (combine with `|`), or `render` alone. Server HTML renders immediately; in the browser `<try>` shows a `@placeholder` while loading. Don't hand-roll an `IntersectionObserver`.
170
174
 
171
175
  ```marko
172
176
  import PriceChart from "<price-chart>" with { load: "visible#chart" }
@@ -196,7 +200,7 @@ Each left-hand habit is an error or silently wrong.
196
200
  | Wrong (React/Vue/Marko5 habit) | Right |
197
201
  | ----------------------------------------------------------- | ------------------------------------------------------------------------------------ |
198
202
  | `disabled=n>=8` (hugging `>` in a value) | `disabled=n >= 8` or `disabled=(n >= 8)`; a hugging `>` silently closes the tag |
199
- | `<let/s=new Set<string>()>` (type argument in a value) | `<let/s=(new Set<string>())>`; a tag-var annotation fails type-check |
203
+ | `<let/s=new Set<string>()>` (type argument in a value) | `<let/s=(new Set<string>())>`; else it parses as `new Set() < string` |
200
204
  | `{expr}` in markup, `className`, `key=`, `style={{...}}` | `${expr}`, `class`, `by=` on `<for>`, `style={...}` |
201
205
  | `onClick={() => ...}` / `@click` / `on-click("name")` | `onClick() { ... }` |
202
206
  | `const [x, setX] = useState()` / `state` / `class {}` block | `<let/x=0>` then `x = 1` |
@@ -213,18 +217,17 @@ Each left-hand habit is an error or silently wrong.
213
217
  | `el.focus()` on a ref | `el().focus()` inside `<script>`/handler |
214
218
  | `input.tab[0]` / `input.tab.length` | `[...input.tab ?? []]` first (attr tags are iterables, not arrays) |
215
219
  | bare text on its own line at template root | wrap in an element (`<p>...`), or prefix the line with `--` and a space |
216
- | `by=item` using the loop variable | `by="propName"` or `by=(item) => key`; `by=` is evaluated outside the loop |
217
220
  | `onInput(e) { q = e.target.value }` to sync an input | `value:=q`; the change handler owns the value |
218
221
  | `<script>` syncing a draft field back from `value` | `<const/draft=pending ?? value>`; a `<let>` holds only the uncommitted edit |
219
222
  | fetching inside the component that renders the data | start the promise early (route handler / top of template), pass it down to `<await>` |
220
223
  | `style={ backgroundColor: c }` (camelCase keys) | `style={ "background-color": c }` (kebab-case) |
221
224
  | `this.querySelector` / `this.getRootNode()` in `<script>` | element ref getter: `<div/el>` then `el()` (there is no `this`) |
222
- | `<div/my-el>` / `<input/card-input>` (hyphen in tag var) | valid JS identifier: `<div/myEl>` (the error won't name the hyphen) |
223
225
  | hand-rolled radios `checked=x checkedChange(v){…}` | `checkedValue:=picked` on each radio (shared var, distinct `value=`) |
224
226
  | hand-rolled `IntersectionObserver` to defer a widget's JS | `import W from "<w>" with { load: "visible#sel" }` |
225
227
  | imperative lib wired through `<script>` mount + cleanup | `<lifecycle onMount/onUpdate/onDestroy>` (keeps `this` across all three) |
226
228
  | `createContext`/provider to share data | `input` (prop drilling) or request-scoped `$global` |
227
229
  | `<title>`/`<meta>` in a nested component | put page meta in the layout that owns `<head>`; head tags never hoist |
230
+ | `<option selected=...>` in a controlled `<select>` | `value=` on every option and `value:=picked` on the select |
228
231
  | `$global.x` in client-reactive code, not allow-listed | `$global.serializedGlobals = { x: true }` first; otherwise the read is `undefined` |
229
232
  | hand-namespaced global classes (`.my-card-title`) | `<style/styles>` + `class=styles.card` (scoped CSS modules) |
230
233
  | `tsc --noEmit` to type check templates | `mtc`; `tsc` skips `.marko` files and exits 0 |
@@ -2,7 +2,6 @@ import * as AccessorPrefix from "./constants/accessor-prefix";
2
2
  import * as AccessorProp from "./constants/accessor-prop";
3
3
  import * as ClosureSignalProp from "./constants/closure-signal-prop";
4
4
  import * as KeyedScopesProp from "./constants/keyed-scopes-prop";
5
- import * as LoadSignalValue from "./constants/load-signal-value";
6
5
  import * as PendingRenderProp from "./constants/pending-render-prop";
7
6
  import * as RendererProp from "./constants/renderer-prop";
8
7
  type AccessorPrefix = AccessorPrefix.Value;
@@ -17,5 +16,3 @@ type ClosureSignalProp = ClosureSignalProp.Value;
17
16
  export { ClosureSignalProp };
18
17
  type KeyedScopesProp = KeyedScopesProp.Value;
19
18
  export { KeyedScopesProp };
20
- type LoadSignalValue = LoadSignalValue.Value;
21
- export { LoadSignalValue };
@@ -2,7 +2,6 @@ import * as AccessorPrefix from "./constants/accessor-prefix.debug";
2
2
  import * as AccessorProp from "./constants/accessor-prop.debug";
3
3
  import * as ClosureSignalProp from "./constants/closure-signal-prop.debug";
4
4
  import * as KeyedScopesProp from "./constants/keyed-scopes-prop.debug";
5
- import * as LoadSignalValue from "./constants/load-signal-value.debug";
6
5
  import * as PendingRenderProp from "./constants/pending-render-prop.debug";
7
6
  import * as RendererProp from "./constants/renderer-prop.debug";
8
7
  type AccessorPrefix = AccessorPrefix.Value;
@@ -17,5 +16,3 @@ type ClosureSignalProp = ClosureSignalProp.Value;
17
16
  export { ClosureSignalProp };
18
17
  type KeyedScopesProp = KeyedScopesProp.Value;
19
18
  export { KeyedScopesProp };
20
- type LoadSignalValue = LoadSignalValue.Value;
21
- export { LoadSignalValue };
@@ -8,6 +8,7 @@ export declare const BranchEndNativeTag = "(";
8
8
  export declare const BranchEndSingleNode = "|";
9
9
  export declare const BranchEndOnlyChildInParent = ")";
10
10
  export declare const BranchEndSingleNodeOnlyChildInParent = "}";
11
+ export declare const ReorderStart = "*";
11
12
  type Self = typeof import("./resume-symbol");
12
13
  export type Value = Self[keyof Self];
13
14
  export {};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/catch.feat.ts
4
4
  const handlePendingTry = (fn, scope, branch) => {
5
5
  while (branch) {
@@ -1,4 +1,4 @@
1
- import { An as PendingEffects, Sn as Scope, g as renderCatch, jn as PendingRenders, kn as ParentBranch, nn as installCatch, rn as placeholderShown, tn as caughtError, wn as ClosestBranch, xn as Pending } from "../dom-DyBeisho.mjs";
1
+ import { An as ParentBranch, Cn as Scope, Mn as PendingRenders, Sn as Pending, Tn as ClosestBranch, g as renderCatch, jn as PendingEffects, nn as installCatch, rn as placeholderShown, tn as caughtError } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/catch.feat.ts
3
3
  const handlePendingTry = (fn, scope, branch) => {
4
4
  while (branch) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/controllable-input.feat.ts
4
4
  require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
5
5
  require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
@@ -1,4 +1,4 @@
1
- import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
1
+ import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/controllable-input.feat.ts
3
3
  controllableScripts[0] = _attr_input_checked_script;
4
4
  controllableScripts[1] = _attr_input_checkedValue_script;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/controllable-open.feat.ts
4
4
  require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
1
+ import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/controllable-open.feat.ts
3
3
  controllableScripts[4] = _attr_details_or_dialog_open_script;
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/controllable-select.feat.ts
4
4
  require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { N as _attr_select_value_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
1
+ import { N as _attr_select_value_script, z as controllableScripts } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/controllable-textarea.feat.ts
4
4
  require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { A as _attr_input_value_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
1
+ import { A as _attr_input_value_script, z as controllableScripts } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  require("./controllable-input.feat.js");
4
4
  require("./controllable-open.feat.js");
5
5
  require("./controllable-select.feat.js");
@@ -1,4 +1,4 @@
1
- import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-DyBeisho.mjs";
1
+ import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-C55iHvof.mjs";
2
2
  import "./controllable-input.feat.mjs";
3
3
  import "./controllable-open.feat.mjs";
4
4
  import "./controllable-select.feat.mjs";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/dynamic-tag-var.feat.ts
4
4
  const elementGetter = (branch) => () => require_control_flow._el_read(branch[require_control_flow.StartNode]);
5
5
  require_control_flow.installDynamicTagVar((branch) => branch[require_control_flow.TagVariable](elementGetter(branch)));
@@ -1,4 +1,4 @@
1
- import { Nn as StartNode, Pn as TagVariable, Zt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, kt as _el_read, m as installDynamicTagVar } from "../dom-DyBeisho.mjs";
1
+ import { Fn as TagVariable, Pn as StartNode, Zt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, kt as _el_read, m as installDynamicTagVar } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/dynamic-tag-var.feat.ts
3
3
  const elementGetter = (branch) => () => _el_read(branch[StartNode]);
4
4
  installDynamicTagVar((branch) => branch[TagVariable](elementGetter(branch)));
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BheMBjYT.js");
2
+ const require_control_flow = require("../dom-BAGeiafn.js");
3
3
  //#region src/dom/placeholder.feat.ts
4
4
  require_control_flow.registeredValues[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
5
5
  if (tryBranch["#PlaceholderBranch"]) {
@@ -1,4 +1,4 @@
1
- import { Ct as registeredValues, Kt as destroyBranch, Mn as PlaceholderBranch, Qt as PLACEHOLDER_DISMISS_REGISTER_ID } from "../dom-DyBeisho.mjs";
1
+ import { Ct as registeredValues, Kt as destroyBranch, Nn as PlaceholderBranch, Qt as PLACEHOLDER_DISMISS_REGISTER_ID } from "../dom-C55iHvof.mjs";
2
2
  //#region src/dom/placeholder.feat.ts
3
3
  registeredValues[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
4
4
  if (tryBranch["#PlaceholderBranch"]) {
@@ -909,13 +909,14 @@ function init(runtimeId = "M") {
909
909
  const render = curRenders[renderId] = renders[renderId] || renders(renderId);
910
910
  const walk = render.w;
911
911
  const scopeLookup = {};
912
+ const pending = [];
912
913
  const getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { ["#Id"]: +id }) : initGlobal());
913
914
  const initGlobal = () => scopeLookup[0] ||= {
914
915
  runtimeId,
915
916
  renderId
916
917
  };
917
918
  const initScope = (scope) => {
918
- scope[Gen$1] = 1;
919
+ scope[Gen$1] ??= 1;
919
920
  scope[Global] = initGlobal();
920
921
  if (branchesEnabled && scope["#ClosestBranchId"]) scope[ClosestBranch] = getScope(scope[ClosestBranchId]);
921
922
  return scope;
@@ -933,11 +934,16 @@ function init(runtimeId = "M") {
933
934
  }
934
935
  };
935
936
  const serializeContext = ((data, registryId) => typeof data === "number" ? registryId ? registeredValues[registryId](getScope(data)) : getScope(data) : applyScopes(data));
936
- const createVisitBranches = (branchScopesStack = [], branchStarts = [], orphanBranches = [], deferredOwners = [], curBranchScopes) => {
937
- return (branchId, branch, endedBranches, accessor, singleNode, parent = visit.parentNode, startVisit = visit, i = orphanBranches.length, j = deferredOwners.length) => {
937
+ const createVisitBranches = (branchScopesStack = [], branchStarts = [], curBranchScopes, reorderBranch, reorderDepth = 0, adopt = (scope, branch) => scope["#ClosestBranch"] === scope ? scope !== branch && setParentBranch(scope, branch) : scope[ClosestBranch] = branch) => {
938
+ return (branchId, branch, endedBranches, accessor, nodeAccessor, singleNode, parent = visit.parentNode, startVisit = visit) => {
939
+ if (visitType === "*") {
940
+ while (reorderBranch && pending.length >= reorderDepth) adopt(pending.pop(), reorderBranch);
941
+ if (reorderBranch = +lastToken && visitScope) reorderDepth = pending.push(reorderBranch);
942
+ return;
943
+ }
938
944
  if (visitType !== "[") {
939
945
  visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit;
940
- accessor = BranchScopes$1 + lastToken;
946
+ accessor = BranchScopes$1 + (nodeAccessor = lastToken);
941
947
  singleNode = visitType !== "]" && visitType !== ")";
942
948
  nextToken();
943
949
  }
@@ -951,6 +957,7 @@ function init(runtimeId = "M") {
951
957
  branch[EndNode] = branch[StartNode] = startVisit;
952
958
  if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
953
959
  } else {
960
+ branch[BranchAccessor] = nodeAccessor;
954
961
  curBranchScopes = push(curBranchScopes, branch);
955
962
  if (accessor) {
956
963
  visitScope[accessor] = curBranchScopes;
@@ -962,19 +969,11 @@ function init(runtimeId = "M") {
962
969
  branch[StartNode] = startVisit;
963
970
  branch[EndNode] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
964
971
  }
965
- while (i && orphanBranches[i - 1]["#Id"] > branchId) {
966
- i--;
967
- setParentBranch(orphanBranches.pop(), branch);
968
- }
969
- while (j && deferredOwners[j - 1]["#Id"] > branchId) {
970
- j--;
971
- const owner = deferredOwners.pop();
972
- if (owner["#ClosestBranch"] !== owner) owner[ClosestBranch] = branch;
973
- }
972
+ while (pending.at(-1)?.["#Id"] >= branchId) adopt(pending.pop(), branch);
974
973
  nextToken();
975
974
  }
976
975
  if (endedBranches) {
977
- for (const ended of endedBranches) orphanBranches.push(ended);
976
+ for (const ended of endedBranches) pending.push(ended);
978
977
  if (singleNode) visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0];
979
978
  }
980
979
  if (visitType === "[") {
@@ -983,7 +982,7 @@ function init(runtimeId = "M") {
983
982
  curBranchScopes = void 0;
984
983
  }
985
984
  branchStarts.push(visit);
986
- } else deferredOwners.push(visitScope);
985
+ } else pending.push(visitScope);
987
986
  };
988
987
  };
989
988
  const nextToken = () => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1);
@@ -1039,12 +1038,21 @@ function init(runtimeId = "M") {
1039
1038
  else {
1040
1039
  visitScope[nextToken()] = htmlStart;
1041
1040
  visitScope[DynamicHTMLLastChild + lastToken] = visit;
1041
+ if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1042
1042
  }
1043
1043
  else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
1044
1044
  else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
1045
- else visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
1045
+ else {
1046
+ visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling;
1047
+ if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1048
+ }
1046
1049
  }
1047
- if (embedRenders && !embedAnchor && visit) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
1050
+ if (branchesEnabled && visitBranches) {
1051
+ visitType = "*";
1052
+ lastToken = "";
1053
+ visitBranches();
1054
+ }
1055
+ if (embedRenders && !embedAnchor && visit?.parentNode) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
1048
1056
  visits.length = retained;
1049
1057
  return effects;
1050
1058
  };
@@ -2873,6 +2881,12 @@ Object.defineProperty(exports, "queueEffect", {
2873
2881
  return queueEffect;
2874
2882
  }
2875
2883
  });
2884
+ Object.defineProperty(exports, "queueRender", {
2885
+ enumerable: true,
2886
+ get: function() {
2887
+ return queueRender;
2888
+ }
2889
+ });
2876
2890
  Object.defineProperty(exports, "ready", {
2877
2891
  enumerable: true,
2878
2892
  get: function() {
@@ -908,13 +908,14 @@ function init(runtimeId = "M") {
908
908
  const render = curRenders[renderId] = renders[renderId] || renders(renderId);
909
909
  const walk = render.w;
910
910
  const scopeLookup = {};
911
+ const pending = [];
911
912
  const getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { ["#Id"]: +id }) : initGlobal());
912
913
  const initGlobal = () => scopeLookup[0] ||= {
913
914
  runtimeId,
914
915
  renderId
915
916
  };
916
917
  const initScope = (scope) => {
917
- scope[Gen$1] = 1;
918
+ scope[Gen$1] ??= 1;
918
919
  scope[Global] = initGlobal();
919
920
  if (branchesEnabled && scope["#ClosestBranchId"]) scope[ClosestBranch] = getScope(scope[ClosestBranchId]);
920
921
  return scope;
@@ -932,11 +933,16 @@ function init(runtimeId = "M") {
932
933
  }
933
934
  };
934
935
  const serializeContext = ((data, registryId) => typeof data === "number" ? registryId ? registeredValues[registryId](getScope(data)) : getScope(data) : applyScopes(data));
935
- const createVisitBranches = (branchScopesStack = [], branchStarts = [], orphanBranches = [], deferredOwners = [], curBranchScopes) => {
936
- return (branchId, branch, endedBranches, accessor, singleNode, parent = visit.parentNode, startVisit = visit, i = orphanBranches.length, j = deferredOwners.length) => {
936
+ const createVisitBranches = (branchScopesStack = [], branchStarts = [], curBranchScopes, reorderBranch, reorderDepth = 0, adopt = (scope, branch) => scope["#ClosestBranch"] === scope ? scope !== branch && setParentBranch(scope, branch) : scope[ClosestBranch] = branch) => {
937
+ return (branchId, branch, endedBranches, accessor, nodeAccessor, singleNode, parent = visit.parentNode, startVisit = visit) => {
938
+ if (visitType === "*") {
939
+ while (reorderBranch && pending.length >= reorderDepth) adopt(pending.pop(), reorderBranch);
940
+ if (reorderBranch = +lastToken && visitScope) reorderDepth = pending.push(reorderBranch);
941
+ return;
942
+ }
937
943
  if (visitType !== "[") {
938
944
  visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit;
939
- accessor = BranchScopes$1 + lastToken;
945
+ accessor = BranchScopes$1 + (nodeAccessor = lastToken);
940
946
  singleNode = visitType !== "]" && visitType !== ")";
941
947
  nextToken();
942
948
  }
@@ -950,6 +956,7 @@ function init(runtimeId = "M") {
950
956
  branch[EndNode] = branch[StartNode] = startVisit;
951
957
  if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
952
958
  } else {
959
+ branch[BranchAccessor] = nodeAccessor;
953
960
  curBranchScopes = push(curBranchScopes, branch);
954
961
  if (accessor) {
955
962
  visitScope[accessor] = curBranchScopes;
@@ -961,19 +968,11 @@ function init(runtimeId = "M") {
961
968
  branch[StartNode] = startVisit;
962
969
  branch[EndNode] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
963
970
  }
964
- while (i && orphanBranches[i - 1]["#Id"] > branchId) {
965
- i--;
966
- setParentBranch(orphanBranches.pop(), branch);
967
- }
968
- while (j && deferredOwners[j - 1]["#Id"] > branchId) {
969
- j--;
970
- const owner = deferredOwners.pop();
971
- if (owner["#ClosestBranch"] !== owner) owner[ClosestBranch] = branch;
972
- }
971
+ while (pending.at(-1)?.["#Id"] >= branchId) adopt(pending.pop(), branch);
973
972
  nextToken();
974
973
  }
975
974
  if (endedBranches) {
976
- for (const ended of endedBranches) orphanBranches.push(ended);
975
+ for (const ended of endedBranches) pending.push(ended);
977
976
  if (singleNode) visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0];
978
977
  }
979
978
  if (visitType === "[") {
@@ -982,7 +981,7 @@ function init(runtimeId = "M") {
982
981
  curBranchScopes = void 0;
983
982
  }
984
983
  branchStarts.push(visit);
985
- } else deferredOwners.push(visitScope);
984
+ } else pending.push(visitScope);
986
985
  };
987
986
  };
988
987
  const nextToken = () => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1);
@@ -1038,12 +1037,21 @@ function init(runtimeId = "M") {
1038
1037
  else {
1039
1038
  visitScope[nextToken()] = htmlStart;
1040
1039
  visitScope[DynamicHTMLLastChild + lastToken] = visit;
1040
+ if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1041
1041
  }
1042
1042
  else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
1043
1043
  else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
1044
- else visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
1044
+ else {
1045
+ visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling;
1046
+ if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1047
+ }
1048
+ }
1049
+ if (branchesEnabled && visitBranches) {
1050
+ visitType = "*";
1051
+ lastToken = "";
1052
+ visitBranches();
1045
1053
  }
1046
- if (embedRenders && !embedAnchor && visit) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
1054
+ if (embedRenders && !embedAnchor && visit?.parentNode) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
1047
1055
  visits.length = retained;
1048
1056
  return effects;
1049
1057
  };
@@ -2092,4 +2100,4 @@ function byFirstArg(name) {
2092
2100
  return name;
2093
2101
  }
2094
2102
  //#endregion
2095
- export { _attrs_script as $, $signal as $t, _attr_input_value_script as A, PendingEffects as An, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, AwaitCounter as Cn, registeredValues as Ct, _attr_input_value_attribute_default as D, Global as Dn, _closure_get as Dt, _attr_input_value as E, Gen$1 as En, _closure as Et, _controllable_open as F, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, PlaceholderBranch as Mn, _global_read as Mt, _attr_select_value_script as N, StartNode as Nn, _hoist as Nt, _attr_input_value_default as O, Load as On, _const as Ot, _controllable_input as P, TagVariable as Pn, _hoist_resume as Pt, _attrs_partial_content as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, Scope as Sn, readyFailed as St, _attr_input_checked_script as T, EndNode as Tn, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, DYNAMIC_TAG_VAR_REGISTER_ID as Zt, _attr_details_or_dialog_open as _, Clone as _n, _var_resume as _t, _for_in as a, queueAsyncRender as an, _text_content as at, _attr_input_checked as b, Setup as bn, initEmbedded as bt, _for_until as c, runEffects as cn, toInsertNode as ct, _show as d, forOf as dn, _content_resume as dt, $signalReset as en, _html as et, _try as f, forTo as fn, createAndSetupBranch as ft, renderCatch as g, _call as gn, _resume as gt, patchDynamicTag as h, _hoist_read_error as hn, _el as ht, _dynamic_tag_content as i, prepareEffects as in, _text as it, _attr_select_value as j, PendingRenders as jn, _for_selector as jt, _attr_input_value_dynamic_default as k, ParentBranch as kn, _el_read as kt, _if as l, runId as ln, _content as lt, installDynamicTagVar as m, _assert_hoist as mn, setupBranch as mt, _await_promise as n, installCatch as nn, _style_rule_item as nt, _for_of as o, queueEffect as on, _to_text as ot, addAwaitCounter as p, forUntil as pn, createBranch as pt, _attr_style_item as q, insertBranchBefore as qt, _dynamic_tag as r, placeholderShown as rn, _style_shell as rt, _for_to as s, run as sn, insertChildNodes as st, _await_content as t, caughtError as tn, _lifecycle as tt, _resume_dynamic_tag as u, forIn as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, Owner as vn, getRegisteredWithScope as vt, _attr_input_checked_default as w, ClosestBranch as wn, withLazy as wt, _attr_input_checkedValue as x, Pending as xn, ready as xt, _attr_details_or_dialog_open_script as y, Params as yn, init as yt, controllableScripts as z, _or as zt };
2103
+ export { _attrs_script as $, $signal as $t, _attr_input_value_script as A, ParentBranch as An, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, Scope as Cn, registeredValues as Ct, _attr_input_value_attribute_default as D, Gen$1 as Dn, _closure_get as Dt, _attr_input_value as E, EndNode as En, _closure as Et, _controllable_open as F, TagVariable as Fn, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, PendingRenders as Mn, _global_read as Mt, _attr_select_value_script as N, PlaceholderBranch as Nn, _hoist as Nt, _attr_input_value_default as O, Global as On, _const as Ot, _controllable_input as P, StartNode as Pn, _hoist_resume as Pt, _attrs_partial_content as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, Pending as Sn, readyFailed as St, _attr_input_checked_script as T, ClosestBranch as Tn, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, DYNAMIC_TAG_VAR_REGISTER_ID as Zt, _attr_details_or_dialog_open as _, _call as _n, _var_resume as _t, _for_in as a, queueAsyncRender as an, _text_content as at, _attr_input_checked as b, Params as bn, initEmbedded as bt, _for_until as c, run as cn, toInsertNode as ct, _show as d, forIn as dn, _content_resume as dt, $signalReset as en, _html as et, _try as f, forOf as fn, createAndSetupBranch as ft, renderCatch as g, _hoist_read_error as gn, _resume as gt, patchDynamicTag as h, _assert_hoist as hn, _el as ht, _dynamic_tag_content as i, prepareEffects as in, _text as it, _attr_select_value as j, PendingEffects as jn, _for_selector as jt, _attr_input_value_dynamic_default as k, Load as kn, _el_read as kt, _if as l, runEffects as ln, _content as lt, installDynamicTagVar as m, forUntil as mn, setupBranch as mt, _await_promise as n, installCatch as nn, _style_rule_item as nt, _for_of as o, queueEffect as on, _to_text as ot, addAwaitCounter as p, forTo as pn, createBranch as pt, _attr_style_item as q, insertBranchBefore as qt, _dynamic_tag as r, placeholderShown as rn, _style_shell as rt, _for_to as s, queueRender as sn, insertChildNodes as st, _await_content as t, caughtError as tn, _lifecycle as tt, _resume_dynamic_tag as u, runId as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, Clone as vn, getRegisteredWithScope as vt, _attr_input_checked_default as w, AwaitCounter as wn, withLazy as wt, _attr_input_checkedValue as x, Setup as xn, ready as xt, _attr_details_or_dialog_open_script as y, Owner as yn, init as yt, controllableScripts as z, _or as zt };
package/dist/debug/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("./dom-BheMBjYT.js");
3
+ const require_control_flow = require("./dom-BAGeiafn.js");
4
4
  //#region src/common/attr-tag.ts
5
5
  const empty = [];
6
6
  const rest = Symbol("Attribute Tag");
@@ -22,10 +22,6 @@ function* attrTagIterator() {
22
22
  yield* this[rest];
23
23
  }
24
24
  //#endregion
25
- //#region src/common/constants/load-signal-value.debug.ts
26
- const Value = "value";
27
- const Signal = "signal";
28
- //#endregion
29
25
  //#region src/common/compat-meta.ts
30
26
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
31
27
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -213,9 +209,10 @@ const _load_template = /*@__PURE__*/ require_control_flow.withLazy((id, load) =>
213
209
  const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((nodeAccessor, childScopeAccessor, load) => {
214
210
  let pending;
215
211
  let renderer;
212
+ const insertCached = (child, marker) => insertLoaded(renderer, child, marker);
216
213
  return (owner) => {
217
214
  const child = owner[childScopeAccessor];
218
- if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
215
+ if (renderer) require_control_flow.queueRender(child, insertCached, -1, owner[nodeAccessor]);
219
216
  else {
220
217
  const awaitCounter = require_control_flow.addAwaitCounter(owner);
221
218
  child[require_control_flow.Load] ||= /* @__PURE__ */ new Map();
@@ -227,27 +224,26 @@ const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((nodeAccessor, c
227
224
  };
228
225
  });
229
226
  function insertLoaded(renderer, branch, marker, awaitCounter) {
230
- const parent = marker.parentNode, values = branch[require_control_flow.Load], insert = () => {
227
+ const parent = marker.parentNode, values = branch[require_control_flow.Load], clone = () => {
228
+ require_control_flow.syncGen(branch);
229
+ renderer[require_control_flow.Clone](branch, parent.namespaceURI);
230
+ branch[require_control_flow.Load] = 0;
231
+ }, insert = () => {
231
232
  require_control_flow.insertBranchBefore(branch, parent, marker);
232
233
  marker.remove();
233
234
  awaitCounter?.c();
234
235
  };
235
236
  let remaining;
236
- require_control_flow.syncGen(branch);
237
- renderer[require_control_flow.Clone](branch, parent.namespaceURI);
238
- branch[require_control_flow.Load] = 0;
239
237
  if (remaining = values?.size) {
240
238
  const fail = loadFailed(branch, awaitCounter);
241
- for (const [promise, entry] of values) promise.then((signal) => {
242
- entry[Signal] = signal;
243
- if (!--remaining) require_control_flow.queueAsyncRender(branch, (branch) => {
244
- require_control_flow.syncGen(branch);
245
- renderer[require_control_flow.Setup]?.(branch);
246
- values.forEach((e) => e[Signal]._(branch, e[Value]));
247
- insert();
248
- });
249
- }, (error) => remaining > 0 && (remaining = 0, fail(error)));
239
+ values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.queueAsyncRender(branch, (branch) => {
240
+ clone();
241
+ renderer["setup"]?.(branch);
242
+ values.forEach(([value, apply]) => apply(branch, value));
243
+ insert();
244
+ }), (error) => remaining > 0 && (remaining = 0, fail(error))));
250
245
  } else {
246
+ clone();
251
247
  require_control_flow.setupBranch(renderer, branch);
252
248
  insert();
253
249
  }
@@ -261,13 +257,13 @@ function loadFailed(scope, awaitCounter) {
261
257
  }
262
258
  const _load_signal = /*@__PURE__*/ require_control_flow.withLazy((load) => {
263
259
  let pending;
264
- let signal;
265
- return (scope, value) => {
260
+ const apply = (scope, value) => {
266
261
  pending ||= load();
267
- if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === require_control_flow.runId) (scope[require_control_flow.Load] ||= /* @__PURE__ */ new Map()).set(pending, { [Value]: value });
268
- else if (signal) signal(scope, value);
269
- else pending.then((mod) => require_control_flow.queueAsyncRender(scope, signal = mod._, value), () => 0);
262
+ if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === require_control_flow.runId) (scope[require_control_flow.Load] ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]);
263
+ else if (apply._) apply._(scope, value);
264
+ else pending.then((mod) => require_control_flow.queueAsyncRender(scope, apply._ = mod._, value), () => 0);
270
265
  };
266
+ return apply;
271
267
  });
272
268
  function _load_visible_trigger(selector, options) {
273
269
  let pending;