marko 6.4.8 → 6.4.10

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 (93) hide show
  1. package/cheatsheet.md +1 -1
  2. package/dist/common/constants/closure-signal-prop.d.ts +1 -1
  3. package/dist/common/constants/closure-signal-prop.debug.d.ts +1 -1
  4. package/dist/debug/dom/catch.feat.js +2 -3
  5. package/dist/debug/dom/catch.feat.mjs +2 -3
  6. package/dist/debug/dom/controllable-input.feat.js +2 -3
  7. package/dist/debug/dom/controllable-input.feat.mjs +2 -3
  8. package/dist/debug/dom/controllable-open.feat.js +2 -3
  9. package/dist/debug/dom/controllable-open.feat.mjs +2 -3
  10. package/dist/debug/dom/controllable-select.feat.js +2 -3
  11. package/dist/debug/dom/controllable-select.feat.mjs +2 -3
  12. package/dist/debug/dom/controllable-textarea.feat.js +2 -3
  13. package/dist/debug/dom/controllable-textarea.feat.mjs +2 -3
  14. package/dist/debug/dom/controllable.feat.js +2 -3
  15. package/dist/debug/dom/controllable.feat.mjs +2 -3
  16. package/dist/debug/dom/dynamic-tag-script.feat.js +2 -3
  17. package/dist/debug/dom/dynamic-tag-script.feat.mjs +2 -3
  18. package/dist/debug/dom/dynamic-tag-var.feat.js +2 -3
  19. package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -3
  20. package/dist/debug/dom/lazy.feat.js +2 -3
  21. package/dist/debug/dom/lazy.feat.mjs +2 -3
  22. package/dist/debug/dom/placeholder.feat.js +2 -3
  23. package/dist/debug/dom/placeholder.feat.mjs +2 -3
  24. package/dist/debug/{dom-CFCBDift.mjs → dom-C1V5vpFs.mjs} +60 -98
  25. package/dist/debug/{dom-D8znnhpf.js → dom-DNB5yq3U.js} +59 -109
  26. package/dist/debug/dom.js +9 -14
  27. package/dist/debug/dom.mjs +9 -14
  28. package/dist/debug/html.js +39 -51
  29. package/dist/debug/html.mjs +37 -49
  30. package/dist/dom/catch.feat.js +4 -5
  31. package/dist/dom/catch.feat.mjs +2 -3
  32. package/dist/dom/compat.d.ts +1 -1
  33. package/dist/dom/control-flow.d.ts +1 -1
  34. package/dist/dom/controllable-input.feat.js +1 -2
  35. package/dist/dom/controllable-input.feat.mjs +1 -2
  36. package/dist/dom/controllable-open.feat.js +2 -3
  37. package/dist/dom/controllable-open.feat.mjs +2 -3
  38. package/dist/dom/controllable-select.feat.js +2 -3
  39. package/dist/dom/controllable-select.feat.mjs +2 -3
  40. package/dist/dom/controllable-textarea.feat.js +2 -3
  41. package/dist/dom/controllable-textarea.feat.mjs +2 -3
  42. package/dist/dom/controllable.feat.js +1 -2
  43. package/dist/dom/controllable.feat.mjs +1 -2
  44. package/dist/dom/dom.d.ts +2 -3
  45. package/dist/dom/dynamic-tag-script.feat.js +3 -4
  46. package/dist/dom/dynamic-tag-script.feat.mjs +2 -3
  47. package/dist/dom/dynamic-tag-var.feat.js +3 -4
  48. package/dist/dom/dynamic-tag-var.feat.mjs +1 -2
  49. package/dist/dom/lazy.feat.js +2 -3
  50. package/dist/dom/lazy.feat.mjs +2 -3
  51. package/dist/dom/placeholder.feat.js +4 -5
  52. package/dist/dom/placeholder.feat.mjs +2 -3
  53. package/dist/dom/resume.d.ts +1 -1
  54. package/dist/dom/scope.d.ts +1 -1
  55. package/dist/dom/signals.d.ts +1 -1
  56. package/dist/{dom-Bpkm72vV.js → dom-C2-Flitp.js} +122 -166
  57. package/dist/{dom-CVAevsbz.mjs → dom-DsHYWMCR.mjs} +59 -94
  58. package/dist/dom.js +36 -40
  59. package/dist/dom.mjs +9 -14
  60. package/dist/html/serializer.d.ts +1 -1
  61. package/dist/html/writer.d.ts +3 -3
  62. package/dist/html.d.ts +1 -1
  63. package/dist/html.js +60 -74
  64. package/dist/html.mjs +60 -75
  65. package/dist/translator/core/show.d.ts +3 -4
  66. package/dist/translator/index.js +1193 -1295
  67. package/dist/translator/util/assert.d.ts +9 -2
  68. package/dist/translator/util/bindings.d.ts +6 -5
  69. package/dist/translator/util/branch-tag.d.ts +1 -1
  70. package/dist/translator/util/constants/slot-kind.d.ts +1 -1
  71. package/dist/translator/util/known-tag.d.ts +3 -0
  72. package/dist/translator/util/module-registrations.d.ts +1 -1
  73. package/dist/translator/util/optional.d.ts +1 -0
  74. package/dist/translator/util/params-tree.d.ts +3 -3
  75. package/dist/translator/util/reasons.d.ts +2 -2
  76. package/dist/translator/util/references.d.ts +13 -10
  77. package/dist/translator/util/replace-with-statements.d.ts +4 -0
  78. package/dist/translator/util/runtime.d.ts +1 -0
  79. package/dist/translator/util/scope-accessor.d.ts +1 -1
  80. package/dist/translator/util/sections.d.ts +38 -14
  81. package/dist/translator/util/signals.d.ts +3 -11
  82. package/dist/translator/util/slots.d.ts +1 -1
  83. package/dist/translator/util/solve-reasons.d.ts +5 -0
  84. package/dist/translator/util/sources.d.ts +1 -1
  85. package/dist/translator/util/static-text.d.ts +1 -0
  86. package/dist/translator/util/structure.d.ts +3 -2
  87. package/dist/translator/util/tag-import.d.ts +0 -2
  88. package/dist/translator/util/tag-name-type.d.ts +3 -0
  89. package/dist/translator/util/write-guard.d.ts +2 -0
  90. package/dist/translator/visitors/placeholder.d.ts +4 -4
  91. package/package.json +6 -6
  92. package/tags/lifecycle.d.marko +2 -0
  93. package/dist/translator/visitors/constants/sibling-text.d.ts +0 -6
