marko 6.0.8 → 6.0.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.
package/dist/debug/dom.js CHANGED
@@ -246,6 +246,10 @@ var DEFAULT_RENDER_ID = "_";
246
246
 
247
247
  // src/dom/resume.ts
248
248
  var registeredValues = {};
249
+ var branchesEnabled;
250
+ function enableBranches() {
251
+ branchesEnabled = 1;
252
+ }
249
253
  function init(runtimeId = DEFAULT_RUNTIME_ID) {
250
254
  if (true) {
251
255
  if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
@@ -312,41 +316,43 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
312
316
  if (token === "*" /* Node */) {
313
317
  const node = scope[data2] = visit.previousSibling;
314
318
  scope["Getter:" /* Getter */ + data2] = () => node;
315
- } else if (token === "[" /* BranchStart */) {
316
- if (currentBranchId && dataIndex) {
317
- branchEnd(currentBranchId, visit);
319
+ } else if (branchesEnabled) {
320
+ if (token === "[" /* BranchStart */) {
321
+ if (currentBranchId && dataIndex) {
322
+ branchEnd(currentBranchId, visit);
323
+ currentBranchId = branchStack.pop();
324
+ }
325
+ if (currentBranchId) {
326
+ branchStack.push(currentBranchId);
327
+ parentBranchIds.set(scopeId, currentBranchId);
328
+ }
329
+ currentBranchId = scopeId;
330
+ scope.___startNode = visit;
331
+ } else if (token === "]" /* BranchEnd */) {
332
+ scope[data2] = visit;
333
+ const curParent = visit.parentNode;
334
+ const startNode = branchEnd(
335
+ currentBranchId,
336
+ visit
337
+ ).___startNode;
338
+ if (curParent !== startNode.parentNode) {
339
+ curParent.prepend(startNode);
340
+ }
318
341
  currentBranchId = branchStack.pop();
319
- }
320
- if (currentBranchId) {
321
- branchStack.push(currentBranchId);
322
- parentBranchIds.set(scopeId, currentBranchId);
323
- }
324
- currentBranchId = scopeId;
325
- scope.___startNode = visit;
326
- } else if (token === "]" /* BranchEnd */) {
327
- scope[data2] = visit;
328
- const curParent = visit.parentNode;
329
- const startNode = branchEnd(
330
- currentBranchId,
331
- visit
332
- ).___startNode;
333
- if (curParent !== startNode.parentNode) {
334
- curParent.prepend(startNode);
335
- }
336
- currentBranchId = branchStack.pop();
337
- } else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
338
- let next = data2.indexOf(" ");
339
- let curNode = visit;
340
- scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
341
- while (~next) {
342
- const start = next + 1;
343
- next = data2.indexOf(" ", start);
344
- const childScopeId = +data2.slice(
345
- start,
346
- ~next ? next : data2.length
347
- );
348
- curNode = branchEnd(childScopeId, curNode).___endNode;
349
- parentBranchIds.set(childScopeId, scopeId);
342
+ } else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
343
+ let next = data2.indexOf(" ");
344
+ let curNode = visit;
345
+ scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
346
+ while (~next) {
347
+ const start = next + 1;
348
+ next = data2.indexOf(" ", start);
349
+ const childScopeId = +data2.slice(
350
+ start,
351
+ ~next ? next : data2.length
352
+ );
353
+ curNode = branchEnd(childScopeId, curNode).___endNode;
354
+ parentBranchIds.set(childScopeId, scopeId);
355
+ }
350
356
  }
351
357
  }
352
358
  }
@@ -378,19 +384,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
378
384
  prevScope
379
385
  );
380
386
  }
