octane 0.2.6 → 0.2.7

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.
@@ -243,6 +243,8 @@ __export(runtime_exports, {
243
243
  textHoleUpdate: () => textHoleUpdate,
244
244
  textSlot: () => textSlot,
245
245
  tryBlock: () => tryBlock,
246
+ updateFreshClassAttr: () => updateFreshClassAttr,
247
+ updateFreshClassName: () => updateFreshClassName,
246
248
  use: () => use,
247
249
  useActionState: () => useActionState,
248
250
  useBatch: () => useBatch,
@@ -1057,7 +1059,9 @@ function beginTransitionAttempt(block) {
1057
1059
  TRANSITION_JOURNAL ??= [];
1058
1060
  TRANSITION_JOURNAL_BAGS ??= /* @__PURE__ */ new Map();
1059
1061
  TRANSITION_JOURNAL_WINDOWS.push(TRANSITION_JOURNAL_CHECKPOINT);
1062
+ TRANSITION_JOURNAL_BAG_WINDOWS.push(TRANSITION_JOURNAL_BAG_WINDOW);
1060
1063
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL.length;
1064
+ TRANSITION_JOURNAL_BAG_WINDOW = ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW;
1061
1065
  TRANSITION_JOURNAL_DEPTH++;
1062
1066
  const capture = WIP_CAPTURE;
1063
1067
  const effects = capture?.effects ?? effectQueues;
@@ -1133,6 +1137,7 @@ function endTransitionAttempt(attempt) {
1133
1137
  if (!continuing) scheduleRender(attempt.origin);
1134
1138
  }
1135
1139
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL_WINDOWS.pop();
1140
+ TRANSITION_JOURNAL_BAG_WINDOW = TRANSITION_JOURNAL_BAG_WINDOWS.pop();
1136
1141
  if (--TRANSITION_JOURNAL_DEPTH === 0) {
1137
1142
  TRANSITION_JOURNAL = null;
1138
1143
  TRANSITION_JOURNAL_BAGS = null;
@@ -1228,7 +1233,7 @@ function keepsRootTransition(owner, includePromoted = false) {
1228
1233
  }
1229
1234
  function holdRootTransition(owner, transaction, attempt) {
1230
1235
  const previous = owner.transition;
1231
- if (attempt === null || !attempt.origin.mounted || attempt.origin.disposed || transaction.created?.has(attempt.origin) || attempt.heldSlots !== null && attempt.heldSlots.size !== 0) {
1236
+ if (attempt === null || !attempt.origin.mounted || attempt.origin.disposed || isCreatedInRootRender(transaction, attempt.origin) || attempt.heldSlots !== null && attempt.heldSlots.size !== 0) {
1232
1237
  if (previous !== void 0 && !rootTransitionCellsIntact(previous))
1233
1238
  discardRootTransition(owner);
1234
1239
  return false;
@@ -1330,16 +1335,21 @@ const JOURNAL_TEXT = 0;
1330
1335
  const JOURNAL_ATTR = 1;
1331
1336
  const JOURNAL_BAG = 2;
1332
1337
  const JOURNAL_PROP = 3;
1338
+ const JOURNAL_CREATED = 4;
1333
1339
  const JOURNAL_RENDER = 5;
1334
1340
  const JOURNAL_UNDO = 6;
1335
1341
  let TRANSITION_JOURNAL = null;
1336
1342
  let TRANSITION_JOURNAL_BAGS = null;
1337
1343
  let TRANSITION_JOURNAL_CHECKPOINT = 0;
1338
1344
  const TRANSITION_JOURNAL_WINDOWS = [];
1345
+ let TRANSITION_JOURNAL_BAG_WINDOW = 0;
1346
+ let NEXT_TRANSITION_JOURNAL_BAG_WINDOW = 0;
1347
+ const TRANSITION_JOURNAL_BAG_WINDOWS = [];
1339
1348
  let TRANSITION_JOURNAL_DEPTH = 0;
1340
1349
  let ROOT_RENDER_TRANSACTION = null;
1341
1350
  let ROOT_RENDER_TRANSACTIONS = [];
1342
1351
  let ROOT_RENDER_ROLLBACK = false;
1352
+ let NEXT_ROOT_RENDER_CREATED_STAMP = 0;
1343
1353
  function getRootRenderRetryKey(scope, retryOnly = false) {
1344
1354
  const owner = scope.block.idState.renderOwner;
1345
1355
  if (owner === void 0 || owner.disposed || retryOnly && !owner.transaction?.rootRequest)
@@ -1360,6 +1370,8 @@ function beginRootRender(owner) {
1360
1370
  bags: /* @__PURE__ */ new Map(),
1361
1371
  capture,
1362
1372
  created: null,
1373
+ createdStamp: ++NEXT_ROOT_RENDER_CREATED_STAMP,
1374
+ bagWindow: ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW,
1363
1375
  retainedCreated: null,
1364
1376
  retired: null,
1365
1377
  structures: null,
@@ -1377,6 +1389,7 @@ function beginRootRender(owner) {
1377
1389
  log: TRANSITION_JOURNAL,
1378
1390
  bags: TRANSITION_JOURNAL_BAGS,
1379
1391
  checkpoint: TRANSITION_JOURNAL_CHECKPOINT,
1392
+ bagWindow: TRANSITION_JOURNAL_BAG_WINDOW,
1380
1393
  depth: TRANSITION_JOURNAL_DEPTH,
1381
1394
  parked: PARKED_ITEMS,
1382
1395
  capture: WIP_CAPTURE
@@ -1385,6 +1398,7 @@ function beginRootRender(owner) {
1385
1398
  TRANSITION_JOURNAL = transaction.log;
1386
1399
  TRANSITION_JOURNAL_BAGS = transaction.bags;
1387
1400
  TRANSITION_JOURNAL_CHECKPOINT = 0;
1401
+ TRANSITION_JOURNAL_BAG_WINDOW = transaction.bagWindow;
1388
1402
  TRANSITION_JOURNAL_DEPTH = 1;
1389
1403
  PARKED_ITEMS = transaction.parked;
1390
1404
  WIP_CAPTURE = transaction.capture;
@@ -1397,6 +1411,7 @@ function endRootRender(frame) {
1397
1411
  TRANSITION_JOURNAL = frame.log;
1398
1412
  TRANSITION_JOURNAL_BAGS = frame.bags;
1399
1413
  TRANSITION_JOURNAL_CHECKPOINT = frame.checkpoint;
1414
+ TRANSITION_JOURNAL_BAG_WINDOW = frame.bagWindow;
1400
1415
  TRANSITION_JOURNAL_DEPTH = frame.depth;
1401
1416
  PARKED_ITEMS = frame.parked;
1402
1417
  WIP_CAPTURE = frame.capture;
@@ -1404,9 +1419,9 @@ function endRootRender(frame) {
1404
1419
  function journalUndo(undo) {
1405
1420
  TRANSITION_JOURNAL.push(JOURNAL_UNDO, undo, null, null);
1406
1421
  }
1407
- function journalRootProperty(target, key) {
1422
+ function journalRootProperty(target, key, oldValue) {
1408
1423
  if (ROOT_RENDER_TRANSACTION === null || ROOT_RENDER_ROLLBACK) return;
1409
- TRANSITION_JOURNAL.push(JOURNAL_PROP, target, key, target[key]);
1424
+ TRANSITION_JOURNAL.push(JOURNAL_PROP, target, key, oldValue);
1410
1425
  }
1411
1426
  function journalRootSlot(state, parent, before, after) {
1412
1427
  const transaction = ROOT_RENDER_TRANSACTION;
@@ -1474,7 +1489,7 @@ function retireRootBlock(block) {
1474
1489
  });
1475
1490
  }
1476
1491
  if (block.pending) {
1477
- journalRootProperty(block, "pending");
1492
+ journalRootProperty(block, "pending", block.pending);
1478
1493
  block.pending = false;
1479
1494
  }
1480
1495
  }
@@ -1511,7 +1526,7 @@ function deferRootRange(parent, first, last, cleanup, finalize) {
1511
1526
  }
1512
1527
  function deferRootUnmount(block, detachDom) {
1513
1528
  const transaction = ROOT_RENDER_TRANSACTION;
1514
- if (transaction === null || transaction.aborted || ROOT_RENDER_ROLLBACK || block.idState.renderOwner !== transaction.owner || !block.mounted || transaction.created?.has(block))
1529
+ if (transaction === null || transaction.aborted || ROOT_RENDER_ROLLBACK || block.idState.renderOwner !== transaction.owner || !block.mounted || isCreatedInRootRender(transaction, block))
1515
1530
  return false;
1516
1531
  retireRootBlock(block);
1517
1532
  const start = block.startMarker;
@@ -1558,18 +1573,24 @@ function deferRootUnmount(block, detachDom) {
1558
1573
  if (detachDom && parent !== null) for (const node of nodes) parent.removeChild(node);
1559
1574
  return true;
1560
1575
  }
1576
+ function isCreatedInRootRender(transaction, block) {
1577
+ return block.createdStamp === transaction.createdStamp;
1578
+ }
1579
+ function undoCreatedInRootRender(block, transaction) {
1580
+ const refCheckpoint = refDetachQueue.length;
1581
+ unmountBlock(
1582
+ block,
1583
+ (!transaction.hydrating || block.kind === "portal") && !transaction.retainedCreated?.has(block)
1584
+ );
1585
+ refDetachQueue.length = refCheckpoint;
1586
+ }
1561
1587
  function createdInRootRender(block) {
1562
1588
  const transaction = ROOT_RENDER_TRANSACTION;
1563
- if (transaction === null || ROOT_RENDER_ROLLBACK || transaction.created?.has(block)) return;
1564
- (transaction.created ??= /* @__PURE__ */ new Set()).add(block);
1565
- journalUndo(() => {
1566
- const checkpoint = refDetachQueue.length;
1567
- unmountBlock(
1568
- block,
1569
- (!transaction.hydrating || block.kind === "portal") && !transaction.retainedCreated?.has(block)
1570
- );
1571
- refDetachQueue.length = checkpoint;
1572
- });
1589
+ if (transaction === null || ROOT_RENDER_ROLLBACK || isCreatedInRootRender(transaction, block))
1590
+ return;
1591
+ block.createdStamp = transaction.createdStamp;
1592
+ (transaction.created ??= []).push(block);
1593
+ TRANSITION_JOURNAL.push(JOURNAL_CREATED, block, transaction, null);
1573
1594
  }
1574
1595
  function preserveRootCreatedDom(block) {
1575
1596
  if (ROOT_RENDER_TRANSACTION !== null)
@@ -1587,6 +1608,8 @@ function rollbackRootRender(transaction) {
1587
1608
  else {
1588
1609
  for (let i = transaction.log.length - 4; i >= 0; i -= 4) {
1589
1610
  if (transaction.log[i] === JOURNAL_UNDO) transaction.log[i + 1]();
1611
+ else if (transaction.log[i] === JOURNAL_CREATED)
1612
+ undoCreatedInRootRender(transaction.log[i + 1], transaction.log[i + 2]);
1590
1613
  }
1591
1614
  transaction.log.length = 0;
1592
1615
  }
@@ -1663,7 +1686,7 @@ function suspendRootRender(block, wakeable, attempt) {
1663
1686
  if (TRANSITION_SWAP_DRIVER === null || !TRANSITION_SWAP_DRIVER.holdRoot(owner, transaction, attempt)) {
1664
1687
  if (WARM_EVER && transaction.created !== null) {
1665
1688
  for (const created of transaction.created) {
1666
- if (created.parentBlock === null || !transaction.created.has(created.parentBlock))
1689
+ if (created.parentBlock === null || !isCreatedInRootRender(transaction, created.parentBlock))
1667
1690
  retainDiscardedWarmMemos(created);
1668
1691
  }
1669
1692
  }
@@ -1685,11 +1708,116 @@ function suspendRootRender(block, wakeable, attempt) {
1685
1708
  wakeable.then(ping, ping);
1686
1709
  return true;
1687
1710
  }
1711
+ const BINDING_BAG_ARITY = /* @__PURE__ */ Symbol();
1712
+ function cloneBag0(bag) {
1713
+ return { ...bag };
1714
+ }
1715
+ function cloneBag1(bag) {
1716
+ return { ...bag };
1717
+ }
1718
+ function cloneBag2(bag) {
1719
+ return { ...bag };
1720
+ }
1721
+ function cloneBag3(bag) {
1722
+ return { ...bag };
1723
+ }
1724
+ function cloneBag4(bag) {
1725
+ return { ...bag };
1726
+ }
1727
+ function cloneBag5(bag) {
1728
+ return { ...bag };
1729
+ }
1730
+ function cloneBag6(bag) {
1731
+ return { ...bag };
1732
+ }
1733
+ function cloneBag7(bag) {
1734
+ return { ...bag };
1735
+ }
1736
+ function cloneBag8(bag) {
1737
+ return { ...bag };
1738
+ }
1739
+ function cloneBag9(bag) {
1740
+ return { ...bag };
1741
+ }
1742
+ function cloneBag10(bag) {
1743
+ return { ...bag };
1744
+ }
1745
+ function cloneBag11(bag) {
1746
+ return { ...bag };
1747
+ }
1748
+ function cloneBag12(bag) {
1749
+ return { ...bag };
1750
+ }
1751
+ function cloneBag13(bag) {
1752
+ return { ...bag };
1753
+ }
1754
+ function cloneBag14(bag) {
1755
+ return { ...bag };
1756
+ }
1757
+ function cloneBag15(bag) {
1758
+ return { ...bag };
1759
+ }
1760
+ function cloneBag16(bag) {
1761
+ return { ...bag };
1762
+ }
1763
+ function cloneBindingBag(bag, arity) {
1764
+ switch (arity) {
1765
+ case 0:
1766
+ return cloneBag0(bag);
1767
+ case 1:
1768
+ return cloneBag1(bag);
1769
+ case 2:
1770
+ return cloneBag2(bag);
1771
+ case 3:
1772
+ return cloneBag3(bag);
1773
+ case 4:
1774
+ return cloneBag4(bag);
1775
+ case 5:
1776
+ return cloneBag5(bag);
1777
+ case 6:
1778
+ return cloneBag6(bag);
1779
+ case 7:
1780
+ return cloneBag7(bag);
1781
+ case 8:
1782
+ return cloneBag8(bag);
1783
+ case 9:
1784
+ return cloneBag9(bag);
1785
+ case 10:
1786
+ return cloneBag10(bag);
1787
+ case 11:
1788
+ return cloneBag11(bag);
1789
+ case 12:
1790
+ return cloneBag12(bag);
1791
+ case 13:
1792
+ return cloneBag13(bag);
1793
+ case 14:
1794
+ return cloneBag14(bag);
1795
+ case 15:
1796
+ return cloneBag15(bag);
1797
+ case 16:
1798
+ return cloneBag16(bag);
1799
+ default:
1800
+ return { ...bag };
1801
+ }
1802
+ }
1688
1803
  function journalBag() {
1689
1804
  const scope = CURRENT_SCOPE;
1690
1805
  if (scope === null) return;
1806
+ const transaction = ROOT_RENDER_TRANSACTION;
1807
+ if (transaction !== null && !transaction.hydrating && transaction.retainedCreated === null && TRANSITION_JOURNAL_DEPTH === 1 && scope.block.createdStamp === transaction.createdStamp)
1808
+ return;
1691
1809
  const bag = scope.slots[0];
1692
- if (bag === null || typeof bag !== "object" || bag.__kind !== void 0) return;
1810
+ if (bag === null || typeof bag !== "object") return;
1811
+ const arity = bag[BINDING_BAG_ARITY];
1812
+ if (arity !== void 0) {
1813
+ const window2 = TRANSITION_JOURNAL_BAG_WINDOW;
1814
+ if (bag.__journalWindow === window2) return;
1815
+ const snapshot = cloneBindingBag(bag, arity);
1816
+ TRANSITION_JOURNAL.push(JOURNAL_BAG, bag, snapshot, null);
1817
+ bag.__journalWindow = window2;
1818
+ return;
1819
+ }
1820
+ if (bag.__kind !== void 0) return;
1693
1821
  journalObjectOnce(bag);
1694
1822
  }
1695
1823
  function journalObjectOnce(obj) {
@@ -1750,10 +1878,31 @@ function journalControlledOption(option, withDefault) {
1750
1878
  TRANSITION_JOURNAL.push(JOURNAL_PROP, option, "defaultSelected", option.defaultSelected);
1751
1879
  }
1752
1880
  let PARKED_ITEMS = null;
1753
- function parkItemForHold(block) {
1754
- const nodes = [];
1881
+ function retainedForSlotNodes(state, retained) {
1882
+ const parked = PARKED_ITEMS;
1883
+ if (parked !== null) {
1884
+ for (const item of parked) {
1885
+ const previous = item.block;
1886
+ if (previous.forSlot !== state && !(previous.exclusiveMarkers && previous.startMarker === state.start && previous.endMarker === state.end))
1887
+ continue;
1888
+ for (const node of item.nodes) (retained ??= /* @__PURE__ */ new Set()).add(node);
1889
+ }
1890
+ }
1891
+ const retired = ROOT_RENDER_TRANSACTION.retired;
1892
+ if (retired !== null) {
1893
+ for (const row of retired) {
1894
+ if (row.forSlot !== state) continue;
1895
+ const start = row.startMarker;
1896
+ if (start !== null && start === row.endMarker) (retained ??= /* @__PURE__ */ new Set()).add(start);
1897
+ }
1898
+ }
1899
+ return retained;
1900
+ }
1901
+ function parkItemForHold(block, owningList) {
1755
1902
  const retainConnected = ROOT_RENDER_TRANSACTION !== null && !ROOT_RENDER_ROLLBACK;
1756
1903
  if (retainConnected) retireRootBlock(block);
1904
+ const excluded = owningList !== void 0 && retainConnected ? retainedForSlotNodes(owningList, null) : null;
1905
+ const nodes = [];
1757
1906
  const start = block.startMarker;
1758
1907
  const end = block.endMarker;
1759
1908
  if (start && end) {
@@ -1762,11 +1911,22 @@ function parkItemForHold(block) {
1762
1911
  const exclusive = block.exclusiveMarkers;
1763
1912
  let n = exclusive ? start.nextSibling : start;
1764
1913
  const stop = exclusive ? end : end.nextSibling;
1765
- while (n !== null && n !== stop) {
1766
- const next = getNextSibling(n);
1767
- if (!retainConnected) parent.removeChild(n);
1768
- nodes.push(n);
1769
- n = next;
1914
+ if (excluded === null) {
1915
+ while (n !== null && n !== stop) {
1916
+ const next = getNextSibling(n);
1917
+ if (!retainConnected) parent.removeChild(n);
1918
+ nodes.push(n);
1919
+ n = next;
1920
+ }
1921
+ } else {
1922
+ while (n !== null && n !== stop) {
1923
+ const next = getNextSibling(n);
1924
+ if (!excluded.has(n)) {
1925
+ if (!retainConnected) parent.removeChild(n);
1926
+ nodes.push(n);
1927
+ }
1928
+ n = next;
1929
+ }
1770
1930
  }
1771
1931
  }
1772
1932
  }
@@ -1791,14 +1951,19 @@ function journalForSlot(state) {
1791
1951
  }
1792
1952
  const chain = [];
1793
1953
  for (let b = state.head; b !== null; b = b.nextSibling) {
1794
- chain.push([b, b.nextSibling, b.prevSibling]);
1954
+ chain.push(b);
1955
+ }
1956
+ let mapOrder = null;
1957
+ let index = 0;
1958
+ for (const block of state.items.values()) {
1959
+ if (mapOrder === null && chain[index] !== block) mapOrder = chain.slice(0, index);
1960
+ mapOrder?.push(block);
1961
+ index++;
1795
1962
  }
1963
+ if (mapOrder === null && index !== chain.length) mapOrder = chain.slice(0, index);
1796
1964
  const snapshot = {
1797
- head: state.head,
1798
- tail: state.tail,
1799
- size: state.size,
1800
1965
  empty: state.emptyBlock,
1801
- entries: [...state.items]
1966
+ mapOrder
1802
1967
  };
1803
1968
  journalUndo(() => {
1804
1969
  restoreForSlot(state, snapshot, chain);
@@ -1824,31 +1989,36 @@ function journalForOwnedListClear(state) {
1824
1989
  }
1825
1990
  function restoreForSlot(state, snapshot, chain) {
1826
1991
  const preservedMap = chain === null ? snapshot.entries : null;
1827
- const kept = chain === null ? null : /* @__PURE__ */ new Set();
1828
- if (chain !== null) for (let i = 0; i < chain.length; i++) kept.add(chain[i][0]);
1992
+ const kept = chain === null ? null : new Set(chain);
1829
1993
  for (let b = state.head; b !== null; b = b.nextSibling) {
1830
1994
  if (preservedMap !== null || !kept.has(b)) unmountBlock(b, false);
1831
1995
  }
1832
1996
  if (state.end.parentNode === null) return;
1833
- state.head = snapshot.head;
1834
- state.tail = snapshot.tail;
1835
- state.size = snapshot.size;
1997
+ state.head = chain === null ? snapshot.head : chain[0] ?? null;
1998
+ state.tail = chain === null ? snapshot.tail : chain[chain.length - 1] ?? null;
1999
+ state.size = chain === null ? snapshot.size : chain.length;
1836
2000
  if (preservedMap !== null) state.items = preservedMap;
1837
2001
  else {
1838
2002
  const originalChain = chain;
1839
2003
  state.items.clear();
1840
- for (let i = 0; i < snapshot.entries.length; i++) {
1841
- state.items.set(snapshot.entries[i][0], snapshot.entries[i][1]);
1842
- }
1843
2004
  for (let i = 0; i < originalChain.length; i++) {
1844
- originalChain[i][0].nextSibling = originalChain[i][1];
1845
- originalChain[i][0].prevSibling = originalChain[i][2];
2005
+ const block = originalChain[i];
2006
+ block.nextSibling = originalChain[i + 1] ?? null;
2007
+ block.prevSibling = originalChain[i - 1] ?? null;
2008
+ }
2009
+ const keyOrder = snapshot.mapOrder ?? originalChain;
2010
+ for (let i = 0; i < keyOrder.length; i++) {
2011
+ const block = keyOrder[i];
2012
+ state.items.set(block.key, block);
1846
2013
  }
1847
2014
  }
1848
2015
  const nodes = [];
1849
2016
  for (let b = state.head; b !== null; b = b.nextSibling) {
1850
- const range = takeParkedItem(b) ?? collectBlockRange(b);
1851
- for (const node of range) nodes.push(node);
2017
+ const parked = takeParkedItem(b);
2018
+ if (parked !== null) for (const node of parked) nodes.push(node);
2019
+ else if (b.startMarker !== null && b.startMarker === b.endMarker) {
2020
+ nodes.push(b.startMarker);
2021
+ } else for (const node of collectBlockRange(b)) nodes.push(node);
1852
2022
  }
1853
2023
  if (state.emptyBlock !== snapshot.empty) {
1854
2024
  if (state.emptyBlock !== null) unmountBlock(state.emptyBlock, false);
@@ -1861,6 +2031,7 @@ function restoreForSlot(state, snapshot, chain) {
1861
2031
  }
1862
2032
  const parent = state.end.parentNode;
1863
2033
  const keptNodes = new Set(nodes);
2034
+ if (ROOT_RENDER_TRANSACTION !== null) retainedForSlotNodes(state, keptNodes);
1864
2035
  let current = state.start.nextSibling;
1865
2036
  while (current !== null && current !== state.end) {
1866
2037
  const next = current.nextSibling;
@@ -1917,13 +2088,16 @@ function armTransitionJournal(state) {
1917
2088
  TRANSITION_JOURNAL ??= [];
1918
2089
  TRANSITION_JOURNAL_BAGS ??= /* @__PURE__ */ new Map();
1919
2090
  TRANSITION_JOURNAL_WINDOWS.push(TRANSITION_JOURNAL_CHECKPOINT);
2091
+ TRANSITION_JOURNAL_BAG_WINDOWS.push(TRANSITION_JOURNAL_BAG_WINDOW);
1920
2092
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL.length;
2093
+ TRANSITION_JOURNAL_BAG_WINDOW = ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW;
1921
2094
  TRANSITION_JOURNAL_DEPTH++;
1922
2095
  return TRANSITION_JOURNAL.length;
1923
2096
  }
1924
2097
  function disarmTransitionJournal(checkpoint) {
1925
2098
  if (checkpoint < 0) return;
1926
2099
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL_WINDOWS.pop();
2100
+ TRANSITION_JOURNAL_BAG_WINDOW = TRANSITION_JOURNAL_BAG_WINDOWS.pop();
1927
2101
  if (--TRANSITION_JOURNAL_DEPTH === 0) {
1928
2102
  TRANSITION_JOURNAL = null;
1929
2103
  TRANSITION_JOURNAL_BAGS = null;
@@ -1962,6 +2136,9 @@ function rollbackTransitionJournal(checkpoint, owner) {
1962
2136
  case JOURNAL_PROP:
1963
2137
  target[a] = b;
1964
2138
  break;
2139
+ case JOURNAL_CREATED:
2140
+ undoCreatedInRootRender(target, a);
2141
+ break;
1965
2142
  case JOURNAL_RENDER:
1966
2143
  if (!target.disposed && (target === owner || blockIsAncestorOf(owner, target))) {
1967
2144
  invalidateRender(target, owner);
@@ -3225,7 +3402,7 @@ function replaceRef(scope, previous, next, target) {
3225
3402
  if (TRANSITION_JOURNAL !== null) {
3226
3403
  journalBag();
3227
3404
  if (Object.prototype.hasOwnProperty.call(target, "_currentRef"))
3228
- journalRootProperty(target, "_currentRef");
3405
+ journalRootProperty(target, "_currentRef", target._currentRef);
3229
3406
  }
3230
3407
  if (previous != null) queueRefDetach(previous, target);
3231
3408
  if (next != null) queueRefAttach(scope, next, target);
@@ -3545,8 +3722,17 @@ function blockIsAncestorOf(anc, node) {
3545
3722
  }
3546
3723
  function comparePostOrder(aBlock, aSeq, bBlock, bSeq) {
3547
3724
  if (aBlock !== bBlock && aBlock !== null && bBlock !== null) {
3548
- if (blockIsAncestorOf(aBlock, bBlock)) return 1;
3549
- if (blockIsAncestorOf(bBlock, aBlock)) return -1;
3725
+ const aParent = aBlock.parentBlock;
3726
+ const bParent = bBlock.parentBlock;
3727
+ if (aParent === bBlock) return -1;
3728
+ if (bParent === aBlock) return 1;
3729
+ if (aParent === bParent) return aSeq - bSeq;
3730
+ for (let b = bParent; b !== null; b = b.parentBlock) {
3731
+ if (b === aBlock) return 1;
3732
+ }
3733
+ for (let a = aParent; a !== null; a = a.parentBlock) {
3734
+ if (a === bBlock) return -1;
3735
+ }
3550
3736
  }
3551
3737
  return aSeq - bSeq;
3552
3738
  }
@@ -3636,6 +3822,7 @@ function runEffectBody(e) {
3636
3822
  }
3637
3823
  function nativeEffectPublicationCurrent(entry, slot) {
3638
3824
  if (NATIVE_READ_DRIVER?.publicationCurrent(entry) !== false) return true;
3825
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(slot);
3639
3826
  slot.deps = void 0;
3640
3827
  slot.active = slot.connectedFn !== null;
3641
3828
  invalidateRender(entry.scope.block, entry.scope.block);
@@ -3802,86 +3989,6 @@ function schedulePostPaint(cb) {
3802
3989
  }
3803
3990
  }
3804
3991
  class BlockImpl {
3805
- // Hot fields first (touched by every renderBlock / reconcile iteration).
3806
- body;
3807
- props;
3808
- extra;
3809
- outputHandler;
3810
- memoInChain;
3811
- parentNode;
3812
- parentBlock;
3813
- idState;
3814
- startMarker;
3815
- endMarker;
3816
- exclusiveMarkers;
3817
- itemIndex;
3818
- // Scheduler / lifecycle.
3819
- pending;
3820
- disposed;
3821
- mounted;
3822
- renderStatus;
3823
- pendingMode;
3824
- currentRenderMode;
3825
- pendingDeferred;
3826
- currentRenderDeferred;
3827
- inactive;
3828
- // Hooks + cleanups (per-block state).
3829
- hooks;
3830
- cleanups;
3831
- effectSlots;
3832
- children;
3833
- _slots;
3834
- refFields;
3835
- $$ctxValues;
3836
- // Contexts whose value this block's subtree consumes — stamped on this block
3837
- // AND its memo ancestors by useContextInternal. The TRANSITIVE signal: a
3838
- // changed version here means "a consumer somewhere at/below me needs the new
3839
- // value", so the memo bailout descends rather than skipping.
3840
- $$ctxReads;
3841
- // Contexts this block's OWN render directly read (its own body, or an inline
3842
- // lite descendant that shares this block). The DIRECT signal: a changed
3843
- // version here means THIS block must re-run; if only $$ctxReads changed, the
3844
- // block can bail its body and refresh just its consuming child blocks.
3845
- $$ctxDirect;
3846
- // Resolved-provider cache for `use(ctx)` — see Scope.$$ctxCache.
3847
- $$ctxCache;
3848
- // Armed for React's IMPLICIT same-element bailout (beginWork's
3849
- // oldProps === newProps skip). Set at value-position component mounts
3850
- // (childSlot) — the only sites that can receive a cached descriptor back.
3851
- // Arming makes the block a stamping target (like __memo) so the bail's lazy
3852
- // consumer refresh has the context deps it needs.
3853
- $$implicitBail;
3854
- // __thenableIdx is reset every renderBlock so pre-init costs nothing.
3855
- __thenableIdx;
3856
- // Render-loop guard bookkeeping (see the Block interface).
3857
- drainStamp;
3858
- drainRenders;
3859
- crossRenderUpdate;
3860
- nestedUpdateChain;
3861
- nestedUpdateCount;
3862
- nestedUpdateError;
3863
- effectEventRenderVersion;
3864
- effectEventCompletedVersion;
3865
- // De-opt host node managed by this Block (deoptItemBody / hostElementBody), reused
3866
- // across renders. Null for all other blocks; declared so the shape stays monomorphic.
3867
- deoptNode;
3868
- // A de-opt descriptor with a `ref` was stamped in this subtree (see Block).
3869
- deoptRefs;
3870
- // Per-scope dense slot array (binding bag + control-flow/component/child slots),
3871
- // indexed by compile-time slot index. Keeps the scope shape monomorphic.
3872
- slots;
3873
- // For-block item bookkeeping.
3874
- forSlot;
3875
- prevSibling;
3876
- nextSibling;
3877
- key;
3878
- // ViewTransition boundary props (null on every other block — see Block).
3879
- vt;
3880
- // Scope contract: a Block is its own scope.
3881
- parent;
3882
- block;
3883
- // Metadata.
3884
- kind;
3885
3992
  constructor(kind, parentBlock, parentNode, startMarker, endMarker, body, props, extra, outputHandler) {
3886
3993
  this.body = body;
3887
3994
  this.props = props;
@@ -3935,24 +4042,19 @@ class BlockImpl {
3935
4042
  this.parent = null;
3936
4043
  this.block = this;
3937
4044
  this.kind = kind;
4045
+ this.createdStamp = 0;
4046
+ this.__warmEpisode = void 0;
4047
+ this.__thenableDone = void 0;
4048
+ this.__thenables = void 0;
4049
+ this.$$tryHandler = void 0;
4050
+ this.__suspenseHandler = void 0;
4051
+ this.__trySlot = void 0;
4052
+ this.__activitySlot = void 0;
4053
+ this.__warmCache = void 0;
4054
+ this.__warmCacheEpisode = void 0;
3938
4055
  }
3939
4056
  }
3940
4057
  class ScopeImpl {
3941
- block;
3942
- parent;
3943
- hooks;
3944
- cleanups;
3945
- effectSlots;
3946
- children;
3947
- _slots;
3948
- refFields;
3949
- $$ctxValues;
3950
- $$ctxReads;
3951
- $$ctxCache;
3952
- mounted;
3953
- // Per-scope dense slot array (binding bag + control-flow/component/child slots),
3954
- // indexed by compile-time slot index. Keeps the scope shape monomorphic.
3955
- slots;
3956
4058
  constructor(parent, block) {
3957
4059
  this.block = block;
3958
4060
  this.parent = parent;
@@ -3962,11 +4064,11 @@ class ScopeImpl {
3962
4064
  this.children = null;
3963
4065
  this._slots = null;
3964
4066
  this.refFields = null;
3965
- this.slots = [];
3966
4067
  this.$$ctxValues = null;
3967
4068
  this.$$ctxReads = null;
3968
4069
  this.$$ctxCache = null;
3969
4070
  this.mounted = false;
4071
+ this.slots = [];
3970
4072
  }
3971
4073
  }
3972
4074
  function createBlock(kind, parentBlock, parentNode, startMarker, endMarker, body, props, extra, outputHandler = null) {
@@ -4371,7 +4473,7 @@ function disposeReturnSlot(block, state) {
4371
4473
  if (state.forSlot.emptyBlock !== null) retireRootBlock(state.forSlot.emptyBlock);
4372
4474
  }
4373
4475
  deferRootRange(parent, first, last, () => unmountSlot(state, false));
4374
- journalRootProperty(block.slots, "0");
4476
+ journalRootProperty(block.slots, 0, block.slots[0]);
4375
4477
  const registry = block._slots;
4376
4478
  if (registry !== null) {
4377
4479
  const index = registry.indexOf(state);
@@ -4414,11 +4516,6 @@ function disposeReturnSlot(block, state) {
4414
4516
  block.slots[0] = void 0;
4415
4517
  }
4416
4518
  class LiteBlockImpl {
4417
- parentNode;
4418
- endMarker;
4419
- parentBlock;
4420
- $$ctxValues;
4421
- idState;
4422
4519
  constructor(parentNode, endMarker, parentBlock) {
4423
4520
  this.parentNode = parentNode;
4424
4521
  this.endMarker = endMarker;
@@ -4563,7 +4660,7 @@ function unmountBlockInner(block, detachDom) {
4563
4660
  function registerSlot(scope, slot) {
4564
4661
  const slots = scope._slots;
4565
4662
  const transaction = ROOT_RENDER_TRANSACTION;
4566
- if (transaction !== null && scope.mounted && !transaction.created?.has(scope.block)) {
4663
+ if (transaction !== null && scope.mounted && !isCreatedInRootRender(transaction, scope.block)) {
4567
4664
  journalUndo(() => {
4568
4665
  unmountSlot(slot, true);
4569
4666
  const index = scope.slots.indexOf(slot);
@@ -5274,9 +5371,9 @@ function finishEffectRender(scope) {
5274
5371
  for (let i = 0; i < effects.length; i++) {
5275
5372
  const effect = effects[i];
5276
5373
  if (effect.renderVersion === CURRENT_EFFECT_RENDER_VERSION) continue;
5277
- if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
5278
5374
  if (effect.phase === INSERTION) invalidateInsertionReplay(effect);
5279
5375
  if (!effect.active) continue;
5376
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
5280
5377
  effect.deps = void 0;
5281
5378
  effect.active = false;
5282
5379
  const revision = ++effect.revision;
@@ -8741,55 +8838,55 @@ function commitBag(scope, root, bag) {
8741
8838
  return bag;
8742
8839
  }
8743
8840
  function bag0(s, r) {
8744
- return commitBag(s, r, {});
8841
+ return commitBag(s, r, { __journalWindow: 0, [BINDING_BAG_ARITY]: 0 });
8745
8842
  }
8746
8843
  function bag1(s, r, a) {
8747
- return commitBag(s, r, { a });
8844
+ return commitBag(s, r, { a, __journalWindow: 0, [BINDING_BAG_ARITY]: 1 });
8748
8845
  }
8749
8846
  function bag2(s, r, a, b) {
8750
- return commitBag(s, r, { a, b });
8847
+ return commitBag(s, r, { a, b, __journalWindow: 0, [BINDING_BAG_ARITY]: 2 });
8751
8848
  }
8752
8849
  function bag3(s, r, a, b, c) {
8753
- return commitBag(s, r, { a, b, c });
8850
+ return commitBag(s, r, { a, b, c, __journalWindow: 0, [BINDING_BAG_ARITY]: 3 });
8754
8851
  }
8755
8852
  function bag4(s, r, a, b, c, d) {
8756
- return commitBag(s, r, { a, b, c, d });
8853
+ return commitBag(s, r, { a, b, c, d, __journalWindow: 0, [BINDING_BAG_ARITY]: 4 });
8757
8854
  }
8758
8855
  function bag5(s, r, a, b, c, d, e) {
8759
- return commitBag(s, r, { a, b, c, d, e });
8856
+ return commitBag(s, r, { a, b, c, d, e, __journalWindow: 0, [BINDING_BAG_ARITY]: 5 });
8760
8857
  }
8761
8858
  function bag6(s, r, a, b, c, d, e, f) {
8762
- return commitBag(s, r, { a, b, c, d, e, f });
8859
+ return commitBag(s, r, { a, b, c, d, e, f, __journalWindow: 0, [BINDING_BAG_ARITY]: 6 });
8763
8860
  }
8764
8861
  function bag7(s, r, a, b, c, d, e, f, g) {
8765
- return commitBag(s, r, { a, b, c, d, e, f, g });
8862
+ return commitBag(s, r, { a, b, c, d, e, f, g, __journalWindow: 0, [BINDING_BAG_ARITY]: 7 });
8766
8863
  }
8767
8864
  function bag8(s, r, a, b, c, d, e, f, g, h) {
8768
- return commitBag(s, r, { a, b, c, d, e, f, g, h });
8865
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, __journalWindow: 0, [BINDING_BAG_ARITY]: 8 });
8769
8866
  }
8770
8867
  function bag9(s, r, a, b, c, d, e, f, g, h, i) {
8771
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i });
8868
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, __journalWindow: 0, [BINDING_BAG_ARITY]: 9 });
8772
8869
  }
8773
8870
  function bag10(s, r, a, b, c, d, e, f, g, h, i, j) {
8774
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j });
8871
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, __journalWindow: 0, [BINDING_BAG_ARITY]: 10 });
8775
8872
  }
8776
8873
  function bag11(s, r, a, b, c, d, e, f, g, h, i, j, k) {
8777
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k });
8874
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, __journalWindow: 0, [BINDING_BAG_ARITY]: 11 });
8778
8875
  }
8779
8876
  function bag12(s, r, a, b, c, d, e, f, g, h, i, j, k, l) {
8780
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l });
8877
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, __journalWindow: 0, [BINDING_BAG_ARITY]: 12 });
8781
8878
  }
8782
8879
  function bag13(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m) {
8783
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m });
8880
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, __journalWindow: 0, [BINDING_BAG_ARITY]: 13 });
8784
8881
  }
8785
8882
  function bag14(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
8786
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n });
8883
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, __journalWindow: 0, [BINDING_BAG_ARITY]: 14 });
8787
8884
  }
8788
8885
  function bag15(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
8789
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o });
8886
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, __journalWindow: 0, [BINDING_BAG_ARITY]: 15 });
8790
8887
  }
8791
8888
  function bag16(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
8792
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p });
8889
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, __journalWindow: 0, [BINDING_BAG_ARITY]: 16 });
8793
8890
  }
8794
8891
  function bagOf(s, r, bag) {
8795
8892
  return commitBag(s, r, bag);
@@ -8948,6 +9045,16 @@ function setClassAttrIfChanged(value, previous, el) {
8948
9045
  setClassAttr(el, value);
8949
9046
  return value;
8950
9047
  }
9048
+ function updateFreshClassName(value, previous, el) {
9049
+ const next = (0, import_css.normalizeClass)(value);
9050
+ if (previous !== next) setClassName(el, next);
9051
+ return next;
9052
+ }
9053
+ function updateFreshClassAttr(value, previous, el) {
9054
+ const next = (0, import_css.normalizeClass)(value);
9055
+ if (previous !== next) setClassAttr(el, next);
9056
+ return next;
9057
+ }
8951
9058
  function setScriptText(el, value) {
8952
9059
  const text = value == null ? "" : String(value);
8953
9060
  const first = el.firstChild;
@@ -9023,7 +9130,7 @@ function validateDangerouslySetInnerHTMLValue(value) {
9023
9130
  }
9024
9131
  function setDangerouslySetInnerHTML(el, value) {
9025
9132
  validateDangerouslySetInnerHTMLValue(value);
9026
- journalRootProperty(el, DANGER_HTML_ACTIVE);
9133
+ journalRootProperty(el, DANGER_HTML_ACTIVE, el[DANGER_HTML_ACTIVE]);
9027
9134
  const wasActive = el[DANGER_HTML_ACTIVE] === true;
9028
9135
  if (value == null) {
9029
9136
  el[DANGER_HTML_ACTIVE] = false;
@@ -9082,9 +9189,9 @@ function setDangerouslySetInnerHTMLSources(el, sources, ignoreSourceChildren = f
9082
9189
  if (import_has_own.hasOwnProp.call(el, DANGER_HTML_RESOLVED_VALUE) && Object.is(el[DANGER_HTML_RESOLVED_VALUE], resolved) && Object.is(el[DANGER_HTML_RESOLVED_CHILD], resolvedChild)) {
9083
9190
  return;
9084
9191
  }
9085
- journalRootProperty(el, DANGER_HTML_SPREAD_CHILD);
9086
- journalRootProperty(el, DANGER_HTML_RESOLVED_VALUE);
9087
- journalRootProperty(el, DANGER_HTML_RESOLVED_CHILD);
9192
+ journalRootProperty(el, DANGER_HTML_SPREAD_CHILD, el[DANGER_HTML_SPREAD_CHILD]);
9193
+ journalRootProperty(el, DANGER_HTML_RESOLVED_VALUE, el[DANGER_HTML_RESOLVED_VALUE]);
9194
+ journalRootProperty(el, DANGER_HTML_RESOLVED_CHILD, el[DANGER_HTML_RESOLVED_CHILD]);
9088
9195
  el[DANGER_HTML_SPREAD_CHILD] = resolvedChild;
9089
9196
  setDangerouslySetInnerHTML(el, resolved);
9090
9197
  el[DANGER_HTML_RESOLVED_VALUE] = resolved;
@@ -10402,15 +10509,42 @@ function setSpread(el, value, prev, mountScope, skipDangerouslySetInnerHTML = fa
10402
10509
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, mountScope);
10403
10510
  }
10404
10511
  const _injectedStyles = /* @__PURE__ */ new Set();
10405
- function removeHeadEventListeners(state, attrs) {
10512
+ function journalHeadEventListeners(state) {
10513
+ const before = state.handlers === void 0 ? null : new Map(state.handlers);
10514
+ journalUndo(() => {
10515
+ const handlers = state.handlers;
10516
+ if (handlers !== void 0) {
10517
+ for (const [name, listener] of handlers) {
10518
+ const event = eventSlot(name);
10519
+ state.el.removeEventListener(event.type, listener, event.capture);
10520
+ }
10521
+ handlers.clear();
10522
+ }
10523
+ if (before !== null) {
10524
+ const restored = handlers ?? (state.handlers = /* @__PURE__ */ new Map());
10525
+ for (const [name, listener] of before) {
10526
+ const event = eventSlot(name);
10527
+ state.el.addEventListener(event.type, listener, event.capture);
10528
+ restored.set(name, listener);
10529
+ }
10530
+ }
10531
+ });
10532
+ }
10533
+ function removeHeadEventListeners(state, attrs, journalChanges = false) {
10406
10534
  const handlers = state.handlers;
10407
- if (handlers === void 0) return;
10535
+ if (handlers === void 0) return false;
10536
+ let journaled = false;
10408
10537
  for (const [name, listener] of handlers) {
10409
10538
  if (attrs !== null && name in attrs) continue;
10539
+ if (journalChanges && !journaled) {
10540
+ journalHeadEventListeners(state);
10541
+ journaled = true;
10542
+ }
10410
10543
  const event = eventSlot(name);
10411
10544
  state.el.removeEventListener(event.type, listener, event.capture);
10412
10545
  handlers.delete(name);
10413
10546
  }
10547
+ return journaled;
10414
10548
  }
10415
10549
  function adoptServerHeadEl(head, key, tag) {
10416
10550
  const closeKey = "/" + key;
@@ -10472,7 +10606,7 @@ function headBlock(scope, slot, key, tag, attrs, text) {
10472
10606
  journalObjectOnce(state);
10473
10607
  journalBag();
10474
10608
  }
10475
- if (state.handlers !== void 0) removeHeadEventListeners(state, attrs);
10609
+ let journaledHandlers = state.handlers !== void 0 && removeHeadEventListeners(state, attrs, TRANSITION_JOURNAL !== null);
10476
10610
  const previousNames = state.attrNames;
10477
10611
  if (previousNames !== void 0) {
10478
10612
  for (let i = 0; i < previousNames.length; i++) {
@@ -10490,13 +10624,15 @@ function headBlock(scope, slot, key, tag, attrs, text) {
10490
10624
  const hs = state.handlers;
10491
10625
  const prevH = hs?.get(k);
10492
10626
  if (prevH === listener) continue;
10627
+ const nextH = typeof listener === "function" ? listener : void 0;
10628
+ if (TRANSITION_JOURNAL !== null && !journaledHandlers && (prevH !== void 0 || nextH !== void 0)) {
10629
+ journalHeadEventListeners(state);
10630
+ journaledHandlers = true;
10631
+ }
10493
10632
  if (prevH !== void 0) el.removeEventListener(ev.type, prevH, ev.capture);
10494
- if (typeof listener === "function") {
10495
- el.addEventListener(ev.type, listener, ev.capture);
10496
- (hs ?? (state.handlers = /* @__PURE__ */ new Map())).set(
10497
- k,
10498
- listener
10499
- );
10633
+ if (nextH !== void 0) {
10634
+ el.addEventListener(ev.type, nextH, ev.capture);
10635
+ (hs ?? (state.handlers = /* @__PURE__ */ new Map())).set(k, nextH);
10500
10636
  } else {
10501
10637
  hs?.delete(k);
10502
10638
  }
@@ -10609,7 +10745,7 @@ function setEventHandler(el, key, handler) {
10609
10745
  el[key] = handler;
10610
10746
  }
10611
10747
  function evt0(el, key, fn) {
10612
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: EMPTY_ARGS };
10748
+ const d = { fn, args: EMPTY_ARGS, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10613
10749
  setEventHandler(el, key, d);
10614
10750
  return d;
10615
10751
  }
@@ -10619,37 +10755,30 @@ function evt0u(d, fn) {
10619
10755
  d.fn = fn;
10620
10756
  }
10621
10757
  function evt1(el, key, fn, a0) {
10622
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: [a0] };
10758
+ const d = { fn, args: 1, a0, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10623
10759
  setEventHandler(el, key, d);
10624
10760
  return d;
10625
10761
  }
10626
10762
  function evt1u(d, fn, a0) {
10627
10763
  if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
10628
- if (TRANSITION_JOURNAL !== null) {
10629
- journalObjectOnce(d);
10630
- journalObjectOnce(d.args);
10631
- }
10764
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
10632
10765
  d.fn = fn;
10633
- d.args[0] = a0;
10766
+ d.a0 = a0;
10634
10767
  }
10635
10768
  function evt2(el, key, fn, a0, a1) {
10636
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: [a0, a1] };
10769
+ const d = { fn, args: 2, a0, a1, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10637
10770
  setEventHandler(el, key, d);
10638
10771
  return d;
10639
10772
  }
10640
10773
  function evt2u(d, fn, a0, a1) {
10641
10774
  if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
10642
- if (TRANSITION_JOURNAL !== null) {
10643
- journalObjectOnce(d);
10644
- journalObjectOnce(d.args);
10645
- }
10775
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
10646
10776
  d.fn = fn;
10647
- const a = d.args;
10648
- a[0] = a0;
10649
- a[1] = a1;
10777
+ d.a0 = a0;
10778
+ d.a1 = a1;
10650
10779
  }
10651
10780
  function evtN(el, key, fn, args) {
10652
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args };
10781
+ const d = { fn, args, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10653
10782
  setEventHandler(el, key, d);
10654
10783
  return d;
10655
10784
  }
@@ -11009,11 +11138,17 @@ function preserveDispatchedBundle(bundle) {
11009
11138
  let snapshot;
11010
11139
  for (let index = 0; index < CAPTURE_SLOTS.length; index++) {
11011
11140
  if (CAPTURE_SLOTS[index] === bundle) {
11012
- CAPTURE_SLOTS[index] = snapshot ??= {
11013
- [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND,
11014
- fn: bundle.fn,
11015
- args: bundle.args.slice()
11016
- };
11141
+ if (snapshot === void 0) {
11142
+ const args = bundle.args;
11143
+ snapshot = typeof args !== "number" ? { fn: bundle.fn, args: args.slice(), [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND } : args === 1 ? { fn: bundle.fn, args: 1, a0: bundle.a0, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND } : {
11144
+ fn: bundle.fn,
11145
+ args: 2,
11146
+ a0: bundle.a0,
11147
+ a1: bundle.a1,
11148
+ [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND
11149
+ };
11150
+ }
11151
+ CAPTURE_SLOTS[index] = snapshot;
11017
11152
  }
11018
11153
  }
11019
11154
  }
@@ -11043,8 +11178,8 @@ function resolvePortalEventOwner(node) {
11043
11178
  }
11044
11179
  if (owner === void 0) return;
11045
11180
  if (ROOT_RENDER_TRANSACTION !== null) {
11046
- journalRootProperty(node, "$$portalParent");
11047
- journalRootProperty(node, "$$portalContainer");
11181
+ journalRootProperty(node, "$$portalParent", node.$$portalParent);
11182
+ journalRootProperty(node, "$$portalContainer", node.$$portalContainer);
11048
11183
  }
11049
11184
  node.$$portalParent = owner.host;
11050
11185
  node.$$portalContainer = target;
@@ -11157,18 +11292,24 @@ function fireEventSlot(slot, event) {
11157
11292
  if (isHandlerBundle(slot)) {
11158
11293
  const bundle = slot;
11159
11294
  const a = bundle.args;
11160
- switch (a.length) {
11161
- case 0:
11162
- bundle.fn();
11163
- break;
11164
- case 1:
11165
- bundle.fn(a[0]);
11166
- break;
11167
- case 2:
11168
- bundle.fn(a[0], a[1]);
11169
- break;
11170
- default:
11171
- bundle.fn.apply(null, a);
11295
+ if (typeof a !== "number") {
11296
+ switch (a.length) {
11297
+ case 0:
11298
+ bundle.fn();
11299
+ break;
11300
+ case 1:
11301
+ bundle.fn(a[0]);
11302
+ break;
11303
+ case 2:
11304
+ bundle.fn(a[0], a[1]);
11305
+ break;
11306
+ default:
11307
+ bundle.fn.apply(null, a);
11308
+ }
11309
+ } else if (a === 1) {
11310
+ bundle.fn(bundle.a0);
11311
+ } else {
11312
+ bundle.fn(bundle.a0, bundle.a1);
11172
11313
  }
11173
11314
  return;
11174
11315
  }
@@ -12402,7 +12543,7 @@ function portal(parentScope, slotKey, target, body, props, host, env, fragmentOw
12402
12543
  key
12403
12544
  );
12404
12545
  if (prev !== state) {
12405
- journalRootProperty(parentScope.slots, String(slotKey));
12546
+ journalRootProperty(parentScope.slots, slotKey, parentScope.slots[slotKey]);
12406
12547
  parentScope.slots[slotKey] = state;
12407
12548
  registerSlot(parentScope, state);
12408
12549
  }
@@ -12603,11 +12744,13 @@ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, e
12603
12744
  }
12604
12745
  renderBlock(block);
12605
12746
  } else {
12606
- if (state.host !== host) journalRootProperty(state, "host");
12747
+ if (state.host !== host) journalRootProperty(state, "host", state.host);
12607
12748
  state.host = host;
12608
- if (state.block.body !== norm.body) journalRootProperty(state.block, "body");
12609
- if (state.block.props !== norm.props) journalRootProperty(state.block, "props");
12610
- if (state.block.extra !== env) journalRootProperty(state.block, "extra");
12749
+ if (state.block.body !== norm.body)
12750
+ journalRootProperty(state.block, "body", state.block.body);
12751
+ if (state.block.props !== norm.props)
12752
+ journalRootProperty(state.block, "props", state.block.props);
12753
+ if (state.block.extra !== env) journalRootProperty(state.block, "extra", state.block.extra);
12611
12754
  state.block.body = norm.body;
12612
12755
  state.block.props = norm.props;
12613
12756
  state.block.extra = env;
@@ -12639,7 +12782,7 @@ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, e
12639
12782
  }
12640
12783
  function teardownPortalState(state) {
12641
12784
  const transaction = ROOT_RENDER_TRANSACTION;
12642
- if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && state.block?.mounted && !transaction.created?.has(state.block) && state.target !== null) {
12785
+ if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && state.block?.mounted && !isCreatedInRootRender(transaction, state.block) && state.target !== null) {
12643
12786
  deferRootRange(state.target, state.start, state.end, () => teardownPortalState(state));
12644
12787
  return;
12645
12788
  }
@@ -13231,13 +13374,14 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13231
13374
  }
13232
13375
  }
13233
13376
  if ((hasKey === true || key !== void 0) && !state.keyed) {
13234
- if (!journaledSlot) journalRootProperty(state, "keyed");
13377
+ if (!journaledSlot) journalRootProperty(state, "keyed", state.keyed);
13235
13378
  state.keyed = true;
13236
13379
  }
13237
13380
  if (keyChanged) {
13238
13381
  state.currentComp = null;
13239
13382
  }
13240
- if (!journaledSlot && !Object.is(state.prevKey, nextKey)) journalRootProperty(state, "prevKey");
13383
+ if (!journaledSlot && !Object.is(state.prevKey, nextKey))
13384
+ journalRootProperty(state, "prevKey", state.prevKey);
13241
13385
  state.prevKey = nextKey;
13242
13386
  if (replacing) {
13243
13387
  const swapDriver = TRANSITION_SWAP_DRIVER;
@@ -13248,7 +13392,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13248
13392
  const suspenseSwap = canSwapOffscreen && !transitionMode && committedSuspense;
13249
13393
  const probeOnly = suspenseSwap && !transitionMode;
13250
13394
  const rootTransaction = ROOT_RENDER_TRANSACTION;
13251
- if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !rootTransaction.created?.has(state.block)) {
13395
+ if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !isCreatedInRootRender(rootTransaction, state.block)) {
13252
13396
  const oldBlock = state.block;
13253
13397
  const oldStart = oldBlock.startMarker;
13254
13398
  const oldEnd = oldBlock.endMarker;
@@ -13402,7 +13546,8 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13402
13546
  }
13403
13547
  } else if (state.block) {
13404
13548
  if (tryMemoBail(state.block, identity, props)) return;
13405
- if (state.block.props !== renderProps) journalRootProperty(state.block, "props");
13549
+ if (state.block.props !== renderProps)
13550
+ journalRootProperty(state.block, "props", state.block.props);
13406
13551
  state.block.props = renderProps;
13407
13552
  renderBlock(state.block);
13408
13553
  }
@@ -13965,7 +14110,7 @@ function renderFragmentRefDescriptor(descriptor, scope) {
13965
14110
  block.slots[1] = instance;
13966
14111
  block.refFields = ["f", "a", ""];
13967
14112
  } else if (instance._currentRef !== descriptor.ref) {
13968
- journalRootProperty(instance, "_currentRef");
14113
+ journalRootProperty(instance, "_currentRef", instance._currentRef);
13969
14114
  if (instance._currentRef != null) queueRefDetach(instance._currentRef, instance);
13970
14115
  if (descriptor.ref != null) queueRefAttach(scope, descriptor.ref, instance);
13971
14116
  instance._currentRef = descriptor.ref;
@@ -14271,8 +14416,8 @@ function deoptItemBody(item, scope) {
14271
14416
  const p = sm.parentNode;
14272
14417
  if (ROOT_RENDER_TRANSACTION !== null) {
14273
14418
  journalRootRange(p, sm.previousSibling, sm.nextSibling);
14274
- journalRootProperty(block, "startMarker");
14275
- journalRootProperty(block, "endMarker");
14419
+ journalRootProperty(block, "startMarker", block.startMarker);
14420
+ journalRootProperty(block, "endMarker", block.endMarker);
14276
14421
  }
14277
14422
  const s = document.createComment("it");
14278
14423
  const e = document.createComment("/it");
@@ -14285,7 +14430,7 @@ function deoptItemBody(item, scope) {
14285
14430
  const stale = block.deoptNode;
14286
14431
  let transfer = null;
14287
14432
  if (stale != null) {
14288
- journalRootProperty(block, "deoptNode");
14433
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14289
14434
  if (scope.slots[0] === void 0 && stale.nodeType === 1 && isHostDescriptor(item) && stale.localName === item.type && stale.parentNode === block.parentNode) {
14290
14435
  transfer = stale;
14291
14436
  } else if (stale.parentNode === block.parentNode) {
@@ -14367,7 +14512,7 @@ function deoptItemBody(item, scope) {
14367
14512
  }
14368
14513
  const node = reconcileDeoptNode(prev, item, block, deoptChildNamespace(block.parentNode));
14369
14514
  if (node !== prev) {
14370
- journalRootProperty(block, "deoptNode");
14515
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14371
14516
  if (prev != null && prev !== node && prev.parentNode === block.parentNode) {
14372
14517
  if (ROOT_RENDER_TRANSACTION !== null)
14373
14518
  journalRootRange(block.parentNode, prev.previousSibling, prev.nextSibling);
@@ -14395,8 +14540,8 @@ function deoptItemBody(item, scope) {
14395
14540
  block.parentNode.insertBefore(node, endM);
14396
14541
  }
14397
14542
  if (prev !== null && block.startMarker === prev) {
14398
- journalRootProperty(block, "startMarker");
14399
- journalRootProperty(block, "endMarker");
14543
+ journalRootProperty(block, "startMarker", block.startMarker);
14544
+ journalRootProperty(block, "endMarker", block.endMarker);
14400
14545
  block.startMarker = node;
14401
14546
  block.endMarker = node;
14402
14547
  }
@@ -14509,7 +14654,7 @@ function hostElementBody(d, block) {
14509
14654
  const retired = el;
14510
14655
  if (ROOT_RENDER_TRANSACTION !== null) {
14511
14656
  journalRootRange(block.parentNode, retired.previousSibling, retired.nextSibling);
14512
- journalRootProperty(block, "deoptNode");
14657
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14513
14658
  }
14514
14659
  const childState = block.slots[0];
14515
14660
  if (childState !== void 0) {
@@ -15131,7 +15276,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15131
15276
  }
15132
15277
  if (state === void 0) {
15133
15278
  const transaction = ROOT_RENDER_TRANSACTION;
15134
- if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && parentScope.mounted && !transaction.created?.has(parentBlock)) {
15279
+ if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && parentScope.mounted && !isCreatedInRootRender(transaction, parentBlock)) {
15135
15280
  journalBag();
15136
15281
  const after = ownsHost === void 0 ? anchor ?? null : null;
15137
15282
  const before = ownsHost === void 0 ? after === null ? domParent.lastChild : after.previousSibling : null;
@@ -15363,8 +15508,8 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15363
15508
  }
15364
15509
  if (wasImplicitlyArmed && taggedChildren && comp === state.currentComp && tryImplicitBail(state.block))
15365
15510
  return;
15366
- if (state.block.body !== comp) journalRootProperty(state.block, "body");
15367
- if (state.currentComp !== comp) journalRootProperty(state, "currentComp");
15511
+ if (state.block.body !== comp) journalRootProperty(state.block, "body", state.block.body);
15512
+ if (state.currentComp !== comp) journalRootProperty(state, "currentComp", state.currentComp);
15368
15513
  state.block.body = comp;
15369
15514
  renderBlock(state.block);
15370
15515
  state.currentComp = comp;
@@ -15373,7 +15518,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15373
15518
  if (state.block !== null && comp === state.currentComp) {
15374
15519
  if (tryMemoBail(state.block, comp, props)) return;
15375
15520
  if (props === state.block.props && tryImplicitBail(state.block)) return;
15376
- if (state.block.props !== props) journalRootProperty(state.block, "props");
15521
+ if (state.block.props !== props) journalRootProperty(state.block, "props", state.block.props);
15377
15522
  state.block.props = props;
15378
15523
  renderBlock(state.block);
15379
15524
  return;
@@ -15494,7 +15639,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15494
15639
  const oldEnd = state.end;
15495
15640
  state.start = r.wip.start;
15496
15641
  state.end = r.wip.end;
15497
- journalRootProperty(r.wip.block, "exclusiveMarkers");
15642
+ journalRootProperty(r.wip.block, "exclusiveMarkers", r.wip.block.exclusiveMarkers);
15498
15643
  r.wip.block.exclusiveMarkers = true;
15499
15644
  replaceSharedBlockBoundary(parentBlock, oldStart, oldEnd, state.start, state.end);
15500
15645
  deferRootRange(domParent, oldStart, oldStart);
@@ -15635,7 +15780,7 @@ function childTextHole(parentScope, slotKey, domParent, value, cachedNode) {
15635
15780
  if (ROOT_RENDER_TRANSACTION !== null && state === void 0 && parentScope.mounted) {
15636
15781
  journalBag();
15637
15782
  journalRootRange(domParent, null, null);
15638
- journalRootProperty(parentScope.slots, String(slotKey));
15783
+ journalRootProperty(parentScope.slots, slotKey, parentScope.slots[slotKey]);
15639
15784
  }
15640
15785
  if (state === void 0 && vt !== "object" && vt !== "function") {
15641
15786
  const str = value == null || value === false || value === true ? "" : vt === "string" ? value : String(value);
@@ -16727,7 +16872,7 @@ function renderVisibleTry(state, source) {
16727
16872
  const journalCheckpoint = armTransitionJournal(state);
16728
16873
  const previousCapture = WIP_CAPTURE;
16729
16874
  const capture = journalCheckpoint < 0 ? null : createOffscreenCapture();
16730
- const effectDeps = capture === null ? null : snapshotSubtreeEffectDeps(block);
16875
+ const effectDeps = capture !== null && (ROOT_RENDER_TRANSACTION === null || state.propagateSuspense || (block.pendingMode ?? CURRENT_BLOCK?.currentRenderMode) !== "transition" || block.pending && block.pendingMode === "transition" && CURRENT_BLOCK !== null && CURRENT_BLOCK.currentRenderMode === "urgent" && blockIsAncestor(CURRENT_BLOCK, block) && TRANSITION_SWAP_DRIVER !== null) ? snapshotSubtreeEffectDeps(block) : null;
16731
16876
  const refDetachCheckpoint = refDetachQueue.length;
16732
16877
  let didThrow = false;
16733
16878
  let renderError;
@@ -16744,7 +16889,7 @@ function renderVisibleTry(state, source) {
16744
16889
  if (didThrow) {
16745
16890
  if (capture !== null) {
16746
16891
  refDetachQueue.splice(refDetachCheckpoint);
16747
- restoreSubtreeEffectDeps(block, effectDeps);
16892
+ if (effectDeps !== null) restoreSubtreeEffectDeps(block, effectDeps);
16748
16893
  discardOffscreenCapture(capture);
16749
16894
  }
16750
16895
  if (isHostContextRequest(renderError) || renderError instanceof import_read_protocol.NativeAdoptionMiss)
@@ -17264,6 +17409,7 @@ function invalidatePendingSuspenseEffects(owner) {
17264
17409
  if (block.disposed || block !== owner && !blockIsAncestorOf(owner, block)) continue;
17265
17410
  const effect = pending.scope.hooks?.get(pending.slot);
17266
17411
  if (effect === void 0 || effect.revision !== pending.revision) continue;
17412
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
17267
17413
  effect.revision++;
17268
17414
  effect.active = effect.connectedFn !== null;
17269
17415
  effect.deps = effect.connectedFn === null ? void 0 : effect.connectedArgs;
@@ -17305,7 +17451,7 @@ function hideTryContentAndMountPendingInner(state, resumeThenable) {
17305
17451
  const persistent = state.tryBlock;
17306
17452
  const uncommittedRefs = discardSubtreeRefAttaches(persistent);
17307
17453
  invalidatePendingSuspenseEffects(persistent);
17308
- journalRootProperty(persistent, "inactive");
17454
+ journalRootProperty(persistent, "inactive", persistent.inactive);
17309
17455
  persistent.inactive = true;
17310
17456
  const action = () => deactivateSuspensePrimary(state, persistent, uncommittedRefs);
17311
17457
  if (WIP_CAPTURE === null) effectEventCommitActions.push(action);
@@ -17676,6 +17822,7 @@ function reconnectBailedEffects(block) {
17676
17822
  const queue = context.queues[effect.phase];
17677
17823
  if (replay !== null) {
17678
17824
  const last = replay[replay.length - 1];
17825
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
17679
17826
  effect.active = last.fn !== null;
17680
17827
  effect.deps = last.fn === null ? void 0 : last.args;
17681
17828
  const revision = ++effect.revision;
@@ -18624,8 +18771,8 @@ function replaceSharedBlockBoundary(parent, oldStart, oldEnd, newStart, newEnd)
18624
18771
  if (oldStart === null || oldEnd === null) return;
18625
18772
  let block = parent;
18626
18773
  while (block !== null && block.startMarker === oldStart && block.endMarker === oldEnd) {
18627
- journalRootProperty(block, "startMarker");
18628
- journalRootProperty(block, "endMarker");
18774
+ journalRootProperty(block, "startMarker", block.startMarker);
18775
+ journalRootProperty(block, "endMarker", block.endMarker);
18629
18776
  block.startMarker = newStart;
18630
18777
  block.endMarker = newEnd;
18631
18778
  block = block.parentBlock;
@@ -18691,7 +18838,7 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18691
18838
  }
18692
18839
  const liveEnd = provisionalAfter === null && state.start === null && state.block !== null && state.block.endMarker !== null ? state.block.endMarker : state.end;
18693
18840
  const rootTransaction = ROOT_RENDER_TRANSACTION;
18694
- if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !rootTransaction.created?.has(state.block)) {
18841
+ if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !isCreatedInRootRender(rootTransaction, state.block)) {
18695
18842
  const oldBlock2 = state.block;
18696
18843
  const oldStart = oldBlock2.startMarker;
18697
18844
  const oldEnd = oldBlock2.endMarker;
@@ -18752,7 +18899,7 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18752
18899
  if (!borrowed) {
18753
18900
  replaceSharedBlockBoundary(parentBlock, oldStart, oldEnd, r.wip.start, r.wip.end);
18754
18901
  }
18755
- journalRootProperty(r.wip.block, "exclusiveMarkers");
18902
+ journalRootProperty(r.wip.block, "exclusiveMarkers", r.wip.block.exclusiveMarkers);
18756
18903
  r.wip.block.exclusiveMarkers = true;
18757
18904
  spliceWipCapture(r.wip);
18758
18905
  deferRootReplacement(oldBlock2, domParent, first, last);
@@ -18932,8 +19079,8 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18932
19079
  replaceSharedBlockBoundary(parentBlock, oldBlockStart, oldBlockEnd, s, e);
18933
19080
  }
18934
19081
  } else if (state.block) {
18935
- if (state.block.body !== body) journalRootProperty(state.block, "body");
18936
- if (state.block.extra !== env) journalRootProperty(state.block, "extra");
19082
+ if (state.block.body !== body) journalRootProperty(state.block, "body", state.block.body);
19083
+ if (state.block.extra !== env) journalRootProperty(state.block, "extra", state.block.extra);
18937
19084
  state.block.body = body;
18938
19085
  state.block.extra = env;
18939
19086
  renderBlock(state.block);
@@ -19639,7 +19786,8 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19639
19786
  registerSlot(parentScope, state);
19640
19787
  }
19641
19788
  const serverMarkerState = hydration?.markerState(state.start) ?? -1;
19642
- if (state.env !== deps) journalRootProperty(state, "env");
19789
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
19790
+ journalRootProperty(state, "env", state.env);
19643
19791
  state.env = deps;
19644
19792
  const isEmpty = items.length === 0;
19645
19793
  if (isEmpty && emptyBody) {
@@ -19647,8 +19795,10 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19647
19795
  reconcileKeyed(parentBlock, state, items, getKey, itemBody, false, false);
19648
19796
  }
19649
19797
  if (state.emptyBlock) {
19650
- if (state.emptyBlock.body !== emptyBody) journalRootProperty(state.emptyBlock, "body");
19651
- if (state.emptyBlock.extra !== state.env) journalRootProperty(state.emptyBlock, "extra");
19798
+ if (state.emptyBlock.body !== emptyBody)
19799
+ journalRootProperty(state.emptyBlock, "body", state.emptyBlock.body);
19800
+ if (state.emptyBlock.extra !== state.env)
19801
+ journalRootProperty(state.emptyBlock, "extra", state.emptyBlock.extra);
19652
19802
  state.emptyBlock.body = emptyBody;
19653
19803
  state.emptyBlock.extra = state.env;
19654
19804
  renderBlock(state.emptyBlock);
@@ -19687,7 +19837,7 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19687
19837
  if (state.emptyBlock) {
19688
19838
  if (itemRemovalDefers()) {
19689
19839
  journalForSlot(state);
19690
- parkItemForHold(state.emptyBlock);
19840
+ parkItemForHold(state.emptyBlock, state);
19691
19841
  } else unmountBlock(state.emptyBlock);
19692
19842
  state.emptyBlock = null;
19693
19843
  }
@@ -19713,7 +19863,8 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19713
19863
  } else {
19714
19864
  lite = !requiresScope;
19715
19865
  }
19716
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
19866
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
19867
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
19717
19868
  state.cachedDeps = deps;
19718
19869
  }
19719
19870
  }
@@ -19781,7 +19932,8 @@ function keyedForBlock(parentScope, slotKey, domParent, items, getKey, itemBody,
19781
19932
  );
19782
19933
  if (TRANSITION_JOURNAL === null || ROOT_RENDER_TRANSACTION !== null) {
19783
19934
  const rendered = parentScope.slots[slotKey];
19784
- if (rendered.selectionItems !== items) journalRootProperty(rendered, "selectionItems");
19935
+ if (rendered.selectionItems !== items)
19936
+ journalRootProperty(rendered, "selectionItems", rendered.selectionItems);
19785
19937
  rendered.selectionItems = items;
19786
19938
  }
19787
19939
  }
@@ -19801,14 +19953,16 @@ function mountFastHostItems(parentScope, state, parentNode, items, getKey, itemB
19801
19953
  let previous = null;
19802
19954
  let current = null;
19803
19955
  if (TRANSITION_JOURNAL !== null) journalForSlot(state);
19804
- if (state.env !== deps) journalRootProperty(state, "env");
19956
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
19957
+ journalRootProperty(state, "env", state.env);
19805
19958
  state.env = deps;
19806
19959
  if (((flags || 0) & 4) !== 0 && deps !== void 0) {
19807
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
19960
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
19961
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
19808
19962
  state.cachedDeps = deps;
19809
19963
  }
19810
19964
  if (mapped) {
19811
- if (state.mappedNative !== true) journalRootProperty(state, "mappedNative");
19965
+ if (state.mappedNative !== true) journalRootProperty(state, "mappedNative", state.mappedNative);
19812
19966
  state.mappedNative = true;
19813
19967
  }
19814
19968
  try {
@@ -19918,7 +20072,8 @@ function fastKeyedForBlock(parentScope, slotKey, domParent, items, getKey, itemB
19918
20072
  return;
19919
20073
  }
19920
20074
  mountFastHostItems(parentScope, state, parent, items, getKey, itemBody, flags, deps, false);
19921
- if (state.selectionItems !== items) journalRootProperty(state, "selectionItems");
20075
+ if (state.selectionItems !== items)
20076
+ journalRootProperty(state, "selectionItems", state.selectionItems);
19922
20077
  state.selectionItems = items;
19923
20078
  }
19924
20079
  function fastMapSlot(scopeOrItems, slotOrMethod, domParent, items, method, native, callback, getKey, itemBody, flags, deps, anchor, ownEnd) {
@@ -19995,8 +20150,10 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
19995
20150
  }
19996
20151
  const previous = previousDeps[selectionIndex];
19997
20152
  const next = deps[selectionIndex];
19998
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
19999
- if (state.env !== deps) journalRootProperty(state, "env");
20153
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
20154
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
20155
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
20156
+ journalRootProperty(state, "env", state.env);
20000
20157
  state.cachedDeps = deps;
20001
20158
  state.env = deps;
20002
20159
  if (Object.is(previous, next)) return true;
@@ -20009,8 +20166,8 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
20009
20166
  second = swap;
20010
20167
  }
20011
20168
  if (first !== void 0) {
20012
- if (first.body !== itemBody) journalRootProperty(first, "body");
20013
- if (first.extra !== deps) journalRootProperty(first, "extra");
20169
+ if (first.body !== itemBody) journalRootProperty(first, "body", first.body);
20170
+ if (first.extra !== deps) journalRootProperty(first, "extra", first.extra);
20014
20171
  first.body = itemBody;
20015
20172
  first.extra = deps;
20016
20173
  if (selectionBody !== void 0 && first._slots === null) {
@@ -20020,8 +20177,8 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
20020
20177
  }
20021
20178
  }
20022
20179
  if (second !== void 0) {
20023
- if (second.body !== itemBody) journalRootProperty(second, "body");
20024
- if (second.extra !== deps) journalRootProperty(second, "extra");
20180
+ if (second.body !== itemBody) journalRootProperty(second, "body", second.body);
20181
+ if (second.extra !== deps) journalRootProperty(second, "extra", second.extra);
20025
20182
  second.body = itemBody;
20026
20183
  second.extra = deps;
20027
20184
  if (selectionBody !== void 0 && second._slots === null) {
@@ -20053,14 +20210,16 @@ const MAX_KEYED_REORDER_SCRATCH = 16384;
20053
20210
  let keyedReorderSources = null;
20054
20211
  let keyedLisPredecessors = null;
20055
20212
  function updateSurvivor(block, newItem, newIdx, itemBody, pure, lite, indexIndependent, env) {
20056
- if (block.itemIndex !== newIdx) journalRootProperty(block, "itemIndex");
20057
- if (block.body !== itemBody) journalRootProperty(block, "body");
20213
+ const journal = ROOT_RENDER_TRANSACTION !== null && !ROOT_RENDER_ROLLBACK;
20214
+ if (journal && block.itemIndex !== newIdx)
20215
+ journalRootProperty(block, "itemIndex", block.itemIndex);
20216
+ if (journal && block.body !== itemBody) journalRootProperty(block, "body", block.body);
20058
20217
  if (pure && block.props === newItem && (indexIndependent || block.itemIndex === newIdx)) {
20059
20218
  block.itemIndex = newIdx;
20060
20219
  block.body = itemBody;
20061
20220
  } else {
20062
- if (block.props !== newItem) journalRootProperty(block, "props");
20063
- if (block.extra !== env) journalRootProperty(block, "extra");
20221
+ if (journal && block.props !== newItem) journalRootProperty(block, "props", block.props);
20222
+ if (journal && block.extra !== env) journalRootProperty(block, "extra", block.extra);
20064
20223
  block.props = newItem;
20065
20224
  block.body = itemBody;
20066
20225
  block.itemIndex = newIdx;
@@ -20101,7 +20260,6 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20101
20260
  const adopt = state.adopt;
20102
20261
  let adoptIndex = 0;
20103
20262
  let prev = null;
20104
- const mounted = [];
20105
20263
  try {
20106
20264
  for (let i = 0; i < newLen; i++) {
20107
20265
  const item = items[i];
@@ -20129,7 +20287,6 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20129
20287
  ssrMarkerless,
20130
20288
  adoptNode
20131
20289
  );
20132
- mounted.push(block);
20133
20290
  oldItems.set(key, block);
20134
20291
  block.key = key;
20135
20292
  block.prevSibling = prev;
@@ -20141,8 +20298,9 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20141
20298
  state.tail = prev;
20142
20299
  state.size = newLen;
20143
20300
  } catch (error) {
20144
- for (let i = mounted.length - 1; i >= 0; i--) {
20145
- const block = mounted[i];
20301
+ while (prev !== null) {
20302
+ const block = prev;
20303
+ prev = block.prevSibling;
20146
20304
  oldItems.delete(block.key);
20147
20305
  if (isSuspenseException(error)) retainDiscardedWarmMemos(block);
20148
20306
  unmountBlock(block, !ROOT_RENDER_TRANSACTION?.retainedCreated?.has(block));
@@ -20524,7 +20682,7 @@ function deferRootOwnedListClear(state, certified = false) {
20524
20682
  newlyRetired.push(block);
20525
20683
  }
20526
20684
  if (block.pending) {
20527
- journalRootProperty(block, "pending");
20685
+ journalRootProperty(block, "pending", block.pending);
20528
20686
  block.pending = false;
20529
20687
  }
20530
20688
  }
@@ -21443,7 +21601,8 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
21443
21601
  const block = rootBlock;
21444
21602
  renderOwner.request = (renderMode) => {
21445
21603
  renderOwner.transaction.rootRequest = true;
21446
- if (block.props !== props) journalRootProperty(block, "props");
21604
+ const previousProps = block.props;
21605
+ if (previousProps !== props) journalRootProperty(block, "props", previousProps);
21447
21606
  block.props = props;
21448
21607
  block.pendingMode = renderMode;
21449
21608
  renderBlock(block);
@@ -21463,7 +21622,7 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
21463
21622
  const previousRoot = rootBlock;
21464
21623
  const previousBody = currentBody;
21465
21624
  const previousKey = currentKey;
21466
- const staged = container.nodeType !== 9 && previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !renderOwner.transaction.created?.has(previousRoot);
21625
+ const staged = container.nodeType !== 9 && previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !isCreatedInRootRender(renderOwner.transaction, previousRoot);
21467
21626
  const oldFirst = staged ? container.firstChild : null;
21468
21627
  const oldLast = staged ? container.lastChild : null;
21469
21628
  journalUndo(() => {
@@ -21807,7 +21966,7 @@ function hydrateRoot(container, bodyOrElement, propsOrOptions, rootOptions) {
21807
21966
  owner.transaction.rootRequest = true;
21808
21967
  owner.transaction.hydrating = true;
21809
21968
  createdInRootRender(rootBlock);
21810
- journalRootProperty(idState, "next");
21969
+ journalRootProperty(idState, "next", idState.next);
21811
21970
  idState.next = 0;
21812
21971
  let firstNode = container.firstChild;
21813
21972
  while (firstNode !== null && (firstNode.nodeType === 10 || isRendererHydrationStyle(firstNode)))
@@ -22453,6 +22612,8 @@ function scriptResource(attrs) {
22453
22612
  textHoleUpdate,
22454
22613
  textSlot,
22455
22614
  tryBlock,
22615
+ updateFreshClassAttr,
22616
+ updateFreshClassName,
22456
22617
  use,
22457
22618
  useActionState,
22458
22619
  useBatch,