package/dist/dom.mjs CHANGED
@@ -44,7 +44,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
44
44
  this.scope && destroyBranch(this.scope);
45
45
  },
46
46
  resolveRegistered(value, $global) {
47
- return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(value[0], getRenderScopes($global)?.[value[1]]) : value;
47
+ return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]) : value;
48
48
  },
49
49
  createRenderer(params, clone) {
50
50
  let renderer = _content("", 0, 0, 0, params)();
@@ -63,14 +63,14 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
63
63
  let renderBranch = (_) => {
64
64
  branch ||= (created = 1, component.scope = createAndSetupBranch(out.global, renderer, renderer.e, document.body)), renderer.g?.(branch), renderer.d?.(branch, renderer._ ? args[0] : args);
65
65
  };
66
- if (component.effects = rendering ? renderBranch() : prepareEffects(renderBranch), created) return toInsertNode(branch.S, branch.K);
66
+ if (component.effects = rendering ? renderBranch() : prepareEffects(renderBranch), created) return branch.S.parentNode || branch.S;
67
67
  }
68
68
  }, _template = (id, template, walks, setup, inputSignal) => {
69
69
  let renderer = _content(id, template, walks, setup, inputSignal)();
70
70
  return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
71
71
  }, noop = (_) => 0;
72
- import { $ as _attr_style_items, $t as removeAndDestroyBranch, A as _attr_input_value, B as _controllable_select, Bt as _id, C as _attr_details_or_dialog_open_script, Ct as _resumed, D as _attr_input_checkedValue_script, Dt as initEmbedded, E as _attr_input_checkedValue_default, Et as init, F as _attr_select_value, Ft as _for_closure, G as _attr_class, Gt as _return, Ht as _let, I as _attr_select_value_default, It as _for_selector, J as _attr_class_names, Jt as _var, K as _attr_class_item, Kt as _return_change, L as _attr_select_value_script, Lt as _global_read, M as _attr_input_value_default, Mt as _closure_get, N as _attr_input_value_dynamic_default, Nt as _const, O as _attr_input_checked_default, Ot as ready, P as _attr_input_value_script, Pt as _el_read, Q as _attr_style_item, Qt as insertBranchBefore, R as _controllable_input, Rt as _hoist, S as _attr_details_or_dialog_open_default, Sn as _call, St as _el, T as _attr_input_checkedValue, Tt as getRegisteredWithScope, Ut as _let_change, V as _controllable_textarea, Vt as _if_closure, W as _attr, Wt as _or, X as _attr_nonce, Xt as _assert_init, Y as _attr_content, Yt as _var_change, Z as _attr_style, Zt as destroyBranch, _ as patchDynamicTag, _n as forTo, _t as _return_setup, a as _for_in, at as _html, b as startAwait, bn as _assert_hoist, bt as setupBranch, c as _for_to, cn as queueAsyncRender, ct as _style_shell, d as _for_until_unkeyed, dn as rendering, dt as _to_text, en as syncGen, et as _attrs, f as _if, fn as run, ft as insertChildNodes, gn as forOf, gt as _content_resume, hn as forIn, ht as _content_closures, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _closure, k as _attr_input_checked_script, kt as readyFailed, l as _for_to_unkeyed, ln as queueEffect, lt as _text, m as _try, mn as runId, mt as _content, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as runEffects, pt as toInsertNode, q as _attr_class_items, qt as _script, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as prepareEffects, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueRender, ut as _text_content, v as renderCatch, vn as forUntil, vt as createAndSetupBranch, w as _attr_input_checked, wt as _var_resume, x as _attr_details_or_dialog_open, xn as _hoist_read_error, xt as _dynamic_tag_var_resume, yn as _assert_class_toggles, yt as createBranch, z as _controllable_open, zt as _hoist_resume } from "./dom-CVAevsbz.mjs";
73
- //#region src/common/attr-tag.ts
72
+ import { $ as _attr_style_items, $t as _on, A as _attr_input_value, At as _closure_get, B as _controllable_select, Bt as _let, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dt as readyFailed, E as _attr_input_checkedValue_default, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gt as _script, Ht as _or, I as _attr_select_value_default, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kt as _var, L as _attr_select_value_script, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rt as _id, S as _attr_details_or_dialog_open_default, St as _var_resume, T as _attr_input_checkedValue, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as _assert_class_toggles, _t as createBranch, a as _for_in, an as prepareEffects, at as _html, b as startAwait, bn as _call, bt as _el, c as _for_to, cn as queueRender, ct as _style_shell, d as _for_until_unkeyed, dn as runEffects, dt as _to_text, en as $signal, et as _attrs, f as _if, fn as runId, ft as _content, gn as forUntil, gt as createAndSetupBranch, hn as forTo, ht as _return_setup, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _const, k as _attr_input_checked_script, kt as _closure, l as _for_to_unkeyed, ln as rendering, lt as _text, m as _try, mn as forOf, mt as _content_resume, n as _await_promise, nt as _attrs_partial, o as _for_of, on as queueAsyncRender, ot as _lifecycle, p as _show, pn as forIn, pt as _content_closures, q as _attr_class_items, qt as _var_change, r as _dynamic_tag, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as queueEffect, st as _style_rule_item, t as _await_content, tn as $signalReset, tt as _attrs_content, u as _for_until, un as run, ut as _text_content, v as renderCatch, vn as _assert_hoist, vt as setupBranch, w as _attr_input_checked, wt as init, x as _attr_details_or_dialog_open, xt as _resumed, yn as _hoist_read_error, yt as _dynamic_tag_var_resume, z as _controllable_open, zt as _if_closure } from "./dom-DsHYWMCR.mjs";
73
+ // src/common/attr-tag.ts
74
74
  function attrTag(attrs) {
75
75
  return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
76
76
  }
