@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,9 +1,9 @@
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
  **/
6
- import { pauseTracking, resetTracking, isRef, toRaw, traverse, watch as watch$1, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
6
+ import { pauseTracking, resetTracking, isRef, toRaw, traverse, watch as watch$1, shallowRef, readonly, isReactive, ref, onScopeDispose, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
7
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
8
8
  import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, NOOP, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, hyphenate, hasChanged, looseToNumber, isModelListener, looseEqual, EMPTY_ARR, toRawType, makeMap, toNumber } from '@vue/shared';
9
9
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
@@ -206,7 +206,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
206
206
  const res = callWithErrorHandling(fn, instance, type, args);
207
207
  if (res && isPromise(res)) {
208
208
  res.catch((err) => {
209
- handleError(err, instance, type);
209
+ handleError(err, instance, type, void 0, true);
210
210
  });
211
211
  }
212
212
  return res;
@@ -223,7 +223,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
223
223
  );
224
224
  }
225
225
  }
226
- function handleError(err, instance, type, throwInDev = true) {
226
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
227
227
  const contextVNode = instance ? instance.vnode : null;
228
228
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
229
229
  if (instance) {
@@ -232,7 +232,9 @@ function handleError(err, instance, type, throwInDev = true) {
232
232
  const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
233
233
  while (cur) {
234
234
  const errorCapturedHooks = cur.ec;
235
- if (errorCapturedHooks) {
235
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
236
+ // are deferred or discarded by Suspense.
237
+ (!isAsyncError || cur.scope.active)) {
236
238
  for (let i = 0; i < errorCapturedHooks.length; i++) {
237
239
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
238
240
  return;
@@ -337,21 +339,21 @@ function queuePostFlushCb(cb) {
337
339
  }
338
340
  queueFlush();
339
341
  }
340
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
342
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
341
343
  if (!!(process.env.NODE_ENV !== "production")) {
342
344
  seen = seen || /* @__PURE__ */ new Map();
343
345
  }
344
346
  for (; i < queue.length; i++) {
345
347
  const cb = queue[i];
346
348
  if (cb && cb.flags & 2) {
347
- if (instance && cb.id !== instance.uid) {
349
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
348
350
  continue;
349
351
  }
350
352
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
351
353
  continue;
352
354
  }
353
355
  queue.splice(i, 1);
354
- i--;
356
+ i = instance ? i - 1 : flushIndex;
355
357
  if (cb.flags & 4) {
356
358
  cb.flags &= -2;
357
359
  }
@@ -362,12 +364,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
362
364
  }
363
365
  }
364
366
  }
365
- function flushPostFlushCbs(seen) {
367
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
366
368
  if (pendingPostFlushCbs.length) {
367
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
368
- (a, b) => getId(a) - getId(b)
369
- );
370
- pendingPostFlushCbs.length = 0;
369
+ let cbs = pendingPostFlushCbs;
370
+ let kept = 0;
371
+ if (skip) {
372
+ cbs = [];
373
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
374
+ const cb = pendingPostFlushCbs[i];
375
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
376
+ pendingPostFlushCbs[kept++] = cb;
377
+ } else {
378
+ cbs.push(cb);
379
+ }
380
+ }
381
+ }
382
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
383
+ pendingPostFlushCbs.length = kept;
371
384
  if (activePostFlushCbs) {
372
385
  for (let i = 0; i < deduped.length; i++) {
373
386
  activePostFlushCbs.push(deduped[i]);
@@ -393,6 +406,22 @@ function flushPostFlushCbs(seen) {
393
406
  postFlushIndex = 0;
394
407
  }
395
408
  }
409
+ let isFlushing = false;
410
+ function flushOnAppMount(fn, minUid) {
411
+ if (isFlushing) {
412
+ fn();
413
+ return;
414
+ }
415
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
416
+ fn();
417
+ isFlushing = true;
418
+ try {
419
+ flushPreFlushCbs(void 0, minUid);
420
+ flushPostFlushCbs(void 0, queued, minUid);
421
+ } finally {
422
+ isFlushing = false;
423
+ }
424
+ }
396
425
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
397
426
  function flushJobs(seen) {
398
427
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -537,14 +566,32 @@ function reload(id, newComp) {
537
566
  instance.ceReload(newComp.styles);
538
567
  dirtyInstances.delete(instance);
539
568
  } else if (instance.parent) {
540
- queueJob(() => {
541
- if (!(instance.job.flags & 8)) {
542
- isHmrUpdating = true;
569
+ const update = () => {
570
+ if (!instance.scope.active) return;
571
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
572
+ if (pending) {
573
+ pending.asyncDep.catch(NOOP).then(() => {
574
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
575
+ queueJob(update);
576
+ }
577
+ });
578
+ return;
579
+ }
580
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
581
+ if (!dirtyInstances) {
582
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
583
+ }
584
+ dirtyInstances.add(instance);
585
+ isHmrUpdating = true;
586
+ try {
543
587
  instance.parent.update();
588
+ } finally {
544
589
  isHmrUpdating = false;
545
590
  dirtyInstances.delete(instance);
591
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
546
592
  }
547
- });
593
+ };
594
+ queueJob(update);
548
595
  } else if (instance.appContext.reload) {
549
596
  instance.appContext.reload();
550
597
  } else if (typeof window !== "undefined") {
@@ -760,12 +807,31 @@ function withDirectives(vnode, directives) {
760
807
  return vnode;
761
808
  }
762
809
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
763
- const bindings = vnode.dirs;
810
+ let hookVNode = vnode;
811
+ if (name === "beforeMount") {
812
+ vnode._mount = vnode;
813
+ } else if (name === "beforeUpdate") {
814
+ const mount = prevVNode && prevVNode._mount;
815
+ if (mount) {
816
+ mount._latest = vnode;
817
+ vnode._mount = mount;
818
+ }
819
+ } else if (name === "mounted") {
820
+ const latest = vnode._latest;
821
+ vnode._mount = vnode._latest = void 0;
822
+ if (latest) {
823
+ hookVNode = latest;
824
+ latest._mount = void 0;
825
+ }
826
+ }
827
+ const bindings = hookVNode.dirs;
764
828
  const oldBindings = prevVNode && prevVNode.dirs;
765
829
  for (let i = 0; i < bindings.length; i++) {
766
- const binding = bindings[i];
830
+ let binding = bindings[i];
767
831
  if (oldBindings) {
768
832
  binding.oldValue = oldBindings[i].value;
833
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
834
+ binding = extend({}, binding, { oldValue: void 0 });
769
835
  }
770
836
  let hook = binding.dir[name];
771
837
  if (hook) {
@@ -773,7 +839,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
773
839
  callWithAsyncErrorHandling(hook, instance, 8, [
774
840
  vnode.el,
775
841
  binding,
776
- vnode,
842
+ hookVNode,
777
843
  prevVNode
778
844
  ]);
779
845
  resetTracking();
@@ -894,6 +960,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
894
960
  let isPre = false;
895
961
  if (flush === "post") {
896
962
  baseWatchOptions.scheduler = (job) => {
963
+ job.i = instance;
897
964
  queuePostRenderEffect(job, instance && instance.suspense);
898
965
  };
899
966
  } else if (flush !== "sync") {
@@ -1195,7 +1262,11 @@ const TeleportImpl = {
1195
1262
  };
1196
1263
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
1197
1264
  if (moveType === 0) {
1265
+ if (vnode.targetStart) {
1266
+ insert(vnode.targetStart, container, parentAnchor);
1267
+ }
1198
1268
  insert(vnode.targetAnchor, container, parentAnchor);
1269
+ parentAnchor = vnode.targetAnchor;
1199
1270
  }
1200
1271
  const { el, anchor, shapeFlag, children, props } = vnode;
1201
1272
  const isReorder = moveType === 2;
@@ -1364,10 +1435,6 @@ const BaseTransitionPropsValidators = {
1364
1435
  onAfterAppear: TransitionHookValidator,
1365
1436
  onAppearCancelled: TransitionHookValidator
1366
1437
  };
1367
- const recursiveGetSubtree = (instance) => {
1368
- const subTree = instance.subTree;
1369
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1370
- };
1371
1438
  const BaseTransitionImpl = {
1372
1439
  name: `BaseTransition`,
1373
1440
  props: BaseTransitionPropsValidators,
@@ -1396,19 +1463,17 @@ const BaseTransitionImpl = {
1396
1463
  if (!innerChild) {
1397
1464
  return emptyPlaceholder(child);
1398
1465
  }
1399
- let enterHooks = resolveTransitionHooks(
1466
+ const enterHooks = resolveTransitionHooks(
1400
1467
  innerChild,
1401
1468
  rawProps,
1402
1469
  state,
1403
- instance,
1404
- // #11061, ensure enterHooks is fresh after clone
1405
- (hooks) => enterHooks = hooks
1470
+ instance
1406
1471
  );
1407
1472
  if (innerChild.type !== Comment) {
1408
1473
  setTransitionHooks(innerChild, enterHooks);
1409
1474
  }
1410
1475
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1411
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1476
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
1412
1477
  let leavingHooks = resolveTransitionHooks(
1413
1478
  oldInnerChild,
1414
1479
  rawProps,
@@ -1421,7 +1486,17 @@ const BaseTransitionImpl = {
1421
1486
  leavingHooks.afterLeave = () => {
1422
1487
  state.isLeaving = false;
1423
1488
  if (!(instance.job.flags & 8)) {
1424
- instance.update();
1489
+ if (instance.effect.flags & 2) {
1490
+ const job = () => {
1491
+ if (!(instance.job.flags & 8)) {
1492
+ instance.update();
1493
+ }
1494
+ };
1495
+ job.i = instance;
1496
+ queueJob(job);
1497
+ } else {
1498
+ instance.update();
1499
+ }
1425
1500
  }
1426
1501
  delete leavingHooks.afterLeave;
1427
1502
  oldInnerChild = void 0;
@@ -1486,7 +1561,7 @@ function getLeavingNodesForType(state, vnode) {
1486
1561
  }
1487
1562
  return leavingVNodesCache;
1488
1563
  }
1489
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1564
+ function resolveTransitionHooks(vnode, props, state, instance) {
1490
1565
  const {
1491
1566
  appear,
1492
1567
  mode,
@@ -1542,8 +1617,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1542
1617
  );
1543
1618
  }
1544
1619
  const leavingVNode = leavingVNodesCache[key];
1545
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1546
- leavingVNode.el[leaveCbKey]();
1620
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1621
+ let leavingCb = leavingVNode.el[leaveCbKey];
1622
+ if (!leavingCb) {
1623
+ const leavingRoot = getTransitionRoot(leavingVNode);
1624
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1625
+ }
1626
+ if (leavingCb) {
1627
+ leavingCb();
1628
+ }
1547
1629
  }
1548
1630
  callHook(hook, [el]);
1549
1631
  },
@@ -1618,15 +1700,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1618
1700
  }
1619
1701
  },
1620
1702
  clone(vnode2) {
1621
- const hooks2 = resolveTransitionHooks(
1622
- vnode2,
1623
- props,
1624
- state,
1625
- instance,
1626
- postClone
1627
- );
1628
- if (postClone) postClone(hooks2);
1629
- return hooks2;
1703
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
1704
+ cloned.afterLeave = () => {
1705
+ if (hooks.afterLeave) hooks.afterLeave();
1706
+ };
1707
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
1708
+ if (hooks.delayLeave) {
1709
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
1710
+ } else {
1711
+ delayedLeave();
1712
+ }
1713
+ };
1714
+ cloned.delayedLeave = () => {
1715
+ if (hooks.delayedLeave) hooks.delayedLeave();
1716
+ };
1717
+ return cloned;
1630
1718
  }
1631
1719
  };
1632
1720
  return hooks;
@@ -1667,10 +1755,24 @@ function setTransitionHooks(vnode, hooks) {
1667
1755
  hooks
1668
1756
  );
1669
1757
  } else if (vnode.shapeFlag & 128) {
1670
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1671
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1758
+ const suspense = vnode.suspense;
1759
+ if (suspense) {
1760
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
1761
+ if (branch) {
1762
+ setTransitionHooks(branch, hooks.clone(branch));
1763
+ }
1764
+ } else {
1765
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1766
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1767
+ }
1672
1768
  } else {
1673
1769
  vnode.transition = hooks;
1770
+ if (vnode.type === Fragment && isArray(vnode.children)) {
1771
+ const child = filterSingleRoot(vnode.children, false);
1772
+ if (child) {
1773
+ setTransitionHooks(child, hooks);
1774
+ }
1775
+ }
1674
1776
  }
1675
1777
  }
1676
1778
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1695,6 +1797,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1695
1797
  }
1696
1798
  return ret;
1697
1799
  }
1800
+ function getTransitionRoot(vnode) {
1801
+ if (vnode.component) {
1802
+ return getTransitionRoot(vnode.component.subTree);
1803
+ }
1804
+ if (vnode.type === Fragment) {
1805
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
1806
+ return child ? getTransitionRoot(child) : void 0;
1807
+ }
1808
+ if (vnode.type !== Comment) {
1809
+ return vnode;
1810
+ }
1811
+ }
1698
1812
 
1699
1813
  // @__NO_SIDE_EFFECTS__
1700
1814
  function defineComponent(options, extraOptions) {
@@ -2363,7 +2477,7 @@ Server rendered element contains fewer child nodes than client vdom.`
2363
2477
  getContainerType(container),
2364
2478
  slotScopeIds
2365
2479
  );
2366
- if (parentComponent) {
2480
+ if (parentComponent && parentComponent.vnode.el === node) {
2367
2481
  parentComponent.vnode.el = vnode.el;
2368
2482
  updateHOCHostEl(parentComponent, vnode.el);
2369
2483
  }
@@ -2612,14 +2726,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
2612
2726
  break;
2613
2727
  }
2614
2728
  }, opts);
2615
- forEach((el) => {
2616
- if (!(el instanceof Element)) return;
2729
+ const observe = (el) => {
2617
2730
  if (elementIsVisibleInViewport(el)) {
2618
2731
  hydrate();
2619
2732
  ob.disconnect();
2620
2733
  return false;
2621
2734
  }
2735
+ if (getComputedStyle(el).display === "contents") {
2736
+ for (let i = 0; i < el.children.length; i++) {
2737
+ if (observe(el.children[i]) === false) return false;
2738
+ }
2739
+ }
2622
2740
  ob.observe(el);
2741
+ };
2742
+ forEach((el) => {
2743
+ if (!(el instanceof Element)) return;
2744
+ return observe(el);
2623
2745
  });
2624
2746
  return () => ob.disconnect();
2625
2747
  };
@@ -2789,7 +2911,8 @@ function defineAsyncComponent(source) {
2789
2911
  err,
2790
2912
  instance,
2791
2913
  13,
2792
- !errorComponent
2914
+ !errorComponent,
2915
+ true
2793
2916
  );
2794
2917
  };
2795
2918
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -2807,7 +2930,7 @@ function defineAsyncComponent(source) {
2807
2930
  const delayed = ref(!!delay);
2808
2931
  let timeoutTimer;
2809
2932
  let delayTimer;
2810
- onUnmounted(() => {
2933
+ onScopeDispose(() => {
2811
2934
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
2812
2935
  if (delayTimer != null) clearTimeout(delayTimer);
2813
2936
  });
@@ -2935,6 +3058,12 @@ const KeepAliveImpl = {
2935
3058
  }
2936
3059
  };
2937
3060
  sharedContext.deactivate = (vnode) => {
3061
+ const cached = cache.get(
3062
+ vnode.key == null ? vnode.type : vnode.key
3063
+ );
3064
+ if (!cached || cached.component !== vnode.component) {
3065
+ return false;
3066
+ }
2938
3067
  const instance2 = vnode.component;
2939
3068
  invalidateMount(instance2.m);
2940
3069
  invalidateMount(instance2.a);
@@ -2955,6 +3084,7 @@ const KeepAliveImpl = {
2955
3084
  if (!!(process.env.NODE_ENV !== "production") && true) {
2956
3085
  instance2.__keepAliveStorageContainer = storageContainer;
2957
3086
  }
3087
+ return true;
2958
3088
  };
2959
3089
  function unmount(vnode) {
2960
3090
  resetShapeFlag(vnode);
@@ -2976,6 +3106,7 @@ const KeepAliveImpl = {
2976
3106
  unmount(cached);
2977
3107
  } else if (current) {
2978
3108
  resetShapeFlag(current);
3109
+ if (cached) resetShapeFlag(cached);
2979
3110
  }
2980
3111
  cache.delete(key);
2981
3112
  keys.delete(key);
@@ -2993,12 +3124,17 @@ const KeepAliveImpl = {
2993
3124
  const cacheSubtree = () => {
2994
3125
  if (pendingCacheKey != null) {
2995
3126
  if (isSuspense(instance.subTree.type)) {
2996
- queuePostRenderEffect(() => {
3127
+ const cacheInnerChild = () => {
2997
3128
  const vnode = getInnerChild(instance.subTree);
2998
3129
  if (vnode.component) {
2999
3130
  cache.set(pendingCacheKey, vnode);
3000
3131
  }
3001
- }, instance.subTree.suspense);
3132
+ };
3133
+ if (instance.subTree.suspense.pendingBranch) {
3134
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
3135
+ } else {
3136
+ cacheInnerChild();
3137
+ }
3002
3138
  } else {
3003
3139
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
3004
3140
  }
@@ -3129,9 +3265,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
3129
3265
  true
3130
3266
  /* prepend */
3131
3267
  );
3132
- onUnmounted(() => {
3133
- remove(keepAliveRoot[type], injected);
3134
- }, target);
3268
+ const removal = injectHook(
3269
+ "um",
3270
+ () => remove(keepAliveRoot[type], injected),
3271
+ target
3272
+ );
3273
+ removal.flags = 16;
3135
3274
  }
3136
3275
  function resetShapeFlag(vnode) {
3137
3276
  vnode.shapeFlag &= -257;
@@ -3266,10 +3405,12 @@ function renderList(source, renderItem, cache, index) {
3266
3405
  );
3267
3406
  }
3268
3407
  } else if (typeof source === "number") {
3269
- if (!!(process.env.NODE_ENV !== "production") && (!Number.isInteger(source) || source < 0)) {
3270
- warn$1(
3271
- `The v-for range expects a positive integer value but got ${source}.`
3272
- );
3408
+ if (!Number.isInteger(source) || source < 0) {
3409
+ if (!!(process.env.NODE_ENV !== "production")) {
3410
+ warn$1(
3411
+ `The v-for range expects a positive integer value but got ${source}.`
3412
+ );
3413
+ }
3273
3414
  ret = [];
3274
3415
  } else {
3275
3416
  ret = new Array(source);
@@ -4911,7 +5052,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4911
5052
  }
4912
5053
  for (let i = 0; i < nextKeys.length; i++) {
4913
5054
  const key = nextKeys[i];
4914
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
5055
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4915
5056
  return true;
4916
5057
  }
4917
5058
  }
@@ -5818,6 +5959,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5818
5959
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
5819
5960
  if (needCallTransitionHooks) {
5820
5961
  transition.beforeEnter(el);
5962
+ } else if (transition && !transition.persisted) {
5963
+ el[deferredEnterKey] = true;
5821
5964
  }
5822
5965
  hostInsert(el, container, anchor);
5823
5966
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -5977,15 +6120,16 @@ function baseCreateRenderer(options, createHydrationFns) {
5977
6120
  for (let i = 0; i < newChildren.length; i++) {
5978
6121
  const oldVNode = oldChildren[i];
5979
6122
  const newVNode = newChildren[i];
6123
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
5980
6124
  const container = (
5981
6125
  // oldVNode may be an errored async setup() component inside Suspense
5982
6126
  // which will not have a mounted element
5983
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
6127
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
5984
6128
  // of the Fragment itself so it can move its children.
5985
6129
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5986
6130
  // which also requires the correct parent container
5987
6131
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5988
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
6132
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
5989
6133
  // In other cases, the parent container is not actually used so we
5990
6134
  // just pass the block element here to avoid a DOM parentNode call.
5991
6135
  fallbackContainer
@@ -6160,7 +6304,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6160
6304
  }
6161
6305
  if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
6162
6306
  if (instance.asyncDep) {
6163
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6307
+ parentSuspense && parentSuspense.registerDep(
6308
+ instance,
6309
+ setupRenderEffect,
6310
+ optimized,
6311
+ namespace
6312
+ );
6164
6313
  if (!initialVNode.el) {
6165
6314
  const placeholder = instance.subTree = createVNode(Comment);
6166
6315
  processCommentNode(null, placeholder, container, anchor);
@@ -6190,6 +6339,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6190
6339
  pushWarningContext(n2);
6191
6340
  }
6192
6341
  n2.el = n1.el;
6342
+ n2.placeholder = n1.placeholder;
6193
6343
  updateComponentPreRender(instance, n2, optimized);
6194
6344
  if (!!(process.env.NODE_ENV !== "production")) {
6195
6345
  popWarningContext();
@@ -6201,6 +6351,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6201
6351
  }
6202
6352
  } else {
6203
6353
  n2.el = n1.el;
6354
+ n2.placeholder = n1.placeholder;
6204
6355
  instance.vnode = n2;
6205
6356
  }
6206
6357
  };
@@ -6303,16 +6454,23 @@ function baseCreateRenderer(options, createHydrationFns) {
6303
6454
  } else {
6304
6455
  let { next, bu, u, parent, vnode } = instance;
6305
6456
  {
6306
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
6307
- if (nonHydratedAsyncRoot) {
6457
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
6458
+ if (unresolvedAsyncRoot) {
6308
6459
  if (next) {
6309
6460
  next.el = vnode.el;
6310
6461
  updateComponentPreRender(instance, next, optimized);
6311
6462
  }
6312
- nonHydratedAsyncRoot.asyncDep.then(() => {
6313
- queuePostRenderEffect(() => {
6314
- if (!instance.isUnmounted) update();
6315
- }, parentSuspense);
6463
+ unresolvedAsyncRoot.asyncDep.then(() => {
6464
+ const retry = () => {
6465
+ if (instance.job.flags & 8) return;
6466
+ if (parentSuspense && parentSuspense.pendingBranch) {
6467
+ queuePostRenderEffect(retry, parentSuspense);
6468
+ } else {
6469
+ update();
6470
+ }
6471
+ };
6472
+ retry.flags = 16 | 32;
6473
+ queuePostRenderEffect(retry, parentSuspense);
6316
6474
  });
6317
6475
  return;
6318
6476
  }
@@ -6351,8 +6509,11 @@ function baseCreateRenderer(options, createHydrationFns) {
6351
6509
  patch(
6352
6510
  prevTree,
6353
6511
  nextTree,
6354
- // parent may have changed if it's in a teleport
6355
- hostParentNode(prevTree.el),
6512
+ // parent may have changed if it's in a teleport. a root that is a
6513
+ // pending async component only has its placeholder comment
6514
+ hostParentNode(
6515
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
6516
+ ),
6356
6517
  // anchor may have changed if it's in a fragment
6357
6518
  getNextHostNode(prevTree),
6358
6519
  instance,
@@ -6792,8 +6953,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6792
6953
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
6793
6954
  parentComponent.renderCache[cacheIndex] = void 0;
6794
6955
  }
6795
- if (shapeFlag & 256) {
6796
- parentComponent.ctx.deactivate(vnode);
6956
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
6797
6957
  return;
6798
6958
  }
6799
6959
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6854,18 +7014,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6854
7014
  };
6855
7015
  const remove = (vnode) => {
6856
7016
  const { type, el, anchor, transition } = vnode;
6857
- if (type === Fragment) {
6858
- if (!!(process.env.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
6859
- vnode.children.forEach((child) => {
6860
- if (child.type === Comment) {
6861
- hostRemove(child.el);
6862
- } else {
6863
- remove(child);
6864
- }
6865
- });
6866
- } else {
6867
- removeFragment(el, anchor);
6868
- }
7017
+ const isFragment = type === Fragment;
7018
+ if (isFragment && !transition) {
7019
+ removeFragment(el, anchor);
6869
7020
  return;
6870
7021
  }
6871
7022
  if (type === Static) {
@@ -6875,17 +7026,25 @@ function baseCreateRenderer(options, createHydrationFns) {
6875
7026
  }
6876
7027
  return;
6877
7028
  }
7029
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
6878
7030
  const performRemove = () => {
6879
- hostRemove(el);
7031
+ if (isFragment) {
7032
+ if (hostParentNode(el)) {
7033
+ removeFragment(el, anchor);
7034
+ }
7035
+ } else {
7036
+ hostRemove(el);
7037
+ }
6880
7038
  if (transition && !transition.persisted && transition.afterLeave) {
6881
7039
  transition.afterLeave();
6882
7040
  }
6883
7041
  };
6884
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
7042
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
6885
7043
  const { leave, delayLeave } = transition;
6886
- const performLeave = () => leave(el, performRemove);
7044
+ const leavingEl = leavingNode.el;
7045
+ const performLeave = () => leave(leavingEl, performRemove);
6887
7046
  if (delayLeave) {
6888
- delayLeave(vnode.el, performRemove, performLeave);
7047
+ delayLeave(leavingEl, performRemove, performLeave);
6889
7048
  } else {
6890
7049
  performLeave();
6891
7050
  }
@@ -6916,16 +7075,18 @@ function baseCreateRenderer(options, createHydrationFns) {
6916
7075
  if (job) {
6917
7076
  job.flags |= 8;
6918
7077
  unmount(subTree, instance, parentSuspense, doRemove);
6919
- } else if (instance.vnode.el && subTree) {
7078
+ } else if (subTree) {
6920
7079
  subTree.transition = instance.vnode.transition;
6921
7080
  unmount(subTree, instance, parentSuspense, doRemove);
6922
7081
  }
6923
7082
  if (um) {
6924
7083
  queuePostRenderEffect(um, parentSuspense);
6925
7084
  }
6926
- queuePostRenderEffect(() => {
7085
+ const markUnmounted = () => {
6927
7086
  instance.isUnmounted = true;
6928
- }, parentSuspense);
7087
+ };
7088
+ markUnmounted.flags = 16;
7089
+ queuePostRenderEffect(markUnmounted, parentSuspense);
6929
7090
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
6930
7091
  devtoolsComponentRemoved(instance);
6931
7092
  }
@@ -6946,32 +7107,26 @@ function baseCreateRenderer(options, createHydrationFns) {
6946
7107
  const teleportEnd = el && el[TeleportEndKey];
6947
7108
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
6948
7109
  };
6949
- let isFlushing = false;
6950
7110
  const render = (vnode, container, namespace) => {
6951
- let instance;
6952
- if (vnode == null) {
6953
- if (container._vnode) {
6954
- unmount(container._vnode, null, null, true);
6955
- instance = container._vnode.component;
7111
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
7112
+ flushOnAppMount(() => {
7113
+ if (vnode == null) {
7114
+ if (container._vnode) {
7115
+ unmount(container._vnode, null, null, true);
7116
+ }
7117
+ } else {
7118
+ patch(
7119
+ container._vnode || null,
7120
+ vnode,
7121
+ container,
7122
+ null,
7123
+ null,
7124
+ null,
7125
+ namespace
7126
+ );
6956
7127
  }
6957
- } else {
6958
- patch(
6959
- container._vnode || null,
6960
- vnode,
6961
- container,
6962
- null,
6963
- null,
6964
- null,
6965
- namespace
6966
- );
6967
- }
6968
- container._vnode = vnode;
6969
- if (!isFlushing) {
6970
- isFlushing = true;
6971
- flushPreFlushCbs(instance);
6972
- flushPostFlushCbs();
6973
- isFlushing = false;
6974
- }
7128
+ container._vnode = vnode;
7129
+ }, minUid);
6975
7130
  };
6976
7131
  const internals = {
6977
7132
  p: patch,
@@ -7083,13 +7238,13 @@ function getSequence(arr) {
7083
7238
  }
7084
7239
  return result;
7085
7240
  }
7086
- function locateNonHydratedAsyncRoot(instance) {
7241
+ function locateUnresolvedAsyncRoot(instance) {
7087
7242
  const subComponent = instance.subTree.component;
7088
7243
  if (subComponent) {
7089
7244
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
7090
7245
  return subComponent;
7091
7246
  } else {
7092
- return locateNonHydratedAsyncRoot(subComponent);
7247
+ return locateUnresolvedAsyncRoot(subComponent);
7093
7248
  }
7094
7249
  }
7095
7250
  }
@@ -7107,11 +7262,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
7107
7262
  if (instance) {
7108
7263
  return resolveAsyncComponentPlaceholder(instance.subTree);
7109
7264
  }
7265
+ const suspense = anchorVnode.suspense;
7266
+ if (suspense && suspense.activeBranch) {
7267
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
7268
+ }
7110
7269
  return null;
7111
7270
  }
7112
7271
 
7113
7272
  const isSuspense = (type) => type.__isSuspense;
7114
7273
  let suspenseId = 0;
7274
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
7115
7275
  const SuspenseImpl = {
7116
7276
  name: "Suspense",
7117
7277
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -7133,11 +7293,22 @@ const SuspenseImpl = {
7133
7293
  rendererInternals
7134
7294
  );
7135
7295
  } else {
7136
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7137
- n2.suspense = n1.suspense;
7138
- n2.suspense.vnode = n2;
7139
- n2.el = n1.el;
7140
- return;
7296
+ const suspense = n1.suspense;
7297
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
7298
+ const owner = suspense.parentComponent;
7299
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
7300
+ if (retained ? (
7301
+ // deps can outlive the pending branch: skip only while it exists
7302
+ parentSuspense.pendingBranch && !isSameVNodeType(
7303
+ n2.ssContent,
7304
+ suspense.pendingBranch || suspense.activeBranch
7305
+ )
7306
+ ) : !suspense.isInFallback) {
7307
+ n2.suspense = suspense;
7308
+ suspense.vnode = n2;
7309
+ n2.el = n1.el;
7310
+ return;
7311
+ }
7141
7312
  }
7142
7313
  patchSuspense(
7143
7314
  n1,
@@ -7162,6 +7333,38 @@ function triggerEvent(vnode, name) {
7162
7333
  eventListener();
7163
7334
  }
7164
7335
  }
7336
+ function enterDeferred(branch) {
7337
+ const enters = [];
7338
+ collectDeferredEnters(branch, enters, true);
7339
+ if (enters.length) {
7340
+ queuePostFlushCb(enters);
7341
+ }
7342
+ }
7343
+ function collectDeferredEnters(vnode, enters, isRoot) {
7344
+ const { el, transition, children, shapeFlag } = vnode;
7345
+ if (shapeFlag & 6) {
7346
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
7347
+ return;
7348
+ }
7349
+ if (shapeFlag & (128 | 64)) {
7350
+ return;
7351
+ }
7352
+ if (shapeFlag & 1) {
7353
+ if (!isRoot && el && el[deferredEnterKey]) {
7354
+ el[deferredEnterKey] = void 0;
7355
+ if (transition && !transition.persisted) {
7356
+ transition.beforeEnter(el);
7357
+ enters.push(() => transition.enter(el));
7358
+ }
7359
+ }
7360
+ isRoot = false;
7361
+ }
7362
+ if (shapeFlag & 16) {
7363
+ for (let i = 0; i < children.length; i++) {
7364
+ collectDeferredEnters(children[i], enters, isRoot);
7365
+ }
7366
+ }
7367
+ }
7165
7368
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7166
7369
  const {
7167
7370
  p: patch,
@@ -7261,7 +7464,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7261
7464
  unmount(pendingBranch, parentComponent, suspense);
7262
7465
  }
7263
7466
  suspense.deps = 0;
7264
- suspense.effects.length = 0;
7467
+ discardEffects(suspense);
7265
7468
  suspense.hiddenContainer = createElement("div");
7266
7469
  if (isInFallback) {
7267
7470
  patch(
@@ -7339,11 +7542,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7339
7542
  } else {
7340
7543
  triggerEvent(n2, "onPending");
7341
7544
  suspense.pendingBranch = newBranch;
7342
- if (newBranch.shapeFlag & 512) {
7343
- suspense.pendingId = newBranch.component.suspenseId;
7344
- } else {
7345
- suspense.pendingId = suspenseId++;
7346
- }
7545
+ suspense.pendingId = suspenseId++;
7347
7546
  patch(
7348
7547
  null,
7349
7548
  newBranch,
@@ -7358,12 +7557,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7358
7557
  if (suspense.deps <= 0) {
7359
7558
  suspense.resolve();
7360
7559
  } else {
7361
- const { timeout, pendingId } = suspense;
7560
+ const { timeout } = suspense;
7362
7561
  if (timeout > 0) {
7363
- setTimeout(() => {
7364
- if (suspense.pendingId === pendingId) {
7365
- suspense.fallback(newFallback);
7366
- }
7562
+ suspense.timeoutTimer = setTimeout(() => {
7563
+ suspense.timeoutTimer = void 0;
7564
+ suspense.fallback(suspense.vnode.ssFallback);
7367
7565
  }, timeout);
7368
7566
  } else if (timeout === 0) {
7369
7567
  suspense.fallback(newFallback);
@@ -7410,6 +7608,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7410
7608
  deps: 0,
7411
7609
  pendingId: suspenseId++,
7412
7610
  timeout: typeof timeout === "number" ? timeout : -1,
7611
+ timeoutTimer: void 0,
7413
7612
  activeBranch: null,
7414
7613
  isFallbackMountPending: false,
7415
7614
  pendingBranch: null,
@@ -7448,7 +7647,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7448
7647
  let hasUpdatedAnchor = false;
7449
7648
  if (delayEnter) {
7450
7649
  activeBranch.transition.afterLeave = () => {
7451
- if (pendingId === suspense.pendingId) {
7650
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
7651
+ enterDeferred(pendingBranch);
7452
7652
  move(
7453
7653
  pendingBranch,
7454
7654
  container2,
@@ -7463,7 +7663,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7463
7663
  };
7464
7664
  }
7465
7665
  if (activeBranch && !suspense.isFallbackMountPending) {
7466
- if (parentNode(activeBranch.el) === container2) {
7666
+ if (parentNode(
7667
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
7668
+ ) === container2) {
7467
7669
  anchor = next(activeBranch);
7468
7670
  hasUpdatedAnchor = true;
7469
7671
  }
@@ -7473,13 +7675,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7473
7675
  }
7474
7676
  }
7475
7677
  if (!delayEnter) {
7678
+ enterDeferred(pendingBranch);
7476
7679
  move(pendingBranch, container2, anchor, 0);
7477
7680
  }
7478
7681
  }
7682
+ clearTimeout(suspense.timeoutTimer);
7683
+ suspense.timeoutTimer = void 0;
7479
7684
  suspense.isFallbackMountPending = false;
7480
7685
  setActiveBranch(suspense, pendingBranch);
7481
7686
  suspense.pendingBranch = null;
7482
7687
  suspense.isInFallback = false;
7688
+ let kept = 0;
7689
+ for (let i = 0; i < effects.length; i++) {
7690
+ const effect = effects[i];
7691
+ if (effect.flags & 32) {
7692
+ queuePostFlushCb(effect);
7693
+ } else {
7694
+ effects[kept++] = effect;
7695
+ }
7696
+ }
7697
+ effects.length = kept;
7483
7698
  let parent = suspense.parent;
7484
7699
  let hasUnresolvedAncestor = false;
7485
7700
  while (parent) {
@@ -7508,7 +7723,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7508
7723
  triggerEvent(vnode2, "onResolve");
7509
7724
  },
7510
7725
  fallback(fallbackVNode) {
7511
- if (!suspense.pendingBranch) {
7726
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
7512
7727
  return;
7513
7728
  }
7514
7729
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -7516,7 +7731,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7516
7731
  const anchor2 = next(activeBranch);
7517
7732
  const mountFallback = () => {
7518
7733
  suspense.isFallbackMountPending = false;
7519
- if (!suspense.isInFallback) {
7734
+ if (suspense.isUnmounted || !suspense.isInFallback) {
7520
7735
  return;
7521
7736
  }
7522
7737
  const latestFallback = suspense.vnode.ssFallback;
@@ -7559,25 +7774,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7559
7774
  next() {
7560
7775
  return suspense.activeBranch && next(suspense.activeBranch);
7561
7776
  },
7562
- registerDep(instance, setupRenderEffect, optimized2) {
7777
+ // `namespace` intentionally shadows the boundary's own: the dep must be
7778
+ // mounted with the namespace of the position it was rendered at, which can
7779
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
7780
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
7563
7781
  const isInPendingSuspense = !!suspense.pendingBranch;
7564
7782
  if (isInPendingSuspense) {
7565
7783
  suspense.deps++;
7566
7784
  }
7567
7785
  const hydratedEl = instance.vnode.el;
7568
- instance.asyncDep.catch((err) => {
7569
- handleError(err, instance, 0);
7570
- }).then((asyncSetupResult) => {
7571
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
7572
- return;
7573
- }
7574
- unsetCurrentInstance();
7575
- if (hydratedEl && !instance.scope.active) {
7576
- if (isInPendingSuspense && --suspense.deps === 0) {
7577
- suspense.resolve();
7578
- }
7579
- return;
7580
- }
7786
+ const render = (asyncSetupResult) => {
7581
7787
  instance.asyncResolved = true;
7582
7788
  const { vnode: vnode2 } = instance;
7583
7789
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -7599,7 +7805,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7599
7805
  // consider the comment placeholder case.
7600
7806
  hydratedEl ? null : next(instance.subTree),
7601
7807
  suspense,
7602
- namespace,
7808
+ namespace2,
7603
7809
  optimized2
7604
7810
  );
7605
7811
  if (placeholder) {
@@ -7610,13 +7816,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7610
7816
  if (!!(process.env.NODE_ENV !== "production")) {
7611
7817
  popWarningContext();
7612
7818
  }
7613
- if (isInPendingSuspense && --suspense.deps === 0) {
7819
+ };
7820
+ instance.asyncDep.catch((err) => {
7821
+ handleError(err, instance, 0, false, true);
7822
+ return () => null;
7823
+ }).then((asyncSetupResult) => {
7824
+ if (instance.isUnmounted || suspense.isUnmounted) {
7825
+ return;
7826
+ }
7827
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
7828
+ unsetCurrentInstance();
7829
+ if (!instance.scope.active) {
7830
+ if (isPendingDep && --suspense.deps === 0) {
7831
+ suspense.resolve();
7832
+ }
7833
+ return;
7834
+ }
7835
+ if (!isPendingDep && suspense.pendingBranch) {
7836
+ const job = () => {
7837
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
7838
+ return;
7839
+ }
7840
+ if (suspense.pendingBranch) {
7841
+ queueEffectWithSuspense(job, suspense);
7842
+ } else {
7843
+ render(asyncSetupResult);
7844
+ }
7845
+ };
7846
+ job.flags = 16 | 32;
7847
+ queueEffectWithSuspense(job, suspense);
7848
+ return;
7849
+ }
7850
+ render(asyncSetupResult);
7851
+ if (isPendingDep && --suspense.deps === 0) {
7614
7852
  suspense.resolve();
7615
7853
  }
7616
7854
  });
7617
7855
  },
7618
7856
  unmount(parentSuspense2, doRemove) {
7619
7857
  suspense.isUnmounted = true;
7858
+ clearTimeout(suspense.timeoutTimer);
7859
+ suspense.timeoutTimer = void 0;
7860
+ if (parentSuspenseId !== void 0) {
7861
+ const parent = suspense.parent;
7862
+ const pendingId = parentSuspenseId;
7863
+ parentSuspenseId = void 0;
7864
+ queuePostFlushCb(() => {
7865
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
7866
+ parent.resolve();
7867
+ }
7868
+ });
7869
+ }
7620
7870
  if (suspense.activeBranch) {
7621
7871
  unmount(
7622
7872
  suspense.activeBranch,
@@ -7626,12 +7876,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7626
7876
  );
7627
7877
  }
7628
7878
  if (suspense.pendingBranch) {
7629
- unmount(
7630
- suspense.pendingBranch,
7631
- parentComponent,
7632
- parentSuspense2,
7633
- doRemove
7634
- );
7879
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
7880
+ discardEffects(suspense);
7635
7881
  }
7636
7882
  }
7637
7883
  };
@@ -7701,6 +7947,16 @@ function normalizeSuspenseSlot(s) {
7701
7947
  }
7702
7948
  return s;
7703
7949
  }
7950
+ function discardEffects(suspense) {
7951
+ const { effects } = suspense;
7952
+ for (let i = 0; i < effects.length; i++) {
7953
+ const effect = effects[i];
7954
+ if (effect.flags & 16) {
7955
+ queuePostFlushCb(effect);
7956
+ }
7957
+ }
7958
+ effects.length = 0;
7959
+ }
7704
7960
  function queueEffectWithSuspense(fn, suspense) {
7705
7961
  if (suspense && suspense.pendingBranch) {
7706
7962
  if (isArray(fn)) {
@@ -7952,7 +8208,8 @@ Component that was made reactive: `,
7952
8208
  }
7953
8209
  function guardReactiveProps(props) {
7954
8210
  if (!props) return null;
7955
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8211
+ if (isProxy(props)) return extend({}, props);
8212
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
7956
8213
  }
7957
8214
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7958
8215
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -8131,8 +8388,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8131
8388
  ]);
8132
8389
  }
