marko 6.0.67 → 6.0.68

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.
@@ -1836,12 +1836,11 @@ function isInResumedBranch() {
1836
1836
  function withBranchId(branchId, cb) {
1837
1837
  return withContext(branchIdKey, branchId, cb);
1838
1838
  }
1839
- function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1839
+ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1840
1840
  const { state } = $chunk.boundary;
1841
- const resumeBranch = serializeBranch !== 0;
1842
1841
  const resumeMarker = serializeMarker !== 0;
1843
1842
  let flushBranchIds = "";
1844
- if (resumeBranch) {
1843
+ if (serializeBranch !== 0) {
1845
1844
  const loopScopes = /* @__PURE__ */ new Map();
1846
1845
  forOf(list, (item, index) => {
1847
1846
  const branchId = _peek_scope_id();
@@ -1871,19 +1870,18 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
1871
1870
  writeBranchEnd(
1872
1871
  scopeId,
1873
1872
  accessor,
1874
- resumeBranch,
1873
+ serializeStateful,
1875
1874
  resumeMarker,
1876
1875
  parentEndTag,
1877
1876
  singleNode,
1878
1877
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1879
1878
  );
1880
1879
  }
1881
- function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1880
+ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1882
1881
  const { state } = $chunk.boundary;
1883
- const resumeBranch = serializeBranch !== 0;
1884
1882
  const resumeMarker = serializeMarker !== 0;
1885
1883
  let flushBranchIds = "";
1886
- if (resumeBranch) {
1884
+ if (serializeBranch !== 0) {
1887
1885
  const loopScopes = /* @__PURE__ */ new Map();
1888
1886
  forIn(obj, (key, value) => {
1889
1887
  const branchId = _peek_scope_id();
@@ -1913,19 +1911,18 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
1913
1911
  writeBranchEnd(
1914
1912
  scopeId,
1915
1913
  accessor,
1916
- resumeBranch,
1914
+ serializeStateful,
1917
1915
  resumeMarker,
1918
1916
  parentEndTag,
1919
1917
  singleNode,
1920
1918
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1921
1919
  );
1922
1920
  }
1923
- function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1921
+ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1924
1922
  const { state } = $chunk.boundary;
1925
- const resumeBranch = serializeBranch !== 0;
1926
1923
  const resumeMarker = serializeMarker !== 0;
1927
1924
  let flushBranchIds = "";
1928
- if (resumeBranch) {
1925
+ if (serializeBranch !== 0) {
1929
1926
  const loopScopes = /* @__PURE__ */ new Map();
1930
1927
  forTo(to, from, step, (i) => {
1931
1928
  const branchId = _peek_scope_id();
@@ -1955,19 +1952,18 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
1955
1952
  writeBranchEnd(
1956
1953
  scopeId,
1957
1954
  accessor,
1958
- resumeBranch,
1955
+ serializeStateful,
1959
1956
  resumeMarker,
1960
1957
  parentEndTag,
1961
1958
  singleNode,
1962
1959
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1963
1960
  );
1964
1961
  }
1965
- function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1962
+ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1966
1963
  const { state } = $chunk.boundary;
1967
- const resumeBranch = serializeBranch !== 0;
1968
1964
  const resumeMarker = serializeMarker !== 0;
1969
1965
  let flushBranchIds = "";
1970
- if (resumeBranch) {
1966
+ if (serializeBranch !== 0) {
1971
1967
  const loopScopes = /* @__PURE__ */ new Map();
1972
1968
  forUntil(to, from, step, (i) => {
1973
1969
  const branchId = _peek_scope_id();
@@ -1997,14 +1993,14 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1997
1993
  writeBranchEnd(
1998
1994
  scopeId,
1999
1995
  accessor,
2000
- resumeBranch,
1996
+ serializeStateful,
2001
1997
  resumeMarker,
2002
1998
  parentEndTag,
2003
1999
  singleNode,
2004
2000
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
2005
2001
  );
2006
2002
  }
2007
- function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
2003
+ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
2008
2004
  const { state } = $chunk.boundary;
2009
2005
  const resumeBranch = serializeBranch !== 0;
2010
2006
  const resumeMarker = serializeMarker !== 0;
@@ -2023,17 +2019,17 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndT
2023
2019
  writeBranchEnd(
2024
2020
  scopeId,
2025
2021
  accessor,
2026
- resumeBranch,
2022
+ serializeStateful,
2027
2023
  resumeMarker,
2028
2024
  parentEndTag,
2029
2025
  singleNode,
2030
2026
  shouldWriteBranch ? " " + branchId : ""
2031
2027
  );
2032
2028
  }
2033
- function writeBranchEnd(scopeId, accessor, resumeBranch, resumeMarker, parentEndTag, singleNode, branchIds) {
2029
+ function writeBranchEnd(scopeId, accessor, serializeStateful, resumeMarker, parentEndTag, singleNode, branchIds) {
2034
2030
  const endTag = parentEndTag || "";
2035
2031
  if (resumeMarker) {
2036
- if (!parentEndTag || resumeBranch) {
2032
+ if (!parentEndTag || serializeStateful !== 0) {
2037
2033
  const { state } = $chunk.boundary;
2038
2034
  const mark = singleNode ? state.mark(
2039
2035
  parentEndTag ? "}" /* BranchEndSingleNodeOnlyChildInParent */ : "|" /* BranchEndSingleNode */,
@@ -1750,12 +1750,11 @@ function isInResumedBranch() {
1750
1750
  function withBranchId(branchId, cb) {
1751
1751
  return withContext(branchIdKey, branchId, cb);
1752
1752
  }
1753
- function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1753
+ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1754
1754
  const { state } = $chunk.boundary;
1755
- const resumeBranch = serializeBranch !== 0;
1756
1755
  const resumeMarker = serializeMarker !== 0;
1757
1756
  let flushBranchIds = "";
1758
- if (resumeBranch) {
1757
+ if (serializeBranch !== 0) {
1759
1758
  const loopScopes = /* @__PURE__ */ new Map();
1760
1759
  forOf(list, (item, index) => {
1761
1760
  const branchId = _peek_scope_id();
@@ -1785,19 +1784,18 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
1785
1784
  writeBranchEnd(
1786
1785
  scopeId,
1787
1786
  accessor,
1788
- resumeBranch,
1787
+ serializeStateful,
1789
1788
  resumeMarker,
1790
1789
  parentEndTag,
1791
1790
  singleNode,
1792
1791
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1793
1792
  );
1794
1793
  }
1795
- function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1794
+ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1796
1795
  const { state } = $chunk.boundary;
1797
- const resumeBranch = serializeBranch !== 0;
1798
1796
  const resumeMarker = serializeMarker !== 0;
1799
1797
  let flushBranchIds = "";
1800
- if (resumeBranch) {
1798
+ if (serializeBranch !== 0) {
1801
1799
  const loopScopes = /* @__PURE__ */ new Map();
1802
1800
  forIn(obj, (key, value) => {
1803
1801
  const branchId = _peek_scope_id();
@@ -1827,19 +1825,18 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
1827
1825
  writeBranchEnd(
1828
1826
  scopeId,
1829
1827
  accessor,
1830
- resumeBranch,
1828
+ serializeStateful,
1831
1829
  resumeMarker,
1832
1830
  parentEndTag,
1833
1831
  singleNode,
1834
1832
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1835
1833
  );
1836
1834
  }
1837
- function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1835
+ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1838
1836
  const { state } = $chunk.boundary;
1839
- const resumeBranch = serializeBranch !== 0;
1840
1837
  const resumeMarker = serializeMarker !== 0;
1841
1838
  let flushBranchIds = "";
1842
- if (resumeBranch) {
1839
+ if (serializeBranch !== 0) {
1843
1840
  const loopScopes = /* @__PURE__ */ new Map();
1844
1841
  forTo(to, from, step, (i) => {
1845
1842
  const branchId = _peek_scope_id();
@@ -1869,19 +1866,18 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
1869
1866
  writeBranchEnd(
1870
1867
  scopeId,
1871
1868
  accessor,
1872
- resumeBranch,
1869
+ serializeStateful,
1873
1870
  resumeMarker,
1874
1871
  parentEndTag,
1875
1872
  singleNode,
1876
1873
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1877
1874
  );
1878
1875
  }
1879
- function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1876
+ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1880
1877
  const { state } = $chunk.boundary;
1881
- const resumeBranch = serializeBranch !== 0;
1882
1878
  const resumeMarker = serializeMarker !== 0;
1883
1879
  let flushBranchIds = "";
1884
- if (resumeBranch) {
1880
+ if (serializeBranch !== 0) {
1885
1881
  const loopScopes = /* @__PURE__ */ new Map();
1886
1882
  forUntil(to, from, step, (i) => {
1887
1883
  const branchId = _peek_scope_id();
@@ -1911,14 +1907,14 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1911
1907
  writeBranchEnd(
1912
1908
  scopeId,
1913
1909
  accessor,
1914
- resumeBranch,
1910
+ serializeStateful,
1915
1911
  resumeMarker,
1916
1912
  parentEndTag,
1917
1913
  singleNode,
1918
1914
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1919
1915
  );
1920
1916
  }
1921
- function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1917
+ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1922
1918
  const { state } = $chunk.boundary;
1923
1919
  const resumeBranch = serializeBranch !== 0;
1924
1920
  const resumeMarker = serializeMarker !== 0;
@@ -1937,17 +1933,17 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndT
1937
1933
  writeBranchEnd(
1938
1934
  scopeId,
1939
1935
  accessor,
1940
- resumeBranch,
1936
+ serializeStateful,
1941
1937
  resumeMarker,
1942
1938
  parentEndTag,
1943
1939
  singleNode,
1944
1940
  shouldWriteBranch ? " " + branchId : ""
1945
1941
  );
1946
1942
  }
1947
- function writeBranchEnd(scopeId, accessor, resumeBranch, resumeMarker, parentEndTag, singleNode, branchIds) {
1943
+ function writeBranchEnd(scopeId, accessor, serializeStateful, resumeMarker, parentEndTag, singleNode, branchIds) {
1948
1944
  const endTag = parentEndTag || "";
1949
1945
  if (resumeMarker) {
1950
- if (!parentEndTag || resumeBranch) {
1946
+ if (!parentEndTag || serializeStateful !== 0) {
1951
1947
  const { state } = $chunk.boundary;
1952
1948
  const mark = singleNode ? state.mark(
1953
1949
  parentEndTag ? "}" /* BranchEndSingleNodeOnlyChildInParent */ : "|" /* BranchEndSingleNode */,
@@ -39,11 +39,11 @@ export declare function _hoist(scopeId: number, id?: string): {
39
39
  export declare function _resume_branch(scopeId: number): void;
40
40
  export declare function isInResumedBranch(): boolean;
41
41
  export declare function withBranchId<T>(branchId: number, cb: () => T): T;
42
- export declare function _for_of(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
43
- export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
44
- export declare function _for_to(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
45
- export declare function _for_until(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
46
- export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
42
+ export declare function _for_of(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
43
+ export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
44
+ export declare function _for_to(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
45
+ export declare function _for_until(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
46
+ export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
47
47
  declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
48
48
  export declare function writeScopeToState(state: State, scopeId: number, partialScope: PartialScope): ScopeInternals;
49
49
  export { writeScope as _scope };
package/dist/html.js CHANGED
@@ -1195,9 +1195,9 @@ function isInResumedBranch() {
1195
1195
  function withBranchId(branchId, cb) {
1196
1196
  return withContext(branchIdKey, branchId, cb);
1197
1197
  }
1198
- function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1199
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1200
- if (resumeBranch) {
1198
+ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1199
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1200
+ if (serializeBranch !== 0) {
1201
1201
  let loopScopes = /* @__PURE__ */ new Map();
1202
1202
  forOf(list, (item, index) => {
1203
1203
  let branchId = _peek_scope_id();
@@ -1214,16 +1214,16 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
1214
1214
  writeBranchEnd(
1215
1215
  scopeId,
1216
1216
  accessor,
1217
- resumeBranch,
1217
+ serializeStateful,
1218
1218
  resumeMarker,
1219
1219
  parentEndTag,
1220
1220
  singleNode,
1221
1221
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1222
1222
  );
1223
1223
  }
1224
- function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1225
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1226
- if (resumeBranch) {
1224
+ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1225
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1226
+ if (serializeBranch !== 0) {
1227
1227
  let loopScopes = /* @__PURE__ */ new Map();
1228
1228
  forIn(obj, (key, value) => {
1229
1229
  let branchId = _peek_scope_id();
@@ -1240,16 +1240,16 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
1240
1240
  writeBranchEnd(
1241
1241
  scopeId,
1242
1242
  accessor,
1243
- resumeBranch,
1243
+ serializeStateful,
1244
1244
  resumeMarker,
1245
1245
  parentEndTag,
1246
1246
  singleNode,
1247
1247
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1248
1248
  );
1249
1249
  }
1250
- function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1251
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1252
- if (resumeBranch) {
1250
+ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1251
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1252
+ if (serializeBranch !== 0) {
1253
1253
  let loopScopes = /* @__PURE__ */ new Map();
1254
1254
  forTo(to, from, step, (i) => {
1255
1255
  let branchId = _peek_scope_id();
@@ -1266,16 +1266,16 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
1266
1266
  writeBranchEnd(
1267
1267
  scopeId,
1268
1268
  accessor,
1269
- resumeBranch,
1269
+ serializeStateful,
1270
1270
  resumeMarker,
1271
1271
  parentEndTag,
1272
1272
  singleNode,
1273
1273
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1274
1274
  );
1275
1275
  }
1276
- function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1277
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1278
- if (resumeBranch) {
1276
+ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1277
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1278
+ if (serializeBranch !== 0) {
1279
1279
  let loopScopes = /* @__PURE__ */ new Map();
1280
1280
  forUntil(to, from, step, (i) => {
1281
1281
  let branchId = _peek_scope_id();
@@ -1292,14 +1292,14 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1292
1292
  writeBranchEnd(
1293
1293
  scopeId,
1294
1294
  accessor,
1295
- resumeBranch,
1295
+ serializeStateful,
1296
1296
  resumeMarker,
1297
1297
  parentEndTag,
1298
1298
  singleNode,
1299
1299
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1300
1300
  );
1301
1301
  }
1302
- function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1302
+ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1303
1303
  let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = _peek_scope_id();
1304
1304
  resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, ""));
1305
1305
  let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
@@ -1309,17 +1309,17 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndT
1309
1309
  }), writeBranchEnd(
1310
1310
  scopeId,
1311
1311
  accessor,
1312
- resumeBranch,
1312
+ serializeStateful,
1313
1313
  resumeMarker,
1314
1314
  parentEndTag,
1315
1315
  singleNode,
1316
1316
  shouldWriteBranch ? " " + branchId : ""
1317
1317
  );
1318
1318
  }
1319
- function writeBranchEnd(scopeId, accessor, resumeBranch, resumeMarker, parentEndTag, singleNode, branchIds) {
1319
+ function writeBranchEnd(scopeId, accessor, serializeStateful, resumeMarker, parentEndTag, singleNode, branchIds) {
1320
1320
  let endTag = parentEndTag || "";
1321
1321
  if (resumeMarker)
1322
- if (!parentEndTag || resumeBranch) {
1322
+ if (!parentEndTag || serializeStateful !== 0) {
1323
1323
  let { state } = $chunk.boundary, mark = singleNode ? state.mark(
1324
1324
  parentEndTag ? "}" /* BranchEndSingleNodeOnlyChildInParent */ : "|" /* BranchEndSingleNode */,
1325
1325
  scopeId + " " + accessor + (branchIds || "")
package/dist/html.mjs CHANGED
@@ -1112,9 +1112,9 @@ function isInResumedBranch() {
1112
1112
  function withBranchId(branchId, cb) {
1113
1113
  return withContext(branchIdKey, branchId, cb);
1114
1114
  }
1115
- function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1116
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1117
- if (resumeBranch) {
1115
+ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1116
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1117
+ if (serializeBranch !== 0) {
1118
1118
  let loopScopes = /* @__PURE__ */ new Map();
1119
1119
  forOf(list, (item, index) => {
1120
1120
  let branchId = _peek_scope_id();
@@ -1131,16 +1131,16 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
1131
1131
  writeBranchEnd(
1132
1132
  scopeId,
1133
1133
  accessor,
1134
- resumeBranch,
1134
+ serializeStateful,
1135
1135
  resumeMarker,
1136
1136
  parentEndTag,
1137
1137
  singleNode,
1138
1138
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1139
1139
  );
1140
1140
  }
1141
- function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1142
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1143
- if (resumeBranch) {
1141
+ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1142
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1143
+ if (serializeBranch !== 0) {
1144
1144
  let loopScopes = /* @__PURE__ */ new Map();
1145
1145
  forIn(obj, (key, value) => {
1146
1146
  let branchId = _peek_scope_id();
@@ -1157,16 +1157,16 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
1157
1157
  writeBranchEnd(
1158
1158
  scopeId,
1159
1159
  accessor,
1160
- resumeBranch,
1160
+ serializeStateful,
1161
1161
  resumeMarker,
1162
1162
  parentEndTag,
1163
1163
  singleNode,
1164
1164
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1165
1165
  );
1166
1166
  }
1167
- function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1168
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1169
- if (resumeBranch) {
1167
+ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1168
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1169
+ if (serializeBranch !== 0) {
1170
1170
  let loopScopes = /* @__PURE__ */ new Map();
1171
1171
  forTo(to, from, step, (i) => {
1172
1172
  let branchId = _peek_scope_id();
@@ -1183,16 +1183,16 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
1183
1183
  writeBranchEnd(
1184
1184
  scopeId,
1185
1185
  accessor,
1186
- resumeBranch,
1186
+ serializeStateful,
1187
1187
  resumeMarker,
1188
1188
  parentEndTag,
1189
1189
  singleNode,
1190
1190
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1191
1191
  );
1192
1192
  }
1193
- function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1194
- let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1195
- if (resumeBranch) {
1193
+ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1194
+ let { state } = $chunk.boundary, resumeMarker = serializeMarker !== 0, flushBranchIds = "";
1195
+ if (serializeBranch !== 0) {
1196
1196
  let loopScopes = /* @__PURE__ */ new Map();
1197
1197
  forUntil(to, from, step, (i) => {
1198
1198
  let branchId = _peek_scope_id();
@@ -1209,14 +1209,14 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1209
1209
  writeBranchEnd(
1210
1210
  scopeId,
1211
1211
  accessor,
1212
- resumeBranch,
1212
+ serializeStateful,
1213
1213
  resumeMarker,
1214
1214
  parentEndTag,
1215
1215
  singleNode,
1216
1216
  singleNode ? flushBranchIds : flushBranchIds ? " " + flushBranchIds : ""
1217
1217
  );
1218
1218
  }
1219
- function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1219
+ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
1220
1220
  let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = _peek_scope_id();
1221
1221
  resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, ""));
1222
1222
  let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
@@ -1226,17 +1226,17 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndT
1226
1226
  }), writeBranchEnd(
1227
1227
  scopeId,
1228
1228
  accessor,
1229
- resumeBranch,
1229
+ serializeStateful,
1230
1230
  resumeMarker,
1231
1231
  parentEndTag,
1232
1232
  singleNode,
1233
1233
  shouldWriteBranch ? " " + branchId : ""
1234
1234
  );
1235
1235
  }
1236
- function writeBranchEnd(scopeId, accessor, resumeBranch, resumeMarker, parentEndTag, singleNode, branchIds) {
1236
+ function writeBranchEnd(scopeId, accessor, serializeStateful, resumeMarker, parentEndTag, singleNode, branchIds) {
1237
1237
  let endTag = parentEndTag || "";
1238
1238
  if (resumeMarker)
1239
- if (!parentEndTag || resumeBranch) {
1239
+ if (!parentEndTag || serializeStateful !== 0) {
1240
1240
  let { state } = $chunk.boundary, mark = singleNode ? state.mark(
1241
1241
  parentEndTag ? "}" /* BranchEndSingleNodeOnlyChildInParent */ : "|" /* BranchEndSingleNode */,
1242
1242
  scopeId + " " + accessor + (branchIds || "")
@@ -4172,7 +4172,8 @@ function replaceAssignedNode(node) {
4172
4172
  switch (node.type) {
4173
4173
  case "ExpressionStatement": {
4174
4174
  if (node.expression.type === "SequenceExpression" && updateExpressions.delete(node.expression)) {
4175
- return node.expression.expressions[0];
4175
+ node.expression = node.expression.expressions[0];
4176
+ return node;
4176
4177
  }
4177
4178
  break;
4178
4179
  }
@@ -7259,6 +7260,7 @@ function getOptimizedOnlyChildNodeBinding(tag, section, branchSize = 1) {
7259
7260
  }
7260
7261
 
7261
7262
  // src/translator/core/for.ts
7263
+ var kStatefulReason = Symbol("<for> stateful reason");
7262
7264
  var for_default = {
7263
7265
  analyze(tag) {
7264
7266
  const tagSection = getOrCreateSection(tag);
@@ -7306,6 +7308,7 @@ var for_default = {
7306
7308
  tag.node,
7307
7309
  getAllTagReferenceNodes(tag.node)
7308
7310
  );
7311
+ addSectionSerializeReasonExpr(tagSection, tagExtra, kStatefulReason);
7309
7312
  if (paramsBinding) {
7310
7313
  setBindingDownstream(paramsBinding, tagExtra);
7311
7314
  }
@@ -7364,16 +7367,21 @@ var for_default = {
7364
7367
  );
7365
7368
  if (branchSerializeReason) {
7366
7369
  const skipParentEnd = onlyChildParentTagName && markerSerializeReason;
7370
+ const statefulSerializeArg = getSerializeGuard(
7371
+ getSectionSerializeReason(tagSection, kStatefulReason),
7372
+ !(skipParentEnd || singleNodeOptimization)
7373
+ );
7367
7374
  const markerSerializeArg = getSerializeGuard(
7368
7375
  markerSerializeReason,
7369
- !(skipParentEnd || singleNodeOptimization)
7376
+ !statefulSerializeArg
7370
7377
  );
7371
7378
  forTagArgs.push(
7372
7379
  forAttrs.by || import_compiler34.types.numericLiteral(0),
7373
7380
  getScopeIdIdentifier(tagSection),
7374
7381
  getScopeAccessorLiteral(nodeBinding),
7375
7382
  getSerializeGuard(branchSerializeReason, !markerSerializeArg),
7376
- markerSerializeArg
7383
+ markerSerializeArg,
7384
+ statefulSerializeArg
7377
7385
  );
7378
7386
  if (skipParentEnd) {
7379
7387
  getParentTag(tag).node.extra[kSkipEndTag] = true;
@@ -9201,6 +9209,7 @@ function toFirstStatementOrBlock(body) {
9201
9209
  }
9202
9210
 
9203
9211
  // src/translator/core/if.ts
9212
+ var kStatefulReason2 = Symbol("<if> stateful reason");
9204
9213
  var BRANCHES_LOOKUP = /* @__PURE__ */ new WeakMap();
9205
9214
  var IfTag = {
9206
9215
  analyze(tag) {
@@ -9235,6 +9244,7 @@ var IfTag = {
9235
9244
  }
9236
9245
  mergeReferences(ifTagSection, ifTag.node, mergeReferenceNodes);
9237
9246
  ifTagExtra.singleNodeOptimization = singleNodeOptimization;
9247
+ addSectionSerializeReasonExpr(ifTagSection, ifTagExtra, kStatefulReason2);
9238
9248
  }
9239
9249
  },
9240
9250
  translate: translateByTarget({
@@ -9323,9 +9333,13 @@ var IfTag = {
9323
9333
  if (skipParentEnd) {
9324
9334
  getParentTag(ifTag).node.extra[kSkipEndTag] = true;
9325
9335
  }
9336
+ const statefulSerializeArg = getSerializeGuard(
9337
+ getSectionSerializeReason(ifTagSection, kStatefulReason2),
9338
+ !(skipParentEnd || singleNodeOptimization)
9339
+ );
9326
9340
  const markerSerializeArg = getSerializeGuard(
9327
9341
  markerSerializeReason,
9328
- !(skipParentEnd || singleNodeOptimization)
9342
+ !statefulSerializeArg
9329
9343
  );
9330
9344
  const cbNode = import_compiler43.types.arrowFunctionExpression(
9331
9345
  [],
@@ -9342,6 +9356,7 @@ var IfTag = {
9342
9356
  !markerSerializeArg
9343
9357
  ),
9344
9358
  markerSerializeArg,
9359
+ statefulSerializeArg,
9345
9360
  skipParentEnd ? import_compiler43.types.stringLiteral(`</${onlyChildParentTagName}>`) : singleNodeOptimization ? import_compiler43.types.numericLiteral(0) : void 0,
9346
9361
  singleNodeOptimization ? import_compiler43.types.numericLiteral(1) : void 0
9347
9362
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.67",
3
+ "version": "6.0.68",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",