381
- const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
382
- if (parentBranchId) {
383
- scope.___closestBranch = scopeLookup[parentBranchId];
384
- }
385
- if (branchIds.has(scopeId)) {
386
- const branch = scope;
387
- const parentBranch = branch.___closestBranch;
388
- scope.___closestBranch = branch;
389
- if (parentBranch) {
390
- branch.___parentBranch = parentBranch;
391
- (parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
392
- branch
393
- );
387
+ if (branchesEnabled) {
388
+ const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
389
+ if (parentBranchId) {
390
+ scope.___closestBranch = scopeLookup[parentBranchId];
391
+ }
392
+ if (branchIds.has(scopeId)) {
393
+ const branch = scope;
394
+ const parentBranch = branch.___closestBranch;
395
+ scope.___closestBranch = branch;
396
+ if (parentBranch) {
397
+ branch.___parentBranch = parentBranch;
398
+ (parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
399
+ branch
400
+ );
401
+ }
394
402
  }
395
403
  }
396
404
  if (true) {
@@ -1767,6 +1775,7 @@ function renderCatch(scope, error) {
1767
1775
  }
1768
1776
  function conditional(nodeAccessor, ...branches) {
1769
1777
  const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1778
+ enableBranches();
1770
1779
  return (scope, newBranch) => {
1771
1780
  if (newBranch !== scope[branchAccessor]) {
1772
1781
  setConditionalRenderer(
@@ -1784,6 +1793,7 @@ function patchDynamicTag(fn) {
1784
1793
  var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1785
1794
  const childScopeAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
1786
1795
  const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1796
+ enableBranches();
1787
1797
  return (scope, newRenderer, getInput) => {
1788
1798
  const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
1789
1799
  if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.___id || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
@@ -1903,6 +1913,7 @@ function loopTo(nodeAccessor, renderer) {
1903
1913
  }
1904
1914
  function loop(nodeAccessor, renderer, forEach) {
1905
1915
  const params = renderer.___params;
1916
+ enableBranches();
1906
1917
  return (scope, value2) => {
1907
1918
  const referenceNode = scope[nodeAccessor];
1908
1919
  const oldMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor];
@@ -2069,6 +2080,7 @@ var runRender = (render) => render.___signal(render.___scope, render.___value);
2069
2080
  var enableCatch = () => {
2070
2081
  enableCatch = () => {
2071
2082
  };
2083
+ enableBranches();
2072
2084
  const handlePendingTry = (fn, scope, branch) => {
2073
2085
  while (branch) {
2074
2086
  if (branch.___pendingAsyncCount) {
@@ -154,6 +154,10 @@ var DEFAULT_RENDER_ID = "_";
154
154
 
155
155
  // src/dom/resume.ts
156
156
  var registeredValues = {};
157
+ var branchesEnabled;
158
+ function enableBranches() {
159
+ branchesEnabled = 1;
160
+ }
157
161
  function init(runtimeId = DEFAULT_RUNTIME_ID) {
158
162
  if (true) {
159
163
  if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
@@ -220,41 +224,43 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
220
224
  if (token === "*" /* Node */) {
221
225
  const node = scope[data2] = visit.previousSibling;
222
226
  scope["Getter:" /* Getter */ + data2] = () => node;
223
- } else if (token === "[" /* BranchStart */) {
224
- if (currentBranchId && dataIndex) {
225
- branchEnd(currentBranchId, visit);
227
+ } else if (branchesEnabled) {
228
+ if (token === "[" /* BranchStart */) {
229
+ if (currentBranchId && dataIndex) {
230
+ branchEnd(currentBranchId, visit);
231
+ currentBranchId = branchStack.pop();
232
+ }
233
+ if (currentBranchId) {
234
+ branchStack.push(currentBranchId);
235
+ parentBranchIds.set(scopeId, currentBranchId);
236
+ }
237
+ currentBranchId = scopeId;
238
+ scope.___startNode = visit;
239
+ } else if (token === "]" /* BranchEnd */) {
240
+ scope[data2] = visit;
241
+ const curParent = visit.parentNode;
242
+ const startNode = branchEnd(
243
+ currentBranchId,
244
+ visit
245
+ ).___startNode;
246
+ if (curParent !== startNode.parentNode) {
247
+ curParent.prepend(startNode);
248
+ }
226
249
  currentBranchId = branchStack.pop();
227
- }
228
- if (currentBranchId) {
229
- branchStack.push(currentBranchId);
230
- parentBranchIds.set(scopeId, currentBranchId);
231
- }
232
- currentBranchId = scopeId;
233
- scope.___startNode = visit;
234
- } else if (token === "]" /* BranchEnd */) {
235
- scope[data2] = visit;
236
- const curParent = visit.parentNode;
237
- const startNode = branchEnd(
238
- currentBranchId,
239
- visit
240
- ).___startNode;
241
- if (curParent !== startNode.parentNode) {
242
- curParent.prepend(startNode);
243
- }
244
- currentBranchId = branchStack.pop();
245
- } else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
246
- let next = data2.indexOf(" ");
247
- let curNode = visit;
248
- scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
249
- while (~next) {
250
- const start = next + 1;
251
- next = data2.indexOf(" ", start);
252
- const childScopeId = +data2.slice(
253
- start,
254
- ~next ? next : data2.length
255
- );
256
- curNode = branchEnd(childScopeId, curNode).___endNode;
257
- parentBranchIds.set(childScopeId, scopeId);
250
+ } else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
251
+ let next = data2.indexOf(" ");
252
+ let curNode = visit;
253
+ scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
254
+ while (~next) {
255
+ const start = next + 1;
256
+ next = data2.indexOf(" ", start);
257
+ const childScopeId = +data2.slice(
258
+ start,
259
+ ~next ? next : data2.length
260
+ );
261
+ curNode = branchEnd(childScopeId, curNode).___endNode;
262
+ parentBranchIds.set(childScopeId, scopeId);
263
+ }
258
264
  }
259
265
  }
260
266
  }
@@ -286,19 +292,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
286
292
  prevScope
287
293
  );
288
294
  }
289
- const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
290
- if (parentBranchId) {
291
- scope.___closestBranch = scopeLookup[parentBranchId];
292
- }
293
- if (branchIds.has(scopeId)) {
294
- const branch = scope;
295
- const parentBranch = branch.___closestBranch;
296
- scope.___closestBranch = branch;
297
- if (parentBranch) {
298
- branch.___parentBranch = parentBranch;
299
- (parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
300
- branch
301
- );
295
+ if (branchesEnabled) {
296
+ const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
297
+ if (parentBranchId) {
298
+ scope.___closestBranch = scopeLookup[parentBranchId];
299
+ }
300
+ if (branchIds.has(scopeId)) {
301
+ const branch = scope;
302
+ const parentBranch = branch.___closestBranch;
303
+ scope.___closestBranch = branch;
304
+ if (parentBranch) {
305
+ branch.___parentBranch = parentBranch;
306
+ (parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
307
+ branch
308
+ );
309
+ }
302
310
  }
303
311
  }
304
312
  if (true) {
@@ -1675,6 +1683,7 @@ function renderCatch(scope, error) {
1675
1683
  }
1676
1684
  function conditional(nodeAccessor, ...branches) {
1677
1685
  const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1686
+ enableBranches();
1678
1687
  return (scope, newBranch) => {
1679
1688
  if (newBranch !== scope[branchAccessor]) {
1680
1689
  setConditionalRenderer(
@@ -1692,6 +1701,7 @@ function patchDynamicTag(fn) {
1692
1701
  var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1693
1702
  const childScopeAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
1694
1703
  const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1704
+ enableBranches();
1695
1705
  return (scope, newRenderer, getInput) => {
1696
1706
  const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
1697
1707
  if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.___id || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
@@ -1811,6 +1821,7 @@ function loopTo(nodeAccessor, renderer) {
1811
1821
  }
1812
1822
  function loop(nodeAccessor, renderer, forEach) {
1813
1823
  const params = renderer.___params;
1824
+ enableBranches();
1814
1825
  return (scope, value2) => {
1815
1826
  const referenceNode = scope[nodeAccessor];
1816
1827
  const oldMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor];
@@ -1977,6 +1988,7 @@ var runRender = (render) => render.___signal(render.___scope, render.___value);
1977
1988
  var enableCatch = () => {
1978
1989
  enableCatch = () => {
1979
1990
  };
1991
+ enableBranches();
1980
1992
  const handlePendingTry = (fn, scope, branch) => {
1981
1993
  while (branch) {
1982
1994
  if (branch.___pendingAsyncCount) {
@@ -1790,7 +1790,7 @@ var branchIdKey = Symbol();
1790
1790
  function withBranchId(branchId, cb) {
1791
1791
  return withContext(branchIdKey, branchId, cb);
1792
1792
  }
1793
- function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
1793
+ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1794
1794
  const resumeBranch = serializeBranch !== 0;
1795
1795
  const resumeMarker = serializeMarker !== 0;
1796
1796
  if (resumeBranch) {
@@ -1818,16 +1818,18 @@ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serialize
1818
1818
  } else {
1819
1819
  forOf(list, cb);
1820
1820
  }
1821
- if (resumeMarker) {
1822
- $chunk.writeHTML(
1823
- $chunk.boundary.state.mark(
1824
- "]" /* BranchEnd */,
1825
- scopeId + " " + accessor
1826
- )
1827
- );
1828
- }
1821
+ writeBranchEnd(
1822
+ scopeId,
1823
+ accessor,
1824
+ resumeMarker,
1825
+ parentEndTag,
1826
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1827
+ "]" /* BranchEnd */,
1828
+ scopeId + " " + accessor
1829
+ )
1830
+ );
1829
1831
  }
1830
- function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
1832
+ function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1831
1833
  const resumeBranch = serializeBranch !== 0;
1832
1834
  const resumeMarker = serializeMarker !== 0;
1833
1835
  let branchIds = "";
@@ -1851,16 +1853,18 @@ function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch,
1851
1853
  } else {
1852
1854
  forOf(list, cb);
1853
1855
  }
1854
- if (resumeMarker) {
1855
- $chunk.writeHTML(
1856
- $chunk.boundary.state.mark(
1857
- onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1858
- scopeId + " " + accessor + branchIds
1859
- )
1860
- );
1861
- }
1856
+ writeBranchEnd(
1857
+ scopeId,
1858
+ accessor,
1859
+ resumeMarker,
1860
+ parentEndTag,
1861
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1862
+ parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1863
+ scopeId + " " + accessor + branchIds
1864
+ )
1865
+ );
1862
1866
  }
1863
- function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
1867
+ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1864
1868
  const resumeBranch = serializeBranch !== 0;
1865
1869
  const resumeMarker = serializeMarker !== 0;
1866
1870
  if (resumeBranch) {
@@ -1887,16 +1891,18 @@ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeM
1887
1891
  } else {
1888
1892
  forIn(obj, cb);
1889
1893
  }
1890
- if (resumeMarker) {
1891
- $chunk.writeHTML(
1892
- $chunk.boundary.state.mark(
1893
- "]" /* BranchEnd */,
1894
- scopeId + " " + accessor
1895
- )
1896
- );
1897
- }
1894
+ writeBranchEnd(
1895
+ scopeId,
1896
+ accessor,
1897
+ resumeMarker,
1898
+ parentEndTag,
1899
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1900
+ "]" /* BranchEnd */,
1901
+ scopeId + " " + accessor
1902
+ )
1903
+ );
1898
1904
  }
1899
- function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
1905
+ function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1900
1906
  const resumeBranch = serializeBranch !== 0;
1901
1907
  const resumeMarker = serializeMarker !== 0;
1902
1908
  let branchIds = "";
@@ -1920,16 +1926,18 @@ function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch,
1920
1926
  } else {
1921
1927
  forIn(obj, cb);
1922
1928
  }
1923
- if (resumeMarker) {
1924
- $chunk.writeHTML(
1925
- $chunk.boundary.state.mark(
1926
- onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1927
- scopeId + " " + accessor + branchIds
1928
- )
1929
- );
1930
- }
1929
+ writeBranchEnd(
1930
+ scopeId,
1931
+ accessor,
1932
+ resumeMarker,
1933
+ parentEndTag,
1934
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1935
+ parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1936
+ scopeId + " " + accessor + branchIds
1937
+ )
1938
+ );
1931
1939
  }
1932
- function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
1940
+ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1933
1941
  const resumeBranch = serializeBranch !== 0;
1934
1942
  const resumeMarker = serializeMarker !== 0;
1935
1943
  if (resumeBranch) {
@@ -1956,16 +1964,18 @@ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1956
1964
  } else {
1957
1965
  forTo(to, from, step, cb);
1958
1966
  }
1959
- if (resumeMarker) {
1960
- $chunk.writeHTML(
1961
- $chunk.boundary.state.mark(
1962
- "]" /* BranchEnd */,
1963
- scopeId + " " + accessor
1964
- )
1965
- );
1966
- }
1967
+ writeBranchEnd(
1968
+ scopeId,
1969
+ accessor,
1970
+ resumeMarker,
1971
+ parentEndTag,
1972
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1973
+ "]" /* BranchEnd */,
1974
+ scopeId + " " + accessor
1975
+ )
1976
+ );
1967
1977
  }
1968
- function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
1978
+ function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1969
1979
  const resumeBranch = serializeBranch !== 0;
1970
1980
  const resumeMarker = serializeMarker !== 0;
1971
1981
  let branchIds = "";
@@ -1989,16 +1999,18 @@ function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serial
1989
1999
  } else {
1990
2000
  forTo(to, from, step, cb);
1991
2001
  }
1992
- if (resumeMarker) {
1993
- $chunk.writeHTML(
1994
- $chunk.boundary.state.mark(
1995
- onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1996
- scopeId + " " + accessor + branchIds
1997
- )
1998
- );
1999
- }
2002
+ writeBranchEnd(
2003
+ scopeId,
2004
+ accessor,
2005
+ resumeMarker,
2006
+ parentEndTag,
2007
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
2008
+ parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
2009
+ scopeId + " " + accessor + branchIds
2010
+ )
2011
+ );
2000
2012
  }
2001
- function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker) {
2013
+ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
2002
2014
  const resumeBranch = serializeBranch !== 0;
2003
2015
  const resumeMarker = serializeMarker !== 0;
2004
2016
  const branchId = peekNextScopeId();
@@ -2015,16 +2027,18 @@ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMark
2015
2027
  ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
2016
2028
  });
2017
2029
  }
2018
- if (resumeMarker) {
2019
- $chunk.writeHTML(
2020
- $chunk.boundary.state.mark(
2021
- "]" /* BranchEnd */,
2022
- scopeId + " " + accessor
2023
- )
2024
- );
2025
- }
2030
+ writeBranchEnd(
2031
+ scopeId,
2032
+ accessor,
2033
+ resumeMarker,
2034
+ parentEndTag,
2035
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
2036
+ "]" /* BranchEnd */,
2037
+ scopeId + " " + accessor
2038
+ )
2039
+ );
2026
2040
  }
2027
- function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
2041
+ function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
2028
2042
  const resumeBranch = serializeBranch !== 0;
2029
2043
  const resumeMarker = serializeMarker !== 0;
2030
2044
  const branchId = peekNextScopeId();
@@ -2036,13 +2050,27 @@ function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, ser
2036
2050
  ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
2037
2051
  });
2038
2052
  }
2053
+ writeBranchEnd(
2054
+ scopeId,
2055
+ accessor,
2056
+ resumeMarker,
2057
+ parentEndTag,
2058
+ resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
2059
+ parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
2060
+ scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
2061
+ )
2062
+ );
2063
+ }
2064
+ function writeBranchEnd(scopeId, accessor, resumeMarker, parentEndTag, mark) {
2065
+ const endTag = parentEndTag || "";
2039
2066
  if (resumeMarker) {
2040
- $chunk.writeHTML(
2041
- $chunk.boundary.state.mark(
2042
- onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
2043
- scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
2044
- )
2045
- );
2067
+ if (mark) {
2068
+ $chunk.writeHTML(mark + endTag);
2069
+ } else {
2070
+ $chunk.writeHTML(endTag + markResumeNode(scopeId, accessor));
2071
+ }
2072
+ } else {
2073
+ $chunk.writeHTML(endTag);
2046
2074
  }
2047
2075
  }
2048
2076
  var writeScope = (scopeId, partialScope) => {