@@ -80,12 +80,9 @@ function attrTags(first, attrs) {
80
80
  function* attrTagIterator() {
81
81
  yield this, yield* this[rest];
82
82
  }
83
- //#endregion
84
- //#region src/common/compat-meta.ts
85
- //#endregion
86
- //#region src/dom/compat.ts
87
- //#endregion
88
- //#region src/dom/template.ts
83
+ // src/common/compat-meta.ts
84
+ // src/dom/compat.ts
85
+ // src/dom/template.ts
89
86
  function mount(input = {}, reference, position) {
90
87
  let branch, parentNode = reference, nextSibling = null, { $global } = input;
91
88
  switch ($global ? ({$global, ...input} = input, $global = {
@@ -109,7 +106,7 @@ function mount(input = {}, reference, position) {
109
106
  curValue = newValue;
110
107
  }, this.c?.(branch), args?.(branch, input);
111
108
  });
112
- return insertChildNodes(parentNode, nextSibling, branch.S, branch.K), runEffects(effects), {
109
+ return insertBranchBefore(branch, parentNode, nextSibling), runEffects(effects), {
113
110
  get value() {
114
111
  return curValue;
115
112
  },
@@ -126,8 +123,7 @@ function mount(input = {}, reference, position) {
126
123
  }
127
124
  };
128
125
  }
129
- //#endregion
130
- //#region src/dom/load.ts
126
+ // src/dom/load.ts
131
127
  function _load_template(id, load) {
132
128
  let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
133
129
  let awaitCounter = startAwait(branch);
@@ -197,5 +193,4 @@ function _load_race_trigger(...triggers) {
197
193
  function getSelectorOrResolve(selector, resolve) {
198
194
  return document.querySelector(selector) || resolve();
199
195
  }
200
- //#endregion
201
196
  export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
@@ -76,7 +76,7 @@ export declare function dropQueuedCall(state: State, value: unknown, object: unk
76
76
  export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown, locals?: Locals, access?: string): T;
77
77
  export declare function writeDeferred(state: State): void;
78
78
  export declare function hasMatchingCalls(state: State, readyId: string | undefined): boolean;
79
- export declare function quoteRegisterId(id: string): string;
79
+ export declare function quoteRegistryId(id: string): string;
80
80
  export declare function toObjectKey(name: string): string;
81
81
  export declare function toAccess(accessor: string): string;
82
82
  export declare function quote(str: string, startPos: number): string;
@@ -60,9 +60,9 @@ export declare function _hoist(scopeId: number, id: string): {
60
60
  (): void;
61
61
  [Symbol.iterator]: typeof _hoist_read_error;
62
62
  };
63
- export declare function _el_resume(scopeId: number, accessor: Accessor, markerGuard?: number): string;
64
- export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
65
- export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
63
+ export declare function _el_mark(scopeId: number, accessor: Accessor, markerGuard?: number): string;
64
+ export declare function _text_mark(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
65
+ export declare function _html_mark(scopeId: number, accessor: Accessor, val: unknown, markerGuard?: number): string;
66
66
  export declare function _resume_branch(scopeId: number): void;
67
67
  export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, markerGuard?: number): void;
68
68
  export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
package/dist/html.d.ts CHANGED
@@ -8,4 +8,4 @@ export { _await, _for_in, _for_of, _for_to, _for_until, _if, _show_end, _show_st
8
8
  export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
9
9
  export { forIn, forOf, forTo, forUntil } from "./html/for";
10
10
  export { _template } from "./html/template";
11
- export { _attr_content, _el, _el_resume, _existing_scope, _hoist, _html, _id, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script, _write_guard, _write_if, _set_scope_reason, _text_resume, _subscribe, _trailers, _var, $global, } from "./html/writer";
11
+ export { _attr_content, _el, _el_mark, _existing_scope, _hoist, _html, _id, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_mark, _scope_with_id, _script, _write_guard, _write_if, _set_scope_reason, _text_mark, _subscribe, _trailers, _var, $global, } from "./html/writer";
package/dist/html.js CHANGED
@@ -283,7 +283,10 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
283
283
  })(_dynamic_tag), _template = (templateId, renderer, page) => (renderer.render = render, renderer.i = !page, renderer._ = renderer, _content_resume(templateId, renderer)), kAssets = Symbol(), kHead = Symbol(), SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
284
284
  $global,
285
285
  writeLoadAsset,
286
- fork: _await,
286
+ fork: ((scopeId, accessor, promise, content) => _await(scopeId, accessor, promise, (value) => {
287
+ let branchId = _peek_scope_id();
288
+ content(value), _peek_scope_id() === branchId && _scope_id();
289
+ })),
287
290
  write: _html,
288
291
  writeScript,
289
292
  nextScopeId: _scope_id,
@@ -424,7 +427,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
424
427
  }
425
428
  }, pendingClassFunctions = /* @__PURE__ */ new WeakMap();
426
429
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
427
- //#region src/common/attr-tag.ts
430
+ // src/common/attr-tag.ts
428
431
  function attrTag(attrs) {
429
432
  return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
430
433
  }
@@ -434,8 +437,7 @@ function attrTags(first, attrs) {
434
437
  function* attrTagIterator() {
435
438
  yield this, yield* this[rest];
436
439
  }
437
- //#endregion
438
- //#region src/common/helpers.ts
440
+ // src/common/helpers.ts
439
441
  function stringifyClassEntry(name, value) {
440
442
  return value ? name : "";
441
443
  }
@@ -476,15 +478,13 @@ function normalizeDynamicRenderer(value) {
476
478
  if ("a" in normalized) return normalized;
477
479
  }
478
480
  }
479
- //#endregion
480
- //#region src/common/errors.ts
481
+ // src/common/errors.ts
481
482
  function _assert_class_toggles(classes, toggles) {}
482
483
  function _el_read_error() {}
483
484
  function _hoist_read_error() {}
484
485
  function _signal_read_error() {}
485
486
  function _assert_hoist(value) {}
486
- //#endregion
487
- //#region src/common/opt.ts
487
+ // src/common/opt.ts
488
488
  function reduce(opt, cb, acc) {
489
489
  if (opt) {
490
490
  if (Array.isArray(opt)) for (let item of opt) acc = cb(acc, item);
@@ -545,7 +545,7 @@ var State$1 = class {
545
545
  if (locals) {
546
546
  this.buf.push(registered.access + "(_(" + scopeId + ")");
547
547
  for (let local of locals) this.buf.push(","), writePlainObject(this, local, newArgReference(this, ref, local));
548
- } else this.buf.push("_(" + scopeId + "," + quoteRegisterId(registered.id));
548
+ } else this.buf.push("_(" + scopeId + "," + quoteRegistryId(registered.id));
549
549
  this.buf.push(")");
550
550
  }
551
551
  }, Reference = class {
@@ -703,7 +703,7 @@ function newScopeReference(state, val, scopeId) {
703
703
  let ref = new Reference(null, null, state.flushId);
704
704
  return ref.scopeId = scopeId, ref.channel = state.channel, state.refs.set(val, ref), ref;
705
705
  }
706
- function quoteRegisterId(id) {
706
+ function quoteRegistryId(id) {
707
707
  return "\"" + id + "\"";
708
708
  }
709
709
  function writeRegistered(state, val, parent, accessor, registered) {
@@ -1277,8 +1277,7 @@ function patchIteratorNext(proto) {
1277
1277
  return this[kTouchedIterator] = 1, next.call(this, value);
1278
1278
  }, proto.next[kTouchedIterator] = !0;
1279
1279
  }
1280
- //#endregion
1281
- //#region src/html/attrs.ts
1280
+ // src/html/attrs.ts
1282
1281
  function _attr_class(value) {
1283
1282
  return stringAttr("class", toDelimitedString(value, " ", stringifyClassEntry));
1284
1283
  }
@@ -1434,10 +1433,8 @@ function normalizedValueMatches(a, b) {
1434
1433
  function normalizeStrAttrValue(value) {
1435
1434
  return isNotNullishOrFalse(value) && value !== !0 ? value + "" : "";
1436
1435
  }
1437
- //#endregion
1438
- //#region src/html/inlined-runtimes.ts
1439
- //#endregion
1440
- //#region src/html/writer.ts
1436
+ // src/html/inlined-runtimes.ts
1437
+ // src/html/writer.ts
1441
1438
  function getChunk() {
1442
1439
  return $chunk;
1443
1440
  }
@@ -1536,15 +1533,15 @@ function _hoist(scopeId, id) {
1536
1533
  let getter = () => void 0;
1537
1534
  return getter[Symbol.iterator] = _hoist_read_error, _resume(getter, id, scopeId);
1538
1535
  }
1539
- function _el_resume(scopeId, accessor, markerGuard) {
1536
+ function _el_mark(scopeId, accessor, markerGuard) {
1540
1537
  if (markerGuard === 0) return "";
1541
1538
  let { state } = $chunk.boundary;
1542
1539
  return state.needsWalkerRuntime = !0, state.mark("$", scopeId + " " + accessor);
1543
1540
  }
1544
- function _text_resume(scopeId, accessor, val, markerGuard) {
1541
+ function _text_mark(scopeId, accessor, val, markerGuard) {
1545
1542
  return markText(scopeId, accessor, _escape(val), markerGuard);
1546
1543
  }
1547
- function _html_resume(scopeId, accessor, val, markerGuard) {
1544
+ function _html_mark(scopeId, accessor, val, markerGuard) {
1548
1545
  let html = _unescaped(val);
1549
1546
  if (markerGuard === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, markerGuard);
1550
1547
  let { state } = $chunk.boundary;
@@ -1899,9 +1896,9 @@ var State = class {
1899
1896
  let { channel } = this, { readyId } = channel, scripts = "", held = this.takeDeferredReady();
1900
1897
  if (held) for (let chunk of Array.isArray(held) ? held : [held]) chunk.boundary.aborted || (scripts = concatScripts(scripts, chunk.flushReadyScripts(boundary, reservations, holdEffects)), (chunk.effects || chunk.deferredReady) && (this.deferredReady = push(this.deferredReady, chunk)));
1901
1898
  if (readyId && !this.async) {
1902
- let { state } = boundary;
1903
- flushSerializer(boundary, channel);
1904
- let deps = takeChannelDeps(state.serializer), effects = holdEffects ? "" : this.effects, { resumes } = channel, chunkScripts = this.scripts;
1899
+ let { state } = boundary, effects = holdEffects ? "" : this.effects;
1900
+ effects && flushSerializerGlobals(boundary), flushSerializer(boundary, channel);
1901
+ let deps = takeChannelDeps(state.serializer), { resumes } = channel, chunkScripts = this.scripts;
1905
1902
  if (channel.resumes = this.scripts = "", effects && (this.effects = this.lastEffect = ""), resumes || effects) {
1906
1903
  state.needsWalkerRuntime = !0;
1907
1904
  let batch = concatSequence(depsMarker(deps), concatSequence(resumes, effects && `"${effects}"`));
@@ -1924,7 +1921,7 @@ var State = class {
1924
1921
  }
1925
1922
  readyResumeScripts && (needsWalk = !0);
1926
1923
  let effects = this.async ? "" : joinHeldEffects(this.takeHeldEffects(), this.effects), { html, scripts } = this;
1927
- html && state.hasReorderRuntime && (html = state.mark("*", "") + html), state.needsWalkerRuntime && !state.hasWalkerRuntime && (state.hasWalkerRuntime = !0, scripts = concatScripts(scripts, state.runtimeScript())), scripts = concatScripts(scripts, readyResumeScripts), effects && (needsWalk = !0, state.resumes = state.resumes ? state.resumes + ",\"" + effects + "\"" : "\"" + effects + "\"");
1924
+ html && state.hasReorderRuntime && (html = state.mark("*", "") + html), state.needsWalkerRuntime && !state.hasWalkerRuntime && (state.hasWalkerRuntime = !0, scripts = concatScripts(scripts, state.runtimeScript())), scripts = concatScripts(scripts, readyResumeScripts), effects && (needsWalk = !0, flushSerializerGlobals(boundary), state.resumes = state.resumes ? state.resumes + ",\"" + effects + "\"" : "\"" + effects + "\"");
1928
1925
  let reordered = "", needsResumeArray = !1;
1929
1926
  if (state.writeReorders) {
1930
1927
  for (let reorderedChunk of state.writeReorders) {
@@ -2014,12 +2011,15 @@ function flushSerializer(boundary, channel) {
2014
2011
  props
2015
2012
  ]);
2016
2013
  }
2017
- (flushes.length || pending) && (channel.readyId && !state.hasWrittenGlobals && flushSerializerGlobals(boundary), state.addResumes(channel, stringifyScopes(serializer, flushes, boundary, channel))), channel.writeScopes = {}, channel.flushScopes = !1, pending && (state.walkOnNextFlush = !0);
2014
+ (flushes.length || pending) && (channel.readyId && flushSerializerGlobals(boundary), state.addResumes(channel, stringifyScopes(serializer, flushes, boundary, channel))), channel.writeScopes = {}, channel.flushScopes = !1, pending && (state.walkOnNextFlush = !0);
2018
2015
  }
2019
2016
  }
2020
2017
  function flushSerializerGlobals(boundary) {
2021
- let { state } = boundary, globals = getFilteredGlobals(state.$global);
2022
- globals && (state.hasWrittenGlobals = !0, state.needsWalkerRuntime = !0, state.resumes = concatSequence(state.resumes, stringifyScopes(state.serializer, [[
2018
+ let { state } = boundary;
2019
+ if (state.hasWrittenGlobals) return;
2020
+ state.hasWrittenGlobals = !0;
2021
+ let globals = getFilteredGlobals(state.$global);
2022
+ globals && (state.needsWalkerRuntime = !0, state.resumes = concatSequence(state.resumes, stringifyScopes(state.serializer, [[
2023
2023
  0,
2024
2024
  globals,
2025
2025
  globals
@@ -2074,8 +2074,7 @@ function flushTickQueue() {
2074
2074
  });
2075
2075
  }
2076
2076
  }
2077
- //#endregion
2078
- //#region src/html/content.ts
2077
+ // src/html/content.ts
2079
2078
  function _to_text(val) {
2080
2079
  return val || val === 0 ? val + "" : "";
2081
2080
  }
@@ -2100,16 +2099,14 @@ function escapeCommentStr(str) {
2100
2099
  function _escape_comment(val) {
2101
2100
  return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
2102
2101
  }
2103
- //#endregion
2104
- //#region src/html/dynamic-tag.ts
2102
+ // src/html/dynamic-tag.ts
2105
2103
  function _content(id, fn, scopeId) {
2106
2104
  return fn.a = id, fn.e = scopeId, fn;
2107
2105
  }
2108
2106
  function _content_resume(id, fn, scopeId, locals) {
2109
2107
  return _resume(_content(id, fn, scopeId), id, scopeId, locals);
2110
2108
  }
2111
- //#endregion
2112
- //#region src/html/template.ts
2109
+ // src/html/template.ts
2113
2110
  function render(input = {}) {
2114
2111
  return startRender(this, input, State);
2115
2112
  }
@@ -2255,30 +2252,29 @@ var ServerRendered = class {
2255
2252
  return;
2256
2253
  }
2257
2254
  let { boundary } = head, onNext = boundary.onNext = (write) => {
2258
- if (flushing) {
2259
- again = !0;
2260
- return;
2261
- }
2262
- flushing = !0;
2263
- do {
2264
- again = !1;
2265
- let status = boundary.flush();
2266
- if (status === 2) {
2267
- tick || offTick(onNext), settle(boundary), onAbort(boundary.reason);
2268
- return;
2269
- }
2270
- if (write || status === 0) {
2271
- if (head = head.consume(boundary), boundary.aborted) continue;
2272
- let html = head.flushHTML(boundary);
2273
- if (boundary.aborted) continue;
2274
- if (html && onWrite(html), !boundary.count) {
2275
- tick || offTick(onNext), settle(boundary), onClose();
2255
+ if (flushing) again = !0;
2256
+ else {
2257
+ flushing = !0;
2258
+ do {
2259
+ again = !1;
2260
+ let status = boundary.flush();
2261
+ if (status === 2) {
2262
+ tick || offTick(onNext), settle(boundary), onAbort(boundary.reason);
2276
2263
  return;
2277
2264
  }
2278
- write && (tick = !0);
2279
- } else tick && (tick = !1, queueTick(onNext));
2280
- } while (again);
2281
- flushing = !1;
2265
+ if (write || status === 0) {
2266
+ if (head = head.consume(boundary), boundary.aborted) continue;
2267
+ let html = head.flushHTML(boundary);
2268
+ if (boundary.aborted) continue;
2269
+ if (html && onWrite(html), !boundary.count) {
2270
+ tick || offTick(onNext), settle(boundary), onClose();
2271
+ return;
2272
+ }
2273
+ write && (tick = !0);
2274
+ } else tick && (tick = !1, queueTick(onNext));
2275
+ } while (again);
2276
+ flushing = !1;
2277
+ }
2282
2278
  };
2283
2279
  return onNext(), boundary;
2284
2280
  }
@@ -2294,8 +2290,7 @@ function settle(boundary) {
2294
2290
  boundary.onNext = NOOP$1, boundary.state.$global.signal?.removeEventListener("abort", boundary);
2295
2291
  }
2296
2292
  function NOOP$1() {}
2297
- //#endregion
2298
- //#region src/html/assets.ts
2293
+ // src/html/assets.ts
2299
2294
  function withLoadAssets(template, id, flush, assetId, triggers) {
2300
2295
  let renderer = (input) => (writeLoadAsset(assetId, flush, triggers), writeWaitReady(assetId, template(), input));
2301
2296
  return _template(id, renderer), renderer;
@@ -2376,10 +2371,8 @@ function toObjectExpression(options) {
2376
2371
  for (let key in options) Object.hasOwn(options, key) && (result += sep + toObjectKey(key) + ":" + JSON.stringify(options[key]), sep = ",");
2377
2372
  return result + "}";
2378
2373
  }
2379
- //#endregion
2380
- //#region src/common/compat-meta.ts
2381
- //#endregion
2382
- //#region src/common/for.ts
2374
+ // src/common/compat-meta.ts
2375
+ // src/common/for.ts
2383
2376
  function forIn(obj, cb) {
2384
2377
  for (let key in obj) cb(key, obj[key]);
2385
2378
  }
@@ -2397,8 +2390,7 @@ function forUntil(until, from, step, cb) {
2397
2390
  let start = from || 0, delta = step || 1;
2398
2391
  for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
2399
2392
  }
2400
- //#endregion
2401
- //#region src/html/for.ts
2393
+ // src/html/for.ts
2402
2394
  function forOfBy(by, item, index) {
2403
2395
  return by ? typeof by == "string" ? item[by] : by(item, index) : index;
2404
2396
  }
@@ -2408,8 +2400,7 @@ function forInBy(by, name, value) {
2408
2400
  function forStepBy(by, index) {
2409
2401
  return by ? by(index) : index;
2410
2402
  }
2411
- //#endregion
2412
- //#region src/html/control-flow.ts
2403
+ // src/html/control-flow.ts
2413
2404
  function _show_start(display, markerGuard, branchExprGuard, parentEndTag) {
2414
2405
  display ? resumesMarker(markerGuard, branchExprGuard, parentEndTag) && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
2415
2406
  }
@@ -2486,7 +2477,7 @@ function writeBranchEnd(scopeId, accessor, branchExprGuard, markerGuard, parentE
2486
2477
  if (resumesMarker(markerGuard, branchExprGuard, parentEndTag)) {
2487
2478
  let { state } = $chunk.boundary, mark = singleNode ? state.mark(parentEndTag ? "}" : "|", scopeId + " " + accessor + (branchIds || "")) : state.mark(parentEndTag ? ")" : "]", scopeId + " " + accessor + (branchIds || ""));
2488
2479
  $chunk.writeHTML(mark + endTag);
2489
- } else markerGuard === 0 ? $chunk.writeHTML(endTag) : $chunk.writeHTML(endTag + _el_resume(scopeId, accessor));
2480
+ } else markerGuard === 0 ? $chunk.writeHTML(endTag) : $chunk.writeHTML(endTag + _el_mark(scopeId, accessor));
2490
2481
  }
2491
2482
  function _await(scopeId, accessor, promise, content, markerGuard) {
2492
2483
  let resumeMarker = markerGuard !== 0;
@@ -2521,17 +2512,13 @@ function _try(scopeId, accessor, content, placeholderContent, catchContent, plac
2521
2512
  }
2522
2513
  function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBranchId) {
2523
2514
  let chunk = $chunk, { boundary } = chunk, body = chunk.fork(boundary, null);
2524
- if (body === body.render(content)) {
2525
- chunk.append(body);
2526
- return;
2527
- }
2528
- chunk.next = chunk.forkRest(boundary), captureContext(chunk), chunk.placeholder = {
2515
+ body === body.render(content) ? chunk.append(body) : (chunk.next = chunk.forkRest(boundary), captureContext(chunk), chunk.placeholder = {
2529
2516
  body,
2530
2517
  render: placeholder,
2531
2518
  branchId,
2532
2519
  scopeId,
2533
2520
  placeholderBranchId
2534
- };
2521
+ });
2535
2522
  }
2536
2523
  function tryBoundary(content, catchContent, branchId, renderers) {
2537
2524
  let chunk = $chunk, { boundary } = chunk, { state } = boundary, bodyBoundary = new Boundary(state, void 0, boundary);
@@ -2584,8 +2571,7 @@ function writeTryRenderers(branchId, catchContent, placeholderContent) {
2584
2571
  Q: placeholderContent
2585
2572
  });
2586
2573
  }
2587
- //#endregion
2588
- //#region src/html/compat.ts
2574
+ // src/html/compat.ts
2589
2575
  function drainClassFunctions($global, writeScope) {
2590
2576
  let pending = pendingClassFunctions.get($global), scopeByHost = {};
2591
2577
  for (let [id, fn, hostId] of pending) register(id, fn, scopeByHost[hostId] ||= writeScope(hostId));
@@ -2601,4 +2587,4 @@ exports.$global = $global, exports._assert_class_toggles = _assert_class_toggles
2601
2587
  get: function() {
2602
2588
  return _dynamic_tag;
2603
2589
  }
2604
- }), exports._el = _el, exports._el_read_error = _el_read_error, exports._el_resume = _el_resume, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._escape_style_value = _escape_style_value, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._html_resume = _html_resume, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._set_scope_reason = _set_scope_reason, exports._show_end = _show_end, exports._show_start = _show_start, exports._signal_read_error = _signal_read_error, exports._style_html = _style_html, exports._subscribe = _subscribe, exports._template = _template, exports._text_resume = _text_resume, exports._textarea_value = _textarea_value, exports._to_text = _to_text, exports._trailers = _trailers, exports._try = _try, exports._unescaped = _unescaped, exports._var = _var, exports._write_guard = _write_guard, exports._write_if = _write_if, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;
2590
+ }), exports._el = _el, exports._el_mark = _el_mark, exports._el_read_error = _el_read_error, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._escape_style_value = _escape_style_value, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._html_mark = _html_mark, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._set_scope_reason = _set_scope_reason, exports._show_end = _show_end, exports._show_start = _show_start, exports._signal_read_error = _signal_read_error, exports._style_html = _style_html, exports._subscribe = _subscribe, exports._template = _template, exports._text_mark = _text_mark, exports._textarea_value = _textarea_value, exports._to_text = _to_text, exports._trailers = _trailers, exports._try = _try, exports._unescaped = _unescaped, exports._var = _var, exports._write_guard = _write_guard, exports._write_if = _write_if, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;