@vue/server-renderer 3.4.26 → 3.4.28

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.4.26
2
+ * @vue/server-renderer v3.4.28
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -75,9 +75,9 @@ const toHandlerKey = cacheStringFunction((str) => {
75
75
  return s;
76
76
  });
77
77
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
78
- const invokeArrayFns = (fns, arg) => {
78
+ const invokeArrayFns = (fns, ...arg) => {
79
79
  for (let i = 0; i < fns.length; i++) {
80
- fns[i](arg);
80
+ fns[i](...arg);
81
81
  }
82
82
  };
83
83
  const def = (obj, key, value, writable = false) => {
@@ -134,8 +134,8 @@ function stringifyStyle(styles) {
134
134
  }
135
135
  for (const key in styles) {
136
136
  const value = styles[key];
137
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
138
137
  if (isString(value) || typeof value === "number") {
138
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
139
139
  ret += `${normalizedKey}:${value};`;
140
140
  }
141
141
  }
@@ -250,8 +250,7 @@ function escapeHtmlComment(src) {
250
250
  }
251
251
 
252
252
  function looseCompareArrays(a, b) {
253
- if (a.length !== b.length)
254
- return false;
253
+ if (a.length !== b.length) return false;
255
254
  let equal = true;
256
255
  for (let i = 0; equal && i < a.length; i++) {
257
256
  equal = looseEqual(a[i], b[i]);
@@ -259,8 +258,7 @@ function looseCompareArrays(a, b) {
259
258
  return equal;
260
259
  }
261
260
  function looseEqual(a, b) {
262
- if (a === b)
263
- return true;
261
+ if (a === b) return true;
264
262
  let aValidType = isDate(a);
265
263
  let bValidType = isDate(b);
266
264
  if (aValidType || bValidType) {
@@ -729,8 +727,7 @@ function createArrayInstrumentations() {
729
727
  return instrumentations;
730
728
  }
731
729
  function hasOwnProperty(key) {
732
- if (!isSymbol(key))
733
- key = String(key);
730
+ if (!isSymbol(key)) key = String(key);
734
731
  const obj = toRaw(this);
735
732
  track(obj, "has", key);
736
733
  return obj.hasOwnProperty(key);
@@ -1214,7 +1211,11 @@ function shallowReadonly(target) {
1214
1211
  function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1215
1212
  if (!isObject(target)) {
1216
1213
  {
1217
- warn$2(`value cannot be made reactive: ${String(target)}`);
1214
+ warn$2(
1215
+ `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
1216
+ target
1217
+ )}`
1218
+ );
1218
1219
  }
1219
1220
  return target;
1220
1221
  }
@@ -1346,7 +1347,7 @@ function trackRefValue(ref2) {
1346
1347
  );
1347
1348
  }
1348
1349
  }
1349
- function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1350
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1350
1351
  ref2 = toRaw(ref2);
1351
1352
  const dep = ref2.dep;
1352
1353
  if (dep) {
@@ -1357,7 +1358,8 @@ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1357
1358
  target: ref2,
1358
1359
  type: "set",
1359
1360
  key: "value",
1360
- newValue: newVal
1361
+ newValue: newVal,
1362
+ oldValue: oldVal
1361
1363
  }
1362
1364
  );
1363
1365
  }
@@ -1402,6 +1404,7 @@ function warn$1(msg, ...args) {
1402
1404
  instance,
1403
1405
  11,
1404
1406
  [
1407
+ // eslint-disable-next-line no-restricted-syntax
1405
1408
  msg + args.map((a) => {
1406
1409
  var _a, _b;
1407
1410
  return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
@@ -1703,10 +1706,11 @@ function flushPostFlushCbs(seen) {
1703
1706
  seen = seen || /* @__PURE__ */ new Map();
1704
1707
  }
1705
1708
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1706
- if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
1709
+ const cb = activePostFlushCbs[postFlushIndex];
1710
+ if (checkRecursiveUpdates(seen, cb)) {
1707
1711
  continue;
1708
1712
  }
1709
- activePostFlushCbs[postFlushIndex]();
1713
+ if (cb.active !== false) cb();
1710
1714
  }
1711
1715
  activePostFlushCbs = null;
1712
1716
  postFlushIndex = 0;
@@ -1716,10 +1720,8 @@ const getId = (job) => job.id == null ? Infinity : job.id;
1716
1720
  const comparator = (a, b) => {
1717
1721
  const diff = getId(a) - getId(b);
1718
1722
  if (diff === 0) {
1719
- if (a.pre && !b.pre)
1720
- return -1;
1721
- if (b.pre && !a.pre)
1722
- return 1;
1723
+ if (a.pre && !b.pre) return -1;
1724
+ if (b.pre && !a.pre) return 1;
1723
1725
  }
1724
1726
  return diff;
1725
1727
  };
@@ -1827,8 +1829,7 @@ function rerender(id, newRender) {
1827
1829
  }
1828
1830
  function reload(id, newComp) {
1829
1831
  const record = map.get(id);
1830
- if (!record)
1831
- return;
1832
+ if (!record) return;
1832
1833
  newComp = normalizeClassComponent(newComp);
1833
1834
  updateComponentDef(record.initialDef, newComp);
1834
1835
  const instances = [...record.instances];
@@ -1849,7 +1850,10 @@ function reload(id, newComp) {
1849
1850
  hmrDirtyComponents.delete(oldComp);
1850
1851
  } else if (instance.parent) {
1851
1852
  instance.parent.effect.dirty = true;
1852
- queueJob(instance.parent.update);
1853
+ queueJob(() => {
1854
+ instance.parent.update();
1855
+ hmrDirtyComponents.delete(oldComp);
1856
+ });
1853
1857
  } else if (instance.appContext.reload) {
1854
1858
  instance.appContext.reload();
1855
1859
  } else if (typeof window !== "undefined") {
@@ -1912,6 +1916,7 @@ function setDevtoolsHook(hook, target) {
1912
1916
  // (#4815)
1913
1917
  typeof window !== "undefined" && // some envs mock window but not fully
1914
1918
  window.HTMLElement && // also exclude jsdom
1919
+ // eslint-disable-next-line no-restricted-syntax
1915
1920
  !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
1916
1921
  ) {
1917
1922
  const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
@@ -1989,8 +1994,7 @@ function devtoolsComponentEmit(component, event, params) {
1989
1994
  }
1990
1995
 
1991
1996
  function emit(instance, event, ...rawArgs) {
1992
- if (instance.isUnmounted)
1993
- return;
1997
+ if (instance.isUnmounted) return;
1994
1998
  const props = instance.vnode.props || EMPTY_OBJ;
1995
1999
  {
1996
2000
  const {
@@ -2136,8 +2140,7 @@ function setCurrentRenderingInstance$1(instance) {
2136
2140
  return prev;
2137
2141
  }
2138
2142
  function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2139
- if (!ctx)
2140
- return fn;
2143
+ if (!ctx) return fn;
2141
2144
  if (fn._n) {
2142
2145
  return fn;
2143
2146
  }
@@ -2470,423 +2473,115 @@ function queueEffectWithSuspense(fn, suspense) {
2470
2473
  }
2471
2474
  }
2472
2475
 
2473
- const ssrContextKey = Symbol.for("v-scx");
2474
- const useSSRContext = () => {
2475
- {
2476
- const ctx = inject(ssrContextKey);
2477
- if (!ctx) {
2478
- warn$1(
2479
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
2480
- );
2476
+ function injectHook(type, hook, target = currentInstance, prepend = false) {
2477
+ if (target) {
2478
+ const hooks = target[type] || (target[type] = []);
2479
+ const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
2480
+ pauseTracking();
2481
+ const reset = setCurrentInstance(target);
2482
+ const res = callWithAsyncErrorHandling(hook, target, type, args);
2483
+ reset();
2484
+ resetTracking();
2485
+ return res;
2486
+ });
2487
+ if (prepend) {
2488
+ hooks.unshift(wrappedHook);
2489
+ } else {
2490
+ hooks.push(wrappedHook);
2481
2491
  }
2482
- return ctx;
2483
- }
2484
- };
2485
-
2486
- const INITIAL_WATCHER_VALUE = {};
2487
- function watch(source, cb, options) {
2488
- if (!isFunction(cb)) {
2492
+ return wrappedHook;
2493
+ } else {
2494
+ const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
2489
2495
  warn$1(
2490
- `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
2496
+ `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
2491
2497
  );
2492
2498
  }
2493
- return doWatch(source, cb, options);
2494
2499
  }
2495
- function doWatch(source, cb, {
2496
- immediate,
2497
- deep,
2498
- flush,
2499
- once,
2500
- onTrack,
2501
- onTrigger
2502
- } = EMPTY_OBJ) {
2503
- if (cb && once) {
2504
- const _cb = cb;
2505
- cb = (...args) => {
2506
- _cb(...args);
2507
- unwatch();
2508
- };
2509
- }
2510
- if (deep !== void 0 && typeof deep === "number") {
2511
- warn$1(
2512
- `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
2513
- );
2500
+ const createHook = (lifecycle) => (hook, target = currentInstance) => {
2501
+ if (!isInSSRComponentSetup || lifecycle === "sp") {
2502
+ injectHook(lifecycle, (...args) => hook(...args), target);
2514
2503
  }
2515
- if (!cb) {
2516
- if (immediate !== void 0) {
2517
- warn$1(
2518
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
2519
- );
2520
- }
2521
- if (deep !== void 0) {
2522
- warn$1(
2523
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
2524
- );
2525
- }
2526
- if (once !== void 0) {
2527
- warn$1(
2528
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
2529
- );
2530
- }
2504
+ };
2505
+ const onBeforeMount = createHook("bm");
2506
+ const onMounted = createHook("m");
2507
+ const onBeforeUpdate = createHook("bu");
2508
+ const onUpdated = createHook("u");
2509
+ const onBeforeUnmount = createHook("bum");
2510
+ const onUnmounted = createHook("um");
2511
+ const onServerPrefetch = createHook("sp");
2512
+ const onRenderTriggered = createHook(
2513
+ "rtg"
2514
+ );
2515
+ const onRenderTracked = createHook(
2516
+ "rtc"
2517
+ );
2518
+ function onErrorCaptured(hook, target = currentInstance) {
2519
+ injectHook("ec", hook, target);
2520
+ }
2521
+
2522
+ function validateDirectiveName(name) {
2523
+ if (isBuiltInDirective(name)) {
2524
+ warn$1("Do not use built-in directive ids as custom directive id: " + name);
2531
2525
  }
2532
- const warnInvalidSource = (s) => {
2533
- warn$1(
2534
- `Invalid watch source: `,
2535
- s,
2536
- `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
2537
- );
2538
- };
2539
- const instance = currentInstance;
2540
- const reactiveGetter = (source2) => deep === true ? source2 : (
2541
- // for deep: false, only traverse root-level properties
2542
- traverse(source2, deep === false ? 1 : void 0)
2543
- );
2544
- let getter;
2545
- let forceTrigger = false;
2546
- let isMultiSource = false;
2547
- if (isRef(source)) {
2548
- getter = () => source.value;
2549
- forceTrigger = isShallow(source);
2550
- } else if (isReactive(source)) {
2551
- getter = () => reactiveGetter(source);
2552
- forceTrigger = true;
2553
- } else if (isArray(source)) {
2554
- isMultiSource = true;
2555
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
2556
- getter = () => source.map((s) => {
2557
- if (isRef(s)) {
2558
- return s.value;
2559
- } else if (isReactive(s)) {
2560
- return reactiveGetter(s);
2561
- } else if (isFunction(s)) {
2562
- return callWithErrorHandling(s, instance, 2);
2563
- } else {
2564
- warnInvalidSource(s);
2565
- }
2566
- });
2567
- } else if (isFunction(source)) {
2568
- if (cb) {
2569
- getter = () => callWithErrorHandling(source, instance, 2);
2570
- } else {
2571
- getter = () => {
2572
- if (cleanup) {
2573
- cleanup();
2574
- }
2575
- return callWithAsyncErrorHandling(
2576
- source,
2577
- instance,
2578
- 3,
2579
- [onCleanup]
2580
- );
2581
- };
2526
+ }
2527
+ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2528
+ const bindings = vnode.dirs;
2529
+ const oldBindings = prevVNode && prevVNode.dirs;
2530
+ for (let i = 0; i < bindings.length; i++) {
2531
+ const binding = bindings[i];
2532
+ if (oldBindings) {
2533
+ binding.oldValue = oldBindings[i].value;
2582
2534
  }
2583
- } else {
2584
- getter = NOOP;
2585
- warnInvalidSource(source);
2586
- }
2587
- if (cb && deep) {
2588
- const baseGetter = getter;
2589
- getter = () => traverse(baseGetter());
2590
- }
2591
- let cleanup;
2592
- let onCleanup = (fn) => {
2593
- cleanup = effect.onStop = () => {
2594
- callWithErrorHandling(fn, instance, 4);
2595
- cleanup = effect.onStop = void 0;
2596
- };
2597
- };
2598
- let ssrCleanup;
2599
- if (isInSSRComponentSetup) {
2600
- onCleanup = NOOP;
2601
- if (!cb) {
2602
- getter();
2603
- } else if (immediate) {
2604
- callWithAsyncErrorHandling(cb, instance, 3, [
2605
- getter(),
2606
- isMultiSource ? [] : void 0,
2607
- onCleanup
2535
+ let hook = binding.dir[name];
2536
+ if (hook) {
2537
+ pauseTracking();
2538
+ callWithAsyncErrorHandling(hook, instance, 8, [
2539
+ vnode.el,
2540
+ binding,
2541
+ vnode,
2542
+ prevVNode
2608
2543
  ]);
2609
- }
2610
- if (flush === "sync") {
2611
- const ctx = useSSRContext();
2612
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
2613
- } else {
2614
- return NOOP;
2544
+ resetTracking();
2615
2545
  }
2616
2546
  }
2617
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2618
- const job = () => {
2619
- if (!effect.active || !effect.dirty) {
2620
- return;
2621
- }
2622
- if (cb) {
2623
- const newValue = effect.run();
2624
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
2625
- if (cleanup) {
2626
- cleanup();
2627
- }
2628
- callWithAsyncErrorHandling(cb, instance, 3, [
2629
- newValue,
2630
- // pass undefined as the old value when it's changed for the first time
2631
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2632
- onCleanup
2633
- ]);
2634
- oldValue = newValue;
2635
- }
2636
- } else {
2637
- effect.run();
2638
- }
2639
- };
2640
- job.allowRecurse = !!cb;
2641
- let scheduler;
2642
- if (flush === "sync") {
2643
- scheduler = job;
2644
- } else if (flush === "post") {
2645
- scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
2646
- } else {
2647
- job.pre = true;
2648
- if (instance)
2649
- job.id = instance.uid;
2650
- scheduler = () => queueJob(job);
2651
- }
2652
- const effect = new ReactiveEffect(getter, NOOP, scheduler);
2653
- const scope = getCurrentScope();
2654
- const unwatch = () => {
2655
- effect.stop();
2656
- if (scope) {
2657
- remove(scope.effects, effect);
2658
- }
2659
- };
2660
- {
2661
- effect.onTrack = onTrack;
2662
- effect.onTrigger = onTrigger;
2663
- }
2664
- if (cb) {
2665
- if (immediate) {
2666
- job();
2667
- } else {
2668
- oldValue = effect.run();
2669
- }
2670
- } else if (flush === "post") {
2671
- queuePostRenderEffect(
2672
- effect.run.bind(effect),
2673
- instance && instance.suspense
2674
- );
2675
- } else {
2676
- effect.run();
2677
- }
2678
- if (ssrCleanup)
2679
- ssrCleanup.push(unwatch);
2680
- return unwatch;
2681
- }
2682
- function instanceWatch(source, value, options) {
2683
- const publicThis = this.proxy;
2684
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
2685
- let cb;
2686
- if (isFunction(value)) {
2687
- cb = value;
2688
- } else {
2689
- cb = value.handler;
2690
- options = value;
2691
- }
2692
- const reset = setCurrentInstance(this);
2693
- const res = doWatch(getter, cb.bind(publicThis), options);
2694
- reset();
2695
- return res;
2696
- }
2697
- function createPathGetter(ctx, path) {
2698
- const segments = path.split(".");
2699
- return () => {
2700
- let cur = ctx;
2701
- for (let i = 0; i < segments.length && cur; i++) {
2702
- cur = cur[segments[i]];
2703
- }
2704
- return cur;
2705
- };
2706
- }
2707
- function traverse(value, depth = Infinity, seen) {
2708
- if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2709
- return value;
2710
- }
2711
- seen = seen || /* @__PURE__ */ new Set();
2712
- if (seen.has(value)) {
2713
- return value;
2714
- }
2715
- seen.add(value);
2716
- depth--;
2717
- if (isRef(value)) {
2718
- traverse(value.value, depth, seen);
2719
- } else if (isArray(value)) {
2720
- for (let i = 0; i < value.length; i++) {
2721
- traverse(value[i], depth, seen);
2722
- }
2723
- } else if (isSet(value) || isMap(value)) {
2724
- value.forEach((v) => {
2725
- traverse(v, depth, seen);
2726
- });
2727
- } else if (isPlainObject(value)) {
2728
- for (const key in value) {
2729
- traverse(value[key], depth, seen);
2730
- }
2731
- }
2732
- return value;
2733
- }
2734
-
2735
- function validateDirectiveName(name) {
2736
- if (isBuiltInDirective(name)) {
2737
- warn$1("Do not use built-in directive ids as custom directive id: " + name);
2738
- }
2739
- }
2740
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2741
- const bindings = vnode.dirs;
2742
- const oldBindings = prevVNode && prevVNode.dirs;
2743
- for (let i = 0; i < bindings.length; i++) {
2744
- const binding = bindings[i];
2745
- if (oldBindings) {
2746
- binding.oldValue = oldBindings[i].value;
2747
- }
2748
- let hook = binding.dir[name];
2749
- if (hook) {
2750
- pauseTracking();
2751
- callWithAsyncErrorHandling(hook, instance, 8, [
2752
- vnode.el,
2753
- binding,
2754
- vnode,
2755
- prevVNode
2756
- ]);
2757
- resetTracking();
2758
- }
2759
- }
2760
- }
2761
-
2762
- const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2763
-
2764
- const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2765
- function onActivated(hook, target) {
2766
- registerKeepAliveHook(hook, "a", target);
2767
- }
2768
- function onDeactivated(hook, target) {
2769
- registerKeepAliveHook(hook, "da", target);
2770
- }
2771
- function registerKeepAliveHook(hook, type, target = currentInstance) {
2772
- const wrappedHook = hook.__wdc || (hook.__wdc = () => {
2773
- let current = target;
2774
- while (current) {
2775
- if (current.isDeactivated) {
2776
- return;
2777
- }
2778
- current = current.parent;
2779
- }
2780
- return hook();
2781
- });
2782
- injectHook(type, wrappedHook, target);
2783
- if (target) {
2784
- let current = target.parent;
2785
- while (current && current.parent) {
2786
- if (isKeepAlive(current.parent.vnode)) {
2787
- injectToKeepAliveRoot(wrappedHook, type, target, current);
2788
- }
2789
- current = current.parent;
2790
- }
2791
- }
2792
- }
2793
- function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
2794
- const injected = injectHook(
2795
- type,
2796
- hook,
2797
- keepAliveRoot,
2798
- true
2799
- /* prepend */
2800
- );
2801
- onUnmounted(() => {
2802
- remove(keepAliveRoot[type], injected);
2803
- }, target);
2804
- }
2805
-
2806
- function injectHook(type, hook, target = currentInstance, prepend = false) {
2807
- if (target) {
2808
- const hooks = target[type] || (target[type] = []);
2809
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
2810
- if (target.isUnmounted) {
2811
- return;
2812
- }
2813
- pauseTracking();
2814
- const reset = setCurrentInstance(target);
2815
- const res = callWithAsyncErrorHandling(hook, target, type, args);
2816
- reset();
2817
- resetTracking();
2818
- return res;
2819
- });
2820
- if (prepend) {
2821
- hooks.unshift(wrappedHook);
2822
- } else {
2823
- hooks.push(wrappedHook);
2824
- }
2825
- return wrappedHook;
2826
- } else {
2827
- const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
2828
- warn$1(
2829
- `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
2830
- );
2831
- }
2832
- }
2833
- const createHook = (lifecycle) => (hook, target = currentInstance) => (
2834
- // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
2835
- (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
2836
- );
2837
- const onBeforeMount = createHook("bm");
2838
- const onMounted = createHook("m");
2839
- const onBeforeUpdate = createHook("bu");
2840
- const onUpdated = createHook("u");
2841
- const onBeforeUnmount = createHook("bum");
2842
- const onUnmounted = createHook("um");
2843
- const onServerPrefetch = createHook("sp");
2844
- const onRenderTriggered = createHook(
2845
- "rtg"
2846
- );
2847
- const onRenderTracked = createHook(
2848
- "rtc"
2849
- );
2850
- function onErrorCaptured(hook, target = currentInstance) {
2851
- injectHook("ec", hook, target);
2852
- }
2853
-
2854
- const getPublicInstance = (i) => {
2855
- if (!i)
2856
- return null;
2857
- if (isStatefulComponent(i))
2858
- return getExposeProxy(i) || i.proxy;
2859
- return getPublicInstance(i.parent);
2860
- };
2861
- const publicPropertiesMap = (
2862
- // Move PURE marker to new line to workaround compiler discarding it
2863
- // due to type annotation
2864
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
2865
- $: (i) => i,
2866
- $el: (i) => i.vnode.el,
2867
- $data: (i) => i.data,
2868
- $props: (i) => shallowReadonly(i.props) ,
2869
- $attrs: (i) => shallowReadonly(i.attrs) ,
2870
- $slots: (i) => shallowReadonly(i.slots) ,
2871
- $refs: (i) => shallowReadonly(i.refs) ,
2872
- $parent: (i) => getPublicInstance(i.parent),
2873
- $root: (i) => getPublicInstance(i.root),
2874
- $emit: (i) => i.emit,
2875
- $options: (i) => resolveMergedOptions(i) ,
2876
- $forceUpdate: (i) => i.f || (i.f = () => {
2877
- i.effect.dirty = true;
2878
- queueJob(i.update);
2879
- }),
2880
- $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
2881
- $watch: (i) => instanceWatch.bind(i)
2882
- })
2883
- );
2884
- const isReservedPrefix = (key) => key === "_" || key === "$";
2885
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
2886
- const PublicInstanceProxyHandlers = {
2887
- get({ _: instance }, key) {
2888
- if (key === "__v_skip") {
2889
- return true;
2547
+ }
2548
+
2549
+ const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2550
+
2551
+ const getPublicInstance = (i) => {
2552
+ if (!i) return null;
2553
+ if (isStatefulComponent(i)) return getComponentPublicInstance(i);
2554
+ return getPublicInstance(i.parent);
2555
+ };
2556
+ const publicPropertiesMap = (
2557
+ // Move PURE marker to new line to workaround compiler discarding it
2558
+ // due to type annotation
2559
+ /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
2560
+ $: (i) => i,
2561
+ $el: (i) => i.vnode.el,
2562
+ $data: (i) => i.data,
2563
+ $props: (i) => shallowReadonly(i.props) ,
2564
+ $attrs: (i) => shallowReadonly(i.attrs) ,
2565
+ $slots: (i) => shallowReadonly(i.slots) ,
2566
+ $refs: (i) => shallowReadonly(i.refs) ,
2567
+ $parent: (i) => getPublicInstance(i.parent),
2568
+ $root: (i) => getPublicInstance(i.root),
2569
+ $emit: (i) => i.emit,
2570
+ $options: (i) => resolveMergedOptions(i) ,
2571
+ $forceUpdate: (i) => i.f || (i.f = () => {
2572
+ i.effect.dirty = true;
2573
+ queueJob(i.update);
2574
+ }),
2575
+ $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
2576
+ $watch: (i) => instanceWatch.bind(i)
2577
+ })
2578
+ );
2579
+ const isReservedPrefix = (key) => key === "_" || key === "$";
2580
+ const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
2581
+ const PublicInstanceProxyHandlers = {
2582
+ get({ _: instance }, key) {
2583
+ if (key === "__v_skip") {
2584
+ return true;
2890
2585
  }
2891
2586
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
2892
2587
  if (key === "__isVue") {
@@ -3284,10 +2979,8 @@ function applyOptions(instance) {
3284
2979
  if (inheritAttrs != null) {
3285
2980
  instance.inheritAttrs = inheritAttrs;
3286
2981
  }
3287
- if (components)
3288
- instance.components = components;
3289
- if (directives)
3290
- instance.directives = directives;
2982
+ if (components) instance.components = components;
2983
+ if (directives) instance.directives = directives;
3291
2984
  }
3292
2985
  function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
3293
2986
  if (isArray(injectOptions)) {
@@ -3488,10 +3181,8 @@ function mergeEmitsOrPropsOptions(to, from) {
3488
3181
  }
3489
3182
  }
3490
3183
  function mergeWatchOptions(to, from) {
3491
- if (!to)
3492
- return from;
3493
- if (!from)
3494
- return to;
3184
+ if (!to) return from;
3185
+ if (!from) return to;
3495
3186
  const merged = extend(/* @__PURE__ */ Object.create(null), to);
3496
3187
  for (const key in from) {
3497
3188
  merged[key] = mergeAsArray(to[key], from[key]);
@@ -3641,7 +3332,7 @@ function createAppAPI(render, hydrate) {
3641
3332
  app._instance = vnode.component;
3642
3333
  devtoolsInitApp(app, version);
3643
3334
  }
3644
- return getExposeProxy(vnode.component) || vnode.component.proxy;
3335
+ return getComponentPublicInstance(vnode.component);
3645
3336
  } else {
3646
3337
  warn$1(
3647
3338
  `App has already been mounted.
@@ -3745,8 +3436,7 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
3745
3436
  }
3746
3437
  function isInHmrContext(instance) {
3747
3438
  while (instance) {
3748
- if (instance.type.__hmrId)
3749
- return true;
3439
+ if (instance.type.__hmrId) return true;
3750
3440
  instance = instance.parent;
3751
3441
  }
3752
3442
  }
@@ -3931,8 +3621,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3931
3621
  hasExtends = true;
3932
3622
  const [props, keys] = normalizePropsOptions(raw2, appContext, true);
3933
3623
  extend(normalized, props);
3934
- if (keys)
3935
- needCastKeys.push(...keys);
3624
+ if (keys) needCastKeys.push(...keys);
3936
3625
  };
3937
3626
  if (!asMixin && appContext.mixins.length) {
3938
3627
  appContext.mixins.forEach(extendProps);
@@ -4023,8 +3712,7 @@ function validateProps(rawProps, props, instance) {
4023
3712
  const options = instance.propsOptions[0];
4024
3713
  for (const key in options) {
4025
3714
  let opt = options[key];
4026
- if (opt == null)
4027
- continue;
3715
+ if (opt == null) continue;
4028
3716
  validateProp(
4029
3717
  key,
4030
3718
  resolvedValues[key],
@@ -4142,8 +3830,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
4142
3830
  const normalizeObjectSlots = (rawSlots, slots, instance) => {
4143
3831
  const ctx = rawSlots._ctx;
4144
3832
  for (const key in rawSlots) {
4145
- if (isInternalKey(key))
4146
- continue;
3833
+ if (isInternalKey(key)) continue;
4147
3834
  const value = rawSlots[key];
4148
3835
  if (isFunction(value)) {
4149
3836
  slots[key] = normalizeSlot(key, value, ctx);
@@ -4233,7 +3920,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4233
3920
  if (isAsyncWrapper(vnode) && !isUnmount) {
4234
3921
  return;
4235
3922
  }
4236
- const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
3923
+ const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
4237
3924
  const value = isUnmount ? null : refValue;
4238
3925
  const { i: owner, r: ref } = rawRef;
4239
3926
  if (!owner) {
@@ -4275,8 +3962,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4275
3962
  }
4276
3963
  } else {
4277
3964
  ref.value = [refValue];
4278
- if (rawRef.k)
4279
- refs[rawRef.k] = ref.value;
3965
+ if (rawRef.k) refs[rawRef.k] = ref.value;
4280
3966
  }
4281
3967
  } else if (!existing.includes(refValue)) {
4282
3968
  existing.push(refValue);
@@ -4289,8 +3975,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4289
3975
  }
4290
3976
  } else if (_isRef) {
4291
3977
  ref.value = value;
4292
- if (rawRef.k)
4293
- refs[rawRef.k] = value;
3978
+ if (rawRef.k) refs[rawRef.k] = value;
4294
3979
  } else {
4295
3980
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
4296
3981
  }
@@ -4849,8 +4534,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4849
4534
  }
4850
4535
  }
4851
4536
  for (const key in newProps) {
4852
- if (isReservedProp(key))
4853
- continue;
4537
+ if (isReservedProp(key)) continue;
4854
4538
  const next = newProps[key];
4855
4539
  const prev = oldProps[key];
4856
4540
  if (next !== prev && key !== "value") {
@@ -4987,7 +4671,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4987
4671
  }
4988
4672
  }
4989
4673
  if (instance.asyncDep) {
4990
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
4674
+ parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
4991
4675
  if (!initialVNode.el) {
4992
4676
  const placeholder = instance.subTree = createVNode(Comment);
4993
4677
  processCommentNode(null, placeholder, container, anchor);
@@ -5452,8 +5136,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5452
5136
  let moved = false;
5453
5137
  let maxNewIndexSoFar = 0;
5454
5138
  const newIndexToOldIndexMap = new Array(toBePatched);
5455
- for (i = 0; i < toBePatched; i++)
5456
- newIndexToOldIndexMap[i] = 0;
5139
+ for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
5457
5140
  for (i = s1; i <= e1; i++) {
5458
5141
  const prevChild = c1[i];
5459
5142
  if (patched >= toBePatched) {
@@ -5582,11 +5265,15 @@ function baseCreateRenderer(options, createHydrationFns) {
5582
5265
  dynamicChildren,
5583
5266
  shapeFlag,
5584
5267
  patchFlag,
5585
- dirs
5268
+ dirs,
5269
+ memoIndex
5586
5270
  } = vnode;
5587
5271
  if (ref != null) {
5588
5272
  setRef(ref, null, parentSuspense, vnode, true);
5589
5273
  }
5274
+ if (memoIndex != null) {
5275
+ parentComponent.renderCache[memoIndex] = void 0;
5276
+ }
5590
5277
  if (shapeFlag & 256) {
5591
5278
  parentComponent.ctx.deactivate(vnode);
5592
5279
  return;
@@ -5690,7 +5377,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5690
5377
  if (instance.type.__hmrId) {
5691
5378
  unregisterHMR(instance);
5692
5379
  }
5693
- const { bum, scope, update, subTree, um } = instance;
5380
+ const { bum, scope, update, subTree, um, m, a } = instance;
5381
+ invalidateMount(m);
5382
+ invalidateMount(a);
5694
5383
  if (bum) {
5695
5384
  invokeArrayFns(bum);
5696
5385
  }
@@ -5795,7 +5484,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
5795
5484
  c2 = ch2[i] = cloneIfMounted(ch2[i]);
5796
5485
  c2.el = c1.el;
5797
5486
  }
5798
- if (!shallow)
5487
+ if (!shallow && c2.patchFlag !== -2)
5799
5488
  traverseStaticChildren(c1, c2);
5800
5489
  }
5801
5490
  if (c2.type === Text) {
@@ -5857,13 +5546,336 @@ function locateNonHydratedAsyncRoot(instance) {
5857
5546
  }
5858
5547
  }
5859
5548
  }
5549
+ function invalidateMount(hooks) {
5550
+ if (hooks) {
5551
+ for (let i = 0; i < hooks.length; i++) hooks[i].active = false;
5552
+ }
5553
+ }
5860
5554
 
5861
- const isTeleport = (type) => type.__isTeleport;
5862
-
5863
- const Fragment = Symbol.for("v-fgt");
5864
- const Text = Symbol.for("v-txt");
5865
- const Comment = Symbol.for("v-cmt");
5866
- const Static = Symbol.for("v-stc");
5555
+ const ssrContextKey = Symbol.for("v-scx");
5556
+ const useSSRContext = () => {
5557
+ {
5558
+ const ctx = inject(ssrContextKey);
5559
+ if (!ctx) {
5560
+ warn$1(
5561
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
5562
+ );
5563
+ }
5564
+ return ctx;
5565
+ }
5566
+ };
5567
+
5568
+ const INITIAL_WATCHER_VALUE = {};
5569
+ function watch(source, cb, options) {
5570
+ if (!isFunction(cb)) {
5571
+ warn$1(
5572
+ `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
5573
+ );
5574
+ }
5575
+ return doWatch(source, cb, options);
5576
+ }
5577
+ function doWatch(source, cb, {
5578
+ immediate,
5579
+ deep,
5580
+ flush,
5581
+ once,
5582
+ onTrack,
5583
+ onTrigger
5584
+ } = EMPTY_OBJ) {
5585
+ if (cb && once) {
5586
+ const _cb = cb;
5587
+ cb = (...args) => {
5588
+ _cb(...args);
5589
+ unwatch();
5590
+ };
5591
+ }
5592
+ if (deep !== void 0 && typeof deep === "number") {
5593
+ warn$1(
5594
+ `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
5595
+ );
5596
+ }
5597
+ if (!cb) {
5598
+ if (immediate !== void 0) {
5599
+ warn$1(
5600
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
5601
+ );
5602
+ }
5603
+ if (deep !== void 0) {
5604
+ warn$1(
5605
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
5606
+ );
5607
+ }
5608
+ if (once !== void 0) {
5609
+ warn$1(
5610
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
5611
+ );
5612
+ }
5613
+ }
5614
+ const warnInvalidSource = (s) => {
5615
+ warn$1(
5616
+ `Invalid watch source: `,
5617
+ s,
5618
+ `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
5619
+ );
5620
+ };
5621
+ const instance = currentInstance;
5622
+ const reactiveGetter = (source2) => deep === true ? source2 : (
5623
+ // for deep: false, only traverse root-level properties
5624
+ traverse(source2, deep === false ? 1 : void 0)
5625
+ );
5626
+ let getter;
5627
+ let forceTrigger = false;
5628
+ let isMultiSource = false;
5629
+ if (isRef(source)) {
5630
+ getter = () => source.value;
5631
+ forceTrigger = isShallow(source);
5632
+ } else if (isReactive(source)) {
5633
+ getter = () => reactiveGetter(source);
5634
+ forceTrigger = true;
5635
+ } else if (isArray(source)) {
5636
+ isMultiSource = true;
5637
+ forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
5638
+ getter = () => source.map((s) => {
5639
+ if (isRef(s)) {
5640
+ return s.value;
5641
+ } else if (isReactive(s)) {
5642
+ return reactiveGetter(s);
5643
+ } else if (isFunction(s)) {
5644
+ return callWithErrorHandling(s, instance, 2);
5645
+ } else {
5646
+ warnInvalidSource(s);
5647
+ }
5648
+ });
5649
+ } else if (isFunction(source)) {
5650
+ if (cb) {
5651
+ getter = () => callWithErrorHandling(source, instance, 2);
5652
+ } else {
5653
+ getter = () => {
5654
+ if (cleanup) {
5655
+ cleanup();
5656
+ }
5657
+ return callWithAsyncErrorHandling(
5658
+ source,
5659
+ instance,
5660
+ 3,
5661
+ [onCleanup]
5662
+ );
5663
+ };
5664
+ }
5665
+ } else {
5666
+ getter = NOOP;
5667
+ warnInvalidSource(source);
5668
+ }
5669
+ if (cb && deep) {
5670
+ const baseGetter = getter;
5671
+ getter = () => traverse(baseGetter());
5672
+ }
5673
+ let cleanup;
5674
+ let onCleanup = (fn) => {
5675
+ cleanup = effect.onStop = () => {
5676
+ callWithErrorHandling(fn, instance, 4);
5677
+ cleanup = effect.onStop = void 0;
5678
+ };
5679
+ };
5680
+ let ssrCleanup;
5681
+ if (isInSSRComponentSetup) {
5682
+ onCleanup = NOOP;
5683
+ if (!cb) {
5684
+ getter();
5685
+ } else if (immediate) {
5686
+ callWithAsyncErrorHandling(cb, instance, 3, [
5687
+ getter(),
5688
+ isMultiSource ? [] : void 0,
5689
+ onCleanup
5690
+ ]);
5691
+ }
5692
+ if (flush === "sync") {
5693
+ const ctx = useSSRContext();
5694
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
5695
+ } else {
5696
+ return NOOP;
5697
+ }
5698
+ }
5699
+ let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
5700
+ const job = () => {
5701
+ if (!effect.active || !effect.dirty) {
5702
+ return;
5703
+ }
5704
+ if (cb) {
5705
+ const newValue = effect.run();
5706
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
5707
+ if (cleanup) {
5708
+ cleanup();
5709
+ }
5710
+ callWithAsyncErrorHandling(cb, instance, 3, [
5711
+ newValue,
5712
+ // pass undefined as the old value when it's changed for the first time
5713
+ oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
5714
+ onCleanup
5715
+ ]);
5716
+ oldValue = newValue;
5717
+ }
5718
+ } else {
5719
+ effect.run();
5720
+ }
5721
+ };
5722
+ job.allowRecurse = !!cb;
5723
+ let scheduler;
5724
+ if (flush === "sync") {
5725
+ scheduler = job;
5726
+ } else if (flush === "post") {
5727
+ scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
5728
+ } else {
5729
+ job.pre = true;
5730
+ if (instance) job.id = instance.uid;
5731
+ scheduler = () => queueJob(job);
5732
+ }
5733
+ const effect = new ReactiveEffect(getter, NOOP, scheduler);
5734
+ const scope = getCurrentScope();
5735
+ const unwatch = () => {
5736
+ effect.stop();
5737
+ if (scope) {
5738
+ remove(scope.effects, effect);
5739
+ }
5740
+ };
5741
+ {
5742
+ effect.onTrack = onTrack;
5743
+ effect.onTrigger = onTrigger;
5744
+ }
5745
+ if (cb) {
5746
+ if (immediate) {
5747
+ job();
5748
+ } else {
5749
+ oldValue = effect.run();
5750
+ }
5751
+ } else if (flush === "post") {
5752
+ queuePostRenderEffect(
5753
+ effect.run.bind(effect),
5754
+ instance && instance.suspense
5755
+ );
5756
+ } else {
5757
+ effect.run();
5758
+ }
5759
+ if (ssrCleanup) ssrCleanup.push(unwatch);
5760
+ return unwatch;
5761
+ }
5762
+ function instanceWatch(source, value, options) {
5763
+ const publicThis = this.proxy;
5764
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
5765
+ let cb;
5766
+ if (isFunction(value)) {
5767
+ cb = value;
5768
+ } else {
5769
+ cb = value.handler;
5770
+ options = value;
5771
+ }
5772
+ const reset = setCurrentInstance(this);
5773
+ const res = doWatch(getter, cb.bind(publicThis), options);
5774
+ reset();
5775
+ return res;
5776
+ }
5777
+ function createPathGetter(ctx, path) {
5778
+ const segments = path.split(".");
5779
+ return () => {
5780
+ let cur = ctx;
5781
+ for (let i = 0; i < segments.length && cur; i++) {
5782
+ cur = cur[segments[i]];
5783
+ }
5784
+ return cur;
5785
+ };
5786
+ }
5787
+ function traverse(value, depth = Infinity, seen) {
5788
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
5789
+ return value;
5790
+ }
5791
+ seen = seen || /* @__PURE__ */ new Set();
5792
+ if (seen.has(value)) {
5793
+ return value;
5794
+ }
5795
+ seen.add(value);
5796
+ depth--;
5797
+ if (isRef(value)) {
5798
+ traverse(value.value, depth, seen);
5799
+ } else if (isArray(value)) {
5800
+ for (let i = 0; i < value.length; i++) {
5801
+ traverse(value[i], depth, seen);
5802
+ }
5803
+ } else if (isSet(value) || isMap(value)) {
5804
+ value.forEach((v) => {
5805
+ traverse(v, depth, seen);
5806
+ });
5807
+ } else if (isPlainObject(value)) {
5808
+ for (const key in value) {
5809
+ traverse(value[key], depth, seen);
5810
+ }
5811
+ for (const key of Object.getOwnPropertySymbols(value)) {
5812
+ if (Object.prototype.propertyIsEnumerable.call(value, key)) {
5813
+ traverse(value[key], depth, seen);
5814
+ }
5815
+ }
5816
+ }
5817
+ return value;
5818
+ }
5819
+
5820
+ const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
5821
+ function onActivated(hook, target) {
5822
+ registerKeepAliveHook(hook, "a", target);
5823
+ }
5824
+ function onDeactivated(hook, target) {
5825
+ registerKeepAliveHook(hook, "da", target);
5826
+ }
5827
+ function registerKeepAliveHook(hook, type, target = currentInstance) {
5828
+ const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5829
+ let current = target;
5830
+ while (current) {
5831
+ if (current.isDeactivated) {
5832
+ return;
5833
+ }
5834
+ current = current.parent;
5835
+ }
5836
+ return hook();
5837
+ });
5838
+ injectHook(type, wrappedHook, target);
5839
+ if (target) {
5840
+ let current = target.parent;
5841
+ while (current && current.parent) {
5842
+ if (isKeepAlive(current.parent.vnode)) {
5843
+ injectToKeepAliveRoot(wrappedHook, type, target, current);
5844
+ }
5845
+ current = current.parent;
5846
+ }
5847
+ }
5848
+ }
5849
+ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5850
+ const injected = injectHook(
5851
+ type,
5852
+ hook,
5853
+ keepAliveRoot,
5854
+ true
5855
+ /* prepend */
5856
+ );
5857
+ onUnmounted(() => {
5858
+ remove(keepAliveRoot[type], injected);
5859
+ }, target);
5860
+ }
5861
+
5862
+ function setTransitionHooks(vnode, hooks) {
5863
+ if (vnode.shapeFlag & 6 && vnode.component) {
5864
+ setTransitionHooks(vnode.component.subTree, hooks);
5865
+ } else if (vnode.shapeFlag & 128) {
5866
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
5867
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
5868
+ } else {
5869
+ vnode.transition = hooks;
5870
+ }
5871
+ }
5872
+
5873
+ const isTeleport = (type) => type.__isTeleport;
5874
+
5875
+ const Fragment = Symbol.for("v-fgt");
5876
+ const Text = Symbol.for("v-txt");
5877
+ const Comment = Symbol.for("v-cmt");
5878
+ const Static = Symbol.for("v-stc");
5867
5879
  let currentBlock = null;
5868
5880
  let isBlockTreeEnabled = 1;
5869
5881
  function setBlockTracking(value) {
@@ -5974,7 +5986,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5974
5986
  currentBlock.push(cloned);
5975
5987
  }
5976
5988
  }
5977
- cloned.patchFlag |= -2;
5989
+ cloned.patchFlag = -2;
5978
5990
  return cloned;
5979
5991
  }
5980
5992
  if (isClassComponent(type)) {
@@ -6015,8 +6027,7 @@ Component that was made reactive: `,
6015
6027
  );
6016
6028
  }
6017
6029
  function guardReactiveProps(props) {
6018
- if (!props)
6019
- return null;
6030
+ if (!props) return null;
6020
6031
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
6021
6032
  }
6022
6033
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
@@ -6065,7 +6076,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
6065
6076
  ce: vnode.ce
6066
6077
  };
6067
6078
  if (transition && cloneTransition) {
6068
- cloned.transition = transition.clone(cloned);
6079
+ setTransitionHooks(
6080
+ cloned,
6081
+ transition.clone(cloned)
6082
+ );
6069
6083
  }
6070
6084
  return cloned;
6071
6085
  }
@@ -6273,14 +6287,11 @@ let setInSSRSetupState;
6273
6287
  const g = getGlobalThis();
6274
6288
  const registerGlobalSetter = (key, setter) => {
6275
6289
  let setters;
6276
- if (!(setters = g[key]))
6277
- setters = g[key] = [];
6290
+ if (!(setters = g[key])) setters = g[key] = [];
6278
6291
  setters.push(setter);
6279
6292
  return (v) => {
6280
- if (setters.length > 1)
6281
- setters.forEach((set) => set(v));
6282
- else
6283
- setters[0](v);
6293
+ if (setters.length > 1) setters.forEach((set) => set(v));
6294
+ else setters[0](v);
6284
6295
  };
6285
6296
  };
6286
6297
  internalSetCurrentInstance = registerGlobalSetter(
@@ -6471,7 +6482,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
6471
6482
  `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
6472
6483
  );
6473
6484
  } else {
6474
- warn$1(`Component is missing template or render function.`);
6485
+ warn$1(`Component is missing template or render function: `, Component);
6475
6486
  }
6476
6487
  }
6477
6488
  }
@@ -6538,7 +6549,7 @@ function createSetupContext(instance) {
6538
6549
  });
6539
6550
  }
6540
6551
  }
6541
- function getExposeProxy(instance) {
6552
+ function getComponentPublicInstance(instance) {
6542
6553
  if (instance.exposed) {
6543
6554
  return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
6544
6555
  get(target, key) {
@@ -6552,6 +6563,8 @@ function getExposeProxy(instance) {
6552
6563
  return key in target || key in publicPropertiesMap;
6553
6564
  }
6554
6565
  }));
6566
+ } else {
6567
+ return instance.proxy;
6555
6568
  }
6556
6569
  }
6557
6570
  const classifyRE = /(?:^|[-_])(\w)/g;
@@ -6596,7 +6609,7 @@ const computed = (getterOrOptions, debugOptions) => {
6596
6609
  return c;
6597
6610
  };
6598
6611
 
6599
- const version = "3.4.26";
6612
+ const version = "3.4.28";
6600
6613
  const warn = warn$1 ;
6601
6614
  const _ssrUtils = {
6602
6615
  createComponentInstance: createComponentInstance$1,
@@ -6604,7 +6617,8 @@ const _ssrUtils = {
6604
6617
  renderComponentRoot: renderComponentRoot$1,
6605
6618
  setCurrentRenderingInstance: setCurrentRenderingInstance$1,
6606
6619
  isVNode: isVNode$2,
6607
- normalizeVNode: normalizeVNode$1
6620
+ normalizeVNode: normalizeVNode$1,
6621
+ getComponentPublicInstance
6608
6622
  };
6609
6623
  const ssrUtils = _ssrUtils ;
6610
6624
 
@@ -6623,7 +6637,7 @@ const nodeOps = {
6623
6637
  }
6624
6638
  },
6625
6639
  createElement: (tag, namespace, is, props) => {
6626
- const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
6640
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
6627
6641
  if (tag === "select" && props && props.multiple != null) {
6628
6642
  el.setAttribute("multiple", props.multiple);
6629
6643
  }
@@ -6652,8 +6666,7 @@ const nodeOps = {
6652
6666
  if (start && (start === end || start.nextSibling)) {
6653
6667
  while (true) {
6654
6668
  parent.insertBefore(start.cloneNode(true), anchor);
6655
- if (start === end || !(start = start.nextSibling))
6656
- break;
6669
+ if (start === end || !(start = start.nextSibling)) break;
6657
6670
  }
6658
6671
  } else {
6659
6672
  templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
@@ -6752,8 +6765,7 @@ function setStyle(style, name, val) {
6752
6765
  if (isArray(val)) {
6753
6766
  val.forEach((v) => setStyle(style, name, v));
6754
6767
  } else {
6755
- if (val == null)
6756
- val = "";
6768
+ if (val == null) val = "";
6757
6769
  {
6758
6770
  if (semicolonRE.test(val)) {
6759
6771
  warn(
@@ -6799,7 +6811,7 @@ function autoPrefix(style, rawName) {
6799
6811
  }
6800
6812
 
6801
6813
  const xlinkNS = "http://www.w3.org/1999/xlink";
6802
- function patchAttr(el, key, value, isSVG, instance) {
6814
+ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
6803
6815
  if (isSVG && key.startsWith("xlink:")) {
6804
6816
  if (value == null) {
6805
6817
  el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
@@ -6807,11 +6819,10 @@ function patchAttr(el, key, value, isSVG, instance) {
6807
6819
  el.setAttributeNS(xlinkNS, key, value);
6808
6820
  }
6809
6821
  } else {
6810
- const isBoolean = isSpecialBooleanAttr(key);
6811
6822
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
6812
6823
  el.removeAttribute(key);
6813
6824
  } else {
6814
- el.setAttribute(key, isBoolean ? "" : value);
6825
+ el.setAttribute(key, isBoolean ? "" : String(value));
6815
6826
  }
6816
6827
  }
6817
6828
  }
@@ -6828,7 +6839,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
6828
6839
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
6829
6840
  !tag.includes("-")) {
6830
6841
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
6831
- const newValue = value == null ? "" : value;
6842
+ const newValue = value == null ? "" : String(value);
6832
6843
  if (oldValue !== newValue || !("_value" in el)) {
6833
6844
  el.value = newValue;
6834
6845
  }
@@ -6972,6 +6983,9 @@ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, paren
6972
6983
  parentSuspense,
6973
6984
  unmountChildren
6974
6985
  );
6986
+ if (key === "value" || key === "checked" || key === "selected") {
6987
+ patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
6988
+ }
6975
6989
  } else {
6976
6990
  if (key === "true-value") {
6977
6991
  el._trueValue = nextValue;
@@ -7035,8 +7049,7 @@ const vModelText = {
7035
7049
  el[assignKey] = getModelAssigner(vnode);
7036
7050
  const castToNumber = number || vnode.props && vnode.props.type === "number";
7037
7051
  addEventListener(el, lazy ? "change" : "input", (e) => {
7038
- if (e.target.composing)
7039
- return;
7052
+ if (e.target.composing) return;
7040
7053
  let domValue = el.value;
7041
7054
  if (trim) {
7042
7055
  domValue = domValue.trim();
@@ -7061,17 +7074,16 @@ const vModelText = {
7061
7074
  mounted(el, { value }) {
7062
7075
  el.value = value == null ? "" : value;
7063
7076
  },
7064
- beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
7077
+ beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
7065
7078
  el[assignKey] = getModelAssigner(vnode);
7066
- if (el.composing)
7067
- return;
7079
+ if (el.composing) return;
7068
7080
  const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
7069
7081
  const newValue = value == null ? "" : value;
7070
7082
  if (elValue === newValue) {
7071
7083
  return;
7072
7084
  }
7073
7085
  if (document.activeElement === el && el.type !== "range") {
7074
- if (lazy) {
7086
+ if (lazy && value === oldValue) {
7075
7087
  return;
7076
7088
  }
7077
7089
  if (trim && el.value.trim() === newValue) {
@@ -7189,8 +7201,7 @@ const createApp = (...args) => {
7189
7201
  const { mount } = app;
7190
7202
  app.mount = (containerOrSelector) => {
7191
7203
  const container = normalizeContainer(containerOrSelector);
7192
- if (!container)
7193
- return;
7204
+ if (!container) return;
7194
7205
  const component = app._component;
7195
7206
  if (!isFunction(component) && !component.render && !component.template) {
7196
7207
  component.template = container.innerHTML;
@@ -7397,13 +7408,11 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
7397
7408
  fallbackRenderFn();
7398
7409
  }
7399
7410
  }
7400
- const commentTestRE = /^<!--.*-->$/s;
7411
+ const commentTestRE = /^<!--[\s\S]*-->$/;
7401
7412
  const commentRE = /<!--[^]*?-->/gm;
7402
7413
  function isComment(item) {
7403
- if (typeof item !== "string" || !commentTestRE.test(item))
7404
- return false;
7405
- if (item.length <= 8)
7406
- return true;
7414
+ if (typeof item !== "string" || !commentTestRE.test(item)) return false;
7415
+ if (item.length <= 8) return true;
7407
7416
  return !item.replace(commentRE, "").trim();
7408
7417
  }
7409
7418
 
@@ -7473,7 +7482,7 @@ function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
7473
7482
  return dir.getSSRProps(
7474
7483
  {
7475
7484
  dir,
7476
- instance,
7485
+ instance: ssrUtils.getComponentPublicInstance(instance.$),
7477
7486
  value,
7478
7487
  oldValue: void 0,
7479
7488
  arg,
@@ -7615,9 +7624,11 @@ function renderComponentSubTree(instance, slotScopeId) {
7615
7624
  }
7616
7625
  }
7617
7626
  if (slotScopeId) {
7618
- if (!hasCloned)
7619
- attrs = { ...attrs };
7620
- attrs[slotScopeId.trim()] = "";
7627
+ if (!hasCloned) attrs = { ...attrs };
7628
+ const slotScopeIdList = slotScopeId.trim().split(" ");
7629
+ for (let i = 0; i < slotScopeIdList.length; i++) {
7630
+ attrs[slotScopeIdList[i]] = "";
7631
+ }
7621
7632
  }
7622
7633
  const prev = setCurrentRenderingInstance(instance);
7623
7634
  try {
@@ -7764,8 +7775,7 @@ function applySSRDirectives(vnode, rawProps, dirs) {
7764
7775
  } = binding;
7765
7776
  if (getSSRProps) {
7766
7777
  const props = getSSRProps(binding, vnode);
7767
- if (props)
7768
- toMerge.push(props);
7778
+ if (props) toMerge.push(props);
7769
7779
  }
7770
7780
  }
7771
7781
  return mergeProps(rawProps || {}, ...toMerge);
@@ -7950,8 +7960,7 @@ function renderToWebStream(input, context = {}) {
7950
7960
  start(controller) {
7951
7961
  renderToSimpleStream(input, context, {
7952
7962
  push(content) {
7953
- if (cancelled)
7954
- return;
7963
+ if (cancelled) return;
7955
7964
  if (content != null) {
7956
7965
  controller.enqueue(encoder.encode(content));
7957
7966
  } else {