@vue/runtime-core 3.5.43 → 3.5.45

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.43
2
+ * @vue/runtime-core v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -207,7 +207,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
207
207
  const res = callWithErrorHandling(fn, instance, type, args);
208
208
  if (res && shared.isPromise(res)) {
209
209
  res.catch((err) => {
210
- handleError(err, instance, type);
210
+ handleError(err, instance, type, void 0, true);
211
211
  });
212
212
  }
213
213
  return res;
@@ -224,7 +224,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
224
224
  );
225
225
  }
226
226
  }
227
- function handleError(err, instance, type, throwInDev = true) {
227
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
228
228
  const contextVNode = instance ? instance.vnode : null;
229
229
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
230
230
  if (instance) {
@@ -233,7 +233,9 @@ function handleError(err, instance, type, throwInDev = true) {
233
233
  const errorInfo = ErrorTypeStrings$1[type] ;
234
234
  while (cur) {
235
235
  const errorCapturedHooks = cur.ec;
236
- if (errorCapturedHooks) {
236
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
237
+ // are deferred or discarded by Suspense.
238
+ (!isAsyncError || cur.scope.active)) {
237
239
  for (let i = 0; i < errorCapturedHooks.length; i++) {
238
240
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
239
241
  return;
@@ -334,21 +336,21 @@ function queuePostFlushCb(cb) {
334
336
  }
335
337
  queueFlush();
336
338
  }
337
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
339
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
338
340
  {
339
341
  seen = seen || /* @__PURE__ */ new Map();
340
342
  }
341
343
  for (; i < queue.length; i++) {
342
344
  const cb = queue[i];
343
345
  if (cb && cb.flags & 2) {
344
- if (instance && cb.id !== instance.uid) {
346
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
345
347
  continue;
346
348
  }
347
349
  if (checkRecursiveUpdates(seen, cb)) {
348
350
  continue;
349
351
  }
350
352
  queue.splice(i, 1);
351
- i--;
353
+ i = instance ? i - 1 : flushIndex;
352
354
  if (cb.flags & 4) {
353
355
  cb.flags &= -2;
354
356
  }
@@ -359,12 +361,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
359
361
  }
360
362
  }
361
363
  }
362
- function flushPostFlushCbs(seen) {
364
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
363
365
  if (pendingPostFlushCbs.length) {
364
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
365
- (a, b) => getId(a) - getId(b)
366
- );
367
- pendingPostFlushCbs.length = 0;
366
+ let cbs = pendingPostFlushCbs;
367
+ let kept = 0;
368
+ if (skip) {
369
+ cbs = [];
370
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
371
+ const cb = pendingPostFlushCbs[i];
372
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
373
+ pendingPostFlushCbs[kept++] = cb;
374
+ } else {
375
+ cbs.push(cb);
376
+ }
377
+ }
378
+ }
379
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
380
+ pendingPostFlushCbs.length = kept;
368
381
  if (activePostFlushCbs) {
369
382
  for (let i = 0; i < deduped.length; i++) {
370
383
  activePostFlushCbs.push(deduped[i]);
@@ -390,6 +403,22 @@ function flushPostFlushCbs(seen) {
390
403
  postFlushIndex = 0;
391
404
  }
392
405
  }
406
+ let isFlushing = false;
407
+ function flushOnAppMount(fn, minUid) {
408
+ if (isFlushing) {
409
+ fn();
410
+ return;
411
+ }
412
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
413
+ fn();
414
+ isFlushing = true;
415
+ try {
416
+ flushPreFlushCbs(void 0, minUid);
417
+ flushPostFlushCbs(void 0, queued, minUid);
418
+ } finally {
419
+ isFlushing = false;
420
+ }
421
+ }
393
422
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
394
423
  function flushJobs(seen) {
395
424
  {
@@ -534,14 +563,32 @@ function reload(id, newComp) {
534
563
  instance.ceReload(newComp.styles);
535
564
  dirtyInstances.delete(instance);
536
565
  } else if (instance.parent) {
537
- queueJob(() => {
538
- if (!(instance.job.flags & 8)) {
539
- isHmrUpdating = true;
566
+ const update = () => {
567
+ if (!instance.scope.active) return;
568
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
569
+ if (pending) {
570
+ pending.asyncDep.catch(shared.NOOP).then(() => {
571
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
572
+ queueJob(update);
573
+ }
574
+ });
575
+ return;
576
+ }
577
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
578
+ if (!dirtyInstances) {
579
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
580
+ }
581
+ dirtyInstances.add(instance);
582
+ isHmrUpdating = true;
583
+ try {
540
584
  instance.parent.update();
585
+ } finally {
541
586
  isHmrUpdating = false;
542
587
  dirtyInstances.delete(instance);
588
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
543
589
  }
544
- });
590
+ };
591
+ queueJob(update);
545
592
  } else if (instance.appContext.reload) {
546
593
  instance.appContext.reload();
547
594
  } else if (typeof window !== "undefined") {
@@ -757,12 +804,31 @@ function withDirectives(vnode, directives) {
757
804
  return vnode;
758
805
  }
759
806
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
760
- const bindings = vnode.dirs;
807
+ let hookVNode = vnode;
808
+ if (name === "beforeMount") {
809
+ vnode._mount = vnode;
810
+ } else if (name === "beforeUpdate") {
811
+ const mount = prevVNode && prevVNode._mount;
812
+ if (mount) {
813
+ mount._latest = vnode;
814
+ vnode._mount = mount;
815
+ }
816
+ } else if (name === "mounted") {
817
+ const latest = vnode._latest;
818
+ vnode._mount = vnode._latest = void 0;
819
+ if (latest) {
820
+ hookVNode = latest;
821
+ latest._mount = void 0;
822
+ }
823
+ }
824
+ const bindings = hookVNode.dirs;
761
825
  const oldBindings = prevVNode && prevVNode.dirs;
762
826
  for (let i = 0; i < bindings.length; i++) {
763
- const binding = bindings[i];
827
+ let binding = bindings[i];
764
828
  if (oldBindings) {
765
829
  binding.oldValue = oldBindings[i].value;
830
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
831
+ binding = shared.extend({}, binding, { oldValue: void 0 });
766
832
  }
767
833
  let hook = binding.dir[name];
768
834
  if (hook) {
@@ -770,7 +836,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
770
836
  callWithAsyncErrorHandling(hook, instance, 8, [
771
837
  vnode.el,
772
838
  binding,
773
- vnode,
839
+ hookVNode,
774
840
  prevVNode
775
841
  ]);
776
842
  reactivity.resetTracking();
@@ -891,6 +957,7 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
891
957
  let isPre = false;
892
958
  if (flush === "post") {
893
959
  baseWatchOptions.scheduler = (job) => {
960
+ job.i = instance;
894
961
  queuePostRenderEffect(job, instance && instance.suspense);
895
962
  };
896
963
  } else if (flush !== "sync") {
@@ -1192,7 +1259,11 @@ const TeleportImpl = {
1192
1259
  };
1193
1260
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
1194
1261
  if (moveType === 0) {
1262
+ if (vnode.targetStart) {
1263
+ insert(vnode.targetStart, container, parentAnchor);
1264
+ }
1195
1265
  insert(vnode.targetAnchor, container, parentAnchor);
1266
+ parentAnchor = vnode.targetAnchor;
1196
1267
  }
1197
1268
  const { el, anchor, shapeFlag, children, props } = vnode;
1198
1269
  const isReorder = moveType === 2;
@@ -1361,10 +1432,6 @@ const BaseTransitionPropsValidators = {
1361
1432
  onAfterAppear: TransitionHookValidator,
1362
1433
  onAppearCancelled: TransitionHookValidator
1363
1434
  };
1364
- const recursiveGetSubtree = (instance) => {
1365
- const subTree = instance.subTree;
1366
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1367
- };
1368
1435
  const BaseTransitionImpl = {
1369
1436
  name: `BaseTransition`,
1370
1437
  props: BaseTransitionPropsValidators,
@@ -1393,19 +1460,17 @@ const BaseTransitionImpl = {
1393
1460
  if (!innerChild) {
1394
1461
  return emptyPlaceholder(child);
1395
1462
  }
1396
- let enterHooks = resolveTransitionHooks(
1463
+ const enterHooks = resolveTransitionHooks(
1397
1464
  innerChild,
1398
1465
  rawProps,
1399
1466
  state,
1400
- instance,
1401
- // #11061, ensure enterHooks is fresh after clone
1402
- (hooks) => enterHooks = hooks
1467
+ instance
1403
1468
  );
1404
1469
  if (innerChild.type !== Comment) {
1405
1470
  setTransitionHooks(innerChild, enterHooks);
1406
1471
  }
1407
1472
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1408
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1473
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
1409
1474
  let leavingHooks = resolveTransitionHooks(
1410
1475
  oldInnerChild,
1411
1476
  rawProps,
@@ -1418,7 +1483,17 @@ const BaseTransitionImpl = {
1418
1483
  leavingHooks.afterLeave = () => {
1419
1484
  state.isLeaving = false;
1420
1485
  if (!(instance.job.flags & 8)) {
1421
- instance.update();
1486
+ if (instance.effect.flags & 2) {
1487
+ const job = () => {
1488
+ if (!(instance.job.flags & 8)) {
1489
+ instance.update();
1490
+ }
1491
+ };
1492
+ job.i = instance;
1493
+ queueJob(job);
1494
+ } else {
1495
+ instance.update();
1496
+ }
1422
1497
  }
1423
1498
  delete leavingHooks.afterLeave;
1424
1499
  oldInnerChild = void 0;
@@ -1482,7 +1557,7 @@ function getLeavingNodesForType(state, vnode) {
1482
1557
  }
1483
1558
  return leavingVNodesCache;
1484
1559
  }
1485
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1560
+ function resolveTransitionHooks(vnode, props, state, instance) {
1486
1561
  const {
1487
1562
  appear,
1488
1563
  mode,
@@ -1538,8 +1613,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1538
1613
  );
1539
1614
  }
1540
1615
  const leavingVNode = leavingVNodesCache[key];
1541
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1542
- leavingVNode.el[leaveCbKey]();
1616
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1617
+ let leavingCb = leavingVNode.el[leaveCbKey];
1618
+ if (!leavingCb) {
1619
+ const leavingRoot = getTransitionRoot(leavingVNode);
1620
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1621
+ }
1622
+ if (leavingCb) {
1623
+ leavingCb();
1624
+ }
1543
1625
  }
1544
1626
  callHook(hook, [el]);
1545
1627
  },
@@ -1614,15 +1696,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1614
1696
  }
1615
1697
  },
1616
1698
  clone(vnode2) {
1617
- const hooks2 = resolveTransitionHooks(
1618
- vnode2,
1619
- props,
1620
- state,
1621
- instance,
1622
- postClone
1623
- );
1624
- if (postClone) postClone(hooks2);
1625
- return hooks2;
1699
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
1700
+ cloned.afterLeave = () => {
1701
+ if (hooks.afterLeave) hooks.afterLeave();
1702
+ };
1703
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
1704
+ if (hooks.delayLeave) {
1705
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
1706
+ } else {
1707
+ delayedLeave();
1708
+ }
1709
+ };
1710
+ cloned.delayedLeave = () => {
1711
+ if (hooks.delayedLeave) hooks.delayedLeave();
1712
+ };
1713
+ return cloned;
1626
1714
  }
1627
1715
  };
1628
1716
  return hooks;
@@ -1663,10 +1751,24 @@ function setTransitionHooks(vnode, hooks) {
1663
1751
  hooks
1664
1752
  );
1665
1753
  } else if (vnode.shapeFlag & 128) {
1666
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1667
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1754
+ const suspense = vnode.suspense;
1755
+ if (suspense) {
1756
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
1757
+ if (branch) {
1758
+ setTransitionHooks(branch, hooks.clone(branch));
1759
+ }
1760
+ } else {
1761
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1762
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1763
+ }
1668
1764
  } else {
1669
1765
  vnode.transition = hooks;
1766
+ if (vnode.type === Fragment && shared.isArray(vnode.children)) {
1767
+ const child = filterSingleRoot(vnode.children, false);
1768
+ if (child) {
1769
+ setTransitionHooks(child, hooks);
1770
+ }
1771
+ }
1670
1772
  }
1671
1773
  }
1672
1774
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1691,6 +1793,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1691
1793
  }
1692
1794
  return ret;
1693
1795
  }
1796
+ function getTransitionRoot(vnode) {
1797
+ if (vnode.component) {
1798
+ return getTransitionRoot(vnode.component.subTree);
1799
+ }
1800
+ if (vnode.type === Fragment) {
1801
+ const child = shared.isArray(vnode.children) && filterSingleRoot(vnode.children, false);
1802
+ return child ? getTransitionRoot(child) : void 0;
1803
+ }
1804
+ if (vnode.type !== Comment) {
1805
+ return vnode;
1806
+ }
1807
+ }
1694
1808
 
1695
1809
  // @__NO_SIDE_EFFECTS__
1696
1810
  function defineComponent(options, extraOptions) {
@@ -2347,7 +2461,7 @@ Server rendered element contains fewer child nodes than client vdom.`
2347
2461
  getContainerType(container),
2348
2462
  slotScopeIds
2349
2463
  );
2350
- if (parentComponent) {
2464
+ if (parentComponent && parentComponent.vnode.el === node) {
2351
2465
  parentComponent.vnode.el = vnode.el;
2352
2466
  updateHOCHostEl(parentComponent, vnode.el);
2353
2467
  }
@@ -2596,14 +2710,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
2596
2710
  break;
2597
2711
  }
2598
2712
  }, opts);
2599
- forEach((el) => {
2600
- if (!(el instanceof Element)) return;
2713
+ const observe = (el) => {
2601
2714
  if (elementIsVisibleInViewport(el)) {
2602
2715
  hydrate();
2603
2716
  ob.disconnect();
2604
2717
  return false;
2605
2718
  }
2719
+ if (getComputedStyle(el).display === "contents") {
2720
+ for (let i = 0; i < el.children.length; i++) {
2721
+ if (observe(el.children[i]) === false) return false;
2722
+ }
2723
+ }
2606
2724
  ob.observe(el);
2725
+ };
2726
+ forEach((el) => {
2727
+ if (!(el instanceof Element)) return;
2728
+ return observe(el);
2607
2729
  });
2608
2730
  return () => ob.disconnect();
2609
2731
  };
@@ -2773,7 +2895,8 @@ function defineAsyncComponent(source) {
2773
2895
  err,
2774
2896
  instance,
2775
2897
  13,
2776
- !errorComponent
2898
+ !errorComponent,
2899
+ true
2777
2900
  );
2778
2901
  };
2779
2902
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -2791,7 +2914,7 @@ function defineAsyncComponent(source) {
2791
2914
  const delayed = reactivity.ref(!!delay);
2792
2915
  let timeoutTimer;
2793
2916
  let delayTimer;
2794
- onUnmounted(() => {
2917
+ reactivity.onScopeDispose(() => {
2795
2918
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
2796
2919
  if (delayTimer != null) clearTimeout(delayTimer);
2797
2920
  });
@@ -2919,6 +3042,12 @@ const KeepAliveImpl = {
2919
3042
  }
2920
3043
  };
2921
3044
  sharedContext.deactivate = (vnode) => {
3045
+ const cached = cache.get(
3046
+ vnode.key == null ? vnode.type : vnode.key
3047
+ );
3048
+ if (!cached || cached.component !== vnode.component) {
3049
+ return false;
3050
+ }
2922
3051
  const instance2 = vnode.component;
2923
3052
  invalidateMount(instance2.m);
2924
3053
  invalidateMount(instance2.a);
@@ -2936,6 +3065,7 @@ const KeepAliveImpl = {
2936
3065
  {
2937
3066
  devtoolsComponentAdded(instance2);
2938
3067
  }
3068
+ return true;
2939
3069
  };
2940
3070
  function unmount(vnode) {
2941
3071
  resetShapeFlag(vnode);
@@ -2957,6 +3087,7 @@ const KeepAliveImpl = {
2957
3087
  unmount(cached);
2958
3088
  } else if (current) {
2959
3089
  resetShapeFlag(current);
3090
+ if (cached) resetShapeFlag(cached);
2960
3091
  }
2961
3092
  cache.delete(key);
2962
3093
  keys.delete(key);
@@ -2974,12 +3105,17 @@ const KeepAliveImpl = {
2974
3105
  const cacheSubtree = () => {
2975
3106
  if (pendingCacheKey != null) {
2976
3107
  if (isSuspense(instance.subTree.type)) {
2977
- queuePostRenderEffect(() => {
3108
+ const cacheInnerChild = () => {
2978
3109
  const vnode = getInnerChild(instance.subTree);
2979
3110
  if (vnode.component) {
2980
3111
  cache.set(pendingCacheKey, vnode);
2981
3112
  }
2982
- }, instance.subTree.suspense);
3113
+ };
3114
+ if (instance.subTree.suspense.pendingBranch) {
3115
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
3116
+ } else {
3117
+ cacheInnerChild();
3118
+ }
2983
3119
  } else {
2984
3120
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
2985
3121
  }
@@ -3110,9 +3246,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
3110
3246
  true
3111
3247
  /* prepend */
3112
3248
  );
3113
- onUnmounted(() => {
3114
- shared.remove(keepAliveRoot[type], injected);
3115
- }, target);
3249
+ const removal = injectHook(
3250
+ "um",
3251
+ () => shared.remove(keepAliveRoot[type], injected),
3252
+ target
3253
+ );
3254
+ removal.flags = 16;
3116
3255
  }
3117
3256
  function resetShapeFlag(vnode) {
3118
3257
  vnode.shapeFlag &= -257;
@@ -3248,9 +3387,11 @@ function renderList(source, renderItem, cache, index) {
3248
3387
  }
3249
3388
  } else if (typeof source === "number") {
3250
3389
  if (!Number.isInteger(source) || source < 0) {
3251
- warn$1(
3252
- `The v-for range expects a positive integer value but got ${source}.`
3253
- );
3390
+ {
3391
+ warn$1(
3392
+ `The v-for range expects a positive integer value but got ${source}.`
3393
+ );
3394
+ }
3254
3395
  ret = [];
3255
3396
  } else {
3256
3397
  ret = new Array(source);
@@ -4888,7 +5029,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4888
5029
  }
4889
5030
  for (let i = 0; i < nextKeys.length; i++) {
4890
5031
  const key = nextKeys[i];
4891
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
5032
+ if (!shared.hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4892
5033
  return true;
4893
5034
  }
4894
5035
  }
@@ -5768,6 +5909,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5768
5909
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
5769
5910
  if (needCallTransitionHooks) {
5770
5911
  transition.beforeEnter(el);
5912
+ } else if (transition && !transition.persisted) {
5913
+ el[deferredEnterKey] = true;
5771
5914
  }
5772
5915
  hostInsert(el, container, anchor);
5773
5916
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -5927,15 +6070,16 @@ function baseCreateRenderer(options, createHydrationFns) {
5927
6070
  for (let i = 0; i < newChildren.length; i++) {
5928
6071
  const oldVNode = oldChildren[i];
5929
6072
  const newVNode = newChildren[i];
6073
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
5930
6074
  const container = (
5931
6075
  // oldVNode may be an errored async setup() component inside Suspense
5932
6076
  // which will not have a mounted element
5933
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
6077
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
5934
6078
  // of the Fragment itself so it can move its children.
5935
6079
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5936
6080
  // which also requires the correct parent container
5937
6081
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5938
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
6082
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
5939
6083
  // In other cases, the parent container is not actually used so we
5940
6084
  // just pass the block element here to avoid a DOM parentNode call.
5941
6085
  fallbackContainer
@@ -6099,7 +6243,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6099
6243
  }
6100
6244
  if (isHmrUpdating) initialVNode.el = null;
6101
6245
  if (instance.asyncDep) {
6102
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6246
+ parentSuspense && parentSuspense.registerDep(
6247
+ instance,
6248
+ setupRenderEffect,
6249
+ optimized,
6250
+ namespace
6251
+ );
6103
6252
  if (!initialVNode.el) {
6104
6253
  const placeholder = instance.subTree = createVNode(Comment);
6105
6254
  processCommentNode(null, placeholder, container, anchor);
@@ -6129,6 +6278,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6129
6278
  pushWarningContext(n2);
6130
6279
  }
6131
6280
  n2.el = n1.el;
6281
+ n2.placeholder = n1.placeholder;
6132
6282
  updateComponentPreRender(instance, n2, optimized);
6133
6283
  {
6134
6284
  popWarningContext();
@@ -6140,6 +6290,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6140
6290
  }
6141
6291
  } else {
6142
6292
  n2.el = n1.el;
6293
+ n2.placeholder = n1.placeholder;
6143
6294
  instance.vnode = n2;
6144
6295
  }
6145
6296
  };
@@ -6242,16 +6393,23 @@ function baseCreateRenderer(options, createHydrationFns) {
6242
6393
  } else {
6243
6394
  let { next, bu, u, parent, vnode } = instance;
6244
6395
  {
6245
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
6246
- if (nonHydratedAsyncRoot) {
6396
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
6397
+ if (unresolvedAsyncRoot) {
6247
6398
  if (next) {
6248
6399
  next.el = vnode.el;
6249
6400
  updateComponentPreRender(instance, next, optimized);
6250
6401
  }
6251
- nonHydratedAsyncRoot.asyncDep.then(() => {
6252
- queuePostRenderEffect(() => {
6253
- if (!instance.isUnmounted) update();
6254
- }, parentSuspense);
6402
+ unresolvedAsyncRoot.asyncDep.then(() => {
6403
+ const retry = () => {
6404
+ if (instance.job.flags & 8) return;
6405
+ if (parentSuspense && parentSuspense.pendingBranch) {
6406
+ queuePostRenderEffect(retry, parentSuspense);
6407
+ } else {
6408
+ update();
6409
+ }
6410
+ };
6411
+ retry.flags = 16 | 32;
6412
+ queuePostRenderEffect(retry, parentSuspense);
6255
6413
  });
6256
6414
  return;
6257
6415
  }
@@ -6290,8 +6448,11 @@ function baseCreateRenderer(options, createHydrationFns) {
6290
6448
  patch(
6291
6449
  prevTree,
6292
6450
  nextTree,
6293
- // parent may have changed if it's in a teleport
6294
- hostParentNode(prevTree.el),
6451
+ // parent may have changed if it's in a teleport. a root that is a
6452
+ // pending async component only has its placeholder comment
6453
+ hostParentNode(
6454
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
6455
+ ),
6295
6456
  // anchor may have changed if it's in a fragment
6296
6457
  getNextHostNode(prevTree),
6297
6458
  instance,
@@ -6731,8 +6892,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6731
6892
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
6732
6893
  parentComponent.renderCache[cacheIndex] = void 0;
6733
6894
  }
6734
- if (shapeFlag & 256) {
6735
- parentComponent.ctx.deactivate(vnode);
6895
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
6736
6896
  return;
6737
6897
  }
6738
6898
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6793,18 +6953,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6793
6953
  };
6794
6954
  const remove = (vnode) => {
6795
6955
  const { type, el, anchor, transition } = vnode;
6796
- if (type === Fragment) {
6797
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
6798
- vnode.children.forEach((child) => {
6799
- if (child.type === Comment) {
6800
- hostRemove(child.el);
6801
- } else {
6802
- remove(child);
6803
- }
6804
- });
6805
- } else {
6806
- removeFragment(el, anchor);
6807
- }
6956
+ const isFragment = type === Fragment;
6957
+ if (isFragment && !transition) {
6958
+ removeFragment(el, anchor);
6808
6959
  return;
6809
6960
  }
6810
6961
  if (type === Static) {
@@ -6814,17 +6965,25 @@ function baseCreateRenderer(options, createHydrationFns) {
6814
6965
  }
6815
6966
  return;
6816
6967
  }
6968
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
6817
6969
  const performRemove = () => {
6818
- hostRemove(el);
6970
+ if (isFragment) {
6971
+ if (hostParentNode(el)) {
6972
+ removeFragment(el, anchor);
6973
+ }
6974
+ } else {
6975
+ hostRemove(el);
6976
+ }
6819
6977
  if (transition && !transition.persisted && transition.afterLeave) {
6820
6978
  transition.afterLeave();
6821
6979
  }
6822
6980
  };
6823
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6981
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
6824
6982
  const { leave, delayLeave } = transition;
6825
- const performLeave = () => leave(el, performRemove);
6983
+ const leavingEl = leavingNode.el;
6984
+ const performLeave = () => leave(leavingEl, performRemove);
6826
6985
  if (delayLeave) {
6827
- delayLeave(vnode.el, performRemove, performLeave);
6986
+ delayLeave(leavingEl, performRemove, performLeave);
6828
6987
  } else {
6829
6988
  performLeave();
6830
6989
  }
@@ -6855,16 +7014,18 @@ function baseCreateRenderer(options, createHydrationFns) {
6855
7014
  if (job) {
6856
7015
  job.flags |= 8;
6857
7016
  unmount(subTree, instance, parentSuspense, doRemove);
6858
- } else if (instance.vnode.el && subTree) {
7017
+ } else if (subTree) {
6859
7018
  subTree.transition = instance.vnode.transition;
6860
7019
  unmount(subTree, instance, parentSuspense, doRemove);
6861
7020
  }
6862
7021
  if (um) {
6863
7022
  queuePostRenderEffect(um, parentSuspense);
6864
7023
  }
6865
- queuePostRenderEffect(() => {
7024
+ const markUnmounted = () => {
6866
7025
  instance.isUnmounted = true;
6867
- }, parentSuspense);
7026
+ };
7027
+ markUnmounted.flags = 16;
7028
+ queuePostRenderEffect(markUnmounted, parentSuspense);
6868
7029
  {
6869
7030
  devtoolsComponentRemoved(instance);
6870
7031
  }
@@ -6885,32 +7046,26 @@ function baseCreateRenderer(options, createHydrationFns) {
6885
7046
  const teleportEnd = el && el[TeleportEndKey];
6886
7047
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
6887
7048
  };
6888
- let isFlushing = false;
6889
7049
  const render = (vnode, container, namespace) => {
6890
- let instance;
6891
- if (vnode == null) {
6892
- if (container._vnode) {
6893
- unmount(container._vnode, null, null, true);
6894
- instance = container._vnode.component;
7050
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
7051
+ flushOnAppMount(() => {
7052
+ if (vnode == null) {
7053
+ if (container._vnode) {
7054
+ unmount(container._vnode, null, null, true);
7055
+ }
7056
+ } else {
7057
+ patch(
7058
+ container._vnode || null,
7059
+ vnode,
7060
+ container,
7061
+ null,
7062
+ null,
7063
+ null,
7064
+ namespace
7065
+ );
6895
7066
  }
6896
- } else {
6897
- patch(
6898
- container._vnode || null,
6899
- vnode,
6900
- container,
6901
- null,
6902
- null,
6903
- null,
6904
- namespace
6905
- );
6906
- }
6907
- container._vnode = vnode;
6908
- if (!isFlushing) {
6909
- isFlushing = true;
6910
- flushPreFlushCbs(instance);
6911
- flushPostFlushCbs();
6912
- isFlushing = false;
6913
- }
7067
+ container._vnode = vnode;
7068
+ }, minUid);
6914
7069
  };
6915
7070
  const internals = {
6916
7071
  p: patch,
@@ -7022,13 +7177,13 @@ function getSequence(arr) {
7022
7177
  }
7023
7178
  return result;
7024
7179
  }
7025
- function locateNonHydratedAsyncRoot(instance) {
7180
+ function locateUnresolvedAsyncRoot(instance) {
7026
7181
  const subComponent = instance.subTree.component;
7027
7182
  if (subComponent) {
7028
7183
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
7029
7184
  return subComponent;
7030
7185
  } else {
7031
- return locateNonHydratedAsyncRoot(subComponent);
7186
+ return locateUnresolvedAsyncRoot(subComponent);
7032
7187
  }
7033
7188
  }
7034
7189
  }
@@ -7046,11 +7201,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
7046
7201
  if (instance) {
7047
7202
  return resolveAsyncComponentPlaceholder(instance.subTree);
7048
7203
  }
7204
+ const suspense = anchorVnode.suspense;
7205
+ if (suspense && suspense.activeBranch) {
7206
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
7207
+ }
7049
7208
  return null;
7050
7209
  }
7051
7210
 
7052
7211
  const isSuspense = (type) => type.__isSuspense;
7053
7212
  let suspenseId = 0;
7213
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
7054
7214
  const SuspenseImpl = {
7055
7215
  name: "Suspense",
7056
7216
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -7072,11 +7232,22 @@ const SuspenseImpl = {
7072
7232
  rendererInternals
7073
7233
  );
7074
7234
  } else {
7075
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7076
- n2.suspense = n1.suspense;
7077
- n2.suspense.vnode = n2;
7078
- n2.el = n1.el;
7079
- return;
7235
+ const suspense = n1.suspense;
7236
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
7237
+ const owner = suspense.parentComponent;
7238
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
7239
+ if (retained ? (
7240
+ // deps can outlive the pending branch: skip only while it exists
7241
+ parentSuspense.pendingBranch && !isSameVNodeType(
7242
+ n2.ssContent,
7243
+ suspense.pendingBranch || suspense.activeBranch
7244
+ )
7245
+ ) : !suspense.isInFallback) {
7246
+ n2.suspense = suspense;
7247
+ suspense.vnode = n2;
7248
+ n2.el = n1.el;
7249
+ return;
7250
+ }
7080
7251
  }
7081
7252
  patchSuspense(
7082
7253
  n1,
@@ -7101,6 +7272,38 @@ function triggerEvent(vnode, name) {
7101
7272
  eventListener();
7102
7273
  }
7103
7274
  }
7275
+ function enterDeferred(branch) {
7276
+ const enters = [];
7277
+ collectDeferredEnters(branch, enters, true);
7278
+ if (enters.length) {
7279
+ queuePostFlushCb(enters);
7280
+ }
7281
+ }
7282
+ function collectDeferredEnters(vnode, enters, isRoot) {
7283
+ const { el, transition, children, shapeFlag } = vnode;
7284
+ if (shapeFlag & 6) {
7285
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
7286
+ return;
7287
+ }
7288
+ if (shapeFlag & (128 | 64)) {
7289
+ return;
7290
+ }
7291
+ if (shapeFlag & 1) {
7292
+ if (!isRoot && el && el[deferredEnterKey]) {
7293
+ el[deferredEnterKey] = void 0;
7294
+ if (transition && !transition.persisted) {
7295
+ transition.beforeEnter(el);
7296
+ enters.push(() => transition.enter(el));
7297
+ }
7298
+ }
7299
+ isRoot = false;
7300
+ }
7301
+ if (shapeFlag & 16) {
7302
+ for (let i = 0; i < children.length; i++) {
7303
+ collectDeferredEnters(children[i], enters, isRoot);
7304
+ }
7305
+ }
7306
+ }
7104
7307
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7105
7308
  const {
7106
7309
  p: patch,
@@ -7200,7 +7403,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7200
7403
  unmount(pendingBranch, parentComponent, suspense);
7201
7404
  }
7202
7405
  suspense.deps = 0;
7203
- suspense.effects.length = 0;
7406
+ discardEffects(suspense);
7204
7407
  suspense.hiddenContainer = createElement("div");
7205
7408
  if (isInFallback) {
7206
7409
  patch(
@@ -7278,11 +7481,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7278
7481
  } else {
7279
7482
  triggerEvent(n2, "onPending");
7280
7483
  suspense.pendingBranch = newBranch;
7281
- if (newBranch.shapeFlag & 512) {
7282
- suspense.pendingId = newBranch.component.suspenseId;
7283
- } else {
7284
- suspense.pendingId = suspenseId++;
7285
- }
7484
+ suspense.pendingId = suspenseId++;
7286
7485
  patch(
7287
7486
  null,
7288
7487
  newBranch,
@@ -7297,12 +7496,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7297
7496
  if (suspense.deps <= 0) {
7298
7497
  suspense.resolve();
7299
7498
  } else {
7300
- const { timeout, pendingId } = suspense;
7499
+ const { timeout } = suspense;
7301
7500
  if (timeout > 0) {
7302
- setTimeout(() => {
7303
- if (suspense.pendingId === pendingId) {
7304
- suspense.fallback(newFallback);
7305
- }
7501
+ suspense.timeoutTimer = setTimeout(() => {
7502
+ suspense.timeoutTimer = void 0;
7503
+ suspense.fallback(suspense.vnode.ssFallback);
7306
7504
  }, timeout);
7307
7505
  } else if (timeout === 0) {
7308
7506
  suspense.fallback(newFallback);
@@ -7349,6 +7547,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7349
7547
  deps: 0,
7350
7548
  pendingId: suspenseId++,
7351
7549
  timeout: typeof timeout === "number" ? timeout : -1,
7550
+ timeoutTimer: void 0,
7352
7551
  activeBranch: null,
7353
7552
  isFallbackMountPending: false,
7354
7553
  pendingBranch: null,
@@ -7387,7 +7586,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7387
7586
  let hasUpdatedAnchor = false;
7388
7587
  if (delayEnter) {
7389
7588
  activeBranch.transition.afterLeave = () => {
7390
- if (pendingId === suspense.pendingId) {
7589
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
7590
+ enterDeferred(pendingBranch);
7391
7591
  move(
7392
7592
  pendingBranch,
7393
7593
  container2,
@@ -7402,7 +7602,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7402
7602
  };
7403
7603
  }
7404
7604
  if (activeBranch && !suspense.isFallbackMountPending) {
7405
- if (parentNode(activeBranch.el) === container2) {
7605
+ if (parentNode(
7606
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
7607
+ ) === container2) {
7406
7608
  anchor = next(activeBranch);
7407
7609
  hasUpdatedAnchor = true;
7408
7610
  }
@@ -7412,13 +7614,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7412
7614
  }
7413
7615
  }
7414
7616
  if (!delayEnter) {
7617
+ enterDeferred(pendingBranch);
7415
7618
  move(pendingBranch, container2, anchor, 0);
7416
7619
  }
7417
7620
  }
7621
+ clearTimeout(suspense.timeoutTimer);
7622
+ suspense.timeoutTimer = void 0;
7418
7623
  suspense.isFallbackMountPending = false;
7419
7624
  setActiveBranch(suspense, pendingBranch);
7420
7625
  suspense.pendingBranch = null;
7421
7626
  suspense.isInFallback = false;
7627
+ let kept = 0;
7628
+ for (let i = 0; i < effects.length; i++) {
7629
+ const effect = effects[i];
7630
+ if (effect.flags & 32) {
7631
+ queuePostFlushCb(effect);
7632
+ } else {
7633
+ effects[kept++] = effect;
7634
+ }
7635
+ }
7636
+ effects.length = kept;
7422
7637
  let parent = suspense.parent;
7423
7638
  let hasUnresolvedAncestor = false;
7424
7639
  while (parent) {
@@ -7447,7 +7662,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7447
7662
  triggerEvent(vnode2, "onResolve");
7448
7663
  },
7449
7664
  fallback(fallbackVNode) {
7450
- if (!suspense.pendingBranch) {
7665
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
7451
7666
  return;
7452
7667
  }
7453
7668
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -7455,7 +7670,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7455
7670
  const anchor2 = next(activeBranch);
7456
7671
  const mountFallback = () => {
7457
7672
  suspense.isFallbackMountPending = false;
7458
- if (!suspense.isInFallback) {
7673
+ if (suspense.isUnmounted || !suspense.isInFallback) {
7459
7674
  return;
7460
7675
  }
7461
7676
  const latestFallback = suspense.vnode.ssFallback;
@@ -7498,25 +7713,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7498
7713
  next() {
7499
7714
  return suspense.activeBranch && next(suspense.activeBranch);
7500
7715
  },
7501
- registerDep(instance, setupRenderEffect, optimized2) {
7716
+ // `namespace` intentionally shadows the boundary's own: the dep must be
7717
+ // mounted with the namespace of the position it was rendered at, which can
7718
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
7719
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
7502
7720
  const isInPendingSuspense = !!suspense.pendingBranch;
7503
7721
  if (isInPendingSuspense) {
7504
7722
  suspense.deps++;
7505
7723
  }
7506
7724
  const hydratedEl = instance.vnode.el;
7507
- instance.asyncDep.catch((err) => {
7508
- handleError(err, instance, 0);
7509
- }).then((asyncSetupResult) => {
7510
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
7511
- return;
7512
- }
7513
- unsetCurrentInstance();
7514
- if (hydratedEl && !instance.scope.active) {
7515
- if (isInPendingSuspense && --suspense.deps === 0) {
7516
- suspense.resolve();
7517
- }
7518
- return;
7519
- }
7725
+ const render = (asyncSetupResult) => {
7520
7726
  instance.asyncResolved = true;
7521
7727
  const { vnode: vnode2 } = instance;
7522
7728
  {
@@ -7538,7 +7744,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7538
7744
  // consider the comment placeholder case.
7539
7745
  hydratedEl ? null : next(instance.subTree),
7540
7746
  suspense,
7541
- namespace,
7747
+ namespace2,
7542
7748
  optimized2
7543
7749
  );
7544
7750
  if (placeholder) {
@@ -7549,13 +7755,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7549
7755
  {
7550
7756
  popWarningContext();
7551
7757
  }
7552
- if (isInPendingSuspense && --suspense.deps === 0) {
7758
+ };
7759
+ instance.asyncDep.catch((err) => {
7760
+ handleError(err, instance, 0, false, true);
7761
+ return () => null;
7762
+ }).then((asyncSetupResult) => {
7763
+ if (instance.isUnmounted || suspense.isUnmounted) {
7764
+ return;
7765
+ }
7766
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
7767
+ unsetCurrentInstance();
7768
+ if (!instance.scope.active) {
7769
+ if (isPendingDep && --suspense.deps === 0) {
7770
+ suspense.resolve();
7771
+ }
7772
+ return;
7773
+ }
7774
+ if (!isPendingDep && suspense.pendingBranch) {
7775
+ const job = () => {
7776
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
7777
+ return;
7778
+ }
7779
+ if (suspense.pendingBranch) {
7780
+ queueEffectWithSuspense(job, suspense);
7781
+ } else {
7782
+ render(asyncSetupResult);
7783
+ }
7784
+ };
7785
+ job.flags = 16 | 32;
7786
+ queueEffectWithSuspense(job, suspense);
7787
+ return;
7788
+ }
7789
+ render(asyncSetupResult);
7790
+ if (isPendingDep && --suspense.deps === 0) {
7553
7791
  suspense.resolve();
7554
7792
  }
7555
7793
  });
7556
7794
  },
7557
7795
  unmount(parentSuspense2, doRemove) {
7558
7796
  suspense.isUnmounted = true;
7797
+ clearTimeout(suspense.timeoutTimer);
7798
+ suspense.timeoutTimer = void 0;
7799
+ if (parentSuspenseId !== void 0) {
7800
+ const parent = suspense.parent;
7801
+ const pendingId = parentSuspenseId;
7802
+ parentSuspenseId = void 0;
7803
+ queuePostFlushCb(() => {
7804
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
7805
+ parent.resolve();
7806
+ }
7807
+ });
7808
+ }
7559
7809
  if (suspense.activeBranch) {
7560
7810
  unmount(
7561
7811
  suspense.activeBranch,
@@ -7565,12 +7815,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7565
7815
  );
7566
7816
  }
7567
7817
  if (suspense.pendingBranch) {
7568
- unmount(
7569
- suspense.pendingBranch,
7570
- parentComponent,
7571
- parentSuspense2,
7572
- doRemove
7573
- );
7818
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
7819
+ discardEffects(suspense);
7574
7820
  }
7575
7821
  }
7576
7822
  };
@@ -7640,6 +7886,16 @@ function normalizeSuspenseSlot(s) {
7640
7886
  }
7641
7887
  return s;
7642
7888
  }
7889
+ function discardEffects(suspense) {
7890
+ const { effects } = suspense;
7891
+ for (let i = 0; i < effects.length; i++) {
7892
+ const effect = effects[i];
7893
+ if (effect.flags & 16) {
7894
+ queuePostFlushCb(effect);
7895
+ }
7896
+ }
7897
+ effects.length = 0;
7898
+ }
7643
7899
  function queueEffectWithSuspense(fn, suspense) {
7644
7900
  if (suspense && suspense.pendingBranch) {
7645
7901
  if (shared.isArray(fn)) {
@@ -7891,7 +8147,8 @@ Component that was made reactive: `,
7891
8147
  }
7892
8148
  function guardReactiveProps(props) {
7893
8149
  if (!props) return null;
7894
- return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
8150
+ if (reactivity.isProxy(props)) return shared.extend({}, props);
8151
+ return isInternalObject(props) ? shared.extend({}, props[rawAttrsKey] || props) : props;
7895
8152
  }
7896
8153
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7897
8154
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -8070,8 +8327,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8070
8327
  ]);
8071
8328
  }
8072
8329
 
8073
- const emptyAppContext = createAppContext();
8330
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
8074
8331
  let uid = 0;
8332
+ function getNextUid() {
8333
+ return uid;
8334
+ }
8075
8335
  function createComponentInstance(vnode, parent, suspense) {
8076
8336
  const type = vnode.type;
8077
8337
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8280,7 +8540,8 @@ function setupStatefulComponent(instance, isSSR) {
8280
8540
  setInSSRSetupState(false);
8281
8541
  }
8282
8542
  }).catch((e) => {
8283
- handleError(e, instance, 0);
8543
+ handleError(e, instance, 0, void 0, true);
8544
+ instance.ssrRender = (_, push) => push("<!---->");
8284
8545
  });
8285
8546
  } else {
8286
8547
  instance.asyncDep = setupResult;
@@ -8388,11 +8649,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8388
8649
  }
8389
8650
  }
8390
8651
  }
8652
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
8391
8653
  const attrsProxyHandlers = {
8392
8654
  get(target, key) {
8393
8655
  markAttrsAccessed();
8394
8656
  reactivity.track(target, "get", "");
8395
- return target[key];
8657
+ return key === rawAttrsKey ? target : target[key];
8396
8658
  },
8397
8659
  set() {
8398
8660
  warn$1(`setupContext.attrs is readonly.`);
@@ -8744,7 +9006,7 @@ function isMemoSame(cached, memo) {
8744
9006
  return true;
8745
9007
  }
8746
9008
 
8747
- const version = "3.5.43";
9009
+ const version = "3.5.45";
8748
9010
  const warn = warn$1 ;
8749
9011
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8750
9012
  const devtools = devtools$1 ;