@vue/server-renderer 3.5.43 → 3.5.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/server-renderer v3.5.43
2
+ * @vue/server-renderer v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -60,24 +60,20 @@ const cacheStringFunction = (fn) => {
60
60
  });
61
61
  };
62
62
  const camelizeRE = /-\w/g;
63
- const camelize = cacheStringFunction(
64
- (str) => {
65
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
66
- }
67
- );
63
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
64
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
65
+ });
68
66
  const hyphenateRE = /\B([A-Z])/g;
69
- const hyphenate = cacheStringFunction(
67
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
70
68
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
71
69
  );
72
- const capitalize = cacheStringFunction((str) => {
70
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
73
71
  return str.charAt(0).toUpperCase() + str.slice(1);
74
72
  });
75
- const toHandlerKey = cacheStringFunction(
76
- (str) => {
77
- const s = str ? `on${capitalize(str)}` : ``;
78
- return s;
79
- }
80
- );
73
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
74
+ const s = str ? `on${capitalize(str)}` : ``;
75
+ return s;
76
+ });
81
77
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
82
78
  const invokeArrayFns = (fns, ...arg) => {
83
79
  for (let i = 0; i < fns.length; i++) {
@@ -174,7 +170,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
174
170
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
175
171
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
176
172
 
177
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
173
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
178
174
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
179
175
  const isBooleanAttr = /* @__PURE__ */ makeMap(
180
176
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -1238,19 +1234,41 @@ const arrayInstrumentations = {
1238
1234
  };
1239
1235
  function iterator(self, method, wrapValue) {
1240
1236
  const arr = shallowReadArray(self);
1241
- const iter = arr[method]();
1237
+ const methodFn = arr[method];
1238
+ const iter = methodFn.call(arr);
1242
1239
  if (arr !== self && !isShallow(self)) {
1243
- iter._next = iter.next;
1244
- iter.next = () => {
1245
- const result = iter._next();
1246
- if (!result.done) {
1247
- result.value = wrapValue(result.value);
1240
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
1241
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
1242
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
1243
+ if (methodFn !== arrayProto[method]) {
1244
+ Object.defineProperties(wrapped, {
1245
+ return: {
1246
+ get() {
1247
+ const fn = iter.return;
1248
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1249
+ }
1250
+ },
1251
+ throw: {
1252
+ get() {
1253
+ const fn = iter.throw;
1254
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1255
+ }
1256
+ }
1257
+ });
1248
1258
  }
1249
- return result;
1250
- };
1259
+ return wrapped;
1260
+ }
1261
+ iter._next = iter.next;
1262
+ iter.next = () => wrapResult(iter._next(), wrapValue);
1251
1263
  }
1252
1264
  return iter;
1253
1265
  }
1266
+ function wrapResult(result, wrapValue) {
1267
+ if (!result.done) {
1268
+ result.value = wrapValue(result.value);
1269
+ }
1270
+ return result;
1271
+ }
1254
1272
  const arrayProto = Array.prototype;
1255
1273
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1256
1274
  const arr = shallowReadArray(self);
@@ -1319,7 +1337,7 @@ function noTracking(self, method, args = []) {
1319
1337
  }
1320
1338
 
1321
1339
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1322
- const builtInSymbols = new Set(
1340
+ const builtInSymbols = /* @__PURE__ */ new Set(
1323
1341
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1324
1342
  );
1325
1343
  function hasOwnProperty(key) {
@@ -1673,6 +1691,8 @@ function createInstrumentationGetter(isReadonly2, shallow) {
1673
1691
  return !isReadonly2;
1674
1692
  } else if (key === "__v_isReadonly") {
1675
1693
  return isReadonly2;
1694
+ } else if (key === "__v_isShallow") {
1695
+ return shallow;
1676
1696
  } else if (key === "__v_raw") {
1677
1697
  return target;
1678
1698
  }
@@ -2038,9 +2058,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2038
2058
  if (once && cb) {
2039
2059
  const _cb = cb;
2040
2060
  cb = (...args) => {
2041
- const res = _cb(...args);
2042
- watchHandle();
2043
- return res;
2061
+ try {
2062
+ return _cb(...args);
2063
+ } finally {
2064
+ watchHandle();
2065
+ }
2044
2066
  };
2045
2067
  }
2046
2068
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2051,12 +2073,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2051
2073
  if (cb) {
2052
2074
  const newValue = effect.run();
2053
2075
  if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2054
- if (cleanup) {
2055
- cleanup();
2056
- }
2057
2076
  const currentWatcher = activeWatcher;
2058
- activeWatcher = effect;
2077
+ pauseTracking();
2059
2078
  try {
2079
+ if (cleanup) {
2080
+ cleanup();
2081
+ }
2082
+ activeWatcher = effect;
2060
2083
  const args = [
2061
2084
  newValue,
2062
2085
  // pass undefined as the old value when it's changed for the first time
@@ -2070,6 +2093,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2070
2093
  );
2071
2094
  } finally {
2072
2095
  activeWatcher = currentWatcher;
2096
+ resetTracking();
2073
2097
  }
2074
2098
  }
2075
2099
  } else {
@@ -2304,7 +2328,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2304
2328
  const res = callWithErrorHandling(fn, instance, type, args);
2305
2329
  if (res && isPromise(res)) {
2306
2330
  res.catch((err) => {
2307
- handleError(err, instance, type);
2331
+ handleError(err, instance, type, void 0, true);
2308
2332
  });
2309
2333
  }
2310
2334
  return res;
@@ -2321,7 +2345,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2321
2345
  );
2322
2346
  }
2323
2347
  }
2324
- function handleError(err, instance, type, throwInDev = true) {
2348
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2325
2349
  const contextVNode = instance ? instance.vnode : null;
2326
2350
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2327
2351
  if (instance) {
@@ -2330,7 +2354,9 @@ function handleError(err, instance, type, throwInDev = true) {
2330
2354
  const errorInfo = ErrorTypeStrings[type] ;
2331
2355
  while (cur) {
2332
2356
  const errorCapturedHooks = cur.ec;
2333
- if (errorCapturedHooks) {
2357
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2358
+ // are deferred or discarded by Suspense.
2359
+ (!isAsyncError || cur.scope.active)) {
2334
2360
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2335
2361
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2336
2362
  return;
@@ -2431,21 +2457,21 @@ function queuePostFlushCb(cb) {
2431
2457
  }
2432
2458
  queueFlush();
2433
2459
  }
2434
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2460
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
2435
2461
  {
2436
2462
  seen = seen || /* @__PURE__ */ new Map();
2437
2463
  }
2438
2464
  for (; i < queue.length; i++) {
2439
2465
  const cb = queue[i];
2440
2466
  if (cb && cb.flags & 2) {
2441
- if (instance && cb.id !== instance.uid) {
2467
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
2442
2468
  continue;
2443
2469
  }
2444
2470
  if (checkRecursiveUpdates(seen, cb)) {
2445
2471
  continue;
2446
2472
  }
2447
2473
  queue.splice(i, 1);
2448
- i--;
2474
+ i = instance ? i - 1 : flushIndex;
2449
2475
  if (cb.flags & 4) {
2450
2476
  cb.flags &= -2;
2451
2477
  }
@@ -2456,12 +2482,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2456
2482
  }
2457
2483
  }
2458
2484
  }
2459
- function flushPostFlushCbs(seen) {
2485
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2460
2486
  if (pendingPostFlushCbs.length) {
2461
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2462
- (a, b) => getId(a) - getId(b)
2463
- );
2464
- pendingPostFlushCbs.length = 0;
2487
+ let cbs = pendingPostFlushCbs;
2488
+ let kept = 0;
2489
+ if (skip) {
2490
+ cbs = [];
2491
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
2492
+ const cb = pendingPostFlushCbs[i];
2493
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
2494
+ pendingPostFlushCbs[kept++] = cb;
2495
+ } else {
2496
+ cbs.push(cb);
2497
+ }
2498
+ }
2499
+ }
2500
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
2501
+ pendingPostFlushCbs.length = kept;
2465
2502
  if (activePostFlushCbs) {
2466
2503
  for (let i = 0; i < deduped.length; i++) {
2467
2504
  activePostFlushCbs.push(deduped[i]);
@@ -2487,6 +2524,22 @@ function flushPostFlushCbs(seen) {
2487
2524
  postFlushIndex = 0;
2488
2525
  }
2489
2526
  }
2527
+ let isFlushing = false;
2528
+ function flushOnAppMount(fn, minUid) {
2529
+ if (isFlushing) {
2530
+ fn();
2531
+ return;
2532
+ }
2533
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
2534
+ fn();
2535
+ isFlushing = true;
2536
+ try {
2537
+ flushPreFlushCbs(void 0, minUid);
2538
+ flushPostFlushCbs(void 0, queued, minUid);
2539
+ } finally {
2540
+ isFlushing = false;
2541
+ }
2542
+ }
2490
2543
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2491
2544
  function flushJobs(seen) {
2492
2545
  {
@@ -2631,14 +2684,32 @@ function reload(id, newComp) {
2631
2684
  instance.ceReload(newComp.styles);
2632
2685
  dirtyInstances.delete(instance);
2633
2686
  } else if (instance.parent) {
2634
- queueJob(() => {
2635
- if (!(instance.job.flags & 8)) {
2636
- isHmrUpdating = true;
2687
+ const update = () => {
2688
+ if (!instance.scope.active) return;
2689
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2690
+ if (pending) {
2691
+ pending.asyncDep.catch(NOOP).then(() => {
2692
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2693
+ queueJob(update);
2694
+ }
2695
+ });
2696
+ return;
2697
+ }
2698
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2699
+ if (!dirtyInstances) {
2700
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2701
+ }
2702
+ dirtyInstances.add(instance);
2703
+ isHmrUpdating = true;
2704
+ try {
2637
2705
  instance.parent.update();
2706
+ } finally {
2638
2707
  isHmrUpdating = false;
2639
2708
  dirtyInstances.delete(instance);
2709
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2640
2710
  }
2641
- });
2711
+ };
2712
+ queueJob(update);
2642
2713
  } else if (instance.appContext.reload) {
2643
2714
  instance.appContext.reload();
2644
2715
  } else if (typeof window !== "undefined") {
@@ -2816,12 +2887,31 @@ function validateDirectiveName(name) {
2816
2887
  }
2817
2888
  }
2818
2889
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2819
- const bindings = vnode.dirs;
2890
+ let hookVNode = vnode;
2891
+ if (name === "beforeMount") {
2892
+ vnode._mount = vnode;
2893
+ } else if (name === "beforeUpdate") {
2894
+ const mount = prevVNode && prevVNode._mount;
2895
+ if (mount) {
2896
+ mount._latest = vnode;
2897
+ vnode._mount = mount;
2898
+ }
2899
+ } else if (name === "mounted") {
2900
+ const latest = vnode._latest;
2901
+ vnode._mount = vnode._latest = void 0;
2902
+ if (latest) {
2903
+ hookVNode = latest;
2904
+ latest._mount = void 0;
2905
+ }
2906
+ }
2907
+ const bindings = hookVNode.dirs;
2820
2908
  const oldBindings = prevVNode && prevVNode.dirs;
2821
2909
  for (let i = 0; i < bindings.length; i++) {
2822
- const binding = bindings[i];
2910
+ let binding = bindings[i];
2823
2911
  if (oldBindings) {
2824
2912
  binding.oldValue = oldBindings[i].value;
2913
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
2914
+ binding = extend({}, binding, { oldValue: void 0 });
2825
2915
  }
2826
2916
  let hook = binding.dir[name];
2827
2917
  if (hook) {
@@ -2829,7 +2919,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2829
2919
  callWithAsyncErrorHandling(hook, instance, 8, [
2830
2920
  vnode.el,
2831
2921
  binding,
2832
- vnode,
2922
+ hookVNode,
2833
2923
  prevVNode
2834
2924
  ]);
2835
2925
  resetTracking();
@@ -2930,6 +3020,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
2930
3020
  let isPre = false;
2931
3021
  if (flush === "post") {
2932
3022
  baseWatchOptions.scheduler = (job) => {
3023
+ job.i = instance;
2933
3024
  queuePostRenderEffect(job, instance && instance.suspense);
2934
3025
  };
2935
3026
  } else if (flush !== "sync") {
@@ -3042,10 +3133,36 @@ function setTransitionHooks(vnode, hooks) {
3042
3133
  hooks
3043
3134
  );
3044
3135
  } else if (vnode.shapeFlag & 128) {
3045
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3046
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3136
+ const suspense = vnode.suspense;
3137
+ if (suspense) {
3138
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
3139
+ if (branch) {
3140
+ setTransitionHooks(branch, hooks.clone(branch));
3141
+ }
3142
+ } else {
3143
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3144
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3145
+ }
3047
3146
  } else {
3048
3147
  vnode.transition = hooks;
3148
+ if (vnode.type === Fragment && isArray(vnode.children)) {
3149
+ const child = filterSingleRoot(vnode.children, false);
3150
+ if (child) {
3151
+ setTransitionHooks(child, hooks);
3152
+ }
3153
+ }
3154
+ }
3155
+ }
3156
+ function getTransitionRoot(vnode) {
3157
+ if (vnode.component) {
3158
+ return getTransitionRoot(vnode.component.subTree);
3159
+ }
3160
+ if (vnode.type === Fragment) {
3161
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3162
+ return child ? getTransitionRoot(child) : void 0;
3163
+ }
3164
+ if (vnode.type !== Comment) {
3165
+ return vnode;
3049
3166
  }
3050
3167
  }
3051
3168
 
@@ -3239,9 +3356,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
3239
3356
  true
3240
3357
  /* prepend */
3241
3358
  );
3242
- onUnmounted(() => {
3243
- remove(keepAliveRoot[type], injected);
3244
- }, target);
3359
+ const removal = injectHook(
3360
+ "um",
3361
+ () => remove(keepAliveRoot[type], injected),
3362
+ target
3363
+ );
3364
+ removal.flags = 16;
3245
3365
  }
3246
3366
 
3247
3367
  function injectHook(type, hook, target = currentInstance, prepend = false) {
@@ -4592,7 +4712,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4592
4712
  }
4593
4713
  for (let i = 0; i < nextKeys.length; i++) {
4594
4714
  const key = nextKeys[i];
4595
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4715
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4596
4716
  return true;
4597
4717
  }
4598
4718
  }
@@ -5469,6 +5589,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5469
5589
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
5470
5590
  if (needCallTransitionHooks) {
5471
5591
  transition.beforeEnter(el);
5592
+ } else if (transition && !transition.persisted) {
5593
+ el[deferredEnterKey] = true;
5472
5594
  }
5473
5595
  hostInsert(el, container, anchor);
5474
5596
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -5628,15 +5750,16 @@ function baseCreateRenderer(options, createHydrationFns) {
5628
5750
  for (let i = 0; i < newChildren.length; i++) {
5629
5751
  const oldVNode = oldChildren[i];
5630
5752
  const newVNode = newChildren[i];
5753
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
5631
5754
  const container = (
5632
5755
  // oldVNode may be an errored async setup() component inside Suspense
5633
5756
  // which will not have a mounted element
5634
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
5757
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
5635
5758
  // of the Fragment itself so it can move its children.
5636
5759
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5637
5760
  // which also requires the correct parent container
5638
5761
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5639
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
5762
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
5640
5763
  // In other cases, the parent container is not actually used so we
5641
5764
  // just pass the block element here to avoid a DOM parentNode call.
5642
5765
  fallbackContainer
@@ -5800,7 +5923,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5800
5923
  }
5801
5924
  if (isHmrUpdating) initialVNode.el = null;
5802
5925
  if (instance.asyncDep) {
5803
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
5926
+ parentSuspense && parentSuspense.registerDep(
5927
+ instance,
5928
+ setupRenderEffect,
5929
+ optimized,
5930
+ namespace
5931
+ );
5804
5932
  if (!initialVNode.el) {
5805
5933
  const placeholder = instance.subTree = createVNode(Comment);
5806
5934
  processCommentNode(null, placeholder, container, anchor);
@@ -5830,6 +5958,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5830
5958
  pushWarningContext$1(n2);
5831
5959
  }
5832
5960
  n2.el = n1.el;
5961
+ n2.placeholder = n1.placeholder;
5833
5962
  updateComponentPreRender(instance, n2, optimized);
5834
5963
  {
5835
5964
  popWarningContext$1();
@@ -5841,6 +5970,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5841
5970
  }
5842
5971
  } else {
5843
5972
  n2.el = n1.el;
5973
+ n2.placeholder = n1.placeholder;
5844
5974
  instance.vnode = n2;
5845
5975
  }
5846
5976
  };
@@ -5911,16 +6041,23 @@ function baseCreateRenderer(options, createHydrationFns) {
5911
6041
  } else {
5912
6042
  let { next, bu, u, parent, vnode } = instance;
5913
6043
  {
5914
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
5915
- if (nonHydratedAsyncRoot) {
6044
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
6045
+ if (unresolvedAsyncRoot) {
5916
6046
  if (next) {
5917
6047
  next.el = vnode.el;
5918
6048
  updateComponentPreRender(instance, next, optimized);
5919
6049
  }
5920
- nonHydratedAsyncRoot.asyncDep.then(() => {
5921
- queuePostRenderEffect(() => {
5922
- if (!instance.isUnmounted) update();
5923
- }, parentSuspense);
6050
+ unresolvedAsyncRoot.asyncDep.then(() => {
6051
+ const retry = () => {
6052
+ if (instance.job.flags & 8) return;
6053
+ if (parentSuspense && parentSuspense.pendingBranch) {
6054
+ queuePostRenderEffect(retry, parentSuspense);
6055
+ } else {
6056
+ update();
6057
+ }
6058
+ };
6059
+ retry.flags = 16 | 32;
6060
+ queuePostRenderEffect(retry, parentSuspense);
5924
6061
  });
5925
6062
  return;
5926
6063
  }
@@ -5959,8 +6096,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5959
6096
  patch(
5960
6097
  prevTree,
5961
6098
  nextTree,
5962
- // parent may have changed if it's in a teleport
5963
- hostParentNode(prevTree.el),
6099
+ // parent may have changed if it's in a teleport. a root that is a
6100
+ // pending async component only has its placeholder comment
6101
+ hostParentNode(
6102
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
6103
+ ),
5964
6104
  // anchor may have changed if it's in a fragment
5965
6105
  getNextHostNode(prevTree),
5966
6106
  instance,
@@ -6400,8 +6540,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6400
6540
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
6401
6541
  parentComponent.renderCache[cacheIndex] = void 0;
6402
6542
  }
6403
- if (shapeFlag & 256) {
6404
- parentComponent.ctx.deactivate(vnode);
6543
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
6405
6544
  return;
6406
6545
  }
6407
6546
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6462,18 +6601,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6462
6601
  };
6463
6602
  const remove = (vnode) => {
6464
6603
  const { type, el, anchor, transition } = vnode;
6465
- if (type === Fragment) {
6466
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
6467
- vnode.children.forEach((child) => {
6468
- if (child.type === Comment) {
6469
- hostRemove(child.el);
6470
- } else {
6471
- remove(child);
6472
- }
6473
- });
6474
- } else {
6475
- removeFragment(el, anchor);
6476
- }
6604
+ const isFragment = type === Fragment;
6605
+ if (isFragment && !transition) {
6606
+ removeFragment(el, anchor);
6477
6607
  return;
6478
6608
  }
6479
6609
  if (type === Static) {
@@ -6483,17 +6613,25 @@ function baseCreateRenderer(options, createHydrationFns) {
6483
6613
  }
6484
6614
  return;
6485
6615
  }
6616
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
6486
6617
  const performRemove = () => {
6487
- hostRemove(el);
6618
+ if (isFragment) {
6619
+ if (hostParentNode(el)) {
6620
+ removeFragment(el, anchor);
6621
+ }
6622
+ } else {
6623
+ hostRemove(el);
6624
+ }
6488
6625
  if (transition && !transition.persisted && transition.afterLeave) {
6489
6626
  transition.afterLeave();
6490
6627
  }
6491
6628
  };
6492
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6629
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
6493
6630
  const { leave, delayLeave } = transition;
6494
- const performLeave = () => leave(el, performRemove);
6631
+ const leavingEl = leavingNode.el;
6632
+ const performLeave = () => leave(leavingEl, performRemove);
6495
6633
  if (delayLeave) {
6496
- delayLeave(vnode.el, performRemove, performLeave);
6634
+ delayLeave(leavingEl, performRemove, performLeave);
6497
6635
  } else {
6498
6636
  performLeave();
6499
6637
  }
@@ -6524,16 +6662,18 @@ function baseCreateRenderer(options, createHydrationFns) {
6524
6662
  if (job) {
6525
6663
  job.flags |= 8;
6526
6664
  unmount(subTree, instance, parentSuspense, doRemove);
6527
- } else if (instance.vnode.el && subTree) {
6665
+ } else if (subTree) {
6528
6666
  subTree.transition = instance.vnode.transition;
6529
6667
  unmount(subTree, instance, parentSuspense, doRemove);
6530
6668
  }
6531
6669
  if (um) {
6532
6670
  queuePostRenderEffect(um, parentSuspense);
6533
6671
  }
6534
- queuePostRenderEffect(() => {
6672
+ const markUnmounted = () => {
6535
6673
  instance.isUnmounted = true;
6536
- }, parentSuspense);
6674
+ };
6675
+ markUnmounted.flags = 16;
6676
+ queuePostRenderEffect(markUnmounted, parentSuspense);
6537
6677
  {
6538
6678
  devtoolsComponentRemoved(instance);
6539
6679
  }
@@ -6554,32 +6694,26 @@ function baseCreateRenderer(options, createHydrationFns) {
6554
6694
  const teleportEnd = el && el[TeleportEndKey];
6555
6695
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
6556
6696
  };
6557
- let isFlushing = false;
6558
6697
  const render = (vnode, container, namespace) => {
6559
- let instance;
6560
- if (vnode == null) {
6561
- if (container._vnode) {
6562
- unmount(container._vnode, null, null, true);
6563
- instance = container._vnode.component;
6698
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
6699
+ flushOnAppMount(() => {
6700
+ if (vnode == null) {
6701
+ if (container._vnode) {
6702
+ unmount(container._vnode, null, null, true);
6703
+ }
6704
+ } else {
6705
+ patch(
6706
+ container._vnode || null,
6707
+ vnode,
6708
+ container,
6709
+ null,
6710
+ null,
6711
+ null,
6712
+ namespace
6713
+ );
6564
6714
  }
6565
- } else {
6566
- patch(
6567
- container._vnode || null,
6568
- vnode,
6569
- container,
6570
- null,
6571
- null,
6572
- null,
6573
- namespace
6574
- );
6575
- }
6576
- container._vnode = vnode;
6577
- if (!isFlushing) {
6578
- isFlushing = true;
6579
- flushPreFlushCbs(instance);
6580
- flushPostFlushCbs();
6581
- isFlushing = false;
6582
- }
6715
+ container._vnode = vnode;
6716
+ }, minUid);
6583
6717
  };
6584
6718
  const internals = {
6585
6719
  p: patch,
@@ -6685,13 +6819,13 @@ function getSequence(arr) {
6685
6819
  }
6686
6820
  return result;
6687
6821
  }
6688
- function locateNonHydratedAsyncRoot(instance) {
6822
+ function locateUnresolvedAsyncRoot(instance) {
6689
6823
  const subComponent = instance.subTree.component;
6690
6824
  if (subComponent) {
6691
6825
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
6692
6826
  return subComponent;
6693
6827
  } else {
6694
- return locateNonHydratedAsyncRoot(subComponent);
6828
+ return locateUnresolvedAsyncRoot(subComponent);
6695
6829
  }
6696
6830
  }
6697
6831
  }
@@ -6709,10 +6843,15 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
6709
6843
  if (instance) {
6710
6844
  return resolveAsyncComponentPlaceholder(instance.subTree);
6711
6845
  }
6846
+ const suspense = anchorVnode.suspense;
6847
+ if (suspense && suspense.activeBranch) {
6848
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
6849
+ }
6712
6850
  return null;
6713
6851
  }
6714
6852
 
6715
6853
  const isSuspense = (type) => type.__isSuspense;
6854
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
6716
6855
  function queueEffectWithSuspense(fn, suspense) {
6717
6856
  if (suspense && suspense.pendingBranch) {
6718
6857
  if (isArray(fn)) {
@@ -6906,7 +7045,8 @@ Component that was made reactive: `,
6906
7045
  }
6907
7046
  function guardReactiveProps(props) {
6908
7047
  if (!props) return null;
6909
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
7048
+ if (isProxy(props)) return extend({}, props);
7049
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
6910
7050
  }
6911
7051
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
6912
7052
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -7077,8 +7217,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
7077
7217
  ]);
7078
7218
  }
7079
7219
 
7080
- const emptyAppContext = createAppContext();
7220
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
7081
7221
  let uid = 0;
7222
+ function getNextUid() {
7223
+ return uid;
7224
+ }
7082
7225
  function createComponentInstance$1(vnode, parent, suspense) {
7083
7226
  const type = vnode.type;
7084
7227
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -7287,7 +7430,8 @@ function setupStatefulComponent(instance, isSSR) {
7287
7430
  setInSSRSetupState(false);
7288
7431
  }
7289
7432
  }).catch((e) => {
7290
- handleError(e, instance, 0);
7433
+ handleError(e, instance, 0, void 0, true);
7434
+ instance.ssrRender = (_, push) => push("<!---->");
7291
7435
  });
7292
7436
  } else {
7293
7437
  instance.asyncDep = setupResult;
@@ -7358,11 +7502,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7358
7502
  }
7359
7503
  }
7360
7504
  }
7505
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
7361
7506
  const attrsProxyHandlers = {
7362
7507
  get(target, key) {
7363
7508
  markAttrsAccessed();
7364
7509
  track(target, "get", "");
7365
- return target[key];
7510
+ return key === rawAttrsKey ? target : target[key];
7366
7511
  },
7367
7512
  set() {
7368
7513
  warn$1(`setupContext.attrs is readonly.`);
@@ -7482,7 +7627,7 @@ const computed = (getterOrOptions, debugOptions) => {
7482
7627
  return c;
7483
7628
  };
7484
7629
 
7485
- const version = "3.5.43";
7630
+ const version = "3.5.45";
7486
7631
  const warn = warn$1 ;
7487
7632
  const _ssrUtils = {
7488
7633
  createComponentInstance: createComponentInstance$1,
@@ -7655,7 +7800,9 @@ function patchStyle(el, prev, next) {
7655
7800
  }
7656
7801
  }
7657
7802
  if (vShowOriginalDisplay in el) {
7658
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
7803
+ if (!isCssString || prev !== next) {
7804
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
7805
+ }
7659
7806
  if (el[vShowHidden]) {
7660
7807
  style.display = "none";
7661
7808
  }
@@ -8302,9 +8449,11 @@ function ssrRenderList(source, renderItem) {
8302
8449
  }
8303
8450
  } else if (typeof source === "number") {
8304
8451
  if (!Number.isInteger(source) || source < 0) {
8305
- warn(
8306
- `The v-for range expects a positive integer value but got ${source}.`
8307
- );
8452
+ {
8453
+ warn(
8454
+ `The v-for range expects a positive integer value but got ${source}.`
8455
+ );
8456
+ }
8308
8457
  return;
8309
8458
  }
8310
8459
  for (let i = 0; i < source; i++) {
@@ -8430,23 +8579,28 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
8430
8579
  popWarningContext();
8431
8580
  const hasAsyncSetup = isPromise(res);
8432
8581
  let prefetches = instance.sp;
8582
+ let p;
8433
8583
  if (hasAsyncSetup || prefetches) {
8434
- const p = Promise.resolve(res).then(() => {
8584
+ p = Promise.resolve(res).then(() => {
8435
8585
  if (hasAsyncSetup) prefetches = instance.sp;
8436
8586
  if (prefetches) {
8437
- return Promise.all(
8438
- prefetches.map((prefetch) => prefetch.call(instance.proxy))
8439
- );
8587
+ try {
8588
+ return Promise.all(
8589
+ prefetches.map((prefetch) => prefetch.call(instance.proxy))
8590
+ ).catch(NOOP);
8591
+ } catch {
8592
+ }
8440
8593
  }
8441
- }).catch(NOOP);
8442
- return p.then(() => renderComponentSubTree(instance, slotScopeId));
8594
+ }).then(() => renderComponentSubTree(instance, slotScopeId));
8443
8595
  } else {
8444
8596
  try {
8445
8597
  return renderComponentSubTree(instance, slotScopeId);
8446
8598
  } catch (err) {
8447
- return Promise.reject(err);
8599
+ p = Promise.reject(err);
8448
8600
  }
8449
8601
  }
8602
+ p.catch(NOOP);
8603
+ return p;
8450
8604
  }
8451
8605
  function renderComponentSubTree(instance, slotScopeId) {
8452
8606
  pushWarningContext(instance.vnode);
@@ -8617,13 +8771,13 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
8617
8771
  if (!isVoidTag(tag)) {
8618
8772
  let hasChildrenOverride = false;
8619
8773
  if (props) {
8620
- if (props.innerHTML) {
8774
+ if (props.innerHTML != null) {
8621
8775
  hasChildrenOverride = true;
8622
- push(props.innerHTML);
8623
- } else if (props.textContent) {
8776
+ push(String(props.innerHTML));
8777
+ } else if (props.textContent != null) {
8624
8778
  hasChildrenOverride = true;
8625
8779
  push(escapeHtml(props.textContent));
8626
- } else if (tag === "textarea" && props.value) {
8780
+ } else if (tag === "textarea" && props.value != null) {
8627
8781
  hasChildrenOverride = true;
8628
8782
  push(escapeHtml(props.value));
8629
8783
  }
@@ -8739,16 +8893,51 @@ async function renderToString(input, context = {}) {
8739
8893
  const vnode = createVNode(input._component, input._props);
8740
8894
  vnode.appContext = input._context;
8741
8895
  input.provide(ssrContextKey, context);
8742
- const buffer = await renderComponentVNode(vnode);
8743
- const result = await unrollBuffer$1(buffer);
8744
- await resolveTeleports(context);
8745
- if (context.__watcherHandles) {
8746
- for (const unwatch of context.__watcherHandles) {
8747
- unwatch();
8748
- }
8896
+ let buffer;
8897
+ let result;
8898
+ try {
8899
+ buffer = await renderComponentVNode(vnode);
8900
+ result = await unrollBuffer$1(buffer);
8901
+ await resolveTeleports(context);
8902
+ } catch (err) {
8903
+ cleanupFailedRender(buffer, context);
8904
+ throw err;
8749
8905
  }
8906
+ stopWatchers(context);
8750
8907
  return result;
8751
8908
  }
8909
+ function stopWatchers(context, start = 0) {
8910
+ const handles = context.__watcherHandles;
8911
+ if (handles) {
8912
+ for (let i = start; i < handles.length; i++) {
8913
+ handles[i]();
8914
+ }
8915
+ }
8916
+ }
8917
+ function cleanupFailedRender(buffer, context) {
8918
+ const stopped = context.__watcherHandles ? context.__watcherHandles.length : 0;
8919
+ try {
8920
+ stopWatchers(context);
8921
+ } catch {
8922
+ }
8923
+ (async () => {
8924
+ if (buffer) await settleBuffer(buffer);
8925
+ for (const key in context.__teleportBuffers) {
8926
+ await settleBuffer(context.__teleportBuffers[key]);
8927
+ }
8928
+ stopWatchers(context, stopped);
8929
+ })().catch(NOOP);
8930
+ }
8931
+ async function settleBuffer(buffer) {
8932
+ if (!buffer.hasAsync) return;
8933
+ for (let item of buffer) {
8934
+ try {
8935
+ if (isPromise(item)) item = await item;
8936
+ if (!isString(item)) await settleBuffer(item);
8937
+ } catch {
8938
+ }
8939
+ }
8940
+ }
8752
8941
  async function resolveTeleports(context) {
8753
8942
  if (context.__teleportBuffers) {
8754
8943
  context.teleports = context.teleports || {};
@@ -8799,13 +8988,17 @@ function renderToSimpleStream(input, context, stream) {
8799
8988
  const vnode = createVNode(input._component, input._props);
8800
8989
  vnode.appContext = input._context;
8801
8990
  input.provide(ssrContextKey, context);
8802
- Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
8803
- if (context.__watcherHandles) {
8804
- for (const unwatch of context.__watcherHandles) {
8805
- unwatch();
8806
- }
8991
+ let buffer;
8992
+ Promise.resolve(renderComponentVNode(vnode)).then((b) => unrollBuffer(buffer = b, stream)).then(() => resolveTeleports(context)).then(
8993
+ () => {
8994
+ stopWatchers(context);
8995
+ stream.push(null);
8996
+ },
8997
+ (error) => {
8998
+ cleanupFailedRender(buffer, context);
8999
+ throw error;
8807
9000
  }
8808
- }).then(() => stream.push(null)).catch((error) => {
9001
+ ).catch((error) => {
8809
9002
  stream.destroy(error);
8810
9003
  });
8811
9004
  return stream;