@vue/runtime-dom 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/runtime-dom v3.5.44
2
+ * @vue/runtime-dom v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -64,24 +64,20 @@ var VueRuntimeDOM = (function (exports) {
64
64
  });
65
65
  };
66
66
  const camelizeRE = /-\w/g;
67
- const camelize = cacheStringFunction(
68
- (str) => {
69
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
70
- }
71
- );
67
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
68
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
69
+ });
72
70
  const hyphenateRE = /\B([A-Z])/g;
73
- const hyphenate = cacheStringFunction(
71
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
74
72
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
75
73
  );
76
- const capitalize = cacheStringFunction((str) => {
74
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
77
75
  return str.charAt(0).toUpperCase() + str.slice(1);
78
76
  });
79
- const toHandlerKey = cacheStringFunction(
80
- (str) => {
81
- const s = str ? `on${capitalize(str)}` : ``;
82
- return s;
83
- }
84
- );
77
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
78
+ const s = str ? `on${capitalize(str)}` : ``;
79
+ return s;
80
+ });
85
81
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
86
82
  const invokeArrayFns = (fns, ...arg) => {
87
83
  for (let i = 0; i < fns.length; i++) {
@@ -194,7 +190,7 @@ var VueRuntimeDOM = (function (exports) {
194
190
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
195
191
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
196
192
 
197
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
193
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
198
194
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
199
195
  const isBooleanAttr = /* @__PURE__ */ makeMap(
200
196
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -538,7 +534,11 @@ var VueRuntimeDOM = (function (exports) {
538
534
  }
539
535
  function onScopeDispose(fn, failSilently = false) {
540
536
  if (activeEffectScope) {
541
- activeEffectScope.cleanups.push(fn);
537
+ if (activeEffectScope.active) {
538
+ activeEffectScope.cleanups.push(fn);
539
+ } else {
540
+ fn();
541
+ }
542
542
  } else if (!failSilently) {
543
543
  warn$2(
544
544
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1345,7 +1345,7 @@ var VueRuntimeDOM = (function (exports) {
1345
1345
  }
1346
1346
 
1347
1347
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1348
- const builtInSymbols = new Set(
1348
+ const builtInSymbols = /* @__PURE__ */ new Set(
1349
1349
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1350
1350
  );
1351
1351
  function hasOwnProperty(key) {
@@ -2555,7 +2555,7 @@ var VueRuntimeDOM = (function (exports) {
2555
2555
  const res = callWithErrorHandling(fn, instance, type, args);
2556
2556
  if (res && isPromise(res)) {
2557
2557
  res.catch((err) => {
2558
- handleError(err, instance, type);
2558
+ handleError(err, instance, type, void 0, true);
2559
2559
  });
2560
2560
  }
2561
2561
  return res;
@@ -2572,7 +2572,7 @@ var VueRuntimeDOM = (function (exports) {
2572
2572
  );
2573
2573
  }
2574
2574
  }
2575
- function handleError(err, instance, type, throwInDev = true) {
2575
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2576
2576
  const contextVNode = instance ? instance.vnode : null;
2577
2577
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2578
2578
  if (instance) {
@@ -2581,7 +2581,9 @@ var VueRuntimeDOM = (function (exports) {
2581
2581
  const errorInfo = ErrorTypeStrings$1[type] ;
2582
2582
  while (cur) {
2583
2583
  const errorCapturedHooks = cur.ec;
2584
- if (errorCapturedHooks) {
2584
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2585
+ // are deferred or discarded by Suspense.
2586
+ (!isAsyncError || cur.scope.active)) {
2585
2587
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2586
2588
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2587
2589
  return;
@@ -2909,14 +2911,32 @@ var VueRuntimeDOM = (function (exports) {
2909
2911
  instance.ceReload(newComp.styles);
2910
2912
  dirtyInstances.delete(instance);
2911
2913
  } else if (instance.parent) {
2912
- queueJob(() => {
2913
- if (!(instance.job.flags & 8)) {
2914
- isHmrUpdating = true;
2914
+ const update = () => {
2915
+ if (!instance.scope.active) return;
2916
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2917
+ if (pending) {
2918
+ pending.asyncDep.catch(NOOP).then(() => {
2919
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2920
+ queueJob(update);
2921
+ }
2922
+ });
2923
+ return;
2924
+ }
2925
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2926
+ if (!dirtyInstances) {
2927
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2928
+ }
2929
+ dirtyInstances.add(instance);
2930
+ isHmrUpdating = true;
2931
+ try {
2915
2932
  instance.parent.update();
2933
+ } finally {
2916
2934
  isHmrUpdating = false;
2917
2935
  dirtyInstances.delete(instance);
2936
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2918
2937
  }
2919
- });
2938
+ };
2939
+ queueJob(update);
2920
2940
  } else if (instance.appContext.reload) {
2921
2941
  instance.appContext.reload();
2922
2942
  } else if (typeof window !== "undefined") {
@@ -3132,12 +3152,31 @@ var VueRuntimeDOM = (function (exports) {
3132
3152
  return vnode;
3133
3153
  }
3134
3154
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3135
- const bindings = vnode.dirs;
3155
+ let hookVNode = vnode;
3156
+ if (name === "beforeMount") {
3157
+ vnode._mount = vnode;
3158
+ } else if (name === "beforeUpdate") {
3159
+ const mount = prevVNode && prevVNode._mount;
3160
+ if (mount) {
3161
+ mount._latest = vnode;
3162
+ vnode._mount = mount;
3163
+ }
3164
+ } else if (name === "mounted") {
3165
+ const latest = vnode._latest;
3166
+ vnode._mount = vnode._latest = void 0;
3167
+ if (latest) {
3168
+ hookVNode = latest;
3169
+ latest._mount = void 0;
3170
+ }
3171
+ }
3172
+ const bindings = hookVNode.dirs;
3136
3173
  const oldBindings = prevVNode && prevVNode.dirs;
3137
3174
  for (let i = 0; i < bindings.length; i++) {
3138
- const binding = bindings[i];
3175
+ let binding = bindings[i];
3139
3176
  if (oldBindings) {
3140
3177
  binding.oldValue = oldBindings[i].value;
3178
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3179
+ binding = extend({}, binding, { oldValue: void 0 });
3141
3180
  }
3142
3181
  let hook = binding.dir[name];
3143
3182
  if (hook) {
@@ -3145,7 +3184,7 @@ var VueRuntimeDOM = (function (exports) {
3145
3184
  callWithAsyncErrorHandling(hook, instance, 8, [
3146
3185
  vnode.el,
3147
3186
  binding,
3148
- vnode,
3187
+ hookVNode,
3149
3188
  prevVNode
3150
3189
  ]);
3151
3190
  resetTracking();
@@ -3741,13 +3780,11 @@ var VueRuntimeDOM = (function (exports) {
3741
3780
  if (!innerChild) {
3742
3781
  return emptyPlaceholder(child);
3743
3782
  }
3744
- let enterHooks = resolveTransitionHooks(
3783
+ const enterHooks = resolveTransitionHooks(
3745
3784
  innerChild,
3746
3785
  rawProps,
3747
3786
  state,
3748
- instance,
3749
- // #11061, ensure enterHooks is fresh after clone
3750
- (hooks) => enterHooks = hooks
3787
+ instance
3751
3788
  );
3752
3789
  if (innerChild.type !== Comment) {
3753
3790
  setTransitionHooks(innerChild, enterHooks);
@@ -3766,7 +3803,17 @@ var VueRuntimeDOM = (function (exports) {
3766
3803
  leavingHooks.afterLeave = () => {
3767
3804
  state.isLeaving = false;
3768
3805
  if (!(instance.job.flags & 8)) {
3769
- instance.update();
3806
+ if (instance.effect.flags & 2) {
3807
+ const job = () => {
3808
+ if (!(instance.job.flags & 8)) {
3809
+ instance.update();
3810
+ }
3811
+ };
3812
+ job.i = instance;
3813
+ queueJob(job);
3814
+ } else {
3815
+ instance.update();
3816
+ }
3770
3817
  }
3771
3818
  delete leavingHooks.afterLeave;
3772
3819
  oldInnerChild = void 0;
@@ -3830,7 +3877,7 @@ var VueRuntimeDOM = (function (exports) {
3830
3877
  }
3831
3878
  return leavingVNodesCache;
3832
3879
  }
3833
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3880
+ function resolveTransitionHooks(vnode, props, state, instance) {
3834
3881
  const {
3835
3882
  appear,
3836
3883
  mode,
@@ -3969,15 +4016,21 @@ var VueRuntimeDOM = (function (exports) {
3969
4016
  }
3970
4017
  },
3971
4018
  clone(vnode2) {
3972
- const hooks2 = resolveTransitionHooks(
3973
- vnode2,
3974
- props,
3975
- state,
3976
- instance,
3977
- postClone
3978
- );
3979
- if (postClone) postClone(hooks2);
3980
- return hooks2;
4019
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4020
+ cloned.afterLeave = () => {
4021
+ if (hooks.afterLeave) hooks.afterLeave();
4022
+ };
4023
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4024
+ if (hooks.delayLeave) {
4025
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4026
+ } else {
4027
+ delayedLeave();
4028
+ }
4029
+ };
4030
+ cloned.delayedLeave = () => {
4031
+ if (hooks.delayedLeave) hooks.delayedLeave();
4032
+ };
4033
+ return cloned;
3981
4034
  }
3982
4035
  };
3983
4036
  return hooks;
@@ -4018,8 +4071,16 @@ var VueRuntimeDOM = (function (exports) {
4018
4071
  hooks
4019
4072
  );
4020
4073
  } else if (vnode.shapeFlag & 128) {
4021
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4022
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4074
+ const suspense = vnode.suspense;
4075
+ if (suspense) {
4076
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4077
+ if (branch) {
4078
+ setTransitionHooks(branch, hooks.clone(branch));
4079
+ }
4080
+ } else {
4081
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4082
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4083
+ }
4023
4084
  } else {
4024
4085
  vnode.transition = hooks;
4025
4086
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -4720,7 +4781,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4720
4781
  getContainerType(container),
4721
4782
  slotScopeIds
4722
4783
  );
4723
- if (parentComponent) {
4784
+ if (parentComponent && parentComponent.vnode.el === node) {
4724
4785
  parentComponent.vnode.el = vnode.el;
4725
4786
  updateHOCHostEl(parentComponent, vnode.el);
4726
4787
  }
@@ -5154,7 +5215,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5154
5215
  err,
5155
5216
  instance,
5156
5217
  13,
5157
- !errorComponent
5218
+ !errorComponent,
5219
+ true
5158
5220
  );
5159
5221
  };
5160
5222
  if (suspensible && instance.suspense || false) {
@@ -5172,7 +5234,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5172
5234
  const delayed = ref(!!delay);
5173
5235
  let timeoutTimer;
5174
5236
  let delayTimer;
5175
- onUnmounted(() => {
5237
+ onScopeDispose(() => {
5176
5238
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5177
5239
  if (delayTimer != null) clearTimeout(delayTimer);
5178
5240
  });
@@ -5294,6 +5356,12 @@ Server rendered element contains fewer child nodes than client vdom.`
5294
5356
  }
5295
5357
  };
5296
5358
  sharedContext.deactivate = (vnode) => {
5359
+ const cached = cache.get(
5360
+ vnode.key == null ? vnode.type : vnode.key
5361
+ );
5362
+ if (!cached || cached.component !== vnode.component) {
5363
+ return false;
5364
+ }
5297
5365
  const instance2 = vnode.component;
5298
5366
  invalidateMount(instance2.m);
5299
5367
  invalidateMount(instance2.a);
@@ -5314,6 +5382,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5314
5382
  {
5315
5383
  instance2.__keepAliveStorageContainer = storageContainer;
5316
5384
  }
5385
+ return true;
5317
5386
  };
5318
5387
  function unmount(vnode) {
5319
5388
  resetShapeFlag(vnode);
@@ -5353,12 +5422,17 @@ Server rendered element contains fewer child nodes than client vdom.`
5353
5422
  const cacheSubtree = () => {
5354
5423
  if (pendingCacheKey != null) {
5355
5424
  if (isSuspense(instance.subTree.type)) {
5356
- queuePostRenderEffect(() => {
5425
+ const cacheInnerChild = () => {
5357
5426
  const vnode = getInnerChild(instance.subTree);
5358
5427
  if (vnode.component) {
5359
5428
  cache.set(pendingCacheKey, vnode);
5360
5429
  }
5361
- }, instance.subTree.suspense);
5430
+ };
5431
+ if (instance.subTree.suspense.pendingBranch) {
5432
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5433
+ } else {
5434
+ cacheInnerChild();
5435
+ }
5362
5436
  } else {
5363
5437
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5364
5438
  }
@@ -5489,9 +5563,12 @@ Server rendered element contains fewer child nodes than client vdom.`
5489
5563
  true
5490
5564
  /* prepend */
5491
5565
  );
5492
- onUnmounted(() => {
5493
- remove(keepAliveRoot[type], injected);
5494
- }, target);
5566
+ const removal = injectHook(
5567
+ "um",
5568
+ () => remove(keepAliveRoot[type], injected),
5569
+ target
5570
+ );
5571
+ removal.flags = 16;
5495
5572
  }
5496
5573
  function resetShapeFlag(vnode) {
5497
5574
  vnode.shapeFlag &= -257;
@@ -8146,6 +8223,8 @@ If you want to remount the same app, move your app creation logic into a factory
8146
8223
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
8147
8224
  if (needCallTransitionHooks) {
8148
8225
  transition.beforeEnter(el);
8226
+ } else if (transition && !transition.persisted) {
8227
+ el[deferredEnterKey] = true;
8149
8228
  }
8150
8229
  hostInsert(el, container, anchor);
8151
8230
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -8628,16 +8707,23 @@ If you want to remount the same app, move your app creation logic into a factory
8628
8707
  } else {
8629
8708
  let { next, bu, u, parent, vnode } = instance;
8630
8709
  {
8631
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8632
- if (nonHydratedAsyncRoot) {
8710
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8711
+ if (unresolvedAsyncRoot) {
8633
8712
  if (next) {
8634
8713
  next.el = vnode.el;
8635
8714
  updateComponentPreRender(instance, next, optimized);
8636
8715
  }
8637
- nonHydratedAsyncRoot.asyncDep.then(() => {
8638
- queuePostRenderEffect(() => {
8639
- if (!instance.isUnmounted) update();
8640
- }, parentSuspense);
8716
+ unresolvedAsyncRoot.asyncDep.then(() => {
8717
+ const retry = () => {
8718
+ if (instance.job.flags & 8) return;
8719
+ if (parentSuspense && parentSuspense.pendingBranch) {
8720
+ queuePostRenderEffect(retry, parentSuspense);
8721
+ } else {
8722
+ update();
8723
+ }
8724
+ };
8725
+ retry.flags = 16 | 32;
8726
+ queuePostRenderEffect(retry, parentSuspense);
8641
8727
  });
8642
8728
  return;
8643
8729
  }
@@ -8676,8 +8762,11 @@ If you want to remount the same app, move your app creation logic into a factory
8676
8762
  patch(
8677
8763
  prevTree,
8678
8764
  nextTree,
8679
- // parent may have changed if it's in a teleport
8680
- hostParentNode(prevTree.el),
8765
+ // parent may have changed if it's in a teleport. a root that is a
8766
+ // pending async component only has its placeholder comment
8767
+ hostParentNode(
8768
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
8769
+ ),
8681
8770
  // anchor may have changed if it's in a fragment
8682
8771
  getNextHostNode(prevTree),
8683
8772
  instance,
@@ -9117,8 +9206,7 @@ If you want to remount the same app, move your app creation logic into a factory
9117
9206
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
9118
9207
  parentComponent.renderCache[cacheIndex] = void 0;
9119
9208
  }
9120
- if (shapeFlag & 256) {
9121
- parentComponent.ctx.deactivate(vnode);
9209
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
9122
9210
  return;
9123
9211
  }
9124
9212
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -9240,16 +9328,18 @@ If you want to remount the same app, move your app creation logic into a factory
9240
9328
  if (job) {
9241
9329
  job.flags |= 8;
9242
9330
  unmount(subTree, instance, parentSuspense, doRemove);
9243
- } else if (instance.vnode.el && subTree) {
9331
+ } else if (subTree) {
9244
9332
  subTree.transition = instance.vnode.transition;
9245
9333
  unmount(subTree, instance, parentSuspense, doRemove);
9246
9334
  }
9247
9335
  if (um) {
9248
9336
  queuePostRenderEffect(um, parentSuspense);
9249
9337
  }
9250
- queuePostRenderEffect(() => {
9338
+ const markUnmounted = () => {
9251
9339
  instance.isUnmounted = true;
9252
- }, parentSuspense);
9340
+ };
9341
+ markUnmounted.flags = 16;
9342
+ queuePostRenderEffect(markUnmounted, parentSuspense);
9253
9343
  {
9254
9344
  devtoolsComponentRemoved(instance);
9255
9345
  }
@@ -9401,13 +9491,13 @@ If you want to remount the same app, move your app creation logic into a factory
9401
9491
  }
9402
9492
  return result;
9403
9493
  }
9404
- function locateNonHydratedAsyncRoot(instance) {
9494
+ function locateUnresolvedAsyncRoot(instance) {
9405
9495
  const subComponent = instance.subTree.component;
9406
9496
  if (subComponent) {
9407
9497
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
9408
9498
  return subComponent;
9409
9499
  } else {
9410
- return locateNonHydratedAsyncRoot(subComponent);
9500
+ return locateUnresolvedAsyncRoot(subComponent);
9411
9501
  }
9412
9502
  }
9413
9503
  }
@@ -9425,11 +9515,16 @@ If you want to remount the same app, move your app creation logic into a factory
9425
9515
  if (instance) {
9426
9516
  return resolveAsyncComponentPlaceholder(instance.subTree);
9427
9517
  }
9518
+ const suspense = anchorVnode.suspense;
9519
+ if (suspense && suspense.activeBranch) {
9520
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
9521
+ }
9428
9522
  return null;
9429
9523
  }
9430
9524
 
9431
9525
  const isSuspense = (type) => type.__isSuspense;
9432
9526
  let suspenseId = 0;
9527
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
9433
9528
  const SuspenseImpl = {
9434
9529
  name: "Suspense",
9435
9530
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -9451,11 +9546,22 @@ If you want to remount the same app, move your app creation logic into a factory
9451
9546
  rendererInternals
9452
9547
  );
9453
9548
  } else {
9454
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9455
- n2.suspense = n1.suspense;
9456
- n2.suspense.vnode = n2;
9457
- n2.el = n1.el;
9458
- return;
9549
+ const suspense = n1.suspense;
9550
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9551
+ const owner = suspense.parentComponent;
9552
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
9553
+ if (retained ? (
9554
+ // deps can outlive the pending branch: skip only while it exists
9555
+ parentSuspense.pendingBranch && !isSameVNodeType(
9556
+ n2.ssContent,
9557
+ suspense.pendingBranch || suspense.activeBranch
9558
+ )
9559
+ ) : !suspense.isInFallback) {
9560
+ n2.suspense = suspense;
9561
+ suspense.vnode = n2;
9562
+ n2.el = n1.el;
9563
+ return;
9564
+ }
9459
9565
  }
9460
9566
  patchSuspense(
9461
9567
  n1,
@@ -9480,6 +9586,38 @@ If you want to remount the same app, move your app creation logic into a factory
9480
9586
  eventListener();
9481
9587
  }
9482
9588
  }
9589
+ function enterDeferred(branch) {
9590
+ const enters = [];
9591
+ collectDeferredEnters(branch, enters, true);
9592
+ if (enters.length) {
9593
+ queuePostFlushCb(enters);
9594
+ }
9595
+ }
9596
+ function collectDeferredEnters(vnode, enters, isRoot) {
9597
+ const { el, transition, children, shapeFlag } = vnode;
9598
+ if (shapeFlag & 6) {
9599
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
9600
+ return;
9601
+ }
9602
+ if (shapeFlag & (128 | 64)) {
9603
+ return;
9604
+ }
9605
+ if (shapeFlag & 1) {
9606
+ if (!isRoot && el && el[deferredEnterKey]) {
9607
+ el[deferredEnterKey] = void 0;
9608
+ if (transition && !transition.persisted) {
9609
+ transition.beforeEnter(el);
9610
+ enters.push(() => transition.enter(el));
9611
+ }
9612
+ }
9613
+ isRoot = false;
9614
+ }
9615
+ if (shapeFlag & 16) {
9616
+ for (let i = 0; i < children.length; i++) {
9617
+ collectDeferredEnters(children[i], enters, isRoot);
9618
+ }
9619
+ }
9620
+ }
9483
9621
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
9484
9622
  const {
9485
9623
  p: patch,
@@ -9579,7 +9717,7 @@ If you want to remount the same app, move your app creation logic into a factory
9579
9717
  unmount(pendingBranch, parentComponent, suspense);
9580
9718
  }
9581
9719
  suspense.deps = 0;
9582
- suspense.effects.length = 0;
9720
+ discardEffects(suspense);
9583
9721
  suspense.hiddenContainer = createElement("div");
9584
9722
  if (isInFallback) {
9585
9723
  patch(
@@ -9657,11 +9795,7 @@ If you want to remount the same app, move your app creation logic into a factory
9657
9795
  } else {
9658
9796
  triggerEvent(n2, "onPending");
9659
9797
  suspense.pendingBranch = newBranch;
9660
- if (newBranch.shapeFlag & 512) {
9661
- suspense.pendingId = newBranch.component.suspenseId;
9662
- } else {
9663
- suspense.pendingId = suspenseId++;
9664
- }
9798
+ suspense.pendingId = suspenseId++;
9665
9799
  patch(
9666
9800
  null,
9667
9801
  newBranch,
@@ -9676,12 +9810,11 @@ If you want to remount the same app, move your app creation logic into a factory
9676
9810
  if (suspense.deps <= 0) {
9677
9811
  suspense.resolve();
9678
9812
  } else {
9679
- const { timeout, pendingId } = suspense;
9813
+ const { timeout } = suspense;
9680
9814
  if (timeout > 0) {
9681
- setTimeout(() => {
9682
- if (suspense.pendingId === pendingId) {
9683
- suspense.fallback(newFallback);
9684
- }
9815
+ suspense.timeoutTimer = setTimeout(() => {
9816
+ suspense.timeoutTimer = void 0;
9817
+ suspense.fallback(suspense.vnode.ssFallback);
9685
9818
  }, timeout);
9686
9819
  } else if (timeout === 0) {
9687
9820
  suspense.fallback(newFallback);
@@ -9728,6 +9861,7 @@ If you want to remount the same app, move your app creation logic into a factory
9728
9861
  deps: 0,
9729
9862
  pendingId: suspenseId++,
9730
9863
  timeout: typeof timeout === "number" ? timeout : -1,
9864
+ timeoutTimer: void 0,
9731
9865
  activeBranch: null,
9732
9866
  isFallbackMountPending: false,
9733
9867
  pendingBranch: null,
@@ -9766,7 +9900,8 @@ If you want to remount the same app, move your app creation logic into a factory
9766
9900
  let hasUpdatedAnchor = false;
9767
9901
  if (delayEnter) {
9768
9902
  activeBranch.transition.afterLeave = () => {
9769
- if (pendingId === suspense.pendingId) {
9903
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9904
+ enterDeferred(pendingBranch);
9770
9905
  move(
9771
9906
  pendingBranch,
9772
9907
  container2,
@@ -9781,7 +9916,9 @@ If you want to remount the same app, move your app creation logic into a factory
9781
9916
  };
9782
9917
  }
9783
9918
  if (activeBranch && !suspense.isFallbackMountPending) {
9784
- if (parentNode(activeBranch.el) === container2) {
9919
+ if (parentNode(
9920
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
9921
+ ) === container2) {
9785
9922
  anchor = next(activeBranch);
9786
9923
  hasUpdatedAnchor = true;
9787
9924
  }
@@ -9791,13 +9928,26 @@ If you want to remount the same app, move your app creation logic into a factory
9791
9928
  }
9792
9929
  }
9793
9930
  if (!delayEnter) {
9931
+ enterDeferred(pendingBranch);
9794
9932
  move(pendingBranch, container2, anchor, 0);
9795
9933
  }
9796
9934
  }
9935
+ clearTimeout(suspense.timeoutTimer);
9936
+ suspense.timeoutTimer = void 0;
9797
9937
  suspense.isFallbackMountPending = false;
9798
9938
  setActiveBranch(suspense, pendingBranch);
9799
9939
  suspense.pendingBranch = null;
9800
9940
  suspense.isInFallback = false;
9941
+ let kept = 0;
9942
+ for (let i = 0; i < effects.length; i++) {
9943
+ const effect = effects[i];
9944
+ if (effect.flags & 32) {
9945
+ queuePostFlushCb(effect);
9946
+ } else {
9947
+ effects[kept++] = effect;
9948
+ }
9949
+ }
9950
+ effects.length = kept;
9801
9951
  let parent = suspense.parent;
9802
9952
  let hasUnresolvedAncestor = false;
9803
9953
  while (parent) {
@@ -9826,7 +9976,7 @@ If you want to remount the same app, move your app creation logic into a factory
9826
9976
  triggerEvent(vnode2, "onResolve");
9827
9977
  },
9828
9978
  fallback(fallbackVNode) {
9829
- if (!suspense.pendingBranch) {
9979
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
9830
9980
  return;
9831
9981
  }
9832
9982
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -9834,7 +9984,7 @@ If you want to remount the same app, move your app creation logic into a factory
9834
9984
  const anchor2 = next(activeBranch);
9835
9985
  const mountFallback = () => {
9836
9986
  suspense.isFallbackMountPending = false;
9837
- if (!suspense.isInFallback) {
9987
+ if (suspense.isUnmounted || !suspense.isInFallback) {
9838
9988
  return;
9839
9989
  }
9840
9990
  const latestFallback = suspense.vnode.ssFallback;
@@ -9886,19 +10036,7 @@ If you want to remount the same app, move your app creation logic into a factory
9886
10036
  suspense.deps++;
9887
10037
  }
9888
10038
  const hydratedEl = instance.vnode.el;
9889
- instance.asyncDep.catch((err) => {
9890
- handleError(err, instance, 0);
9891
- }).then((asyncSetupResult) => {
9892
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9893
- return;
9894
- }
9895
- unsetCurrentInstance();
9896
- if (!instance.scope.active) {
9897
- if (isInPendingSuspense && --suspense.deps === 0) {
9898
- suspense.resolve();
9899
- }
9900
- return;
9901
- }
10039
+ const render = (asyncSetupResult) => {
9902
10040
  instance.asyncResolved = true;
9903
10041
  const { vnode: vnode2 } = instance;
9904
10042
  {
@@ -9931,13 +10069,57 @@ If you want to remount the same app, move your app creation logic into a factory
9931
10069
  {
9932
10070
  popWarningContext();
9933
10071
  }
9934
- if (isInPendingSuspense && --suspense.deps === 0) {
10072
+ };
10073
+ instance.asyncDep.catch((err) => {
10074
+ handleError(err, instance, 0, false, true);
10075
+ return () => null;
10076
+ }).then((asyncSetupResult) => {
10077
+ if (instance.isUnmounted || suspense.isUnmounted) {
10078
+ return;
10079
+ }
10080
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
10081
+ unsetCurrentInstance();
10082
+ if (!instance.scope.active) {
10083
+ if (isPendingDep && --suspense.deps === 0) {
10084
+ suspense.resolve();
10085
+ }
10086
+ return;
10087
+ }
10088
+ if (!isPendingDep && suspense.pendingBranch) {
10089
+ const job = () => {
10090
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
10091
+ return;
10092
+ }
10093
+ if (suspense.pendingBranch) {
10094
+ queueEffectWithSuspense(job, suspense);
10095
+ } else {
10096
+ render(asyncSetupResult);
10097
+ }
10098
+ };
10099
+ job.flags = 16 | 32;
10100
+ queueEffectWithSuspense(job, suspense);
10101
+ return;
10102
+ }
10103
+ render(asyncSetupResult);
10104
+ if (isPendingDep && --suspense.deps === 0) {
9935
10105
  suspense.resolve();
9936
10106
  }
9937
10107
  });
9938
10108
  },
9939
10109
  unmount(parentSuspense2, doRemove) {
9940
10110
  suspense.isUnmounted = true;
10111
+ clearTimeout(suspense.timeoutTimer);
10112
+ suspense.timeoutTimer = void 0;
10113
+ if (parentSuspenseId !== void 0) {
10114
+ const parent = suspense.parent;
10115
+ const pendingId = parentSuspenseId;
10116
+ parentSuspenseId = void 0;
10117
+ queuePostFlushCb(() => {
10118
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
10119
+ parent.resolve();
10120
+ }
10121
+ });
10122
+ }
9941
10123
  if (suspense.activeBranch) {
9942
10124
  unmount(
9943
10125
  suspense.activeBranch,
@@ -9947,12 +10129,8 @@ If you want to remount the same app, move your app creation logic into a factory
9947
10129
  );
9948
10130
  }
9949
10131
  if (suspense.pendingBranch) {
9950
- unmount(
9951
- suspense.pendingBranch,
9952
- parentComponent,
9953
- parentSuspense2,
9954
- doRemove
9955
- );
10132
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
10133
+ discardEffects(suspense);
9956
10134
  }
9957
10135
  }
9958
10136
  };
@@ -10022,6 +10200,16 @@ If you want to remount the same app, move your app creation logic into a factory
10022
10200
  }
10023
10201
  return s;
10024
10202
  }
10203
+ function discardEffects(suspense) {
10204
+ const { effects } = suspense;
10205
+ for (let i = 0; i < effects.length; i++) {
10206
+ const effect = effects[i];
10207
+ if (effect.flags & 16) {
10208
+ queuePostFlushCb(effect);
10209
+ }
10210
+ }
10211
+ effects.length = 0;
10212
+ }
10025
10213
  function queueEffectWithSuspense(fn, suspense) {
10026
10214
  if (suspense && suspense.pendingBranch) {
10027
10215
  if (isArray(fn)) {
@@ -10273,7 +10461,8 @@ Component that was made reactive: `,
10273
10461
  }
10274
10462
  function guardReactiveProps(props) {
10275
10463
  if (!props) return null;
10276
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10464
+ if (isProxy(props)) return extend({}, props);
10465
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
10277
10466
  }
10278
10467
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
10279
10468
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -10452,7 +10641,7 @@ Component that was made reactive: `,
10452
10641
  ]);
10453
10642
  }
10454
10643
 
10455
- const emptyAppContext = createAppContext();
10644
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
10456
10645
  let uid = 0;
10457
10646
  function getNextUid() {
10458
10647
  return uid;
@@ -10653,7 +10842,8 @@ Component that was made reactive: `,
10653
10842
  setInSSRSetupState(false);
10654
10843
  }
10655
10844
  }).catch((e) => {
10656
- handleError(e, instance, 0);
10845
+ handleError(e, instance, 0, void 0, true);
10846
+ instance.ssrRender = (_, push) => push("<!---->");
10657
10847
  });
10658
10848
  } else {
10659
10849
  instance.asyncDep = setupResult;
@@ -10759,11 +10949,12 @@ Component that was made reactive: `,
10759
10949
  }
10760
10950
  }
10761
10951
  }
10952
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
10762
10953
  const attrsProxyHandlers = {
10763
10954
  get(target, key) {
10764
10955
  markAttrsAccessed();
10765
10956
  track(target, "get", "");
10766
- return target[key];
10957
+ return key === rawAttrsKey ? target : target[key];
10767
10958
  },
10768
10959
  set() {
10769
10960
  warn$1(`setupContext.attrs is readonly.`);
@@ -11115,7 +11306,7 @@ Component that was made reactive: `,
11115
11306
  return true;
11116
11307
  }
11117
11308
 
11118
- const version = "3.5.44";
11309
+ const version = "3.5.45";
11119
11310
  const warn = warn$1 ;
11120
11311
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11121
11312
  const devtools = devtools$1 ;
@@ -12889,18 +13080,18 @@ Expected function or array of functions, received type ${typeof value}.`
12889
13080
  },
12890
13081
  // set value in mounted & updated because <select> relies on its children
12891
13082
  // <option>s.
12892
- mounted(el, { value }) {
12893
- setSelected(el, value);
13083
+ mounted(el, { value, modifiers: { number } }) {
13084
+ setSelected(el, value, number);
12894
13085
  },
12895
13086
  beforeUpdate(el, { value }, vnode) {
12896
13087
  el._modelValue = value;
12897
13088
  el[assignKey] = getModelAssigner(vnode);
12898
13089
  },
12899
- updated(el, { value }) {
13090
+ updated(el, { value, modifiers: { number } }) {
12900
13091
  const pending = el._pendingValue;
12901
13092
  el._pendingValue = void 0;
12902
13093
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
12903
- setSelected(el, value);
13094
+ setSelected(el, value, number);
12904
13095
  }
12905
13096
  }
12906
13097
  };
@@ -12916,7 +13107,7 @@ Expected function or array of functions, received type ${typeof value}.`
12916
13107
  }
12917
13108
  return false;
12918
13109
  }
12919
- function setSelected(el, value) {
13110
+ function setSelected(el, value, number = false) {
12920
13111
  const isMultiple = el.multiple;
12921
13112
  const isArrayValue = isArray(value);
12922
13113
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12937,7 +13128,7 @@ Expected function or array of functions, received type ${typeof value}.`
12937
13128
  option.selected = looseIndexOf(value, optionValue) > -1;
12938
13129
  }
12939
13130
  } else {
12940
- option.selected = value.has(optionValue);
13131
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
12941
13132
  }
12942
13133
  } else if (looseEqual(getValue(option), value)) {
12943
13134
  if (el.selectedIndex !== i) el.selectedIndex = i;