@vue/server-renderer 3.4.30 → 3.4.32

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.30
2
+ * @vue/server-renderer v3.4.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -299,11 +299,14 @@ function looseIndexOf(arr, val) {
299
299
  return arr.findIndex((item) => looseEqual(item, val));
300
300
  }
301
301
 
302
+ const isRef$1 = (val) => {
303
+ return !!(val && val.__v_isRef === true);
304
+ };
302
305
  const toDisplayString = (val) => {
303
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
306
+ return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
304
307
  };
305
308
  const replacer = (_key, val) => {
306
- if (val && val.__v_isRef) {
309
+ if (isRef$1(val)) {
307
310
  return replacer(_key, val.value);
308
311
  } else if (isMap(val)) {
309
312
  return {
@@ -438,7 +441,7 @@ class ReactiveEffect {
438
441
  /**
439
442
  * @internal
440
443
  */
441
- this._dirtyLevel = 5;
444
+ this._dirtyLevel = 4;
442
445
  /**
443
446
  * @internal
444
447
  */
@@ -458,20 +461,14 @@ class ReactiveEffect {
458
461
  recordEffectScope(this, scope);
459
462
  }
460
463
  get dirty() {
461
- if (this._dirtyLevel === 2)
462
- return false;
463
- if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
464
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
464
465
  this._dirtyLevel = 1;
465
466
  pauseTracking();
466
467
  for (let i = 0; i < this._depsLength; i++) {
467
468
  const dep = this.deps[i];
468
469
  if (dep.computed) {
469
- if (dep.computed.effect._dirtyLevel === 2) {
470
- resetTracking();
471
- return true;
472
- }
473
470
  triggerComputed(dep.computed);
474
- if (this._dirtyLevel >= 5) {
471
+ if (this._dirtyLevel >= 4) {
475
472
  break;
476
473
  }
477
474
  }
@@ -481,10 +478,10 @@ class ReactiveEffect {
481
478
  }
482
479
  resetTracking();
483
480
  }
484
- return this._dirtyLevel >= 5;
481
+ return this._dirtyLevel >= 4;
485
482
  }
486
483
  set dirty(v) {
487
- this._dirtyLevel = v ? 5 : 0;
484
+ this._dirtyLevel = v ? 4 : 0;
488
485
  }
489
486
  run() {
490
487
  this._dirtyLevel = 0;
@@ -583,17 +580,8 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
583
580
  pauseScheduling();
584
581
  for (const effect2 of dep.keys()) {
585
582
  let tracking;
586
- if (!dep.computed && effect2.computed) {
587
- if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
588
- effect2._dirtyLevel = 2;
589
- continue;
590
- }
591
- }
592
583
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
593
584
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
594
- if (effect2.computed && effect2._dirtyLevel === 2) {
595
- effect2._shouldSchedule = true;
596
- }
597
585
  effect2._dirtyLevel = dirtyLevel;
598
586
  }
599
587
  if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
@@ -601,7 +589,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
601
589
  (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
602
590
  }
603
591
  effect2.trigger();
604
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
592
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
605
593
  effect2._shouldSchedule = false;
606
594
  if (effect2.scheduler) {
607
595
  queueEffectSchedulers.push(effect2.scheduler);
@@ -693,7 +681,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
693
681
  if (dep) {
694
682
  triggerEffects(
695
683
  dep,
696
- 5,
684
+ 4,
697
685
  {
698
686
  target,
699
687
  type,
@@ -885,18 +873,18 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
885
873
 
886
874
  const toShallow = (value) => value;
887
875
  const getProto = (v) => Reflect.getPrototypeOf(v);
888
- function get(target, key, isReadonly = false, isShallow = false) {
876
+ function get(target, key, isReadonly2 = false, isShallow2 = false) {
889
877
  target = target["__v_raw"];
890
878
  const rawTarget = toRaw(target);
891
879
  const rawKey = toRaw(key);
892
- if (!isReadonly) {
880
+ if (!isReadonly2) {
893
881
  if (hasChanged(key, rawKey)) {
894
882
  track(rawTarget, "get", key);
895
883
  }
896
884
  track(rawTarget, "get", rawKey);
897
885
  }
898
886
  const { has: has2 } = getProto(rawTarget);
899
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
887
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
900
888
  if (has2.call(rawTarget, key)) {
901
889
  return wrap(target.get(key));
902
890
  } else if (has2.call(rawTarget, rawKey)) {
@@ -905,11 +893,11 @@ function get(target, key, isReadonly = false, isShallow = false) {
905
893
  target.get(key);
906
894
  }
907
895
  }
908
- function has(key, isReadonly = false) {
896
+ function has(key, isReadonly2 = false) {
909
897
  const target = this["__v_raw"];
910
898
  const rawTarget = toRaw(target);
911
899
  const rawKey = toRaw(key);
912
- if (!isReadonly) {
900
+ if (!isReadonly2) {
913
901
  if (hasChanged(key, rawKey)) {
914
902
  track(rawTarget, "has", key);
915
903
  }
@@ -917,13 +905,15 @@ function has(key, isReadonly = false) {
917
905
  }
918
906
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
919
907
  }
920
- function size(target, isReadonly = false) {
908
+ function size(target, isReadonly2 = false) {
921
909
  target = target["__v_raw"];
922
- !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
910
+ !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
923
911
  return Reflect.get(target, "size", target);
924
912
  }
925
- function add(value) {
926
- value = toRaw(value);
913
+ function add(value, _isShallow = false) {
914
+ if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
915
+ value = toRaw(value);
916
+ }
927
917
  const target = toRaw(this);
928
918
  const proto = getProto(target);
929
919
  const hadKey = proto.has.call(target, value);
@@ -933,8 +923,10 @@ function add(value) {
933
923
  }
934
924
  return this;
935
925
  }
936
- function set(key, value) {
937
- value = toRaw(value);
926
+ function set(key, value, _isShallow = false) {
927
+ if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
928
+ value = toRaw(value);
929
+ }
938
930
  const target = toRaw(this);
939
931
  const { has: has2, get: get2 } = getProto(target);
940
932
  let hadKey = has2.call(target, key);
@@ -980,19 +972,19 @@ function clear() {
980
972
  }
981
973
  return result;
982
974
  }
983
- function createForEach(isReadonly, isShallow) {
975
+ function createForEach(isReadonly2, isShallow2) {
984
976
  return function forEach(callback, thisArg) {
985
977
  const observed = this;
986
978
  const target = observed["__v_raw"];
987
979
  const rawTarget = toRaw(target);
988
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
989
- !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
980
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
981
+ !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
990
982
  return target.forEach((value, key) => {
991
983
  return callback.call(thisArg, wrap(value), wrap(key), observed);
992
984
  });
993
985
  };
994
986
  }
995
- function createIterableMethod(method, isReadonly, isShallow) {
987
+ function createIterableMethod(method, isReadonly2, isShallow2) {
996
988
  return function(...args) {
997
989
  const target = this["__v_raw"];
998
990
  const rawTarget = toRaw(target);
@@ -1000,8 +992,8 @@ function createIterableMethod(method, isReadonly, isShallow) {
1000
992
  const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
1001
993
  const isKeyOnly = method === "keys" && targetIsMap;
1002
994
  const innerIterator = target[method](...args);
1003
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1004
- !isReadonly && track(
995
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
996
+ !isReadonly2 && track(
1005
997
  rawTarget,
1006
998
  "iterate",
1007
999
  isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
@@ -1057,8 +1049,12 @@ function createInstrumentations() {
1057
1049
  return size(this);
1058
1050
  },
1059
1051
  has,
1060
- add,
1061
- set,
1052
+ add(value) {
1053
+ return add.call(this, value, true);
1054
+ },
1055
+ set(key, value) {
1056
+ return set.call(this, key, value, true);
1057
+ },
1062
1058
  delete: deleteEntry,
1063
1059
  clear,
1064
1060
  forEach: createForEach(false, true)
@@ -1124,13 +1120,13 @@ const [
1124
1120
  shallowInstrumentations,
1125
1121
  shallowReadonlyInstrumentations
1126
1122
  ] = /* @__PURE__ */ createInstrumentations();
1127
- function createInstrumentationGetter(isReadonly, shallow) {
1128
- const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
1123
+ function createInstrumentationGetter(isReadonly2, shallow) {
1124
+ const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1129
1125
  return (target, key, receiver) => {
1130
1126
  if (key === "__v_isReactive") {
1131
- return !isReadonly;
1127
+ return !isReadonly2;
1132
1128
  } else if (key === "__v_isReadonly") {
1133
- return isReadonly;
1129
+ return isReadonly2;
1134
1130
  } else if (key === "__v_raw") {
1135
1131
  return target;
1136
1132
  }
@@ -1292,7 +1288,7 @@ class ComputedRefImpl {
1292
1288
  () => getter(this._value),
1293
1289
  () => triggerRefValue(
1294
1290
  this,
1295
- this.effect._dirtyLevel === 3 ? 3 : 4
1291
+ this.effect._dirtyLevel === 2 ? 2 : 3
1296
1292
  )
1297
1293
  );
1298
1294
  this.effect.computed = this;
@@ -1301,11 +1297,8 @@ class ComputedRefImpl {
1301
1297
  }
1302
1298
  get value() {
1303
1299
  const self = toRaw(this);
1304
- const lastDirtyLevel = self.effect._dirtyLevel;
1305
1300
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1306
- if (lastDirtyLevel !== 3) {
1307
- triggerRefValue(self, 5);
1308
- }
1301
+ triggerRefValue(self, 4);
1309
1302
  }
1310
1303
  trackRefValue(self);
1311
1304
  if (self.effect._dirtyLevel >= 2) {
@@ -1314,7 +1307,7 @@ class ComputedRefImpl {
1314
1307
 
1315
1308
  getter: `, this.getter);
1316
1309
  }
1317
- triggerRefValue(self, 3);
1310
+ triggerRefValue(self, 2);
1318
1311
  }
1319
1312
  return self._value;
1320
1313
  }
@@ -1365,7 +1358,7 @@ function trackRefValue(ref2) {
1365
1358
  );
1366
1359
  }
1367
1360
  }
1368
- function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
1361
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1369
1362
  ref2 = toRaw(ref2);
1370
1363
  const dep = ref2.dep;
1371
1364
  if (dep) {
@@ -1411,7 +1404,10 @@ function pushWarningContext(vnode) {
1411
1404
  function popWarningContext() {
1412
1405
  stack.pop();
1413
1406
  }
1407
+ let isWarning = false;
1414
1408
  function warn$1(msg, ...args) {
1409
+ if (isWarning) return;
1410
+ isWarning = true;
1415
1411
  pauseTracking();
1416
1412
  const instance = stack.length ? stack[stack.length - 1].component : null;
1417
1413
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
@@ -1444,6 +1440,7 @@ function warn$1(msg, ...args) {
1444
1440
  console.warn(...warnArgs);
1445
1441
  }
1446
1442
  resetTracking();
1443
+ isWarning = false;
1447
1444
  }
1448
1445
  function getComponentTrace() {
1449
1446
  let currentVNode = stack[stack.length - 1];
@@ -1542,7 +1539,8 @@ const ErrorTypeStrings = {
1542
1539
  [11]: "app warnHandler",
1543
1540
  [12]: "ref function",
1544
1541
  [13]: "async component loader",
1545
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1542
+ [14]: "scheduler flush",
1543
+ [15]: "component update"
1546
1544
  };
1547
1545
  function callWithErrorHandling(fn, instance, type, args) {
1548
1546
  try {
@@ -1758,7 +1756,11 @@ function flushJobs(seen) {
1758
1756
  if (check(job)) {
1759
1757
  continue;
1760
1758
  }
1761
- callWithErrorHandling(job, null, 14);
1759
+ callWithErrorHandling(
1760
+ job,
1761
+ job.i,
1762
+ job.i ? 15 : 14
1763
+ );
1762
1764
  }
1763
1765
  }
1764
1766
  } finally {
@@ -1778,7 +1780,7 @@ function checkRecursiveUpdates(seen, fn) {
1778
1780
  } else {
1779
1781
  const count = seen.get(fn);
1780
1782
  if (count > RECURSION_LIMIT) {
1781
- const instance = fn.ownerInstance;
1783
+ const instance = fn.i;
1782
1784
  const componentName = instance && getComponentName(instance.type);
1783
1785
  handleError(
1784
1786
  `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
@@ -1793,7 +1795,7 @@ function checkRecursiveUpdates(seen, fn) {
1793
1795
  }
1794
1796
 
1795
1797
  let isHmrUpdating = false;
1796
- const hmrDirtyComponents = /* @__PURE__ */ new Set();
1798
+ const hmrDirtyComponents = /* @__PURE__ */ new Map();
1797
1799
  {
1798
1800
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
1799
1801
  createRecord: tryWrap(createRecord),
@@ -1851,26 +1853,29 @@ function reload(id, newComp) {
1851
1853
  newComp = normalizeClassComponent(newComp);
1852
1854
  updateComponentDef(record.initialDef, newComp);
1853
1855
  const instances = [...record.instances];
1854
- for (const instance of instances) {
1856
+ for (let i = 0; i < instances.length; i++) {
1857
+ const instance = instances[i];
1855
1858
  const oldComp = normalizeClassComponent(instance.type);
1856
- if (!hmrDirtyComponents.has(oldComp)) {
1859
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
1860
+ if (!dirtyInstances) {
1857
1861
  if (oldComp !== record.initialDef) {
1858
1862
  updateComponentDef(oldComp, newComp);
1859
1863
  }
1860
- hmrDirtyComponents.add(oldComp);
1864
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
1861
1865
  }
1866
+ dirtyInstances.add(instance);
1862
1867
  instance.appContext.propsCache.delete(instance.type);
1863
1868
  instance.appContext.emitsCache.delete(instance.type);
1864
1869
  instance.appContext.optionsCache.delete(instance.type);
1865
1870
  if (instance.ceReload) {
1866
- hmrDirtyComponents.add(oldComp);
1871
+ dirtyInstances.add(instance);
1867
1872
  instance.ceReload(newComp.styles);
1868
- hmrDirtyComponents.delete(oldComp);
1873
+ dirtyInstances.delete(instance);
1869
1874
  } else if (instance.parent) {
1870
1875
  instance.parent.effect.dirty = true;
1871
1876
  queueJob(() => {
1872
1877
  instance.parent.update();
1873
- hmrDirtyComponents.delete(oldComp);
1878
+ dirtyInstances.delete(instance);
1874
1879
  });
1875
1880
  } else if (instance.appContext.reload) {
1876
1881
  instance.appContext.reload();
@@ -1883,11 +1888,7 @@ function reload(id, newComp) {
1883
1888
  }
1884
1889
  }
1885
1890
  queuePostFlushCb(() => {
1886
- for (const instance of instances) {
1887
- hmrDirtyComponents.delete(
1888
- normalizeClassComponent(instance.type)
1889
- );
1890
- }
1891
+ hmrDirtyComponents.clear();
1891
1892
  });
1892
1893
  }
1893
1894
  function updateComponentDef(oldComp, newComp) {
@@ -2011,144 +2012,6 @@ function devtoolsComponentEmit(component, event, params) {
2011
2012
  );
2012
2013
  }
2013
2014
 
2014
- function emit(instance, event, ...rawArgs) {
2015
- if (instance.isUnmounted) return;
2016
- const props = instance.vnode.props || EMPTY_OBJ;
2017
- {
2018
- const {
2019
- emitsOptions,
2020
- propsOptions: [propsOptions]
2021
- } = instance;
2022
- if (emitsOptions) {
2023
- if (!(event in emitsOptions) && true) {
2024
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2025
- warn$1(
2026
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
2027
- );
2028
- }
2029
- } else {
2030
- const validator = emitsOptions[event];
2031
- if (isFunction(validator)) {
2032
- const isValid = validator(...rawArgs);
2033
- if (!isValid) {
2034
- warn$1(
2035
- `Invalid event arguments: event validation failed for event "${event}".`
2036
- );
2037
- }
2038
- }
2039
- }
2040
- }
2041
- }
2042
- let args = rawArgs;
2043
- const isModelListener = event.startsWith("update:");
2044
- const modelArg = isModelListener && event.slice(7);
2045
- if (modelArg && modelArg in props) {
2046
- const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
2047
- const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2048
- if (trim) {
2049
- args = rawArgs.map((a) => isString(a) ? a.trim() : a);
2050
- }
2051
- if (number) {
2052
- args = rawArgs.map(looseToNumber);
2053
- }
2054
- }
2055
- {
2056
- devtoolsComponentEmit(instance, event, args);
2057
- }
2058
- {
2059
- const lowerCaseEvent = event.toLowerCase();
2060
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2061
- warn$1(
2062
- `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
2063
- instance,
2064
- instance.type
2065
- )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
2066
- event
2067
- )}" instead of "${event}".`
2068
- );
2069
- }
2070
- }
2071
- let handlerName;
2072
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
2073
- props[handlerName = toHandlerKey(camelize(event))];
2074
- if (!handler && isModelListener) {
2075
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
2076
- }
2077
- if (handler) {
2078
- callWithAsyncErrorHandling(
2079
- handler,
2080
- instance,
2081
- 6,
2082
- args
2083
- );
2084
- }
2085
- const onceHandler = props[handlerName + `Once`];
2086
- if (onceHandler) {
2087
- if (!instance.emitted) {
2088
- instance.emitted = {};
2089
- } else if (instance.emitted[handlerName]) {
2090
- return;
2091
- }
2092
- instance.emitted[handlerName] = true;
2093
- callWithAsyncErrorHandling(
2094
- onceHandler,
2095
- instance,
2096
- 6,
2097
- args
2098
- );
2099
- }
2100
- }
2101
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2102
- const cache = appContext.emitsCache;
2103
- const cached = cache.get(comp);
2104
- if (cached !== void 0) {
2105
- return cached;
2106
- }
2107
- const raw = comp.emits;
2108
- let normalized = {};
2109
- let hasExtends = false;
2110
- if (!isFunction(comp)) {
2111
- const extendEmits = (raw2) => {
2112
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
2113
- if (normalizedFromExtend) {
2114
- hasExtends = true;
2115
- extend(normalized, normalizedFromExtend);
2116
- }
2117
- };
2118
- if (!asMixin && appContext.mixins.length) {
2119
- appContext.mixins.forEach(extendEmits);
2120
- }
2121
- if (comp.extends) {
2122
- extendEmits(comp.extends);
2123
- }
2124
- if (comp.mixins) {
2125
- comp.mixins.forEach(extendEmits);
2126
- }
2127
- }
2128
- if (!raw && !hasExtends) {
2129
- if (isObject(comp)) {
2130
- cache.set(comp, null);
2131
- }
2132
- return null;
2133
- }
2134
- if (isArray(raw)) {
2135
- raw.forEach((key) => normalized[key] = null);
2136
- } else {
2137
- extend(normalized, raw);
2138
- }
2139
- if (isObject(comp)) {
2140
- cache.set(comp, normalized);
2141
- }
2142
- return normalized;
2143
- }
2144
- function isEmitListener(options, key) {
2145
- if (!options || !isOn(key)) {
2146
- return false;
2147
- }
2148
- key = key.slice(2).replace(/Once$/, "");
2149
- return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
2150
- }
2151
-
2152
2015
  let currentRenderingInstance = null;
2153
2016
  let currentScopeId = null;
2154
2017
  function setCurrentRenderingInstance$1(instance) {
@@ -2187,308 +2050,86 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2187
2050
  return renderFnWithContext;
2188
2051
  }
2189
2052
 
2190
- let accessedAttrs = false;
2191
- function markAttrsAccessed() {
2192
- accessedAttrs = true;
2193
- }
2194
- function renderComponentRoot$1(instance) {
2195
- const {
2196
- type: Component,
2197
- vnode,
2198
- proxy,
2199
- withProxy,
2200
- propsOptions: [propsOptions],
2201
- slots,
2202
- attrs,
2203
- emit,
2204
- render,
2205
- renderCache,
2206
- props,
2207
- data,
2208
- setupState,
2209
- ctx,
2210
- inheritAttrs
2211
- } = instance;
2212
- const prev = setCurrentRenderingInstance$1(instance);
2213
- let result;
2214
- let fallthroughAttrs;
2215
- {
2216
- accessedAttrs = false;
2053
+ function validateDirectiveName(name) {
2054
+ if (isBuiltInDirective(name)) {
2055
+ warn$1("Do not use built-in directive ids as custom directive id: " + name);
2217
2056
  }
2218
- try {
2219
- if (vnode.shapeFlag & 4) {
2220
- const proxyToUse = withProxy || proxy;
2221
- const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
2222
- get(target, key, receiver) {
2223
- warn$1(
2224
- `Property '${String(
2225
- key
2226
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
2227
- );
2228
- return Reflect.get(target, key, receiver);
2229
- }
2230
- }) : proxyToUse;
2231
- result = normalizeVNode$1(
2232
- render.call(
2233
- thisProxy,
2234
- proxyToUse,
2235
- renderCache,
2236
- true ? shallowReadonly(props) : props,
2237
- setupState,
2238
- data,
2239
- ctx
2240
- )
2241
- );
2242
- fallthroughAttrs = attrs;
2243
- } else {
2244
- const render2 = Component;
2245
- if (attrs === props) {
2246
- markAttrsAccessed();
2247
- }
2248
- result = normalizeVNode$1(
2249
- render2.length > 1 ? render2(
2250
- true ? shallowReadonly(props) : props,
2251
- true ? {
2252
- get attrs() {
2253
- markAttrsAccessed();
2254
- return shallowReadonly(attrs);
2255
- },
2256
- slots,
2257
- emit
2258
- } : { attrs, slots, emit }
2259
- ) : render2(
2260
- true ? shallowReadonly(props) : props,
2261
- null
2262
- )
2263
- );
2264
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
2057
+ }
2058
+ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2059
+ const bindings = vnode.dirs;
2060
+ const oldBindings = prevVNode && prevVNode.dirs;
2061
+ for (let i = 0; i < bindings.length; i++) {
2062
+ const binding = bindings[i];
2063
+ if (oldBindings) {
2064
+ binding.oldValue = oldBindings[i].value;
2065
+ }
2066
+ let hook = binding.dir[name];
2067
+ if (hook) {
2068
+ pauseTracking();
2069
+ callWithAsyncErrorHandling(hook, instance, 8, [
2070
+ vnode.el,
2071
+ binding,
2072
+ vnode,
2073
+ prevVNode
2074
+ ]);
2075
+ resetTracking();
2265
2076
  }
2266
- } catch (err) {
2267
- handleError(err, instance, 1);
2268
- result = createVNode(Comment);
2269
2077
  }
2270
- let root = result;
2271
- let setRoot = void 0;
2272
- if (result.patchFlag > 0 && result.patchFlag & 2048) {
2273
- [root, setRoot] = getChildRoot(result);
2274
- }
2275
- if (fallthroughAttrs && inheritAttrs !== false) {
2276
- const keys = Object.keys(fallthroughAttrs);
2277
- const { shapeFlag } = root;
2278
- if (keys.length) {
2279
- if (shapeFlag & (1 | 6)) {
2280
- if (propsOptions && keys.some(isModelListener)) {
2281
- fallthroughAttrs = filterModelListeners(
2282
- fallthroughAttrs,
2283
- propsOptions
2284
- );
2285
- }
2286
- root = cloneVNode(root, fallthroughAttrs, false, true);
2287
- } else if (!accessedAttrs && root.type !== Comment) {
2288
- const allAttrs = Object.keys(attrs);
2289
- const eventAttrs = [];
2290
- const extraAttrs = [];
2291
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2292
- const key = allAttrs[i];
2293
- if (isOn(key)) {
2294
- if (!isModelListener(key)) {
2295
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2296
- }
2297
- } else {
2298
- extraAttrs.push(key);
2299
- }
2300
- }
2301
- if (extraAttrs.length) {
2302
- warn$1(
2303
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
2304
- );
2305
- }
2306
- if (eventAttrs.length) {
2307
- warn$1(
2308
- `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
2309
- );
2310
- }
2311
- }
2312
- }
2313
- }
2314
- if (vnode.dirs) {
2315
- if (!isElementRoot(root)) {
2316
- warn$1(
2317
- `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2318
- );
2319
- }
2320
- root = cloneVNode(root, null, false, true);
2321
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2322
- }
2323
- if (vnode.transition) {
2324
- if (!isElementRoot(root)) {
2325
- warn$1(
2326
- `Component inside <Transition> renders non-element root node that cannot be animated.`
2327
- );
2328
- }
2329
- root.transition = vnode.transition;
2330
- }
2331
- if (setRoot) {
2332
- setRoot(root);
2078
+ }
2079
+
2080
+ function setTransitionHooks(vnode, hooks) {
2081
+ if (vnode.shapeFlag & 6 && vnode.component) {
2082
+ setTransitionHooks(vnode.component.subTree, hooks);
2083
+ } else if (vnode.shapeFlag & 128) {
2084
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
2085
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
2333
2086
  } else {
2334
- result = root;
2087
+ vnode.transition = hooks;
2335
2088
  }
2336
- setCurrentRenderingInstance$1(prev);
2337
- return result;
2338
2089
  }
2339
- const getChildRoot = (vnode) => {
2340
- const rawChildren = vnode.children;
2341
- const dynamicChildren = vnode.dynamicChildren;
2342
- const childRoot = filterSingleRoot(rawChildren, false);
2343
- if (!childRoot) {
2344
- return [vnode, void 0];
2345
- } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
2346
- return getChildRoot(childRoot);
2347
- }
2348
- const index = rawChildren.indexOf(childRoot);
2349
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
2350
- const setRoot = (updatedRoot) => {
2351
- rawChildren[index] = updatedRoot;
2352
- if (dynamicChildren) {
2353
- if (dynamicIndex > -1) {
2354
- dynamicChildren[dynamicIndex] = updatedRoot;
2355
- } else if (updatedRoot.patchFlag > 0) {
2356
- vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
2357
- }
2358
- }
2359
- };
2360
- return [normalizeVNode$1(childRoot), setRoot];
2361
- };
2362
- function filterSingleRoot(children, recurse = true) {
2363
- let singleRoot;
2364
- for (let i = 0; i < children.length; i++) {
2365
- const child = children[i];
2366
- if (isVNode$2(child)) {
2367
- if (child.type !== Comment || child.children === "v-if") {
2368
- if (singleRoot) {
2369
- return;
2370
- } else {
2371
- singleRoot = child;
2372
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
2373
- return filterSingleRoot(singleRoot.children);
2374
- }
2375
- }
2376
- }
2377
- } else {
2378
- return;
2379
- }
2380
- }
2381
- return singleRoot;
2090
+
2091
+ const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2092
+
2093
+ const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2094
+ function onActivated(hook, target) {
2095
+ registerKeepAliveHook(hook, "a", target);
2382
2096
  }
2383
- const getFunctionalFallthrough = (attrs) => {
2384
- let res;
2385
- for (const key in attrs) {
2386
- if (key === "class" || key === "style" || isOn(key)) {
2387
- (res || (res = {}))[key] = attrs[key];
2388
- }
2389
- }
2390
- return res;
2391
- };
2392
- const filterModelListeners = (attrs, props) => {
2393
- const res = {};
2394
- for (const key in attrs) {
2395
- if (!isModelListener(key) || !(key.slice(9) in props)) {
2396
- res[key] = attrs[key];
2397
- }
2398
- }
2399
- return res;
2400
- };
2401
- const isElementRoot = (vnode) => {
2402
- return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
2403
- };
2404
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
2405
- const { props: prevProps, children: prevChildren, component } = prevVNode;
2406
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
2407
- const emits = component.emitsOptions;
2408
- if ((prevChildren || nextChildren) && isHmrUpdating) {
2409
- return true;
2410
- }
2411
- if (nextVNode.dirs || nextVNode.transition) {
2412
- return true;
2413
- }
2414
- if (optimized && patchFlag >= 0) {
2415
- if (patchFlag & 1024) {
2416
- return true;
2417
- }
2418
- if (patchFlag & 16) {
2419
- if (!prevProps) {
2420
- return !!nextProps;
2421
- }
2422
- return hasPropsChanged(prevProps, nextProps, emits);
2423
- } else if (patchFlag & 8) {
2424
- const dynamicProps = nextVNode.dynamicProps;
2425
- for (let i = 0; i < dynamicProps.length; i++) {
2426
- const key = dynamicProps[i];
2427
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
2428
- return true;
2429
- }
2097
+ function onDeactivated(hook, target) {
2098
+ registerKeepAliveHook(hook, "da", target);
2099
+ }
2100
+ function registerKeepAliveHook(hook, type, target = currentInstance) {
2101
+ const wrappedHook = hook.__wdc || (hook.__wdc = () => {
2102
+ let current = target;
2103
+ while (current) {
2104
+ if (current.isDeactivated) {
2105
+ return;
2430
2106
  }
2107
+ current = current.parent;
2431
2108
  }
2432
- } else {
2433
- if (prevChildren || nextChildren) {
2434
- if (!nextChildren || !nextChildren.$stable) {
2435
- return true;
2109
+ return hook();
2110
+ });
2111
+ injectHook(type, wrappedHook, target);
2112
+ if (target) {
2113
+ let current = target.parent;
2114
+ while (current && current.parent) {
2115
+ if (isKeepAlive(current.parent.vnode)) {
2116
+ injectToKeepAliveRoot(wrappedHook, type, target, current);
2436
2117
  }
2437
- }
2438
- if (prevProps === nextProps) {
2439
- return false;
2440
- }
2441
- if (!prevProps) {
2442
- return !!nextProps;
2443
- }
2444
- if (!nextProps) {
2445
- return true;
2446
- }
2447
- return hasPropsChanged(prevProps, nextProps, emits);
2448
- }
2449
- return false;
2450
- }
2451
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
2452
- const nextKeys = Object.keys(nextProps);
2453
- if (nextKeys.length !== Object.keys(prevProps).length) {
2454
- return true;
2455
- }
2456
- for (let i = 0; i < nextKeys.length; i++) {
2457
- const key = nextKeys[i];
2458
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
2459
- return true;
2460
- }
2461
- }
2462
- return false;
2463
- }
2464
- function updateHOCHostEl({ vnode, parent }, el) {
2465
- while (parent) {
2466
- const root = parent.subTree;
2467
- if (root.suspense && root.suspense.activeBranch === vnode) {
2468
- root.el = vnode.el;
2469
- }
2470
- if (root === vnode) {
2471
- (vnode = parent.vnode).el = el;
2472
- parent = parent.parent;
2473
- } else {
2474
- break;
2118
+ current = current.parent;
2475
2119
  }
2476
2120
  }
2477
2121
  }
2478
-
2479
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2480
-
2481
- const isSuspense = (type) => type.__isSuspense;
2482
- function queueEffectWithSuspense(fn, suspense) {
2483
- if (suspense && suspense.pendingBranch) {
2484
- if (isArray(fn)) {
2485
- suspense.effects.push(...fn);
2486
- } else {
2487
- suspense.effects.push(fn);
2488
- }
2489
- } else {
2490
- queuePostFlushCb(fn);
2491
- }
2122
+ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
2123
+ const injected = injectHook(
2124
+ type,
2125
+ hook,
2126
+ keepAliveRoot,
2127
+ true
2128
+ /* prepend */
2129
+ );
2130
+ onUnmounted(() => {
2131
+ remove(keepAliveRoot[type], injected);
2132
+ }, target);
2492
2133
  }
2493
2134
 
2494
2135
  function injectHook(type, hook, target = currentInstance, prepend = false) {
@@ -2537,34 +2178,7 @@ function onErrorCaptured(hook, target = currentInstance) {
2537
2178
  injectHook("ec", hook, target);
2538
2179
  }
2539
2180
 
2540
- function validateDirectiveName(name) {
2541
- if (isBuiltInDirective(name)) {
2542
- warn$1("Do not use built-in directive ids as custom directive id: " + name);
2543
- }
2544
- }
2545
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2546
- const bindings = vnode.dirs;
2547
- const oldBindings = prevVNode && prevVNode.dirs;
2548
- for (let i = 0; i < bindings.length; i++) {
2549
- const binding = bindings[i];
2550
- if (oldBindings) {
2551
- binding.oldValue = oldBindings[i].value;
2552
- }
2553
- let hook = binding.dir[name];
2554
- if (hook) {
2555
- pauseTracking();
2556
- callWithAsyncErrorHandling(hook, instance, 8, [
2557
- vnode.el,
2558
- binding,
2559
- vnode,
2560
- prevVNode
2561
- ]);
2562
- resetTracking();
2563
- }
2564
- }
2565
- }
2566
-
2567
- const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2181
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2568
2182
 
2569
2183
  const getPublicInstance = (i) => {
2570
2184
  if (!i) return null;
@@ -3624,8 +3238,9 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3624
3238
  }
3625
3239
  return value;
3626
3240
  }
3241
+ const mixinPropsCache = /* @__PURE__ */ new WeakMap();
3627
3242
  function normalizePropsOptions(comp, appContext, asMixin = false) {
3628
- const cache = appContext.propsCache;
3243
+ const cache = asMixin ? mixinPropsCache : appContext.propsCache;
3629
3244
  const cached = cache.get(comp);
3630
3245
  if (cached) {
3631
3246
  return cached;
@@ -3872,13 +3487,22 @@ const normalizeVNodeSlots = (instance, children) => {
3872
3487
  const normalized = normalizeSlotValue(children);
3873
3488
  instance.slots.default = () => normalized;
3874
3489
  };
3875
- const initSlots = (instance, children) => {
3490
+ const assignSlots = (slots, children, optimized) => {
3491
+ for (const key in children) {
3492
+ if (optimized || key !== "_") {
3493
+ slots[key] = children[key];
3494
+ }
3495
+ }
3496
+ };
3497
+ const initSlots = (instance, children, optimized) => {
3876
3498
  const slots = instance.slots = createInternalObject();
3877
3499
  if (instance.vnode.shapeFlag & 32) {
3878
3500
  const type = children._;
3879
3501
  if (type) {
3880
- extend(slots, children);
3881
- def(slots, "_", type, true);
3502
+ assignSlots(slots, children, optimized);
3503
+ if (optimized) {
3504
+ def(slots, "_", type, true);
3505
+ }
3882
3506
  } else {
3883
3507
  normalizeObjectSlots(children, slots);
3884
3508
  }
@@ -3894,15 +3518,12 @@ const updateSlots = (instance, children, optimized) => {
3894
3518
  const type = children._;
3895
3519
  if (type) {
3896
3520
  if (isHmrUpdating) {
3897
- extend(slots, children);
3521
+ assignSlots(slots, children, optimized);
3898
3522
  trigger(instance, "set", "$slots");
3899
3523
  } else if (optimized && type === 1) {
3900
3524
  needDeletionCheck = false;
3901
3525
  } else {
3902
- extend(slots, children);
3903
- if (!optimized && type === 1) {
3904
- delete slots._;
3905
- }
3526
+ assignSlots(slots, children, optimized);
3906
3527
  }
3907
3528
  } else {
3908
3529
  needDeletionCheck = !children.$stable;
@@ -4010,6 +3631,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4010
3631
  }
4011
3632
  }
4012
3633
 
3634
+ const TeleportEndKey = Symbol("_vte");
3635
+ const isTeleport = (type) => type.__isTeleport;
3636
+
4013
3637
  let supported;
4014
3638
  let perf;
4015
3639
  function startMeasure(instance, type) {
@@ -4302,17 +3926,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4302
3926
  if (props) {
4303
3927
  for (const key in props) {
4304
3928
  if (key !== "value" && !isReservedProp(key)) {
4305
- hostPatchProp(
4306
- el,
4307
- key,
4308
- null,
4309
- props[key],
4310
- namespace,
4311
- vnode.children,
4312
- parentComponent,
4313
- parentSuspense,
4314
- unmountChildren
4315
- );
3929
+ hostPatchProp(el, key, null, props[key], namespace, parentComponent);
4316
3930
  }
4317
3931
  }
4318
3932
  if ("value" in props) {
@@ -4407,6 +4021,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4407
4021
  optimized = false;
4408
4022
  dynamicChildren = null;
4409
4023
  }
4024
+ if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
4025
+ hostSetElementText(el, "");
4026
+ }
4410
4027
  if (dynamicChildren) {
4411
4028
  patchBlockChildren(
4412
4029
  n1.dynamicChildren,
@@ -4435,15 +4052,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4435
4052
  }
4436
4053
  if (patchFlag > 0) {
4437
4054
  if (patchFlag & 16) {
4438
- patchProps(
4439
- el,
4440
- n2,
4441
- oldProps,
4442
- newProps,
4443
- parentComponent,
4444
- parentSuspense,
4445
- namespace
4446
- );
4055
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
4447
4056
  } else {
4448
4057
  if (patchFlag & 2) {
4449
4058
  if (oldProps.class !== newProps.class) {
@@ -4460,17 +4069,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4460
4069
  const prev = oldProps[key];
4461
4070
  const next = newProps[key];
4462
4071
  if (next !== prev || key === "value") {
4463
- hostPatchProp(
4464
- el,
4465
- key,
4466
- prev,
4467
- next,
4468
- namespace,
4469
- n1.children,
4470
- parentComponent,
4471
- parentSuspense,
4472
- unmountChildren
4473
- );
4072
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
4474
4073
  }
4475
4074
  }
4476
4075
  }
@@ -4481,15 +4080,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4481
4080
  }
4482
4081
  }
4483
4082
  } else if (!optimized && dynamicChildren == null) {
4484
- patchProps(
4485
- el,
4486
- n2,
4487
- oldProps,
4488
- newProps,
4489
- parentComponent,
4490
- parentSuspense,
4491
- namespace
4492
- );
4083
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
4493
4084
  }
4494
4085
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
4495
4086
  queuePostRenderEffect(() => {
@@ -4529,7 +4120,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4529
4120
  );
4530
4121
  }
4531
4122
  };
4532
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
4123
+ const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
4533
4124
  if (oldProps !== newProps) {
4534
4125
  if (oldProps !== EMPTY_OBJ) {
4535
4126
  for (const key in oldProps) {
@@ -4540,10 +4131,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4540
4131
  oldProps[key],
4541
4132
  null,
4542
4133
  namespace,
4543
- vnode.children,
4544
- parentComponent,
4545
- parentSuspense,
4546
- unmountChildren
4134
+ parentComponent
4547
4135
  );
4548
4136
  }
4549
4137
  }
@@ -4553,17 +4141,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4553
4141
  const next = newProps[key];
4554
4142
  const prev = oldProps[key];
4555
4143
  if (next !== prev && key !== "value") {
4556
- hostPatchProp(
4557
- el,
4558
- key,
4559
- prev,
4560
- next,
4561
- namespace,
4562
- vnode.children,
4563
- parentComponent,
4564
- parentSuspense,
4565
- unmountChildren
4566
- );
4144
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
4567
4145
  }
4568
4146
  }
4569
4147
  if ("value" in newProps) {
@@ -4680,7 +4258,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4680
4258
  {
4681
4259
  startMeasure(instance, `init`);
4682
4260
  }
4683
- setupComponent$1(instance);
4261
+ setupComponent$1(instance, false, optimized);
4684
4262
  {
4685
4263
  endMeasure(instance, `init`);
4686
4264
  }
@@ -4917,12 +4495,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4917
4495
  effect.run();
4918
4496
  }
4919
4497
  };
4498
+ update.i = instance;
4920
4499
  update.id = instance.uid;
4921
4500
  toggleRecurse(instance, true);
4922
4501
  {
4923
4502
  effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
4924
4503
  effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
4925
- update.ownerInstance = instance;
4926
4504
  }
4927
4505
  update();
4928
4506
  };
@@ -5281,7 +4859,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5281
4859
  shapeFlag,
5282
4860
  patchFlag,
5283
4861
  dirs,
5284
- memoIndex
4862
+ cacheIndex
5285
4863
  } = vnode;
5286
4864
  if (patchFlag === -2) {
5287
4865
  optimized = false;
@@ -5289,8 +4867,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5289
4867
  if (ref != null) {
5290
4868
  setRef(ref, null, parentSuspense, vnode, true);
5291
4869
  }
5292
- if (memoIndex != null) {
5293
- parentComponent.renderCache[memoIndex] = void 0;
4870
+ if (cacheIndex != null) {
4871
+ parentComponent.renderCache[cacheIndex] = void 0;
5294
4872
  }
5295
4873
  if (shapeFlag & 256) {
5296
4874
  parentComponent.ctx.deactivate(vnode);
@@ -5320,7 +4898,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5320
4898
  internals,
5321
4899
  doRemove
5322
4900
  );
5323
- } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
4901
+ } else if (dynamicChildren && // #5154
4902
+ // when v-once is used inside a block, setBlockTracking(-1) marks the
4903
+ // parent block with hasOnce: true
4904
+ // so that it doesn't take the fast path during unmount - otherwise
4905
+ // components nested in v-once are never unmounted.
4906
+ !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
5324
4907
  (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
5325
4908
  unmountChildren(
5326
4909
  dynamicChildren,
@@ -5433,7 +5016,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5433
5016
  if (vnode.shapeFlag & 128) {
5434
5017
  return vnode.suspense.next();
5435
5018
  }
5436
- return hostNextSibling(vnode.anchor || vnode.el);
5019
+ const el = hostNextSibling(vnode.anchor || vnode.el);
5020
+ const teleportEnd = el && el[TeleportEndKey];
5021
+ return teleportEnd ? hostNextSibling(teleportEnd) : el;
5437
5022
  };
5438
5023
  let isFlushing = false;
5439
5024
  const render = (vnode, container, namespace) => {
@@ -5755,140 +5340,527 @@ function doWatch(source, cb, {
5755
5340
  remove(scope.effects, effect);
5756
5341
  }
5757
5342
  };
5758
- {
5759
- effect.onTrack = onTrack;
5760
- effect.onTrigger = onTrigger;
5761
- }
5762
- if (cb) {
5763
- if (immediate) {
5764
- job();
5343
+ {
5344
+ effect.onTrack = onTrack;
5345
+ effect.onTrigger = onTrigger;
5346
+ }
5347
+ if (cb) {
5348
+ if (immediate) {
5349
+ job();
5350
+ } else {
5351
+ oldValue = effect.run();
5352
+ }
5353
+ } else if (flush === "post") {
5354
+ queuePostRenderEffect(
5355
+ effect.run.bind(effect),
5356
+ instance && instance.suspense
5357
+ );
5358
+ } else {
5359
+ effect.run();
5360
+ }
5361
+ if (ssrCleanup) ssrCleanup.push(unwatch);
5362
+ return unwatch;
5363
+ }
5364
+ function instanceWatch(source, value, options) {
5365
+ const publicThis = this.proxy;
5366
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
5367
+ let cb;
5368
+ if (isFunction(value)) {
5369
+ cb = value;
5370
+ } else {
5371
+ cb = value.handler;
5372
+ options = value;
5373
+ }
5374
+ const reset = setCurrentInstance(this);
5375
+ const res = doWatch(getter, cb.bind(publicThis), options);
5376
+ reset();
5377
+ return res;
5378
+ }
5379
+ function createPathGetter(ctx, path) {
5380
+ const segments = path.split(".");
5381
+ return () => {
5382
+ let cur = ctx;
5383
+ for (let i = 0; i < segments.length && cur; i++) {
5384
+ cur = cur[segments[i]];
5385
+ }
5386
+ return cur;
5387
+ };
5388
+ }
5389
+ function traverse(value, depth = Infinity, seen) {
5390
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
5391
+ return value;
5392
+ }
5393
+ seen = seen || /* @__PURE__ */ new Set();
5394
+ if (seen.has(value)) {
5395
+ return value;
5396
+ }
5397
+ seen.add(value);
5398
+ depth--;
5399
+ if (isRef(value)) {
5400
+ traverse(value.value, depth, seen);
5401
+ } else if (isArray(value)) {
5402
+ for (let i = 0; i < value.length; i++) {
5403
+ traverse(value[i], depth, seen);
5404
+ }
5405
+ } else if (isSet(value) || isMap(value)) {
5406
+ value.forEach((v) => {
5407
+ traverse(v, depth, seen);
5408
+ });
5409
+ } else if (isPlainObject(value)) {
5410
+ for (const key in value) {
5411
+ traverse(value[key], depth, seen);
5412
+ }
5413
+ for (const key of Object.getOwnPropertySymbols(value)) {
5414
+ if (Object.prototype.propertyIsEnumerable.call(value, key)) {
5415
+ traverse(value[key], depth, seen);
5416
+ }
5417
+ }
5418
+ }
5419
+ return value;
5420
+ }
5421
+
5422
+ const getModelModifiers = (props, modelName) => {
5423
+ return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
5424
+ };
5425
+
5426
+ function emit(instance, event, ...rawArgs) {
5427
+ if (instance.isUnmounted) return;
5428
+ const props = instance.vnode.props || EMPTY_OBJ;
5429
+ {
5430
+ const {
5431
+ emitsOptions,
5432
+ propsOptions: [propsOptions]
5433
+ } = instance;
5434
+ if (emitsOptions) {
5435
+ if (!(event in emitsOptions) && true) {
5436
+ if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
5437
+ warn$1(
5438
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
5439
+ );
5440
+ }
5441
+ } else {
5442
+ const validator = emitsOptions[event];
5443
+ if (isFunction(validator)) {
5444
+ const isValid = validator(...rawArgs);
5445
+ if (!isValid) {
5446
+ warn$1(
5447
+ `Invalid event arguments: event validation failed for event "${event}".`
5448
+ );
5449
+ }
5450
+ }
5451
+ }
5452
+ }
5453
+ }
5454
+ let args = rawArgs;
5455
+ const isModelListener = event.startsWith("update:");
5456
+ const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
5457
+ if (modifiers) {
5458
+ if (modifiers.trim) {
5459
+ args = rawArgs.map((a) => isString(a) ? a.trim() : a);
5460
+ }
5461
+ if (modifiers.number) {
5462
+ args = rawArgs.map(looseToNumber);
5463
+ }
5464
+ }
5465
+ {
5466
+ devtoolsComponentEmit(instance, event, args);
5467
+ }
5468
+ {
5469
+ const lowerCaseEvent = event.toLowerCase();
5470
+ if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
5471
+ warn$1(
5472
+ `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
5473
+ instance,
5474
+ instance.type
5475
+ )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
5476
+ event
5477
+ )}" instead of "${event}".`
5478
+ );
5479
+ }
5480
+ }
5481
+ let handlerName;
5482
+ let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
5483
+ props[handlerName = toHandlerKey(camelize(event))];
5484
+ if (!handler && isModelListener) {
5485
+ handler = props[handlerName = toHandlerKey(hyphenate(event))];
5486
+ }
5487
+ if (handler) {
5488
+ callWithAsyncErrorHandling(
5489
+ handler,
5490
+ instance,
5491
+ 6,
5492
+ args
5493
+ );
5494
+ }
5495
+ const onceHandler = props[handlerName + `Once`];
5496
+ if (onceHandler) {
5497
+ if (!instance.emitted) {
5498
+ instance.emitted = {};
5499
+ } else if (instance.emitted[handlerName]) {
5500
+ return;
5501
+ }
5502
+ instance.emitted[handlerName] = true;
5503
+ callWithAsyncErrorHandling(
5504
+ onceHandler,
5505
+ instance,
5506
+ 6,
5507
+ args
5508
+ );
5509
+ }
5510
+ }
5511
+ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
5512
+ const cache = appContext.emitsCache;
5513
+ const cached = cache.get(comp);
5514
+ if (cached !== void 0) {
5515
+ return cached;
5516
+ }
5517
+ const raw = comp.emits;
5518
+ let normalized = {};
5519
+ let hasExtends = false;
5520
+ if (!isFunction(comp)) {
5521
+ const extendEmits = (raw2) => {
5522
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
5523
+ if (normalizedFromExtend) {
5524
+ hasExtends = true;
5525
+ extend(normalized, normalizedFromExtend);
5526
+ }
5527
+ };
5528
+ if (!asMixin && appContext.mixins.length) {
5529
+ appContext.mixins.forEach(extendEmits);
5530
+ }
5531
+ if (comp.extends) {
5532
+ extendEmits(comp.extends);
5533
+ }
5534
+ if (comp.mixins) {
5535
+ comp.mixins.forEach(extendEmits);
5536
+ }
5537
+ }
5538
+ if (!raw && !hasExtends) {
5539
+ if (isObject(comp)) {
5540
+ cache.set(comp, null);
5541
+ }
5542
+ return null;
5543
+ }
5544
+ if (isArray(raw)) {
5545
+ raw.forEach((key) => normalized[key] = null);
5546
+ } else {
5547
+ extend(normalized, raw);
5548
+ }
5549
+ if (isObject(comp)) {
5550
+ cache.set(comp, normalized);
5551
+ }
5552
+ return normalized;
5553
+ }
5554
+ function isEmitListener(options, key) {
5555
+ if (!options || !isOn(key)) {
5556
+ return false;
5557
+ }
5558
+ key = key.slice(2).replace(/Once$/, "");
5559
+ return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
5560
+ }
5561
+
5562
+ let accessedAttrs = false;
5563
+ function markAttrsAccessed() {
5564
+ accessedAttrs = true;
5565
+ }
5566
+ function renderComponentRoot$1(instance) {
5567
+ const {
5568
+ type: Component,
5569
+ vnode,
5570
+ proxy,
5571
+ withProxy,
5572
+ propsOptions: [propsOptions],
5573
+ slots,
5574
+ attrs,
5575
+ emit,
5576
+ render,
5577
+ renderCache,
5578
+ props,
5579
+ data,
5580
+ setupState,
5581
+ ctx,
5582
+ inheritAttrs
5583
+ } = instance;
5584
+ const prev = setCurrentRenderingInstance$1(instance);
5585
+ let result;
5586
+ let fallthroughAttrs;
5587
+ {
5588
+ accessedAttrs = false;
5589
+ }
5590
+ try {
5591
+ if (vnode.shapeFlag & 4) {
5592
+ const proxyToUse = withProxy || proxy;
5593
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
5594
+ get(target, key, receiver) {
5595
+ warn$1(
5596
+ `Property '${String(
5597
+ key
5598
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
5599
+ );
5600
+ return Reflect.get(target, key, receiver);
5601
+ }
5602
+ }) : proxyToUse;
5603
+ result = normalizeVNode$1(
5604
+ render.call(
5605
+ thisProxy,
5606
+ proxyToUse,
5607
+ renderCache,
5608
+ true ? shallowReadonly(props) : props,
5609
+ setupState,
5610
+ data,
5611
+ ctx
5612
+ )
5613
+ );
5614
+ fallthroughAttrs = attrs;
5615
+ } else {
5616
+ const render2 = Component;
5617
+ if (attrs === props) {
5618
+ markAttrsAccessed();
5619
+ }
5620
+ result = normalizeVNode$1(
5621
+ render2.length > 1 ? render2(
5622
+ true ? shallowReadonly(props) : props,
5623
+ true ? {
5624
+ get attrs() {
5625
+ markAttrsAccessed();
5626
+ return shallowReadonly(attrs);
5627
+ },
5628
+ slots,
5629
+ emit
5630
+ } : { attrs, slots, emit }
5631
+ ) : render2(
5632
+ true ? shallowReadonly(props) : props,
5633
+ null
5634
+ )
5635
+ );
5636
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
5637
+ }
5638
+ } catch (err) {
5639
+ handleError(err, instance, 1);
5640
+ result = createVNode(Comment);
5641
+ }
5642
+ let root = result;
5643
+ let setRoot = void 0;
5644
+ if (result.patchFlag > 0 && result.patchFlag & 2048) {
5645
+ [root, setRoot] = getChildRoot(result);
5646
+ }
5647
+ if (fallthroughAttrs && inheritAttrs !== false) {
5648
+ const keys = Object.keys(fallthroughAttrs);
5649
+ const { shapeFlag } = root;
5650
+ if (keys.length) {
5651
+ if (shapeFlag & (1 | 6)) {
5652
+ if (propsOptions && keys.some(isModelListener)) {
5653
+ fallthroughAttrs = filterModelListeners(
5654
+ fallthroughAttrs,
5655
+ propsOptions
5656
+ );
5657
+ }
5658
+ root = cloneVNode(root, fallthroughAttrs, false, true);
5659
+ } else if (!accessedAttrs && root.type !== Comment) {
5660
+ const allAttrs = Object.keys(attrs);
5661
+ const eventAttrs = [];
5662
+ const extraAttrs = [];
5663
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
5664
+ const key = allAttrs[i];
5665
+ if (isOn(key)) {
5666
+ if (!isModelListener(key)) {
5667
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
5668
+ }
5669
+ } else {
5670
+ extraAttrs.push(key);
5671
+ }
5672
+ }
5673
+ if (extraAttrs.length) {
5674
+ warn$1(
5675
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
5676
+ );
5677
+ }
5678
+ if (eventAttrs.length) {
5679
+ warn$1(
5680
+ `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
5681
+ );
5682
+ }
5683
+ }
5684
+ }
5685
+ }
5686
+ if (vnode.dirs) {
5687
+ if (!isElementRoot(root)) {
5688
+ warn$1(
5689
+ `Runtime directive used on component with non-element root node. The directives will not function as intended.`
5690
+ );
5691
+ }
5692
+ root = cloneVNode(root, null, false, true);
5693
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5694
+ }
5695
+ if (vnode.transition) {
5696
+ if (!isElementRoot(root)) {
5697
+ warn$1(
5698
+ `Component inside <Transition> renders non-element root node that cannot be animated.`
5699
+ );
5700
+ }
5701
+ root.transition = vnode.transition;
5702
+ }
5703
+ if (setRoot) {
5704
+ setRoot(root);
5705
+ } else {
5706
+ result = root;
5707
+ }
5708
+ setCurrentRenderingInstance$1(prev);
5709
+ return result;
5710
+ }
5711
+ const getChildRoot = (vnode) => {
5712
+ const rawChildren = vnode.children;
5713
+ const dynamicChildren = vnode.dynamicChildren;
5714
+ const childRoot = filterSingleRoot(rawChildren, false);
5715
+ if (!childRoot) {
5716
+ return [vnode, void 0];
5717
+ } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
5718
+ return getChildRoot(childRoot);
5719
+ }
5720
+ const index = rawChildren.indexOf(childRoot);
5721
+ const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
5722
+ const setRoot = (updatedRoot) => {
5723
+ rawChildren[index] = updatedRoot;
5724
+ if (dynamicChildren) {
5725
+ if (dynamicIndex > -1) {
5726
+ dynamicChildren[dynamicIndex] = updatedRoot;
5727
+ } else if (updatedRoot.patchFlag > 0) {
5728
+ vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
5729
+ }
5730
+ }
5731
+ };
5732
+ return [normalizeVNode$1(childRoot), setRoot];
5733
+ };
5734
+ function filterSingleRoot(children, recurse = true) {
5735
+ let singleRoot;
5736
+ for (let i = 0; i < children.length; i++) {
5737
+ const child = children[i];
5738
+ if (isVNode$2(child)) {
5739
+ if (child.type !== Comment || child.children === "v-if") {
5740
+ if (singleRoot) {
5741
+ return;
5742
+ } else {
5743
+ singleRoot = child;
5744
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
5745
+ return filterSingleRoot(singleRoot.children);
5746
+ }
5747
+ }
5748
+ }
5765
5749
  } else {
5766
- oldValue = effect.run();
5750
+ return;
5767
5751
  }
5768
- } else if (flush === "post") {
5769
- queuePostRenderEffect(
5770
- effect.run.bind(effect),
5771
- instance && instance.suspense
5772
- );
5773
- } else {
5774
- effect.run();
5775
5752
  }
5776
- if (ssrCleanup) ssrCleanup.push(unwatch);
5777
- return unwatch;
5753
+ return singleRoot;
5778
5754
  }
5779
- function instanceWatch(source, value, options) {
5780
- const publicThis = this.proxy;
5781
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
5782
- let cb;
5783
- if (isFunction(value)) {
5784
- cb = value;
5785
- } else {
5786
- cb = value.handler;
5787
- options = value;
5755
+ const getFunctionalFallthrough = (attrs) => {
5756
+ let res;
5757
+ for (const key in attrs) {
5758
+ if (key === "class" || key === "style" || isOn(key)) {
5759
+ (res || (res = {}))[key] = attrs[key];
5760
+ }
5788
5761
  }
5789
- const reset = setCurrentInstance(this);
5790
- const res = doWatch(getter, cb.bind(publicThis), options);
5791
- reset();
5792
5762
  return res;
5793
- }
5794
- function createPathGetter(ctx, path) {
5795
- const segments = path.split(".");
5796
- return () => {
5797
- let cur = ctx;
5798
- for (let i = 0; i < segments.length && cur; i++) {
5799
- cur = cur[segments[i]];
5763
+ };
5764
+ const filterModelListeners = (attrs, props) => {
5765
+ const res = {};
5766
+ for (const key in attrs) {
5767
+ if (!isModelListener(key) || !(key.slice(9) in props)) {
5768
+ res[key] = attrs[key];
5800
5769
  }
5801
- return cur;
5802
- };
5803
- }
5804
- function traverse(value, depth = Infinity, seen) {
5805
- if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
5806
- return value;
5807
5770
  }
5808
- seen = seen || /* @__PURE__ */ new Set();
5809
- if (seen.has(value)) {
5810
- return value;
5771
+ return res;
5772
+ };
5773
+ const isElementRoot = (vnode) => {
5774
+ return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
5775
+ };
5776
+ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
5777
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
5778
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
5779
+ const emits = component.emitsOptions;
5780
+ if ((prevChildren || nextChildren) && isHmrUpdating) {
5781
+ return true;
5811
5782
  }
5812
- seen.add(value);
5813
- depth--;
5814
- if (isRef(value)) {
5815
- traverse(value.value, depth, seen);
5816
- } else if (isArray(value)) {
5817
- for (let i = 0; i < value.length; i++) {
5818
- traverse(value[i], depth, seen);
5783
+ if (nextVNode.dirs || nextVNode.transition) {
5784
+ return true;
5785
+ }
5786
+ if (optimized && patchFlag >= 0) {
5787
+ if (patchFlag & 1024) {
5788
+ return true;
5819
5789
  }
5820
- } else if (isSet(value) || isMap(value)) {
5821
- value.forEach((v) => {
5822
- traverse(v, depth, seen);
5823
- });
5824
- } else if (isPlainObject(value)) {
5825
- for (const key in value) {
5826
- traverse(value[key], depth, seen);
5790
+ if (patchFlag & 16) {
5791
+ if (!prevProps) {
5792
+ return !!nextProps;
5793
+ }
5794
+ return hasPropsChanged(prevProps, nextProps, emits);
5795
+ } else if (patchFlag & 8) {
5796
+ const dynamicProps = nextVNode.dynamicProps;
5797
+ for (let i = 0; i < dynamicProps.length; i++) {
5798
+ const key = dynamicProps[i];
5799
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
5800
+ return true;
5801
+ }
5802
+ }
5827
5803
  }
5828
- for (const key of Object.getOwnPropertySymbols(value)) {
5829
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
5830
- traverse(value[key], depth, seen);
5804
+ } else {
5805
+ if (prevChildren || nextChildren) {
5806
+ if (!nextChildren || !nextChildren.$stable) {
5807
+ return true;
5831
5808
  }
5832
5809
  }
5810
+ if (prevProps === nextProps) {
5811
+ return false;
5812
+ }
5813
+ if (!prevProps) {
5814
+ return !!nextProps;
5815
+ }
5816
+ if (!nextProps) {
5817
+ return true;
5818
+ }
5819
+ return hasPropsChanged(prevProps, nextProps, emits);
5833
5820
  }
5834
- return value;
5835
- }
5836
-
5837
- const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
5838
- function onActivated(hook, target) {
5839
- registerKeepAliveHook(hook, "a", target);
5821
+ return false;
5840
5822
  }
5841
- function onDeactivated(hook, target) {
5842
- registerKeepAliveHook(hook, "da", target);
5823
+ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
5824
+ const nextKeys = Object.keys(nextProps);
5825
+ if (nextKeys.length !== Object.keys(prevProps).length) {
5826
+ return true;
5827
+ }
5828
+ for (let i = 0; i < nextKeys.length; i++) {
5829
+ const key = nextKeys[i];
5830
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
5831
+ return true;
5832
+ }
5833
+ }
5834
+ return false;
5843
5835
  }
5844
- function registerKeepAliveHook(hook, type, target = currentInstance) {
5845
- const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5846
- let current = target;
5847
- while (current) {
5848
- if (current.isDeactivated) {
5849
- return;
5850
- }
5851
- current = current.parent;
5836
+ function updateHOCHostEl({ vnode, parent }, el) {
5837
+ while (parent) {
5838
+ const root = parent.subTree;
5839
+ if (root.suspense && root.suspense.activeBranch === vnode) {
5840
+ root.el = vnode.el;
5852
5841
  }
5853
- return hook();
5854
- });
5855
- injectHook(type, wrappedHook, target);
5856
- if (target) {
5857
- let current = target.parent;
5858
- while (current && current.parent) {
5859
- if (isKeepAlive(current.parent.vnode)) {
5860
- injectToKeepAliveRoot(wrappedHook, type, target, current);
5861
- }
5862
- current = current.parent;
5842
+ if (root === vnode) {
5843
+ (vnode = parent.vnode).el = el;
5844
+ parent = parent.parent;
5845
+ } else {
5846
+ break;
5863
5847
  }
5864
5848
  }
5865
5849
  }
5866
- function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5867
- const injected = injectHook(
5868
- type,
5869
- hook,
5870
- keepAliveRoot,
5871
- true
5872
- /* prepend */
5873
- );
5874
- onUnmounted(() => {
5875
- remove(keepAliveRoot[type], injected);
5876
- }, target);
5877
- }
5878
5850
 
5879
- function setTransitionHooks(vnode, hooks) {
5880
- if (vnode.shapeFlag & 6 && vnode.component) {
5881
- setTransitionHooks(vnode.component.subTree, hooks);
5882
- } else if (vnode.shapeFlag & 128) {
5883
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
5884
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
5851
+ const isSuspense = (type) => type.__isSuspense;
5852
+ function queueEffectWithSuspense(fn, suspense) {
5853
+ if (suspense && suspense.pendingBranch) {
5854
+ if (isArray(fn)) {
5855
+ suspense.effects.push(...fn);
5856
+ } else {
5857
+ suspense.effects.push(fn);
5858
+ }
5885
5859
  } else {
5886
- vnode.transition = hooks;
5860
+ queuePostFlushCb(fn);
5887
5861
  }
5888
5862
  }
5889
5863
 
5890
- const isTeleport = (type) => type.__isTeleport;
5891
-
5892
5864
  const Fragment = Symbol.for("v-fgt");
5893
5865
  const Text = Symbol.for("v-txt");
5894
5866
  const Comment = Symbol.for("v-cmt");
@@ -5897,15 +5869,21 @@ let currentBlock = null;
5897
5869
  let isBlockTreeEnabled = 1;
5898
5870
  function setBlockTracking(value) {
5899
5871
  isBlockTreeEnabled += value;
5872
+ if (value < 0 && currentBlock) {
5873
+ currentBlock.hasOnce = true;
5874
+ }
5900
5875
  }
5901
5876
  function isVNode$2(value) {
5902
5877
  return value ? value.__v_isVNode === true : false;
5903
5878
  }
5904
5879
  function isSameVNodeType(n1, n2) {
5905
- if (n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) {
5906
- n1.shapeFlag &= ~256;
5907
- n2.shapeFlag &= ~512;
5908
- return false;
5880
+ if (n2.shapeFlag & 6 && n1.component) {
5881
+ const dirtyInstances = hmrDirtyComponents.get(n2.type);
5882
+ if (dirtyInstances && dirtyInstances.has(n1.component)) {
5883
+ n1.shapeFlag &= ~256;
5884
+ n2.shapeFlag &= ~512;
5885
+ return false;
5886
+ }
5909
5887
  }
5910
5888
  return n1.type === n2.type && n1.key === n2.key;
5911
5889
  }
@@ -5945,6 +5923,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
5945
5923
  el: null,
5946
5924
  anchor: null,
5947
5925
  target: null,
5926
+ targetStart: null,
5948
5927
  targetAnchor: null,
5949
5928
  staticCount: 0,
5950
5929
  shapeFlag,
@@ -6066,6 +6045,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
6066
6045
  slotScopeIds: vnode.slotScopeIds,
6067
6046
  children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
6068
6047
  target: vnode.target,
6048
+ targetStart: vnode.targetStart,
6069
6049
  targetAnchor: vnode.targetAnchor,
6070
6050
  staticCount: vnode.staticCount,
6071
6051
  shapeFlag: vnode.shapeFlag,
@@ -6345,12 +6325,12 @@ function isStatefulComponent(instance) {
6345
6325
  return instance.vnode.shapeFlag & 4;
6346
6326
  }
6347
6327
  let isInSSRComponentSetup = false;
6348
- function setupComponent$1(instance, isSSR = false) {
6328
+ function setupComponent$1(instance, isSSR = false, optimized = false) {
6349
6329
  isSSR && setInSSRSetupState(isSSR);
6350
6330
  const { props, children } = instance.vnode;
6351
6331
  const isStateful = isStatefulComponent(instance);
6352
6332
  initProps(instance, props, isStateful, isSSR);
6353
- initSlots(instance, children);
6333
+ initSlots(instance, children, optimized);
6354
6334
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
6355
6335
  isSSR && setInSSRSetupState(false);
6356
6336
  return setupResult;
@@ -6626,7 +6606,7 @@ const computed = (getterOrOptions, debugOptions) => {
6626
6606
  return c;
6627
6607
  };
6628
6608
 
6629
- const version = "3.4.30";
6609
+ const version = "3.4.32";
6630
6610
  const warn = warn$1 ;
6631
6611
  const _ssrUtils = {
6632
6612
  createComponentInstance: createComponentInstance$1,
@@ -6847,12 +6827,10 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
6847
6827
  }
6848
6828
  }
6849
6829
 
6850
- function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
6830
+ function patchDOMProp(el, key, value, parentComponent) {
6851
6831
  if (key === "innerHTML" || key === "textContent") {
6852
- if (prevChildren) {
6853
- unmountChildren(prevChildren, parentComponent, parentSuspense);
6854
- }
6855
- el[key] = value == null ? "" : value;
6832
+ if (value === null) return;
6833
+ el[key] = value;
6856
6834
  return;
6857
6835
  }
6858
6836
  const tag = el.tagName;
@@ -6983,7 +6961,7 @@ function patchStopImmediatePropagation(e, value) {
6983
6961
 
6984
6962
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
6985
6963
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
6986
- const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
6964
+ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
6987
6965
  const isSVG = namespace === "svg";
6988
6966
  if (key === "class") {
6989
6967
  patchClass(el, nextValue, isSVG);
@@ -6994,15 +6972,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, paren
6994
6972
  patchEvent(el, key, prevValue, nextValue, parentComponent);
6995
6973
  }
6996
6974
  } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
6997
- patchDOMProp(
6998
- el,
6999
- key,
7000
- nextValue,
7001
- prevChildren,
7002
- parentComponent,
7003
- parentSuspense,
7004
- unmountChildren
7005
- );
6975
+ patchDOMProp(el, key, nextValue);
7006
6976
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
7007
6977
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
7008
6978
  }
@@ -7566,9 +7536,9 @@ function createBuffer() {
7566
7536
  const isStringItem = isString(item);
7567
7537
  if (appendable && isStringItem) {
7568
7538
  buffer[buffer.length - 1] += item;
7569
- } else {
7570
- buffer.push(item);
7539
+ return;
7571
7540
  }
7541
+ buffer.push(item);
7572
7542
  appendable = isStringItem;
7573
7543
  if (isPromise(item) || isArray(item) && item.hasAsync) {
7574
7544
  buffer.hasAsync = true;
@@ -7832,24 +7802,36 @@ function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
7832
7802
  }
7833
7803
 
7834
7804
  const { isVNode: isVNode$1 } = ssrUtils;
7835
- async function unrollBuffer$1(buffer) {
7836
- if (buffer.hasAsync) {
7837
- let ret = "";
7838
- for (let i = 0; i < buffer.length; i++) {
7839
- let item = buffer[i];
7840
- if (isPromise(item)) {
7841
- item = await item;
7842
- }
7843
- if (isString(item)) {
7844
- ret += item;
7845
- } else {
7846
- ret += await unrollBuffer$1(item);
7847
- }
7805
+ function nestedUnrollBuffer(buffer, parentRet, startIndex) {
7806
+ if (!buffer.hasAsync) {
7807
+ return parentRet + unrollBufferSync$1(buffer);
7808
+ }
7809
+ let ret = parentRet;
7810
+ for (let i = startIndex; i < buffer.length; i += 1) {
7811
+ const item = buffer[i];
7812
+ if (isString(item)) {
7813
+ ret += item;
7814
+ continue;
7848
7815
  }
7849
- return ret;
7850
- } else {
7851
- return unrollBufferSync$1(buffer);
7816
+ if (isPromise(item)) {
7817
+ return item.then((nestedItem) => {
7818
+ buffer[i] = nestedItem;
7819
+ return nestedUnrollBuffer(buffer, ret, i);
7820
+ });
7821
+ }
7822
+ const result = nestedUnrollBuffer(item, ret, 0);
7823
+ if (isPromise(result)) {
7824
+ return result.then((nestedItem) => {
7825
+ buffer[i] = nestedItem;
7826
+ return nestedUnrollBuffer(buffer, "", i);
7827
+ });
7828
+ }
7829
+ ret = result;
7852
7830
  }
7831
+ return ret;
7832
+ }
7833
+ function unrollBuffer$1(buffer) {
7834
+ return nestedUnrollBuffer(buffer, "", 0);
7853
7835
  }
7854
7836
  function unrollBufferSync$1(buffer) {
7855
7837
  let ret = "";