8133
8390
 
8134
- const emptyAppContext = createAppContext();
8391
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
8135
8392
  let uid = 0;
8393
+ function getNextUid() {
8394
+ return uid;
8395
+ }
8136
8396
  function createComponentInstance(vnode, parent, suspense) {
8137
8397
  const type = vnode.type;
8138
8398
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8343,7 +8603,8 @@ function setupStatefulComponent(instance, isSSR) {
8343
8603
  setInSSRSetupState(false);
8344
8604
  }
8345
8605
  }).catch((e) => {
8346
- handleError(e, instance, 0);
8606
+ handleError(e, instance, 0, void 0, true);
8607
+ instance.ssrRender = (_, push) => push("<!---->");
8347
8608
  });
8348
8609
  } else {
8349
8610
  instance.asyncDep = setupResult;
@@ -8451,11 +8712,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8451
8712
  }
8452
8713
  }
8453
8714
  }
8715
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
8454
8716
  const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
8455
8717
  get(target, key) {
8456
8718
  markAttrsAccessed();
8457
8719
  track(target, "get", "");
8458
- return target[key];
8720
+ return key === rawAttrsKey ? target : target[key];
8459
8721
  },
8460
8722
  set() {
8461
8723
  warn$1(`setupContext.attrs is readonly.`);
@@ -8468,7 +8730,7 @@ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
8468
8730
  } : {
8469
8731
  get(target, key) {
8470
8732
  track(target, "get", "");
8471
- return target[key];
8733
+ return key === rawAttrsKey ? target : target[key];
8472
8734
  }
8473
8735
  };
8474
8736
  function getSlotsProxy(instance) {
@@ -8819,7 +9081,7 @@ function isMemoSame(cached, memo) {
8819
9081
  return true;
8820
9082
  }
8821
9083
 
8822
- const version = "3.5.43";
9084
+ const version = "3.5.45";
8823
9085
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8824
9086
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8825
9087
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;