@vue/compat 3.5.44 → 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/compat v3.5.44
2
+ * @vue/compat v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -61,24 +61,20 @@ const cacheStringFunction = (fn) => {
61
61
  });
62
62
  };
63
63
  const camelizeRE = /-\w/g;
64
- const camelize = cacheStringFunction(
65
- (str) => {
66
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
67
- }
68
- );
64
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
65
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
66
+ });
69
67
  const hyphenateRE = /\B([A-Z])/g;
70
- const hyphenate = cacheStringFunction(
68
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
71
69
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
72
70
  );
73
- const capitalize = cacheStringFunction((str) => {
71
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
74
72
  return str.charAt(0).toUpperCase() + str.slice(1);
75
73
  });
76
- const toHandlerKey = cacheStringFunction(
77
- (str) => {
78
- const s = str ? `on${capitalize(str)}` : ``;
79
- return s;
80
- }
81
- );
74
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
75
+ const s = str ? `on${capitalize(str)}` : ``;
76
+ return s;
77
+ });
82
78
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
83
79
  const invokeArrayFns = (fns, ...arg) => {
84
80
  for (let i = 0; i < fns.length; i++) {
@@ -264,7 +260,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
264
260
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
265
261
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
266
262
 
267
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
263
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
268
264
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
269
265
  const isBooleanAttr = /* @__PURE__ */ makeMap(
270
266
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -608,7 +604,11 @@ function getCurrentScope() {
608
604
  }
609
605
  function onScopeDispose(fn, failSilently = false) {
610
606
  if (activeEffectScope) {
611
- activeEffectScope.cleanups.push(fn);
607
+ if (activeEffectScope.active) {
608
+ activeEffectScope.cleanups.push(fn);
609
+ } else {
610
+ fn();
611
+ }
612
612
  } else if (!!(process.env.NODE_ENV !== "production") && !failSilently) {
613
613
  warn$2(
614
614
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1419,7 +1419,7 @@ function noTracking(self, method, args = []) {
1419
1419
  }
1420
1420
 
1421
1421
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1422
- const builtInSymbols = new Set(
1422
+ const builtInSymbols = /* @__PURE__ */ new Set(
1423
1423
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1424
1424
  );
1425
1425
  function hasOwnProperty(key) {
@@ -2636,7 +2636,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2636
2636
  const res = callWithErrorHandling(fn, instance, type, args);
2637
2637
  if (res && isPromise(res)) {
2638
2638
  res.catch((err) => {
2639
- handleError(err, instance, type);
2639
+ handleError(err, instance, type, void 0, true);
2640
2640
  });
2641
2641
  }
2642
2642
  return res;
@@ -2653,7 +2653,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2653
2653
  );
2654
2654
  }
2655
2655
  }
2656
- function handleError(err, instance, type, throwInDev = true) {
2656
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2657
2657
  const contextVNode = instance ? instance.vnode : null;
2658
2658
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2659
2659
  if (instance) {
@@ -2662,7 +2662,9 @@ function handleError(err, instance, type, throwInDev = true) {
2662
2662
  const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
2663
2663
  while (cur) {
2664
2664
  const errorCapturedHooks = cur.ec;
2665
- if (errorCapturedHooks) {
2665
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2666
+ // are deferred or discarded by Suspense.
2667
+ (!isAsyncError || cur.scope.active)) {
2666
2668
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2667
2669
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2668
2670
  return;
@@ -2994,14 +2996,32 @@ function reload(id, newComp) {
2994
2996
  instance.ceReload(newComp.styles);
2995
2997
  dirtyInstances.delete(instance);
2996
2998
  } else if (instance.parent) {
2997
- queueJob(() => {
2998
- if (!(instance.job.flags & 8)) {
2999
- isHmrUpdating = true;
2999
+ const update = () => {
3000
+ if (!instance.scope.active) return;
3001
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
3002
+ if (pending) {
3003
+ pending.asyncDep.catch(NOOP).then(() => {
3004
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
3005
+ queueJob(update);
3006
+ }
3007
+ });
3008
+ return;
3009
+ }
3010
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
3011
+ if (!dirtyInstances) {
3012
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3013
+ }
3014
+ dirtyInstances.add(instance);
3015
+ isHmrUpdating = true;
3016
+ try {
3000
3017
  instance.parent.update();
3018
+ } finally {
3001
3019
  isHmrUpdating = false;
3002
3020
  dirtyInstances.delete(instance);
3021
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
3003
3022
  }
3004
- });
3023
+ };
3024
+ queueJob(update);
3005
3025
  } else if (instance.appContext.reload) {
3006
3026
  instance.appContext.reload();
3007
3027
  } else if (typeof window !== "undefined") {
@@ -3686,12 +3706,31 @@ function withDirectives(vnode, directives) {
3686
3706
  return vnode;
3687
3707
  }
3688
3708
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3689
- const bindings = vnode.dirs;
3709
+ let hookVNode = vnode;
3710
+ if (name === "beforeMount") {
3711
+ vnode._mount = vnode;
3712
+ } else if (name === "beforeUpdate") {
3713
+ const mount = prevVNode && prevVNode._mount;
3714
+ if (mount) {
3715
+ mount._latest = vnode;
3716
+ vnode._mount = mount;
3717
+ }
3718
+ } else if (name === "mounted") {
3719
+ const latest = vnode._latest;
3720
+ vnode._mount = vnode._latest = void 0;
3721
+ if (latest) {
3722
+ hookVNode = latest;
3723
+ latest._mount = void 0;
3724
+ }
3725
+ }
3726
+ const bindings = hookVNode.dirs;
3690
3727
  const oldBindings = prevVNode && prevVNode.dirs;
3691
3728
  for (let i = 0; i < bindings.length; i++) {
3692
- const binding = bindings[i];
3729
+ let binding = bindings[i];
3693
3730
  if (oldBindings) {
3694
3731
  binding.oldValue = oldBindings[i].value;
3732
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3733
+ binding = extend({}, binding, { oldValue: void 0 });
3695
3734
  }
3696
3735
  let hook = binding.dir[name];
3697
3736
  if (!hook) {
@@ -3702,7 +3741,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3702
3741
  callWithAsyncErrorHandling(hook, instance, 8, [
3703
3742
  vnode.el,
3704
3743
  binding,
3705
- vnode,
3744
+ hookVNode,
3706
3745
  prevVNode
3707
3746
  ]);
3708
3747
  resetTracking();
@@ -4326,13 +4365,11 @@ const BaseTransitionImpl = {
4326
4365
  if (!innerChild) {
4327
4366
  return emptyPlaceholder(child);
4328
4367
  }
4329
- let enterHooks = resolveTransitionHooks(
4368
+ const enterHooks = resolveTransitionHooks(
4330
4369
  innerChild,
4331
4370
  rawProps,
4332
4371
  state,
4333
- instance,
4334
- // #11061, ensure enterHooks is fresh after clone
4335
- (hooks) => enterHooks = hooks
4372
+ instance
4336
4373
  );
4337
4374
  if (innerChild.type !== Comment) {
4338
4375
  setTransitionHooks(innerChild, enterHooks);
@@ -4351,7 +4388,17 @@ const BaseTransitionImpl = {
4351
4388
  leavingHooks.afterLeave = () => {
4352
4389
  state.isLeaving = false;
4353
4390
  if (!(instance.job.flags & 8)) {
4354
- instance.update();
4391
+ if (instance.effect.flags & 2) {
4392
+ const job = () => {
4393
+ if (!(instance.job.flags & 8)) {
4394
+ instance.update();
4395
+ }
4396
+ };
4397
+ job.i = instance;
4398
+ queueJob(job);
4399
+ } else {
4400
+ instance.update();
4401
+ }
4355
4402
  }
4356
4403
  delete leavingHooks.afterLeave;
4357
4404
  oldInnerChild = void 0;
@@ -4419,7 +4466,7 @@ function getLeavingNodesForType(state, vnode) {
4419
4466
  }
4420
4467
  return leavingVNodesCache;
4421
4468
  }
4422
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4469
+ function resolveTransitionHooks(vnode, props, state, instance) {
4423
4470
  const {
4424
4471
  appear,
4425
4472
  mode,
@@ -4558,15 +4605,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4558
4605
  }
4559
4606
  },
4560
4607
  clone(vnode2) {
4561
- const hooks2 = resolveTransitionHooks(
4562
- vnode2,
4563
- props,
4564
- state,
4565
- instance,
4566
- postClone
4567
- );
4568
- if (postClone) postClone(hooks2);
4569
- return hooks2;
4608
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4609
+ cloned.afterLeave = () => {
4610
+ if (hooks.afterLeave) hooks.afterLeave();
4611
+ };
4612
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4613
+ if (hooks.delayLeave) {
4614
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4615
+ } else {
4616
+ delayedLeave();
4617
+ }
4618
+ };
4619
+ cloned.delayedLeave = () => {
4620
+ if (hooks.delayedLeave) hooks.delayedLeave();
4621
+ };
4622
+ return cloned;
4570
4623
  }
4571
4624
  };
4572
4625
  return hooks;
@@ -4607,8 +4660,16 @@ function setTransitionHooks(vnode, hooks) {
4607
4660
  hooks
4608
4661
  );
4609
4662
  } else if (vnode.shapeFlag & 128) {
4610
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4611
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4663
+ const suspense = vnode.suspense;
4664
+ if (suspense) {
4665
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4666
+ if (branch) {
4667
+ setTransitionHooks(branch, hooks.clone(branch));
4668
+ }
4669
+ } else {
4670
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4671
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4672
+ }
4612
4673
  } else {
4613
4674
  vnode.transition = hooks;
4614
4675
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -5321,7 +5382,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5321
5382
  getContainerType(container),
5322
5383
  slotScopeIds
5323
5384
  );
5324
- if (parentComponent) {
5385
+ if (parentComponent && parentComponent.vnode.el === node) {
5325
5386
  parentComponent.vnode.el = vnode.el;
5326
5387
  updateHOCHostEl(parentComponent, vnode.el);
5327
5388
  }
@@ -5755,7 +5816,8 @@ function defineAsyncComponent(source) {
5755
5816
  err,
5756
5817
  instance,
5757
5818
  13,
5758
- !errorComponent
5819
+ !errorComponent,
5820
+ true
5759
5821
  );
5760
5822
  };
5761
5823
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -5773,7 +5835,7 @@ function defineAsyncComponent(source) {
5773
5835
  const delayed = ref(!!delay);
5774
5836
  let timeoutTimer;
5775
5837
  let delayTimer;
5776
- onUnmounted(() => {
5838
+ onScopeDispose(() => {
5777
5839
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5778
5840
  if (delayTimer != null) clearTimeout(delayTimer);
5779
5841
  });
@@ -5901,6 +5963,12 @@ const KeepAliveImpl = {
5901
5963
  }
5902
5964
  };
5903
5965
  sharedContext.deactivate = (vnode) => {
5966
+ const cached = cache.get(
5967
+ vnode.key == null ? vnode.type : vnode.key
5968
+ );
5969
+ if (!cached || cached.component !== vnode.component) {
5970
+ return false;
5971
+ }
5904
5972
  const instance2 = vnode.component;
5905
5973
  invalidateMount(instance2.m);
5906
5974
  invalidateMount(instance2.a);
@@ -5921,6 +5989,7 @@ const KeepAliveImpl = {
5921
5989
  if (!!(process.env.NODE_ENV !== "production") && true) {
5922
5990
  instance2.__keepAliveStorageContainer = storageContainer;
5923
5991
  }
5992
+ return true;
5924
5993
  };
5925
5994
  function unmount(vnode) {
5926
5995
  resetShapeFlag(vnode);
@@ -5960,12 +6029,17 @@ const KeepAliveImpl = {
5960
6029
  const cacheSubtree = () => {
5961
6030
  if (pendingCacheKey != null) {
5962
6031
  if (isSuspense(instance.subTree.type)) {
5963
- queuePostRenderEffect(() => {
6032
+ const cacheInnerChild = () => {
5964
6033
  const vnode = getInnerChild(instance.subTree);
5965
6034
  if (vnode.component) {
5966
6035
  cache.set(pendingCacheKey, vnode);
5967
6036
  }
5968
- }, instance.subTree.suspense);
6037
+ };
6038
+ if (instance.subTree.suspense.pendingBranch) {
6039
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
6040
+ } else {
6041
+ cacheInnerChild();
6042
+ }
5969
6043
  } else {
5970
6044
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5971
6045
  }
@@ -6100,9 +6174,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
6100
6174
  true
6101
6175
  /* prepend */
6102
6176
  );
6103
- onUnmounted(() => {
6104
- remove(keepAliveRoot[type], injected);
6105
- }, target);
6177
+ const removal = injectHook(
6178
+ "um",
6179
+ () => remove(keepAliveRoot[type], injected),
6180
+ target
6181
+ );
6182
+ removal.flags = 16;
6106
6183
  }
6107
6184
  function resetShapeFlag(vnode) {
6108
6185
  vnode.shapeFlag &= -257;
@@ -7838,7 +7915,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7838
7915
  return vm;
7839
7916
  }
7840
7917
  }
7841
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
7918
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7842
7919
  Vue.config = singletonApp.config;
7843
7920
  Vue.use = (plugin, ...options) => {
7844
7921
  if (plugin && isFunction(plugin.install)) {
@@ -9976,6 +10053,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9976
10053
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9977
10054
  if (needCallTransitionHooks) {
9978
10055
  transition.beforeEnter(el);
10056
+ } else if (transition && !transition.persisted) {
10057
+ el[deferredEnterKey] = true;
9979
10058
  }
9980
10059
  hostInsert(el, container, anchor);
9981
10060
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -10485,16 +10564,23 @@ function baseCreateRenderer(options, createHydrationFns) {
10485
10564
  } else {
10486
10565
  let { next, bu, u, parent, vnode } = instance;
10487
10566
  {
10488
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10489
- if (nonHydratedAsyncRoot) {
10567
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10568
+ if (unresolvedAsyncRoot) {
10490
10569
  if (next) {
10491
10570
  next.el = vnode.el;
10492
10571
  updateComponentPreRender(instance, next, optimized);
10493
10572
  }
10494
- nonHydratedAsyncRoot.asyncDep.then(() => {
10495
- queuePostRenderEffect(() => {
10496
- if (!instance.isUnmounted) update();
10497
- }, parentSuspense);
10573
+ unresolvedAsyncRoot.asyncDep.then(() => {
10574
+ const retry = () => {
10575
+ if (instance.job.flags & 8) return;
10576
+ if (parentSuspense && parentSuspense.pendingBranch) {
10577
+ queuePostRenderEffect(retry, parentSuspense);
10578
+ } else {
10579
+ update();
10580
+ }
10581
+ };
10582
+ retry.flags = 16 | 32;
10583
+ queuePostRenderEffect(retry, parentSuspense);
10498
10584
  });
10499
10585
  return;
10500
10586
  }
@@ -10536,8 +10622,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10536
10622
  patch(
10537
10623
  prevTree,
10538
10624
  nextTree,
10539
- // parent may have changed if it's in a teleport
10540
- hostParentNode(prevTree.el),
10625
+ // parent may have changed if it's in a teleport. a root that is a
10626
+ // pending async component only has its placeholder comment
10627
+ hostParentNode(
10628
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10629
+ ),
10541
10630
  // anchor may have changed if it's in a fragment
10542
10631
  getNextHostNode(prevTree),
10543
10632
  instance,
@@ -10983,8 +11072,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10983
11072
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10984
11073
  parentComponent.renderCache[cacheIndex] = void 0;
10985
11074
  }
10986
- if (shapeFlag & 256) {
10987
- parentComponent.ctx.deactivate(vnode);
11075
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10988
11076
  return;
10989
11077
  }
10990
11078
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -11109,7 +11197,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11109
11197
  if (job) {
11110
11198
  job.flags |= 8;
11111
11199
  unmount(subTree, instance, parentSuspense, doRemove);
11112
- } else if (instance.vnode.el && subTree) {
11200
+ } else if (subTree) {
11113
11201
  subTree.transition = instance.vnode.transition;
11114
11202
  unmount(subTree, instance, parentSuspense, doRemove);
11115
11203
  }
@@ -11122,9 +11210,11 @@ function baseCreateRenderer(options, createHydrationFns) {
11122
11210
  parentSuspense
11123
11211
  );
11124
11212
  }
11125
- queuePostRenderEffect(() => {
11213
+ const markUnmounted = () => {
11126
11214
  instance.isUnmounted = true;
11127
- }, parentSuspense);
11215
+ };
11216
+ markUnmounted.flags = 16;
11217
+ queuePostRenderEffect(markUnmounted, parentSuspense);
11128
11218
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
11129
11219
  devtoolsComponentRemoved(instance);
11130
11220
  }
@@ -11276,13 +11366,13 @@ function getSequence(arr) {
11276
11366
  }
11277
11367
  return result;
11278
11368
  }
11279
- function locateNonHydratedAsyncRoot(instance) {
11369
+ function locateUnresolvedAsyncRoot(instance) {
11280
11370
  const subComponent = instance.subTree.component;
11281
11371
  if (subComponent) {
11282
11372
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11283
11373
  return subComponent;
11284
11374
  } else {
11285
- return locateNonHydratedAsyncRoot(subComponent);
11375
+ return locateUnresolvedAsyncRoot(subComponent);
11286
11376
  }
11287
11377
  }
11288
11378
  }
@@ -11300,11 +11390,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
11300
11390
  if (instance) {
11301
11391
  return resolveAsyncComponentPlaceholder(instance.subTree);
11302
11392
  }
11393
+ const suspense = anchorVnode.suspense;
11394
+ if (suspense && suspense.activeBranch) {
11395
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11396
+ }
11303
11397
  return null;
11304
11398
  }
11305
11399
 
11306
11400
  const isSuspense = (type) => type.__isSuspense;
11307
11401
  let suspenseId = 0;
11402
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11308
11403
  const SuspenseImpl = {
11309
11404
  name: "Suspense",
11310
11405
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11326,11 +11421,22 @@ const SuspenseImpl = {
11326
11421
  rendererInternals
11327
11422
  );
11328
11423
  } else {
11329
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11330
- n2.suspense = n1.suspense;
11331
- n2.suspense.vnode = n2;
11332
- n2.el = n1.el;
11333
- return;
11424
+ const suspense = n1.suspense;
11425
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11426
+ const owner = suspense.parentComponent;
11427
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11428
+ if (retained ? (
11429
+ // deps can outlive the pending branch: skip only while it exists
11430
+ parentSuspense.pendingBranch && !isSameVNodeType(
11431
+ n2.ssContent,
11432
+ suspense.pendingBranch || suspense.activeBranch
11433
+ )
11434
+ ) : !suspense.isInFallback) {
11435
+ n2.suspense = suspense;
11436
+ suspense.vnode = n2;
11437
+ n2.el = n1.el;
11438
+ return;
11439
+ }
11334
11440
  }
11335
11441
  patchSuspense(
11336
11442
  n1,
@@ -11355,6 +11461,38 @@ function triggerEvent(vnode, name) {
11355
11461
  eventListener();
11356
11462
  }
11357
11463
  }
11464
+ function enterDeferred(branch) {
11465
+ const enters = [];
11466
+ collectDeferredEnters(branch, enters, true);
11467
+ if (enters.length) {
11468
+ queuePostFlushCb(enters);
11469
+ }
11470
+ }
11471
+ function collectDeferredEnters(vnode, enters, isRoot) {
11472
+ const { el, transition, children, shapeFlag } = vnode;
11473
+ if (shapeFlag & 6) {
11474
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11475
+ return;
11476
+ }
11477
+ if (shapeFlag & (128 | 64)) {
11478
+ return;
11479
+ }
11480
+ if (shapeFlag & 1) {
11481
+ if (!isRoot && el && el[deferredEnterKey]) {
11482
+ el[deferredEnterKey] = void 0;
11483
+ if (transition && !transition.persisted) {
11484
+ transition.beforeEnter(el);
11485
+ enters.push(() => transition.enter(el));
11486
+ }
11487
+ }
11488
+ isRoot = false;
11489
+ }
11490
+ if (shapeFlag & 16) {
11491
+ for (let i = 0; i < children.length; i++) {
11492
+ collectDeferredEnters(children[i], enters, isRoot);
11493
+ }
11494
+ }
11495
+ }
11358
11496
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11359
11497
  const {
11360
11498
  p: patch,
@@ -11454,7 +11592,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11454
11592
  unmount(pendingBranch, parentComponent, suspense);
11455
11593
  }
11456
11594
  suspense.deps = 0;
11457
- suspense.effects.length = 0;
11595
+ discardEffects(suspense);
11458
11596
  suspense.hiddenContainer = createElement("div");
11459
11597
  if (isInFallback) {
11460
11598
  patch(
@@ -11532,11 +11670,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11532
11670
  } else {
11533
11671
  triggerEvent(n2, "onPending");
11534
11672
  suspense.pendingBranch = newBranch;
11535
- if (newBranch.shapeFlag & 512) {
11536
- suspense.pendingId = newBranch.component.suspenseId;
11537
- } else {
11538
- suspense.pendingId = suspenseId++;
11539
- }
11673
+ suspense.pendingId = suspenseId++;
11540
11674
  patch(
11541
11675
  null,
11542
11676
  newBranch,
@@ -11551,12 +11685,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11551
11685
  if (suspense.deps <= 0) {
11552
11686
  suspense.resolve();
11553
11687
  } else {
11554
- const { timeout, pendingId } = suspense;
11688
+ const { timeout } = suspense;
11555
11689
  if (timeout > 0) {
11556
- setTimeout(() => {
11557
- if (suspense.pendingId === pendingId) {
11558
- suspense.fallback(newFallback);
11559
- }
11690
+ suspense.timeoutTimer = setTimeout(() => {
11691
+ suspense.timeoutTimer = void 0;
11692
+ suspense.fallback(suspense.vnode.ssFallback);
11560
11693
  }, timeout);
11561
11694
  } else if (timeout === 0) {
11562
11695
  suspense.fallback(newFallback);
@@ -11603,6 +11736,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11603
11736
  deps: 0,
11604
11737
  pendingId: suspenseId++,
11605
11738
  timeout: typeof timeout === "number" ? timeout : -1,
11739
+ timeoutTimer: void 0,
11606
11740
  activeBranch: null,
11607
11741
  isFallbackMountPending: false,
11608
11742
  pendingBranch: null,
@@ -11641,7 +11775,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11641
11775
  let hasUpdatedAnchor = false;
11642
11776
  if (delayEnter) {
11643
11777
  activeBranch.transition.afterLeave = () => {
11644
- if (pendingId === suspense.pendingId) {
11778
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11779
+ enterDeferred(pendingBranch);
11645
11780
  move(
11646
11781
  pendingBranch,
11647
11782
  container2,
@@ -11656,7 +11791,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11656
11791
  };
11657
11792
  }
11658
11793
  if (activeBranch && !suspense.isFallbackMountPending) {
11659
- if (parentNode(activeBranch.el) === container2) {
11794
+ if (parentNode(
11795
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11796
+ ) === container2) {
11660
11797
  anchor = next(activeBranch);
11661
11798
  hasUpdatedAnchor = true;
11662
11799
  }
@@ -11666,13 +11803,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11666
11803
  }
11667
11804
  }
11668
11805
  if (!delayEnter) {
11806
+ enterDeferred(pendingBranch);
11669
11807
  move(pendingBranch, container2, anchor, 0);
11670
11808
  }
11671
11809
  }
11810
+ clearTimeout(suspense.timeoutTimer);
11811
+ suspense.timeoutTimer = void 0;
11672
11812
  suspense.isFallbackMountPending = false;
11673
11813
  setActiveBranch(suspense, pendingBranch);
11674
11814
  suspense.pendingBranch = null;
11675
11815
  suspense.isInFallback = false;
11816
+ let kept = 0;
11817
+ for (let i = 0; i < effects.length; i++) {
11818
+ const effect = effects[i];
11819
+ if (effect.flags & 32) {
11820
+ queuePostFlushCb(effect);
11821
+ } else {
11822
+ effects[kept++] = effect;
11823
+ }
11824
+ }
11825
+ effects.length = kept;
11676
11826
  let parent = suspense.parent;
11677
11827
  let hasUnresolvedAncestor = false;
11678
11828
  while (parent) {
@@ -11701,7 +11851,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11701
11851
  triggerEvent(vnode2, "onResolve");
11702
11852
  },
11703
11853
  fallback(fallbackVNode) {
11704
- if (!suspense.pendingBranch) {
11854
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11705
11855
  return;
11706
11856
  }
11707
11857
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11709,7 +11859,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11709
11859
  const anchor2 = next(activeBranch);
11710
11860
  const mountFallback = () => {
11711
11861
  suspense.isFallbackMountPending = false;
11712
- if (!suspense.isInFallback) {
11862
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11713
11863
  return;
11714
11864
  }
11715
11865
  const latestFallback = suspense.vnode.ssFallback;
@@ -11761,19 +11911,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11761
11911
  suspense.deps++;
11762
11912
  }
11763
11913
  const hydratedEl = instance.vnode.el;
11764
- instance.asyncDep.catch((err) => {
11765
- handleError(err, instance, 0);
11766
- }).then((asyncSetupResult) => {
11767
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11768
- return;
11769
- }
11770
- unsetCurrentInstance();
11771
- if (!instance.scope.active) {
11772
- if (isInPendingSuspense && --suspense.deps === 0) {
11773
- suspense.resolve();
11774
- }
11775
- return;
11776
- }
11914
+ const render = (asyncSetupResult) => {
11777
11915
  instance.asyncResolved = true;
11778
11916
  const { vnode: vnode2 } = instance;
11779
11917
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -11806,13 +11944,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11806
11944
  if (!!(process.env.NODE_ENV !== "production")) {
11807
11945
  popWarningContext();
11808
11946
  }
11809
- if (isInPendingSuspense && --suspense.deps === 0) {
11947
+ };
11948
+ instance.asyncDep.catch((err) => {
11949
+ handleError(err, instance, 0, false, true);
11950
+ return () => null;
11951
+ }).then((asyncSetupResult) => {
11952
+ if (instance.isUnmounted || suspense.isUnmounted) {
11953
+ return;
11954
+ }
11955
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11956
+ unsetCurrentInstance();
11957
+ if (!instance.scope.active) {
11958
+ if (isPendingDep && --suspense.deps === 0) {
11959
+ suspense.resolve();
11960
+ }
11961
+ return;
11962
+ }
11963
+ if (!isPendingDep && suspense.pendingBranch) {
11964
+ const job = () => {
11965
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11966
+ return;
11967
+ }
11968
+ if (suspense.pendingBranch) {
11969
+ queueEffectWithSuspense(job, suspense);
11970
+ } else {
11971
+ render(asyncSetupResult);
11972
+ }
11973
+ };
11974
+ job.flags = 16 | 32;
11975
+ queueEffectWithSuspense(job, suspense);
11976
+ return;
11977
+ }
11978
+ render(asyncSetupResult);
11979
+ if (isPendingDep && --suspense.deps === 0) {
11810
11980
  suspense.resolve();
11811
11981
  }
11812
11982
  });
11813
11983
  },
11814
11984
  unmount(parentSuspense2, doRemove) {
11815
11985
  suspense.isUnmounted = true;
11986
+ clearTimeout(suspense.timeoutTimer);
11987
+ suspense.timeoutTimer = void 0;
11988
+ if (parentSuspenseId !== void 0) {
11989
+ const parent = suspense.parent;
11990
+ const pendingId = parentSuspenseId;
11991
+ parentSuspenseId = void 0;
11992
+ queuePostFlushCb(() => {
11993
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11994
+ parent.resolve();
11995
+ }
11996
+ });
11997
+ }
11816
11998
  if (suspense.activeBranch) {
11817
11999
  unmount(
11818
12000
  suspense.activeBranch,
@@ -11822,12 +12004,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11822
12004
  );
11823
12005
  }
11824
12006
  if (suspense.pendingBranch) {
11825
- unmount(
11826
- suspense.pendingBranch,
11827
- parentComponent,
11828
- parentSuspense2,
11829
- doRemove
11830
- );
12007
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
12008
+ discardEffects(suspense);
11831
12009
  }
11832
12010
  }
11833
12011
  };
@@ -11897,6 +12075,16 @@ function normalizeSuspenseSlot(s) {
11897
12075
  }
11898
12076
  return s;
11899
12077
  }
12078
+ function discardEffects(suspense) {
12079
+ const { effects } = suspense;
12080
+ for (let i = 0; i < effects.length; i++) {
12081
+ const effect = effects[i];
12082
+ if (effect.flags & 16) {
12083
+ queuePostFlushCb(effect);
12084
+ }
12085
+ }
12086
+ effects.length = 0;
12087
+ }
11900
12088
  function queueEffectWithSuspense(fn, suspense) {
11901
12089
  if (suspense && suspense.pendingBranch) {
11902
12090
  if (isArray(fn)) {
@@ -12212,7 +12400,8 @@ Component that was made reactive: `,
12212
12400
  }
12213
12401
  function guardReactiveProps(props) {
12214
12402
  if (!props) return null;
12215
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12403
+ if (isProxy(props)) return extend({}, props);
12404
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
12216
12405
  }
12217
12406
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
12218
12407
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12394,7 +12583,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
12394
12583
  ]);
12395
12584
  }
12396
12585
 
12397
- const emptyAppContext = createAppContext();
12586
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12398
12587
  let uid = 0;
12399
12588
  function getNextUid() {
12400
12589
  return uid;
@@ -12609,7 +12798,8 @@ function setupStatefulComponent(instance, isSSR) {
12609
12798
  setInSSRSetupState(false);
12610
12799
  }
12611
12800
  }).catch((e) => {
12612
- handleError(e, instance, 0);
12801
+ handleError(e, instance, 0, void 0, true);
12802
+ instance.ssrRender = (_, push) => push("<!---->");
12613
12803
  });
12614
12804
  } else {
12615
12805
  instance.asyncDep = setupResult;
@@ -12729,11 +12919,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
12729
12919
  }
12730
12920
  }
12731
12921
  }
12922
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12732
12923
  const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
12733
12924
  get(target, key) {
12734
12925
  markAttrsAccessed();
12735
12926
  track(target, "get", "");
12736
- return target[key];
12927
+ return key === rawAttrsKey ? target : target[key];
12737
12928
  },
12738
12929
  set() {
12739
12930
  warn$1(`setupContext.attrs is readonly.`);
@@ -12746,7 +12937,7 @@ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
12746
12937
  } : {
12747
12938
  get(target, key) {
12748
12939
  track(target, "get", "");
12749
- return target[key];
12940
+ return key === rawAttrsKey ? target : target[key];
12750
12941
  }
12751
12942
  };
12752
12943
  function getSlotsProxy(instance) {
@@ -13097,7 +13288,7 @@ function isMemoSame(cached, memo) {
13097
13288
  return true;
13098
13289
  }
13099
13290
 
13100
- const version = "3.5.44";
13291
+ const version = "3.5.45";
13101
13292
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
13102
13293
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13103
13294
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -14999,18 +15190,18 @@ const vModelSelect = {
14999
15190
  },
15000
15191
  // set value in mounted & updated because <select> relies on its children
15001
15192
  // <option>s.
15002
- mounted(el, { value }) {
15003
- setSelected(el, value);
15193
+ mounted(el, { value, modifiers: { number } }) {
15194
+ setSelected(el, value, number);
15004
15195
  },
15005
15196
  beforeUpdate(el, { value }, vnode) {
15006
15197
  el._modelValue = value;
15007
15198
  el[assignKey] = getModelAssigner(vnode);
15008
15199
  },
15009
- updated(el, { value }) {
15200
+ updated(el, { value, modifiers: { number } }) {
15010
15201
  const pending = el._pendingValue;
15011
15202
  el._pendingValue = void 0;
15012
15203
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
15013
- setSelected(el, value);
15204
+ setSelected(el, value, number);
15014
15205
  }
15015
15206
  }
15016
15207
  };
@@ -15026,7 +15217,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
15026
15217
  }
15027
15218
  return false;
15028
15219
  }
15029
- function setSelected(el, value) {
15220
+ function setSelected(el, value, number = false) {
15030
15221
  const isMultiple = el.multiple;
15031
15222
  const isArrayValue = isArray(value);
15032
15223
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -15047,7 +15238,7 @@ function setSelected(el, value) {
15047
15238
  option.selected = looseIndexOf(value, optionValue) > -1;
15048
15239
  }
15049
15240
  } else {
15050
- option.selected = value.has(optionValue);
15241
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
15051
15242
  }
15052
15243
  } else if (looseEqual(getValue(option), value)) {
15053
15244
  if (el.selectedIndex !== i) el.selectedIndex = i;
@@ -17726,7 +17917,11 @@ function getLoc(start, end) {
17726
17917
  };
17727
17918
  }
17728
17919
  function cloneLoc(loc) {
17729
- return getLoc(loc.start.offset, loc.end.offset);
17920
+ return {
17921
+ start: extend({}, loc.start),
17922
+ end: extend({}, loc.end),
17923
+ source: loc.source
17924
+ };
17730
17925
  }
17731
17926
  function setLocEnd(loc, end) {
17732
17927
  loc.end = tokenizer.getPos(end);