@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++) {
@@ -191,7 +187,7 @@ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
191
187
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
192
188
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
193
189
 
194
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
190
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
195
191
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
196
192
  const isBooleanAttr = /* @__PURE__ */ makeMap(
197
193
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -535,7 +531,11 @@ function getCurrentScope() {
535
531
  }
536
532
  function onScopeDispose(fn, failSilently = false) {
537
533
  if (activeEffectScope) {
538
- activeEffectScope.cleanups.push(fn);
534
+ if (activeEffectScope.active) {
535
+ activeEffectScope.cleanups.push(fn);
536
+ } else {
537
+ fn();
538
+ }
539
539
  } else if (!!(process.env.NODE_ENV !== "production") && !failSilently) {
540
540
  warn$2(
541
541
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1346,7 +1346,7 @@ function noTracking(self, method, args = []) {
1346
1346
  }
1347
1347
 
1348
1348
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1349
- const builtInSymbols = new Set(
1349
+ const builtInSymbols = /* @__PURE__ */ new Set(
1350
1350
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1351
1351
  );
1352
1352
  function hasOwnProperty(key) {
@@ -2563,7 +2563,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2563
2563
  const res = callWithErrorHandling(fn, instance, type, args);
2564
2564
  if (res && isPromise(res)) {
2565
2565
  res.catch((err) => {
2566
- handleError(err, instance, type);
2566
+ handleError(err, instance, type, void 0, true);
2567
2567
  });
2568
2568
  }
2569
2569
  return res;
@@ -2580,7 +2580,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2580
2580
  );
2581
2581
  }
2582
2582
  }
2583
- function handleError(err, instance, type, throwInDev = true) {
2583
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2584
2584
  const contextVNode = instance ? instance.vnode : null;
2585
2585
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2586
2586
  if (instance) {
@@ -2589,7 +2589,9 @@ function handleError(err, instance, type, throwInDev = true) {
2589
2589
  const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
2590
2590
  while (cur) {
2591
2591
  const errorCapturedHooks = cur.ec;
2592
- if (errorCapturedHooks) {
2592
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2593
+ // are deferred or discarded by Suspense.
2594
+ (!isAsyncError || cur.scope.active)) {
2593
2595
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2594
2596
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2595
2597
  return;
@@ -2921,14 +2923,32 @@ function reload(id, newComp) {
2921
2923
  instance.ceReload(newComp.styles);
2922
2924
  dirtyInstances.delete(instance);
2923
2925
  } else if (instance.parent) {
2924
- queueJob(() => {
2925
- if (!(instance.job.flags & 8)) {
2926
- isHmrUpdating = true;
2926
+ const update = () => {
2927
+ if (!instance.scope.active) return;
2928
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2929
+ if (pending) {
2930
+ pending.asyncDep.catch(NOOP).then(() => {
2931
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2932
+ queueJob(update);
2933
+ }
2934
+ });
2935
+ return;
2936
+ }
2937
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2938
+ if (!dirtyInstances) {
2939
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2940
+ }
2941
+ dirtyInstances.add(instance);
2942
+ isHmrUpdating = true;
2943
+ try {
2927
2944
  instance.parent.update();
2945
+ } finally {
2928
2946
  isHmrUpdating = false;
2929
2947
  dirtyInstances.delete(instance);
2948
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2930
2949
  }
2931
- });
2950
+ };
2951
+ queueJob(update);
2932
2952
  } else if (instance.appContext.reload) {
2933
2953
  instance.appContext.reload();
2934
2954
  } else if (typeof window !== "undefined") {
@@ -3613,12 +3633,31 @@ function withDirectives(vnode, directives) {
3613
3633
  return vnode;
3614
3634
  }
3615
3635
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3616
- const bindings = vnode.dirs;
3636
+ let hookVNode = vnode;
3637
+ if (name === "beforeMount") {
3638
+ vnode._mount = vnode;
3639
+ } else if (name === "beforeUpdate") {
3640
+ const mount = prevVNode && prevVNode._mount;
3641
+ if (mount) {
3642
+ mount._latest = vnode;
3643
+ vnode._mount = mount;
3644
+ }
3645
+ } else if (name === "mounted") {
3646
+ const latest = vnode._latest;
3647
+ vnode._mount = vnode._latest = void 0;
3648
+ if (latest) {
3649
+ hookVNode = latest;
3650
+ latest._mount = void 0;
3651
+ }
3652
+ }
3653
+ const bindings = hookVNode.dirs;
3617
3654
  const oldBindings = prevVNode && prevVNode.dirs;
3618
3655
  for (let i = 0; i < bindings.length; i++) {
3619
- const binding = bindings[i];
3656
+ let binding = bindings[i];
3620
3657
  if (oldBindings) {
3621
3658
  binding.oldValue = oldBindings[i].value;
3659
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3660
+ binding = extend({}, binding, { oldValue: void 0 });
3622
3661
  }
3623
3662
  let hook = binding.dir[name];
3624
3663
  if (!hook) {
@@ -3629,7 +3668,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3629
3668
  callWithAsyncErrorHandling(hook, instance, 8, [
3630
3669
  vnode.el,
3631
3670
  binding,
3632
- vnode,
3671
+ hookVNode,
3633
3672
  prevVNode
3634
3673
  ]);
3635
3674
  resetTracking();
@@ -4253,13 +4292,11 @@ const BaseTransitionImpl = {
4253
4292
  if (!innerChild) {
4254
4293
  return emptyPlaceholder(child);
4255
4294
  }
4256
- let enterHooks = resolveTransitionHooks(
4295
+ const enterHooks = resolveTransitionHooks(
4257
4296
  innerChild,
4258
4297
  rawProps,
4259
4298
  state,
4260
- instance,
4261
- // #11061, ensure enterHooks is fresh after clone
4262
- (hooks) => enterHooks = hooks
4299
+ instance
4263
4300
  );
4264
4301
  if (innerChild.type !== Comment) {
4265
4302
  setTransitionHooks(innerChild, enterHooks);
@@ -4278,7 +4315,17 @@ const BaseTransitionImpl = {
4278
4315
  leavingHooks.afterLeave = () => {
4279
4316
  state.isLeaving = false;
4280
4317
  if (!(instance.job.flags & 8)) {
4281
- instance.update();
4318
+ if (instance.effect.flags & 2) {
4319
+ const job = () => {
4320
+ if (!(instance.job.flags & 8)) {
4321
+ instance.update();
4322
+ }
4323
+ };
4324
+ job.i = instance;
4325
+ queueJob(job);
4326
+ } else {
4327
+ instance.update();
4328
+ }
4282
4329
  }
4283
4330
  delete leavingHooks.afterLeave;
4284
4331
  oldInnerChild = void 0;
@@ -4346,7 +4393,7 @@ function getLeavingNodesForType(state, vnode) {
4346
4393
  }
4347
4394
  return leavingVNodesCache;
4348
4395
  }
4349
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4396
+ function resolveTransitionHooks(vnode, props, state, instance) {
4350
4397
  const {
4351
4398
  appear,
4352
4399
  mode,
@@ -4485,15 +4532,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4485
4532
  }
4486
4533
  },
4487
4534
  clone(vnode2) {
4488
- const hooks2 = resolveTransitionHooks(
4489
- vnode2,
4490
- props,
4491
- state,
4492
- instance,
4493
- postClone
4494
- );
4495
- if (postClone) postClone(hooks2);
4496
- return hooks2;
4535
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4536
+ cloned.afterLeave = () => {
4537
+ if (hooks.afterLeave) hooks.afterLeave();
4538
+ };
4539
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4540
+ if (hooks.delayLeave) {
4541
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4542
+ } else {
4543
+ delayedLeave();
4544
+ }
4545
+ };
4546
+ cloned.delayedLeave = () => {
4547
+ if (hooks.delayedLeave) hooks.delayedLeave();
4548
+ };
4549
+ return cloned;
4497
4550
  }
4498
4551
  };
4499
4552
  return hooks;
@@ -4534,8 +4587,16 @@ function setTransitionHooks(vnode, hooks) {
4534
4587
  hooks
4535
4588
  );
4536
4589
  } else if (vnode.shapeFlag & 128) {
4537
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4538
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4590
+ const suspense = vnode.suspense;
4591
+ if (suspense) {
4592
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4593
+ if (branch) {
4594
+ setTransitionHooks(branch, hooks.clone(branch));
4595
+ }
4596
+ } else {
4597
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4598
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4599
+ }
4539
4600
  } else {
4540
4601
  vnode.transition = hooks;
4541
4602
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -5248,7 +5309,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5248
5309
  getContainerType(container),
5249
5310
  slotScopeIds
5250
5311
  );
5251
- if (parentComponent) {
5312
+ if (parentComponent && parentComponent.vnode.el === node) {
5252
5313
  parentComponent.vnode.el = vnode.el;
5253
5314
  updateHOCHostEl(parentComponent, vnode.el);
5254
5315
  }
@@ -5682,7 +5743,8 @@ function defineAsyncComponent(source) {
5682
5743
  err,
5683
5744
  instance,
5684
5745
  13,
5685
- !errorComponent
5746
+ !errorComponent,
5747
+ true
5686
5748
  );
5687
5749
  };
5688
5750
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -5700,7 +5762,7 @@ function defineAsyncComponent(source) {
5700
5762
  const delayed = ref(!!delay);
5701
5763
  let timeoutTimer;
5702
5764
  let delayTimer;
5703
- onUnmounted(() => {
5765
+ onScopeDispose(() => {
5704
5766
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5705
5767
  if (delayTimer != null) clearTimeout(delayTimer);
5706
5768
  });
@@ -5828,6 +5890,12 @@ const KeepAliveImpl = {
5828
5890
  }
5829
5891
  };
5830
5892
  sharedContext.deactivate = (vnode) => {
5893
+ const cached = cache.get(
5894
+ vnode.key == null ? vnode.type : vnode.key
5895
+ );
5896
+ if (!cached || cached.component !== vnode.component) {
5897
+ return false;
5898
+ }
5831
5899
  const instance2 = vnode.component;
5832
5900
  invalidateMount(instance2.m);
5833
5901
  invalidateMount(instance2.a);
@@ -5848,6 +5916,7 @@ const KeepAliveImpl = {
5848
5916
  if (!!(process.env.NODE_ENV !== "production") && true) {
5849
5917
  instance2.__keepAliveStorageContainer = storageContainer;
5850
5918
  }
5919
+ return true;
5851
5920
  };
5852
5921
  function unmount(vnode) {
5853
5922
  resetShapeFlag(vnode);
@@ -5887,12 +5956,17 @@ const KeepAliveImpl = {
5887
5956
  const cacheSubtree = () => {
5888
5957
  if (pendingCacheKey != null) {
5889
5958
  if (isSuspense(instance.subTree.type)) {
5890
- queuePostRenderEffect(() => {
5959
+ const cacheInnerChild = () => {
5891
5960
  const vnode = getInnerChild(instance.subTree);
5892
5961
  if (vnode.component) {
5893
5962
  cache.set(pendingCacheKey, vnode);
5894
5963
  }
5895
- }, instance.subTree.suspense);
5964
+ };
5965
+ if (instance.subTree.suspense.pendingBranch) {
5966
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5967
+ } else {
5968
+ cacheInnerChild();
5969
+ }
5896
5970
  } else {
5897
5971
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5898
5972
  }
@@ -6027,9 +6101,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
6027
6101
  true
6028
6102
  /* prepend */
6029
6103
  );
6030
- onUnmounted(() => {
6031
- remove(keepAliveRoot[type], injected);
6032
- }, target);
6104
+ const removal = injectHook(
6105
+ "um",
6106
+ () => remove(keepAliveRoot[type], injected),
6107
+ target
6108
+ );
6109
+ removal.flags = 16;
6033
6110
  }
6034
6111
  function resetShapeFlag(vnode) {
6035
6112
  vnode.shapeFlag &= -257;
@@ -7765,7 +7842,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7765
7842
  return vm;
7766
7843
  }
7767
7844
  }
7768
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
7845
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7769
7846
  Vue.config = singletonApp.config;
7770
7847
  Vue.use = (plugin, ...options) => {
7771
7848
  if (plugin && isFunction(plugin.install)) {
@@ -9903,6 +9980,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9903
9980
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9904
9981
  if (needCallTransitionHooks) {
9905
9982
  transition.beforeEnter(el);
9983
+ } else if (transition && !transition.persisted) {
9984
+ el[deferredEnterKey] = true;
9906
9985
  }
9907
9986
  hostInsert(el, container, anchor);
9908
9987
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -10412,16 +10491,23 @@ function baseCreateRenderer(options, createHydrationFns) {
10412
10491
  } else {
10413
10492
  let { next, bu, u, parent, vnode } = instance;
10414
10493
  {
10415
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10416
- if (nonHydratedAsyncRoot) {
10494
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10495
+ if (unresolvedAsyncRoot) {
10417
10496
  if (next) {
10418
10497
  next.el = vnode.el;
10419
10498
  updateComponentPreRender(instance, next, optimized);
10420
10499
  }
10421
- nonHydratedAsyncRoot.asyncDep.then(() => {
10422
- queuePostRenderEffect(() => {
10423
- if (!instance.isUnmounted) update();
10424
- }, parentSuspense);
10500
+ unresolvedAsyncRoot.asyncDep.then(() => {
10501
+ const retry = () => {
10502
+ if (instance.job.flags & 8) return;
10503
+ if (parentSuspense && parentSuspense.pendingBranch) {
10504
+ queuePostRenderEffect(retry, parentSuspense);
10505
+ } else {
10506
+ update();
10507
+ }
10508
+ };
10509
+ retry.flags = 16 | 32;
10510
+ queuePostRenderEffect(retry, parentSuspense);
10425
10511
  });
10426
10512
  return;
10427
10513
  }
@@ -10463,8 +10549,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10463
10549
  patch(
10464
10550
  prevTree,
10465
10551
  nextTree,
10466
- // parent may have changed if it's in a teleport
10467
- hostParentNode(prevTree.el),
10552
+ // parent may have changed if it's in a teleport. a root that is a
10553
+ // pending async component only has its placeholder comment
10554
+ hostParentNode(
10555
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10556
+ ),
10468
10557
  // anchor may have changed if it's in a fragment
10469
10558
  getNextHostNode(prevTree),
10470
10559
  instance,
@@ -10910,8 +10999,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10910
10999
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10911
11000
  parentComponent.renderCache[cacheIndex] = void 0;
10912
11001
  }
10913
- if (shapeFlag & 256) {
10914
- parentComponent.ctx.deactivate(vnode);
11002
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10915
11003
  return;
10916
11004
  }
10917
11005
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -11036,7 +11124,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11036
11124
  if (job) {
11037
11125
  job.flags |= 8;
11038
11126
  unmount(subTree, instance, parentSuspense, doRemove);
11039
- } else if (instance.vnode.el && subTree) {
11127
+ } else if (subTree) {
11040
11128
  subTree.transition = instance.vnode.transition;
11041
11129
  unmount(subTree, instance, parentSuspense, doRemove);
11042
11130
  }
@@ -11049,9 +11137,11 @@ function baseCreateRenderer(options, createHydrationFns) {
11049
11137
  parentSuspense
11050
11138
  );
11051
11139
  }
11052
- queuePostRenderEffect(() => {
11140
+ const markUnmounted = () => {
11053
11141
  instance.isUnmounted = true;
11054
- }, parentSuspense);
11142
+ };
11143
+ markUnmounted.flags = 16;
11144
+ queuePostRenderEffect(markUnmounted, parentSuspense);
11055
11145
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
11056
11146
  devtoolsComponentRemoved(instance);
11057
11147
  }
@@ -11203,13 +11293,13 @@ function getSequence(arr) {
11203
11293
  }
11204
11294
  return result;
11205
11295
  }
11206
- function locateNonHydratedAsyncRoot(instance) {
11296
+ function locateUnresolvedAsyncRoot(instance) {
11207
11297
  const subComponent = instance.subTree.component;
11208
11298
  if (subComponent) {
11209
11299
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11210
11300
  return subComponent;
11211
11301
  } else {
11212
- return locateNonHydratedAsyncRoot(subComponent);
11302
+ return locateUnresolvedAsyncRoot(subComponent);
11213
11303
  }
11214
11304
  }
11215
11305
  }
@@ -11227,11 +11317,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
11227
11317
  if (instance) {
11228
11318
  return resolveAsyncComponentPlaceholder(instance.subTree);
11229
11319
  }
11320
+ const suspense = anchorVnode.suspense;
11321
+ if (suspense && suspense.activeBranch) {
11322
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11323
+ }
11230
11324
  return null;
11231
11325
  }
11232
11326
 
11233
11327
  const isSuspense = (type) => type.__isSuspense;
11234
11328
  let suspenseId = 0;
11329
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11235
11330
  const SuspenseImpl = {
11236
11331
  name: "Suspense",
11237
11332
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11253,11 +11348,22 @@ const SuspenseImpl = {
11253
11348
  rendererInternals
11254
11349
  );
11255
11350
  } else {
11256
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11257
- n2.suspense = n1.suspense;
11258
- n2.suspense.vnode = n2;
11259
- n2.el = n1.el;
11260
- return;
11351
+ const suspense = n1.suspense;
11352
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11353
+ const owner = suspense.parentComponent;
11354
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11355
+ if (retained ? (
11356
+ // deps can outlive the pending branch: skip only while it exists
11357
+ parentSuspense.pendingBranch && !isSameVNodeType(
11358
+ n2.ssContent,
11359
+ suspense.pendingBranch || suspense.activeBranch
11360
+ )
11361
+ ) : !suspense.isInFallback) {
11362
+ n2.suspense = suspense;
11363
+ suspense.vnode = n2;
11364
+ n2.el = n1.el;
11365
+ return;
11366
+ }
11261
11367
  }
11262
11368
  patchSuspense(
11263
11369
  n1,
@@ -11282,6 +11388,38 @@ function triggerEvent(vnode, name) {
11282
11388
  eventListener();
11283
11389
  }
11284
11390
  }
11391
+ function enterDeferred(branch) {
11392
+ const enters = [];
11393
+ collectDeferredEnters(branch, enters, true);
11394
+ if (enters.length) {
11395
+ queuePostFlushCb(enters);
11396
+ }
11397
+ }
11398
+ function collectDeferredEnters(vnode, enters, isRoot) {
11399
+ const { el, transition, children, shapeFlag } = vnode;
11400
+ if (shapeFlag & 6) {
11401
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11402
+ return;
11403
+ }
11404
+ if (shapeFlag & (128 | 64)) {
11405
+ return;
11406
+ }
11407
+ if (shapeFlag & 1) {
11408
+ if (!isRoot && el && el[deferredEnterKey]) {
11409
+ el[deferredEnterKey] = void 0;
11410
+ if (transition && !transition.persisted) {
11411
+ transition.beforeEnter(el);
11412
+ enters.push(() => transition.enter(el));
11413
+ }
11414
+ }
11415
+ isRoot = false;
11416
+ }
11417
+ if (shapeFlag & 16) {
11418
+ for (let i = 0; i < children.length; i++) {
11419
+ collectDeferredEnters(children[i], enters, isRoot);
11420
+ }
11421
+ }
11422
+ }
11285
11423
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11286
11424
  const {
11287
11425
  p: patch,
@@ -11381,7 +11519,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11381
11519
  unmount(pendingBranch, parentComponent, suspense);
11382
11520
  }
11383
11521
  suspense.deps = 0;
11384
- suspense.effects.length = 0;
11522
+ discardEffects(suspense);
11385
11523
  suspense.hiddenContainer = createElement("div");
11386
11524
  if (isInFallback) {
11387
11525
  patch(
@@ -11459,11 +11597,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11459
11597
  } else {
11460
11598
  triggerEvent(n2, "onPending");
11461
11599
  suspense.pendingBranch = newBranch;
11462
- if (newBranch.shapeFlag & 512) {
11463
- suspense.pendingId = newBranch.component.suspenseId;
11464
- } else {
11465
- suspense.pendingId = suspenseId++;
11466
- }
11600
+ suspense.pendingId = suspenseId++;
11467
11601
  patch(
11468
11602
  null,
11469
11603
  newBranch,
@@ -11478,12 +11612,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11478
11612
  if (suspense.deps <= 0) {
11479
11613
  suspense.resolve();
11480
11614
  } else {
11481
- const { timeout, pendingId } = suspense;
11615
+ const { timeout } = suspense;
11482
11616
  if (timeout > 0) {
11483
- setTimeout(() => {
11484
- if (suspense.pendingId === pendingId) {
11485
- suspense.fallback(newFallback);
11486
- }
11617
+ suspense.timeoutTimer = setTimeout(() => {
11618
+ suspense.timeoutTimer = void 0;
11619
+ suspense.fallback(suspense.vnode.ssFallback);
11487
11620
  }, timeout);
11488
11621
  } else if (timeout === 0) {
11489
11622
  suspense.fallback(newFallback);
@@ -11530,6 +11663,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11530
11663
  deps: 0,
11531
11664
  pendingId: suspenseId++,
11532
11665
  timeout: typeof timeout === "number" ? timeout : -1,
11666
+ timeoutTimer: void 0,
11533
11667
  activeBranch: null,
11534
11668
  isFallbackMountPending: false,
11535
11669
  pendingBranch: null,
@@ -11568,7 +11702,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11568
11702
  let hasUpdatedAnchor = false;
11569
11703
  if (delayEnter) {
11570
11704
  activeBranch.transition.afterLeave = () => {
11571
- if (pendingId === suspense.pendingId) {
11705
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11706
+ enterDeferred(pendingBranch);
11572
11707
  move(
11573
11708
  pendingBranch,
11574
11709
  container2,
@@ -11583,7 +11718,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11583
11718
  };
11584
11719
  }
11585
11720
  if (activeBranch && !suspense.isFallbackMountPending) {
11586
- if (parentNode(activeBranch.el) === container2) {
11721
+ if (parentNode(
11722
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11723
+ ) === container2) {
11587
11724
  anchor = next(activeBranch);
11588
11725
  hasUpdatedAnchor = true;
11589
11726
  }
@@ -11593,13 +11730,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11593
11730
  }
11594
11731
  }
11595
11732
  if (!delayEnter) {
11733
+ enterDeferred(pendingBranch);
11596
11734
  move(pendingBranch, container2, anchor, 0);
11597
11735
  }
11598
11736
  }
11737
+ clearTimeout(suspense.timeoutTimer);
11738
+ suspense.timeoutTimer = void 0;
11599
11739
  suspense.isFallbackMountPending = false;
11600
11740
  setActiveBranch(suspense, pendingBranch);
11601
11741
  suspense.pendingBranch = null;
11602
11742
  suspense.isInFallback = false;
11743
+ let kept = 0;
11744
+ for (let i = 0; i < effects.length; i++) {
11745
+ const effect = effects[i];
11746
+ if (effect.flags & 32) {
11747
+ queuePostFlushCb(effect);
11748
+ } else {
11749
+ effects[kept++] = effect;
11750
+ }
11751
+ }
11752
+ effects.length = kept;
11603
11753
  let parent = suspense.parent;
11604
11754
  let hasUnresolvedAncestor = false;
11605
11755
  while (parent) {
@@ -11628,7 +11778,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11628
11778
  triggerEvent(vnode2, "onResolve");
11629
11779
  },
11630
11780
  fallback(fallbackVNode) {
11631
- if (!suspense.pendingBranch) {
11781
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11632
11782
  return;
11633
11783
  }
11634
11784
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11636,7 +11786,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11636
11786
  const anchor2 = next(activeBranch);
11637
11787
  const mountFallback = () => {
11638
11788
  suspense.isFallbackMountPending = false;
11639
- if (!suspense.isInFallback) {
11789
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11640
11790
  return;
11641
11791
  }
11642
11792
  const latestFallback = suspense.vnode.ssFallback;
@@ -11688,19 +11838,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11688
11838
  suspense.deps++;
11689
11839
  }
11690
11840
  const hydratedEl = instance.vnode.el;
11691
- instance.asyncDep.catch((err) => {
11692
- handleError(err, instance, 0);
11693
- }).then((asyncSetupResult) => {
11694
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11695
- return;
11696
- }
11697
- unsetCurrentInstance();
11698
- if (!instance.scope.active) {
11699
- if (isInPendingSuspense && --suspense.deps === 0) {
11700
- suspense.resolve();
11701
- }
11702
- return;
11703
- }
11841
+ const render = (asyncSetupResult) => {
11704
11842
  instance.asyncResolved = true;
11705
11843
  const { vnode: vnode2 } = instance;
11706
11844
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -11733,13 +11871,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11733
11871
  if (!!(process.env.NODE_ENV !== "production")) {
11734
11872
  popWarningContext();
11735
11873
  }
11736
- if (isInPendingSuspense && --suspense.deps === 0) {
11874
+ };
11875
+ instance.asyncDep.catch((err) => {
11876
+ handleError(err, instance, 0, false, true);
11877
+ return () => null;
11878
+ }).then((asyncSetupResult) => {
11879
+ if (instance.isUnmounted || suspense.isUnmounted) {
11880
+ return;
11881
+ }
11882
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11883
+ unsetCurrentInstance();
11884
+ if (!instance.scope.active) {
11885
+ if (isPendingDep && --suspense.deps === 0) {
11886
+ suspense.resolve();
11887
+ }
11888
+ return;
11889
+ }
11890
+ if (!isPendingDep && suspense.pendingBranch) {
11891
+ const job = () => {
11892
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11893
+ return;
11894
+ }
11895
+ if (suspense.pendingBranch) {
11896
+ queueEffectWithSuspense(job, suspense);
11897
+ } else {
11898
+ render(asyncSetupResult);
11899
+ }
11900
+ };
11901
+ job.flags = 16 | 32;
11902
+ queueEffectWithSuspense(job, suspense);
11903
+ return;
11904
+ }
11905
+ render(asyncSetupResult);
11906
+ if (isPendingDep && --suspense.deps === 0) {
11737
11907
  suspense.resolve();
11738
11908
  }
11739
11909
  });
11740
11910
  },
11741
11911
  unmount(parentSuspense2, doRemove) {
11742
11912
  suspense.isUnmounted = true;
11913
+ clearTimeout(suspense.timeoutTimer);
11914
+ suspense.timeoutTimer = void 0;
11915
+ if (parentSuspenseId !== void 0) {
11916
+ const parent = suspense.parent;
11917
+ const pendingId = parentSuspenseId;
11918
+ parentSuspenseId = void 0;
11919
+ queuePostFlushCb(() => {
11920
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11921
+ parent.resolve();
11922
+ }
11923
+ });
11924
+ }
11743
11925
  if (suspense.activeBranch) {
11744
11926
  unmount(
11745
11927
  suspense.activeBranch,
@@ -11749,12 +11931,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11749
11931
  );
11750
11932
  }
11751
11933
  if (suspense.pendingBranch) {
11752
- unmount(
11753
- suspense.pendingBranch,
11754
- parentComponent,
11755
- parentSuspense2,
11756
- doRemove
11757
- );
11934
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
11935
+ discardEffects(suspense);
11758
11936
  }
11759
11937
  }
11760
11938
  };
@@ -11824,6 +12002,16 @@ function normalizeSuspenseSlot(s) {
11824
12002
  }
11825
12003
  return s;
11826
12004
  }
12005
+ function discardEffects(suspense) {
12006
+ const { effects } = suspense;
12007
+ for (let i = 0; i < effects.length; i++) {
12008
+ const effect = effects[i];
12009
+ if (effect.flags & 16) {
12010
+ queuePostFlushCb(effect);
12011
+ }
12012
+ }
12013
+ effects.length = 0;
12014
+ }
11827
12015
  function queueEffectWithSuspense(fn, suspense) {
11828
12016
  if (suspense && suspense.pendingBranch) {
11829
12017
  if (isArray(fn)) {
@@ -12139,7 +12327,8 @@ Component that was made reactive: `,
12139
12327
  }
12140
12328
  function guardReactiveProps(props) {
12141
12329
  if (!props) return null;
12142
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12330
+ if (isProxy(props)) return extend({}, props);
12331
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
12143
12332
  }
12144
12333
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
12145
12334
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12321,7 +12510,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
12321
12510
  ]);
12322
12511
  }
12323
12512
 
12324
- const emptyAppContext = createAppContext();
12513
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12325
12514
  let uid = 0;
12326
12515
  function getNextUid() {
12327
12516
  return uid;
@@ -12536,7 +12725,8 @@ function setupStatefulComponent(instance, isSSR) {
12536
12725
  setInSSRSetupState(false);
12537
12726
  }
12538
12727
  }).catch((e) => {
12539
- handleError(e, instance, 0);
12728
+ handleError(e, instance, 0, void 0, true);
12729
+ instance.ssrRender = (_, push) => push("<!---->");
12540
12730
  });
12541
12731
  } else {
12542
12732
  instance.asyncDep = setupResult;
@@ -12656,11 +12846,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
12656
12846
  }
12657
12847
  }
12658
12848
  }
12849
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12659
12850
  const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
12660
12851
  get(target, key) {
12661
12852
  markAttrsAccessed();
12662
12853
  track(target, "get", "");
12663
- return target[key];
12854
+ return key === rawAttrsKey ? target : target[key];
12664
12855
  },
12665
12856
  set() {
12666
12857
  warn$1(`setupContext.attrs is readonly.`);
@@ -12673,7 +12864,7 @@ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
12673
12864
  } : {
12674
12865
  get(target, key) {
12675
12866
  track(target, "get", "");
12676
- return target[key];
12867
+ return key === rawAttrsKey ? target : target[key];
12677
12868
  }
12678
12869
  };
12679
12870
  function getSlotsProxy(instance) {
@@ -13024,7 +13215,7 @@ function isMemoSame(cached, memo) {
13024
13215
  return true;
13025
13216
  }
13026
13217
 
13027
- const version = "3.5.44";
13218
+ const version = "3.5.45";
13028
13219
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
13029
13220
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13030
13221
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -14926,18 +15117,18 @@ const vModelSelect = {
14926
15117
  },
14927
15118
  // set value in mounted & updated because <select> relies on its children
14928
15119
  // <option>s.
14929
- mounted(el, { value }) {
14930
- setSelected(el, value);
15120
+ mounted(el, { value, modifiers: { number } }) {
15121
+ setSelected(el, value, number);
14931
15122
  },
14932
15123
  beforeUpdate(el, { value }, vnode) {
14933
15124
  el._modelValue = value;
14934
15125
  el[assignKey] = getModelAssigner(vnode);
14935
15126
  },
14936
- updated(el, { value }) {
15127
+ updated(el, { value, modifiers: { number } }) {
14937
15128
  const pending = el._pendingValue;
14938
15129
  el._pendingValue = void 0;
14939
15130
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14940
- setSelected(el, value);
15131
+ setSelected(el, value, number);
14941
15132
  }
14942
15133
  }
14943
15134
  };
@@ -14953,7 +15144,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
14953
15144
  }
14954
15145
  return false;
14955
15146
  }
14956
- function setSelected(el, value) {
15147
+ function setSelected(el, value, number = false) {
14957
15148
  const isMultiple = el.multiple;
14958
15149
  const isArrayValue = isArray(value);
14959
15150
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -14974,7 +15165,7 @@ function setSelected(el, value) {
14974
15165
  option.selected = looseIndexOf(value, optionValue) > -1;
14975
15166
  }
14976
15167
  } else {
14977
- option.selected = value.has(optionValue);
15168
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
14978
15169
  }
14979
15170
  } else if (looseEqual(getValue(option), value)) {
14980
15171
  if (el.selectedIndex !== i) el.selectedIndex = i;