@vue/compat 3.6.0-rc.14 → 3.6.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.14
2
+ * @vue/compat v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -70,10 +70,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
70
70
  const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
71
71
  const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
72
72
  const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
73
+ const STRING_CACHE_MAX_SIZE = 1e4;
73
74
  const cacheStringFunction = (fn) => {
74
- const cache = Object.create(null);
75
+ let cache = Object.create(null);
76
+ let size = 0;
75
77
  return ((str) => {
76
- return cache[str] || (cache[str] = fn(str));
78
+ const hit = cache[str];
79
+ if (hit !== void 0) return hit;
80
+ if (++size > STRING_CACHE_MAX_SIZE) {
81
+ cache = Object.create(null);
82
+ size = 1;
83
+ }
84
+ return cache[str] = fn(str);
77
85
  });
78
86
  };
79
87
  const camelizeRE = /-(\w)/g;
@@ -81,22 +89,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
81
89
  /**
82
90
  * @private
83
91
  */
84
- const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
92
+ const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
85
93
  const hyphenateRE = /\B([A-Z])/g;
86
94
  /**
87
95
  * @private
88
96
  */
89
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
97
+ const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
90
98
  /**
91
99
  * @private
92
100
  */
93
- const capitalize = cacheStringFunction((str) => {
101
+ const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
94
102
  return str.charAt(0).toUpperCase() + str.slice(1);
95
103
  });
96
104
  /**
97
105
  * @private
98
106
  */
99
- const toHandlerKey = cacheStringFunction((str) => {
107
+ const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
100
108
  return str ? `on${capitalize(str)}` : ``;
101
109
  });
102
110
  /**
@@ -300,26 +308,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
300
308
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
301
309
  */
302
310
  const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
303
- //#endregion
304
- //#region packages/shared/src/domAttrConfig.ts
305
- /**
306
- * On the client we only need to offer special cases for boolean attributes that
307
- * have different names from their corresponding dom properties:
308
- * - itemscope -> N/A
309
- * - allowfullscreen -> allowFullscreen
310
- * - formnovalidate -> formNoValidate
311
- * - ismap -> isMap
312
- * - nomodule -> noModule
313
- * - novalidate -> noValidate
314
- * - playsinline -> playsInline
315
- * - readonly -> readOnly
316
- */
317
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
318
- const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
311
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
319
312
  /**
320
313
  * The full list is needed during SSR to produce the correct initial markup.
321
314
  */
322
- const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
315
+ const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
323
316
  /**
324
317
  * Boolean attributes should be included if the value is truthy or ''.
325
318
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -530,40 +523,16 @@ function isVaporBranchStart(data) {
530
523
  }
531
524
  return true;
532
525
  }
533
- //#endregion
534
- //#region packages/reactivity/src/debug.ts
535
- const triggerEventInfos = [];
536
- function onTrack(sub, debugInfo) {
537
- if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
538
- }
539
- function onTrigger(sub) {
540
- if (sub.onTrigger) {
541
- const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
542
- sub.onTrigger(extend({ effect: sub }, debugInfo));
543
- }
544
- }
545
- function setupOnTrigger(target) {
546
- Object.defineProperty(target.prototype, "onTrigger", {
547
- get() {
548
- return this._onTrigger;
549
- },
550
- set(val) {
551
- if (val && !this._onTrigger) setupFlagsHandler(this);
552
- this._onTrigger = val;
553
- }
554
- });
526
+ /**
527
+ * The data of a comment opening a range only a vapor server render emits:
528
+ * `<!--{-->` around the render of a component, or a v-if branch's.
529
+ */
530
+ function isVaporRangeStart(data) {
531
+ return data === "{" || isVaporBranchStart(data);
555
532
  }
556
- function setupFlagsHandler(target) {
557
- target._flags = target.flags;
558
- Object.defineProperty(target, "flags", {
559
- get() {
560
- return target._flags;
561
- },
562
- set(value) {
563
- if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
564
- target._flags = value;
565
- }
566
- });
533
+ /** The data of the comment closing the range `open` opens. */
534
+ function rangeCloseOf(open) {
535
+ return open === "(" ? ")" : open === "{" ? "}" : "]";
567
536
  }
568
537
  //#endregion
569
538
  //#region packages/reactivity/src/warning.ts
@@ -575,13 +544,7 @@ function warn$2(msg, ...args) {
575
544
  const notifyBuffer = [];
576
545
  let batchDepth = 0;
577
546
  let activeSub = void 0;
578
- let runDepth = 0;
579
- function incRunDepth() {
580
- ++runDepth;
581
- }
582
- function decRunDepth() {
583
- --runDepth;
584
- }
547
+ const CHECKING = 512;
585
548
  let globalVersion = 0;
586
549
  let notifyIndex = 0;
587
550
  let notifyBufferLength = 0;
@@ -630,6 +593,7 @@ function unlink(link, sub = link.sub) {
630
593
  const nextDep = link.nextDep;
631
594
  const nextSub = link.nextSub;
632
595
  const prevSub = link.prevSub;
596
+ link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
633
597
  if (nextDep !== void 0) nextDep.prevDep = prevDep;
634
598
  else sub.depsTail = prevDep;
635
599
  if (prevDep !== void 0) prevDep.nextDep = nextDep;
@@ -637,7 +601,7 @@ function unlink(link, sub = link.sub) {
637
601
  if (nextSub !== void 0) nextSub.prevSub = prevSub;
638
602
  else dep.subsTail = prevSub;
639
603
  if (prevSub !== void 0) prevSub.nextSub = nextSub;
640
- else if ((dep.subs = nextSub) === void 0) {
604
+ else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
641
605
  let toRemove = dep.deps;
642
606
  if (toRemove !== void 0) {
643
607
  do
@@ -655,14 +619,12 @@ function propagate(link) {
655
619
  const sub = link.sub;
656
620
  let flags = sub.flags;
657
621
  if (flags & 3) {
658
- if (!(flags & 60)) {
659
- sub.flags = flags | 32;
660
- if (runDepth) sub.flags |= 8;
661
- } else if (!(flags & 12)) flags = 0;
622
+ if (!(flags & 44)) sub.flags = flags | 32;
623
+ else if (!(flags & 12)) flags = 0;
662
624
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
663
625
  else if (!(flags & 48) && isValidLink(link, sub)) {
664
626
  sub.flags = flags | 40;
665
- flags &= 1;
627
+ flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
666
628
  } else flags = 0;
667
629
  if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
668
630
  if (flags & 1) {
@@ -698,7 +660,7 @@ function propagate(link) {
698
660
  function startTracking(sub) {
699
661
  ++globalVersion;
700
662
  sub.depsTail = void 0;
701
- sub.flags = sub.flags & -57 | 4;
663
+ sub.flags = sub.flags & -569 | 4;
702
664
  return setActiveSub(sub);
703
665
  }
704
666
  function endTracking(sub, prevSub) {
@@ -706,8 +668,11 @@ function endTracking(sub, prevSub) {
706
668
  activeSub = prevSub;
707
669
  const depsTail = sub.depsTail;
708
670
  let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
709
- while (toRemove !== void 0) toRemove = unlink(toRemove, sub);
710
- sub.flags &= -5;
671
+ while (toRemove !== void 0) {
672
+ unlink(toRemove, sub);
673
+ toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
674
+ }
675
+ if ((sub.flags &= -5) & 8) markRecursed(sub);
711
676
  }
712
677
  function flush() {
713
678
  let hasError = false;
@@ -729,45 +694,67 @@ function flush() {
729
694
  if (hasError) throw error;
730
695
  }
731
696
  function checkDirty(link, sub) {
697
+ try {
698
+ return walkDirty(link, sub);
699
+ } catch (err) {
700
+ markStale(sub);
701
+ throw err;
702
+ }
703
+ }
704
+ function walkDirty(link, sub) {
705
+ const root = sub;
732
706
  let stack;
733
707
  let checkDepth = 0;
708
+ let staleDepth = 0;
709
+ let staleFloor = 0;
734
710
  top: do {
735
711
  const dep = link.dep;
736
712
  const depFlags = dep.flags;
737
713
  let dirty = false;
738
714
  if (sub.flags & 16) dirty = true;
739
715
  else if ((depFlags & 17) === 17) {
740
- const subs = dep.subs;
741
716
  if (dep.update()) {
742
- if (subs.nextSub !== void 0) shallowPropagate(subs);
717
+ const subs = dep.subs;
718
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
743
719
  dirty = true;
744
720
  }
745
721
  } else if ((depFlags & 33) === 33) {
746
- stack = {
747
- value: link,
748
- prev: stack
749
- };
750
- link = dep.deps;
751
- sub = dep;
752
- ++checkDepth;
753
- continue;
722
+ const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
723
+ if (depth < 0) {
724
+ if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
725
+ stack = {
726
+ value: link,
727
+ prev: stack
728
+ };
729
+ link = dep.deps;
730
+ sub = dep;
731
+ ++checkDepth;
732
+ continue;
733
+ }
734
+ if (depth < checkDepth) {
735
+ staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
736
+ staleDepth = checkDepth;
737
+ }
754
738
  }
755
739
  if (!dirty && link.nextDep !== void 0) {
756
740
  link = link.nextDep;
757
741
  continue;
758
742
  }
759
743
  while (checkDepth) {
744
+ const stale = checkDepth === staleDepth;
745
+ if (stale && --staleDepth === staleFloor) staleDepth = 0;
760
746
  --checkDepth;
761
747
  link = stack.value;
762
748
  stack = stack.prev;
763
749
  if (dirty) {
764
- const subs = sub.subs;
765
750
  if (sub.update()) {
766
- if (subs.nextSub !== void 0) shallowPropagate(subs);
751
+ const subs = sub.subs;
752
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
767
753
  sub = link.sub;
768
754
  continue;
769
755
  }
770
- } else sub.flags &= -33;
756
+ } else if (stale) sub.flags = sub.flags & -545 | 16;
757
+ else sub.flags &= -545;
771
758
  sub = link.sub;
772
759
  if (link.nextDep !== void 0) {
773
760
  link = link.nextDep;
@@ -775,9 +762,21 @@ function checkDirty(link, sub) {
775
762
  }
776
763
  dirty = false;
777
764
  }
778
- return dirty && !!sub.flags;
765
+ return (dirty || !!(sub.flags & 16)) && !!sub.flags;
779
766
  } while (true);
780
767
  }
768
+ function checkingDepth(dep, stack, depth) {
769
+ for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
770
+ return -1;
771
+ }
772
+ function markStale(sub) {
773
+ const nodes = [sub];
774
+ do {
775
+ sub = nodes.pop();
776
+ sub.flags = sub.flags & -33 | 16;
777
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
778
+ } while (nodes.length);
779
+ }
781
780
  function shallowPropagate(link) {
782
781
  do {
783
782
  const sub = link.sub;
@@ -795,6 +794,71 @@ function isValidLink(checkLink, sub) {
795
794
  }
796
795
  return false;
797
796
  }
797
+ function markRecursed(sub) {
798
+ const nodes = [sub];
799
+ do {
800
+ sub = nodes.pop();
801
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) {
802
+ const dep = link.dep;
803
+ if ((dep.flags & 40) === 32) {
804
+ dep.flags |= 8;
805
+ nodes.push(dep);
806
+ }
807
+ }
808
+ } while (nodes.length);
809
+ }
810
+ //#endregion
811
+ //#region packages/reactivity/src/debug.ts
812
+ const triggered = [];
813
+ function onTrack(sub, debugInfo) {
814
+ if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
815
+ }
816
+ function onTrigger(sub, debugInfo) {
817
+ if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
818
+ }
819
+ function startTrigger() {
820
+ triggered.push([]);
821
+ }
822
+ function endTrigger(debugInfo) {
823
+ const subs = triggered.pop();
824
+ if (subs.length) {
825
+ startBatch();
826
+ try {
827
+ for (let i = 0; i < subs.length; i++) {
828
+ const sub = subs[i];
829
+ if (sub.flags & 3) onTrigger(sub, debugInfo);
830
+ }
831
+ } finally {
832
+ endBatch();
833
+ }
834
+ }
835
+ }
836
+ function setupOnTrigger(target) {
837
+ Object.defineProperty(target.prototype, "onTrigger", {
838
+ get() {
839
+ return this._onTrigger;
840
+ },
841
+ set(val) {
842
+ if (val && !this._onTrigger) setupFlagsHandler(this);
843
+ this._onTrigger = val;
844
+ }
845
+ });
846
+ }
847
+ function setupFlagsHandler(target) {
848
+ target._flags = target.flags;
849
+ Object.defineProperty(target, "flags", {
850
+ get() {
851
+ return target._flags;
852
+ },
853
+ set(value) {
854
+ if (!(target._flags & 48) && !!(value & 48)) {
855
+ if (triggered.length) triggered[triggered.length - 1].push(this);
856
+ else onTrigger(this);
857
+ }
858
+ target._flags = value;
859
+ }
860
+ });
861
+ }
798
862
  //#endregion
799
863
  //#region packages/reactivity/src/dep.ts
800
864
  var Dep = class {
@@ -854,20 +918,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
854
918
  if (!depsMap) return;
855
919
  const run = (dep) => {
856
920
  if (dep !== void 0 && dep.subs !== void 0) {
857
- triggerEventInfos.push({
858
- target,
859
- type,
860
- key,
861
- newValue,
862
- oldValue,
863
- oldTarget
864
- });
865
921
  propagate(dep.subs);
866
922
  shallowPropagate(dep.subs);
867
- triggerEventInfos.pop();
868
923
  }
869
924
  };
870
925
  startBatch();
926
+ startTrigger();
871
927
  if (type === "clear") depsMap.forEach(run);
872
928
  else {
873
929
  const targetIsArray = isArray(target);
@@ -897,6 +953,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
897
953
  }
898
954
  }
899
955
  }
956
+ endTrigger({
957
+ target,
958
+ type,
959
+ key,
960
+ newValue,
961
+ oldValue,
962
+ oldTarget
963
+ });
900
964
  endBatch();
901
965
  }
902
966
  function getDepFromReactive(object, key) {
@@ -1111,7 +1175,7 @@ function noTracking(self, method, args = []) {
1111
1175
  //#endregion
1112
1176
  //#region packages/reactivity/src/baseHandlers.ts
1113
1177
  const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1114
- const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1178
+ const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1115
1179
  function hasOwnProperty(key) {
1116
1180
  if (!isSymbol(key)) key = String(key);
1117
1181
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1695,16 +1759,16 @@ var RefImpl = class {
1695
1759
  this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1696
1760
  const subs = this.subs;
1697
1761
  if (subs !== void 0) {
1698
- triggerEventInfos.push({
1762
+ startTrigger();
1763
+ propagate(subs);
1764
+ endTrigger({
1699
1765
  target: this,
1700
1766
  type: "set",
1701
1767
  key: "value",
1702
1768
  newValue,
1703
1769
  oldValue
1704
1770
  });
1705
- propagate(subs);
1706
1771
  if (!batchDepth) flush();
1707
- triggerEventInfos.pop();
1708
1772
  }
1709
1773
  }
1710
1774
  }
@@ -1741,8 +1805,10 @@ var RefImpl = class {
1741
1805
  function triggerRef(ref) {
1742
1806
  const dep = ref.dep;
1743
1807
  if (dep !== void 0 && dep.subs !== void 0) {
1808
+ startTrigger();
1744
1809
  propagate(dep.subs);
1745
1810
  shallowPropagate(dep.subs);
1811
+ endTrigger();
1746
1812
  if (!batchDepth) flush();
1747
1813
  }
1748
1814
  }
@@ -1933,6 +1999,10 @@ var ReactiveEffect = class {
1933
1999
  get active() {
1934
2000
  return !(this.flags & 1024);
1935
2001
  }
2002
+ /** @internal */
2003
+ get running() {
2004
+ return !!(this.flags & 4);
2005
+ }
1936
2006
  pause() {
1937
2007
  this.flags |= 256;
1938
2008
  }
@@ -1946,11 +2016,9 @@ var ReactiveEffect = class {
1946
2016
  if (!this.active) return this.fn();
1947
2017
  cleanup(this);
1948
2018
  const prevSub = startTracking(this);
1949
- incRunDepth();
1950
2019
  try {
1951
2020
  return this.fn();
1952
2021
  } finally {
1953
- decRunDepth();
1954
2022
  endTracking(this, prevSub);
1955
2023
  const flags = this.flags;
1956
2024
  if ((flags & 136) === 136) {
@@ -1973,9 +2041,9 @@ var ReactiveEffect = class {
1973
2041
  if (flags & 16) return true;
1974
2042
  if (flags & 32) {
1975
2043
  if (checkDirty(this.deps, this)) {
1976
- this.flags = flags | 16;
2044
+ if (this.active) this.flags |= 16;
1977
2045
  return true;
1978
- } else this.flags = flags & -33;
2046
+ } else this.flags &= -33;
1979
2047
  }
1980
2048
  return false;
1981
2049
  }
@@ -1987,20 +2055,17 @@ function effect(fn, options) {
1987
2055
  if (options) {
1988
2056
  const { onStop, scheduler } = options;
1989
2057
  if (onStop) {
1990
- options.onStop = void 0;
1991
2058
  const stop = e.stop.bind(e);
1992
2059
  e.stop = () => {
1993
2060
  stop();
1994
2061
  onStop();
1995
2062
  };
1996
2063
  }
1997
- if (scheduler) {
1998
- options.scheduler = void 0;
1999
- e.notify = () => {
2000
- if (!(e.flags & 256)) scheduler();
2001
- };
2002
- }
2003
- extend(e, options);
2064
+ if (scheduler) e.notify = () => {
2065
+ if (!(e.flags & 1280)) scheduler();
2066
+ };
2067
+ e.onTrack = options.onTrack;
2068
+ e.onTrigger = options.onTrigger;
2004
2069
  }
2005
2070
  try {
2006
2071
  e.run();
@@ -2060,8 +2125,10 @@ var EffectScope = class {
2060
2125
  const flags = this.flags;
2061
2126
  if (flags & 256) {
2062
2127
  this.flags = flags & -257;
2063
- for (let link = this.deps; link !== void 0; link = link.nextDep) {
2064
- const dep = link.dep;
2128
+ const deps = [];
2129
+ for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
2130
+ for (let i = 0; i < deps.length; i++) {
2131
+ const dep = deps[i];
2065
2132
  if ("resume" in dep) dep.resume();
2066
2133
  }
2067
2134
  }
@@ -2090,8 +2157,10 @@ var EffectScope = class {
2090
2157
  while (dep !== void 0) {
2091
2158
  const node = dep.dep;
2092
2159
  if ("stop" in node) {
2093
- dep = dep.nextDep;
2160
+ const prev = dep.prevDep;
2094
2161
  node.stop();
2162
+ const next = prev !== void 0 ? prev.nextDep : this.deps;
2163
+ dep = next === dep ? dep.nextDep : next;
2095
2164
  } else dep = unlink(dep, this);
2096
2165
  }
2097
2166
  cleanup(this);
@@ -2132,11 +2201,14 @@ function setCurrentScope(scope) {
2132
2201
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
2133
2202
  */
2134
2203
  function onScopeDispose(fn, failSilently = false) {
2135
- if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2136
- else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2204
+ if (activeEffectScope !== void 0) {
2205
+ if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2206
+ else fn();
2207
+ } else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2137
2208
  }
2138
2209
  //#endregion
2139
2210
  //#region packages/reactivity/src/computed.ts
2211
+ const FAILED = 64;
2140
2212
  /**
2141
2213
  * @private exported by @vue/reactivity for Vue core use, but not exported from
2142
2214
  * the main vue package
@@ -2185,12 +2257,24 @@ var ComputedRefImpl = class {
2185
2257
  }
2186
2258
  get value() {
2187
2259
  const flags = this.flags;
2188
- if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2189
- if (this.update()) {
2190
- const subs = this.subs;
2191
- if (subs !== void 0) shallowPropagate(subs);
2192
- }
2193
- } else if (flags & 32) this.flags = flags & -33;
2260
+ try {
2261
+ if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2262
+ if (this.update()) {
2263
+ const subs = this.subs;
2264
+ if (subs !== void 0) shallowPropagate(subs);
2265
+ }
2266
+ } else if (flags & 32) this.flags = flags & -33;
2267
+ } catch (err) {
2268
+ if (activeSub !== void 0) {
2269
+ onTrack(activeSub, {
2270
+ target: this,
2271
+ type: "get",
2272
+ key: "value"
2273
+ });
2274
+ link(this, activeSub);
2275
+ } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2276
+ throw err;
2277
+ }
2194
2278
  if (activeSub !== void 0) {
2195
2279
  onTrack(activeSub, {
2196
2280
  target: this,
@@ -2198,7 +2282,18 @@ var ComputedRefImpl = class {
2198
2282
  key: "value"
2199
2283
  });
2200
2284
  link(this, activeSub);
2201
- } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2285
+ } else if (activeEffectScope !== void 0) {
2286
+ if (activeEffectScope.active) link(this, activeEffectScope);
2287
+ else if (this.subs === void 0) {
2288
+ let dep = this.deps;
2289
+ if (dep !== void 0) {
2290
+ do
2291
+ dep = unlink(dep, this);
2292
+ while (dep !== void 0);
2293
+ this.flags |= 16;
2294
+ }
2295
+ }
2296
+ }
2202
2297
  return this._value;
2203
2298
  }
2204
2299
  set value(newValue) {
@@ -2210,11 +2305,15 @@ var ComputedRefImpl = class {
2210
2305
  try {
2211
2306
  const oldValue = this._value;
2212
2307
  const newValue = this.fn(oldValue);
2213
- if (hasChanged(oldValue, newValue)) {
2308
+ if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
2214
2309
  this._value = newValue;
2310
+ this.flags &= -65;
2215
2311
  return true;
2216
2312
  }
2217
2313
  return false;
2314
+ } catch (err) {
2315
+ this.flags |= FAILED;
2316
+ throw err;
2218
2317
  } finally {
2219
2318
  endTracking(this, prevSub);
2220
2319
  }
@@ -2235,6 +2334,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2235
2334
  cRef.onTrack = debugOptions.onTrack;
2236
2335
  cRef.onTrigger = debugOptions.onTrigger;
2237
2336
  }
2337
+ if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
2238
2338
  return cRef;
2239
2339
  }
2240
2340
  //#endregion
@@ -2605,7 +2705,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2605
2705
  if (isFunction(fn)) {
2606
2706
  const res = callWithErrorHandling(fn, instance, type, args);
2607
2707
  if (res && isPromise(res)) res.catch((err) => {
2608
- handleError(err, instance, type);
2708
+ handleError(err, instance, type, void 0, true);
2609
2709
  });
2610
2710
  return res;
2611
2711
  }
@@ -2615,7 +2715,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2615
2715
  return values;
2616
2716
  } else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
2617
2717
  }
2618
- function handleError(err, instance, type, throwInDev = true) {
2718
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2619
2719
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2620
2720
  if (instance) {
2621
2721
  let cur = instance.parent;
@@ -2623,7 +2723,7 @@ function handleError(err, instance, type, throwInDev = true) {
2623
2723
  const errorInfo = ErrorTypeStrings$1[type];
2624
2724
  while (cur) {
2625
2725
  const errorCapturedHooks = cur.ec;
2626
- if (errorCapturedHooks) {
2726
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
2627
2727
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
2628
2728
  }
2629
2729
  cur = cur.parent;
@@ -2928,7 +3028,11 @@ function reload(id, newComp) {
2928
3028
  updateComponentDef(record.initialDef, newComp);
2929
3029
  const instances = [...record.instances];
2930
3030
  if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2931
- for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3031
+ for (const instance of instances) {
3032
+ if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3033
+ const oldComp = normalizeClassComponent(instance.type);
3034
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
3035
+ }
2932
3036
  const dirtyInstances = new Set(instances);
2933
3037
  const rerenderedParents = /* @__PURE__ */ new Set();
2934
3038
  runWithHmrUpdating(() => {
@@ -2969,7 +3073,25 @@ function reload(id, newComp) {
2969
3073
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2970
3074
  }
2971
3075
  parents.forEach((parent) => {
2972
- queueJob(() => {
3076
+ const children = instances.filter((instance) => instance.parent === parent);
3077
+ const update = () => {
3078
+ if (!parent.scope.active) return;
3079
+ const activeChildren = children.filter((instance) => instance.scope.active);
3080
+ if (!activeChildren.length) return;
3081
+ const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
3082
+ if (pending) {
3083
+ pending.asyncDep.catch(NOOP).then(() => {
3084
+ if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
3085
+ });
3086
+ return;
3087
+ }
3088
+ for (const instance of activeChildren) {
3089
+ const oldComp = normalizeClassComponent(instance.type);
3090
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
3091
+ if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3092
+ dirtyInstances.add(instance);
3093
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3094
+ }
2973
3095
  runWithHmrUpdating(() => {
2974
3096
  if (parent.vapor) parent.hmrRerender();
2975
3097
  else {
@@ -2980,7 +3102,12 @@ function reload(id, newComp) {
2980
3102
  }
2981
3103
  }
2982
3104
  });
2983
- });
3105
+ queuePostFlushCb(() => {
3106
+ hmrDirtyComponents.clear();
3107
+ hmrDirtyComponentsMode.clear();
3108
+ });
3109
+ };
3110
+ queueJob(update);
2984
3111
  });
2985
3112
  }
2986
3113
  queuePostFlushCb(() => {
@@ -3529,11 +3656,28 @@ function withDirectives(vnode, directives) {
3529
3656
  return vnode;
3530
3657
  }
3531
3658
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3532
- const bindings = vnode.dirs;
3659
+ let hookVNode = vnode;
3660
+ if (name === "beforeMount") vnode._mount = vnode;
3661
+ else if (name === "beforeUpdate") {
3662
+ const mount = prevVNode && prevVNode._mount;
3663
+ if (mount) {
3664
+ mount._latest = vnode;
3665
+ vnode._mount = mount;
3666
+ }
3667
+ } else if (name === "mounted") {
3668
+ const latest = vnode._latest;
3669
+ vnode._mount = vnode._latest = void 0;
3670
+ if (latest) {
3671
+ hookVNode = latest;
3672
+ latest._mount = void 0;
3673
+ }
3674
+ }
3675
+ const bindings = hookVNode.dirs;
3533
3676
  const oldBindings = prevVNode && prevVNode.dirs;
3534
3677
  for (let i = 0; i < bindings.length; i++) {
3535
- const binding = bindings[i];
3678
+ let binding = bindings[i];
3536
3679
  if (oldBindings) binding.oldValue = oldBindings[i].value;
3680
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
3537
3681
  let hook = binding.dir[name];
3538
3682
  if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
3539
3683
  if (hook) {
@@ -3541,7 +3685,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3541
3685
  callWithAsyncErrorHandling(hook, instance, 8, [
3542
3686
  vnode.el,
3543
3687
  binding,
3544
- vnode,
3688
+ hookVNode,
3545
3689
  prevVNode
3546
3690
  ]);
3547
3691
  setActiveSub(prevSub);
@@ -3966,7 +4110,15 @@ const BaseTransitionImpl = {
3966
4110
  const { mode } = rawProps;
3967
4111
  checkTransitionMode(mode);
3968
4112
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3969
- if (!(instance.effect.flags & 1024)) instance.update();
4113
+ if (!(instance.effect.flags & 1024)) {
4114
+ if (instance.effect.running) {
4115
+ const job = () => {
4116
+ if (!(instance.effect.flags & 1024)) instance.update();
4117
+ };
4118
+ job.i = instance;
4119
+ queueJob(job);
4120
+ } else instance.update();
4121
+ }
3970
4122
  }) : NOOP);
3971
4123
  };
3972
4124
  }
@@ -3997,7 +4149,7 @@ function getLeavingNodesForType(state, vnode) {
3997
4149
  }
3998
4150
  return leavingVNodesCache;
3999
4151
  }
4000
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4152
+ function resolveTransitionHooks(vnode, props, state, instance) {
4001
4153
  const key = String(vnode.key);
4002
4154
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4003
4155
  const hooks = baseResolveTransitionHooks({
@@ -4020,9 +4172,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4020
4172
  }
4021
4173
  },
4022
4174
  cloneHooks: (vnode) => {
4023
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
4024
- if (postClone) postClone(hooks);
4025
- return hooks;
4175
+ return resolveTransitionHooks(vnode, props, state, instance);
4026
4176
  }
4027
4177
  }, props, state, instance);
4028
4178
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -4060,7 +4210,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
4060
4210
  callHook(hook, [el]);
4061
4211
  },
4062
4212
  enter(el) {
4063
- if (!isHmrUpdating && isLeaving()) return;
4213
+ if (!isHmrUpdating && isLeaving(el)) return;
4064
4214
  let hook = onEnter;
4065
4215
  let afterHook = onAfterEnter;
4066
4216
  let cancelHook = onEnterCancelled;
@@ -4104,7 +4254,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
4104
4254
  else done();
4105
4255
  },
4106
4256
  clone(node) {
4107
- return cloneHooks ? cloneHooks(node) : hooks;
4257
+ if (!cloneHooks) return hooks;
4258
+ const cloned = cloneHooks(node);
4259
+ cloned.afterLeave = () => {
4260
+ if (hooks.afterLeave) hooks.afterLeave();
4261
+ };
4262
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4263
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
4264
+ else delayedLeave();
4265
+ };
4266
+ cloned.delayedLeave = () => {
4267
+ if (hooks.delayedLeave) hooks.delayedLeave();
4268
+ };
4269
+ return cloned;
4108
4270
  }
4109
4271
  };
4110
4272
  return hooks;
@@ -4139,10 +4301,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
4139
4301
  if (state.isLeaving) return emptyPlaceholder(next);
4140
4302
  const nextInner = getInnerChild$1(next);
4141
4303
  if (!nextInner) return emptyPlaceholder(next);
4142
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
4143
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
4144
- enterHooks = hooks;
4145
- });
4304
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
4146
4305
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
4147
4306
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
4148
4307
  const mode = props.mode;
@@ -4208,9 +4367,14 @@ function setTransitionHooks(vnode, hooks) {
4208
4367
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4209
4368
  }
4210
4369
  } else if (vnode.shapeFlag & 128) {
4211
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4212
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4213
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
4370
+ const suspense = vnode.suspense;
4371
+ if (suspense) {
4372
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4373
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
4374
+ } else {
4375
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4376
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4377
+ }
4214
4378
  } else {
4215
4379
  vnode.transition = hooks;
4216
4380
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -4429,7 +4593,7 @@ const getContainerType = (container) => {
4429
4593
  };
4430
4594
  const isComment = (node) => node.nodeType === 8;
4431
4595
  /** The data of a comment opening a range a hydration steps over as one. */
4432
- const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
4596
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
4433
4597
  function createHydrationFunctions(rendererInternals) {
4434
4598
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4435
4599
  const hydrate = (vnode, container) => {
@@ -4447,7 +4611,7 @@ function createHydrationFunctions(rendererInternals) {
4447
4611
  };
4448
4612
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4449
4613
  optimized = optimized || !!vnode.dynamicChildren;
4450
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
4614
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
4451
4615
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4452
4616
  const { type, ref, shapeFlag, patchFlag } = vnode;
4453
4617
  let domType = node.nodeType;
@@ -4636,10 +4800,11 @@ function createHydrationFunctions(rendererInternals) {
4636
4800
  const container = parentNode(node);
4637
4801
  const first = nextSibling(node);
4638
4802
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4639
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4803
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
4804
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
4640
4805
  else {
4641
4806
  logMismatchError();
4642
- insert(vnode.anchor = createComment(`]`), container, next);
4807
+ insert(vnode.anchor = createComment(close), container, next);
4643
4808
  return next;
4644
4809
  }
4645
4810
  };
@@ -4661,13 +4826,13 @@ function createHydrationFunctions(rendererInternals) {
4661
4826
  const container = parentNode(node);
4662
4827
  remove(node);
4663
4828
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4664
- if (parentComponent && parentComponent.vnode) {
4829
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
4665
4830
  parentComponent.vnode.el = vnode.el;
4666
4831
  updateHOCHostEl(parentComponent, vnode.el);
4667
4832
  }
4668
4833
  return next;
4669
4834
  };
4670
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4835
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
4671
4836
  let match = 0;
4672
4837
  while (node) {
4673
4838
  node = nextSibling(node);
@@ -4930,7 +5095,7 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4930
5095
  function forEachElement(node, cb) {
4931
5096
  if (isComment(node) && isRangeStart(node.data)) {
4932
5097
  const open = node.data;
4933
- const close = open === "(" ? ")" : "]";
5098
+ const close = rangeCloseOf(open);
4934
5099
  let depth = 1;
4935
5100
  let next = node.nextSibling;
4936
5101
  while (next) {
@@ -4967,7 +5132,7 @@ function defineAsyncComponent(source) {
4967
5132
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
4968
5133
  const onError = (err) => {
4969
5134
  setPendingRequest(null);
4970
- handleError(err, instance, 13, !errorComponent);
5135
+ handleError(err, instance, 13, !errorComponent, true);
4971
5136
  };
4972
5137
  if (suspensible && instance.suspense || false) return load().then((comp) => {
4973
5138
  return () => createInnerComp(comp, instance);
@@ -5048,10 +5213,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
5048
5213
  const delayed = /* @__PURE__ */ ref(!!delay);
5049
5214
  let timeoutTimer;
5050
5215
  let delayTimer;
5051
- if (instance) onUnmounted(() => {
5052
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
5053
- if (delayTimer != null) clearTimeout(delayTimer);
5054
- }, instance);
5216
+ if (instance) instance.scope.run(() => {
5217
+ onScopeDispose(() => {
5218
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5219
+ if (delayTimer != null) clearTimeout(delayTimer);
5220
+ });
5221
+ });
5055
5222
  if (delay) delayTimer = setTimeout(() => {
5056
5223
  if (instance && instance.isUnmounted) return;
5057
5224
  delayed.value = false;
@@ -5086,7 +5253,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
5086
5253
  }
5087
5254
  return;
5088
5255
  }
5089
- if (!el.parentNode || wasConnected && !el.isConnected) return;
5256
+ if (!el.parentNode) return;
5257
+ if (wasConnected && !el.isConnected) {
5258
+ let current = instance;
5259
+ while (current && !current.isDeactivated) current = current.parent;
5260
+ if (!current) return;
5261
+ }
5090
5262
  hydrate();
5091
5263
  };
5092
5264
  const doHydrate = hydrateStrategy ? () => {
@@ -5140,7 +5312,11 @@ const KeepAliveImpl = {
5140
5312
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
5141
5313
  };
5142
5314
  sharedContext.deactivate = (vnode) => {
5143
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5315
+ const cached = sharedContext.getCachedComponent(vnode);
5316
+ if (!cached || cached.component !== vnode.component) return false;
5317
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
5318
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5319
+ return true;
5144
5320
  };
5145
5321
  function unmount(vnode) {
5146
5322
  resetShapeFlag(vnode);
@@ -5172,11 +5348,15 @@ const KeepAliveImpl = {
5172
5348
  let pendingCacheKey = null;
5173
5349
  const cacheSubtree = () => {
5174
5350
  if (pendingCacheKey != null) {
5175
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
5176
- const vnode = getInnerChild(keepAliveInstance.subTree);
5177
- if (vnode.component) cache.set(pendingCacheKey, vnode);
5178
- }, void 0, keepAliveInstance.subTree.suspense);
5179
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5351
+ if (isSuspense(keepAliveInstance.subTree.type)) {
5352
+ const cacheInnerChild = () => {
5353
+ const vnode = getInnerChild(keepAliveInstance.subTree);
5354
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
5355
+ };
5356
+ const suspense = keepAliveInstance.subTree.suspense;
5357
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
5358
+ else cacheInnerChild();
5359
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5180
5360
  }
5181
5361
  };
5182
5362
  onMounted(cacheSubtree);
@@ -5286,9 +5466,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
5286
5466
  }
5287
5467
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5288
5468
  const injected = injectHook(type, hook, keepAliveRoot, true);
5289
- onUnmounted(() => {
5290
- remove(keepAliveRoot[type], injected);
5291
- }, target);
5469
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
5470
+ removal.flags = 8;
5292
5471
  }
5293
5472
  function resetShapeFlag(vnode) {
5294
5473
  vnode.shapeFlag &= -257;
@@ -5710,6 +5889,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5710
5889
  ret.props = extend({}, ret.props, { key: branchKey });
5711
5890
  ret.key = branchKey;
5712
5891
  }
5892
+ if (isBlockTreeEnabled <= 0) {
5893
+ if (!ret.vs.props) ret.vs.props = ret.props;
5894
+ ret.props = ret.key != null ? { key: ret.key } : null;
5895
+ ret.vs.attrs = EMPTY_OBJ;
5896
+ }
5713
5897
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5714
5898
  return ret;
5715
5899
  }
@@ -6689,7 +6873,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6689
6873
  if (options.el) return vm.$mount(options.el);
6690
6874
  else return vm;
6691
6875
  }
6692
- Vue.version = `2.6.14-compat:3.6.0-rc.14`;
6876
+ Vue.version = `2.6.14-compat:3.6.0-rc.15`;
6693
6877
  Vue.config = singletonApp.config;
6694
6878
  Vue.use = (plugin, ...options) => {
6695
6879
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -8149,8 +8333,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8149
8333
  def(el, "__vnode", vnode, true);
8150
8334
  def(el, "__vueParentComponent", parentComponent, true);
8151
8335
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8152
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8153
- else hostInsert(el, container, anchor);
8336
+ if (transition) {
8337
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
8338
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8339
+ } else hostInsert(el, container, anchor);
8154
8340
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
8155
8341
  const isHmr = isHmrUpdating;
8156
8342
  queuePostRenderEffect(() => {
@@ -8415,16 +8601,20 @@ function baseCreateRenderer(options, createHydrationFns) {
8415
8601
  } else {
8416
8602
  let { next, bu, u, parent, vnode } = instance;
8417
8603
  {
8418
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8419
- if (nonHydratedAsyncRoot) {
8604
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8605
+ if (unresolvedAsyncRoot) {
8420
8606
  if (next) {
8421
8607
  next.el = vnode.el;
8422
8608
  updateComponentPreRender(instance, next, optimized);
8423
8609
  }
8424
- nonHydratedAsyncRoot.asyncDep.then(() => {
8425
- queuePostRenderEffect(() => {
8426
- if (!instance.isUnmounted) instance.update();
8427
- }, void 0, parentSuspense);
8610
+ unresolvedAsyncRoot.asyncDep.then(() => {
8611
+ const retry = () => {
8612
+ if (instance.effect.flags & 1024) return;
8613
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
8614
+ else instance.update();
8615
+ };
8616
+ retry.flags = 24;
8617
+ queuePostRenderEffect(retry, void 0, parentSuspense);
8428
8618
  });
8429
8619
  return;
8430
8620
  }
@@ -8448,7 +8638,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8448
8638
  const prevTree = instance.subTree;
8449
8639
  instance.subTree = nextTree;
8450
8640
  startMeasure(instance, `patch`);
8451
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8641
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8452
8642
  endMeasure(instance, `patch`);
8453
8643
  next.el = nextTree.el;
8454
8644
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
@@ -8652,9 +8842,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8652
8842
  }
8653
8843
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
8654
8844
  if (shapeFlag & 256) {
8655
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
8656
- else parentComponent.ctx.deactivate(vnode);
8657
- return;
8845
+ if (parentComponent.ctx.deactivate(vnode)) return;
8658
8846
  }
8659
8847
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
8660
8848
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -8735,13 +8923,15 @@ function baseCreateRenderer(options, createHydrationFns) {
8735
8923
  if (effect) {
8736
8924
  effect.stop();
8737
8925
  unmount(subTree, instance, parentSuspense, doRemove);
8738
- } else if (instance.vnode.el && subTree) {
8926
+ } else if (subTree) {
8739
8927
  subTree.transition = instance.vnode.transition;
8740
8928
  unmount(subTree, instance, parentSuspense, doRemove);
8741
8929
  }
8742
8930
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8743
8931
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8744
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
8932
+ const markUnmounted = () => instance.isUnmounted = true;
8933
+ markUnmounted.flags = 8;
8934
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
8745
8935
  devtoolsComponentRemoved(instance);
8746
8936
  };
8747
8937
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
@@ -8855,11 +9045,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8855
9045
  c2.el && (c2.el.__vnode = c2);
8856
9046
  }
8857
9047
  }
8858
- function locateNonHydratedAsyncRoot(instance) {
9048
+ function locateUnresolvedAsyncRoot(instance) {
8859
9049
  const subComponent = instance.subTree && instance.subTree.component;
8860
9050
  if (subComponent) {
8861
9051
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
8862
- else return locateNonHydratedAsyncRoot(subComponent);
9052
+ else return locateUnresolvedAsyncRoot(subComponent);
8863
9053
  }
8864
9054
  }
8865
9055
  function invalidateMount(hooks) {
@@ -8929,7 +9119,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
8929
9119
  function resolveAsyncComponentPlaceholder(anchorVnode) {
8930
9120
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
8931
9121
  const instance = anchorVnode.component;
8932
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
9122
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
9123
+ const suspense = anchorVnode.suspense;
9124
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
8933
9125
  return null;
8934
9126
  }
8935
9127
  //#endregion
@@ -8941,17 +9133,22 @@ function withSuspenseEnabled(value) {
8941
9133
  return value;
8942
9134
  }
8943
9135
  let suspenseId = 0;
9136
+ const deferredEnterKey = Symbol("_deferredEnter");
8944
9137
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
8945
9138
  name: "Suspense",
8946
9139
  __isSuspense: true,
8947
9140
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
8948
9141
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
8949
9142
  else {
8950
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
8951
- n2.suspense = n1.suspense;
8952
- n2.suspense.vnode = n2;
8953
- n2.el = n1.el;
8954
- return;
9143
+ const suspense = n1.suspense;
9144
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9145
+ const owner = suspense.parentComponent;
9146
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
9147
+ n2.suspense = suspense;
9148
+ suspense.vnode = n2;
9149
+ n2.el = n1.el;
9150
+ return;
9151
+ }
8955
9152
  }
8956
9153
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
8957
9154
  }
@@ -8963,6 +9160,36 @@ function triggerEvent(vnode, name) {
8963
9160
  const eventListener = vnode.props && vnode.props[name];
8964
9161
  if (isFunction(eventListener)) eventListener();
8965
9162
  }
9163
+ function enterDeferred(suspense, branch) {
9164
+ const enters = [];
9165
+ collectDeferredEnters(branch, enters, true);
9166
+ if (isVaporInteropEnabled) {
9167
+ const { parentComponent } = suspense;
9168
+ const vapor = parentComponent && parentComponent.appContext.vapor;
9169
+ if (vapor) vapor.enterDeferred(suspense, enters);
9170
+ }
9171
+ if (enters.length) queuePostFlushCb(enters);
9172
+ }
9173
+ function collectDeferredEnters(vnode, enters, isRoot) {
9174
+ const { el, transition, children, shapeFlag } = vnode;
9175
+ if (shapeFlag & 6) {
9176
+ const subTree = vnode.component.subTree;
9177
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
9178
+ return;
9179
+ }
9180
+ if (shapeFlag & 192) return;
9181
+ if (shapeFlag & 1) {
9182
+ if (!isRoot && el && el[deferredEnterKey]) {
9183
+ el[deferredEnterKey] = void 0;
9184
+ if (transition && !transition.persisted) {
9185
+ transition.beforeEnter(el);
9186
+ enters.push(() => transition.enter(el));
9187
+ }
9188
+ }
9189
+ isRoot = false;
9190
+ }
9191
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
9192
+ }
8966
9193
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
8967
9194
  const { p: patch, o: { createElement } } = rendererInternals;
8968
9195
  const hiddenContainer = createElement("div");
@@ -9002,11 +9229,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9002
9229
  suspense.activeBranch = pendingBranch;
9003
9230
  } else unmount(pendingBranch, parentComponent, suspense);
9004
9231
  suspense.deps = 0;
9005
- for (let i = 0; i < suspense.effects.length; i++) {
9006
- const effect = suspense.effects[i];
9007
- if (effect.flags & 8) queuePostFlushCb(effect);
9008
- }
9009
- suspense.effects.length = 0;
9232
+ discardEffects(suspense);
9010
9233
  suspense.hiddenContainer = createElement("div");
9011
9234
  if (isInFallback) {
9012
9235
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -9029,14 +9252,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9029
9252
  } else {
9030
9253
  triggerEvent(n2, "onPending");
9031
9254
  suspense.pendingBranch = newBranch;
9032
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
9033
- else suspense.pendingId = suspenseId++;
9255
+ suspense.pendingId = suspenseId++;
9034
9256
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
9035
9257
  if (suspense.deps <= 0) suspense.resolve();
9036
9258
  else {
9037
- const { timeout, pendingId } = suspense;
9038
- if (timeout > 0) setTimeout(() => {
9039
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
9259
+ const { timeout } = suspense;
9260
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
9261
+ suspense.timeoutTimer = void 0;
9262
+ suspense.fallback(suspense.vnode.ssFallback);
9040
9263
  }, timeout);
9041
9264
  else if (timeout === 0) suspense.fallback(newFallback);
9042
9265
  }
@@ -9072,6 +9295,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9072
9295
  deps: 0,
9073
9296
  pendingId: suspenseId++,
9074
9297
  timeout: typeof timeout === "number" ? timeout : -1,
9298
+ timeoutTimer: void 0,
9075
9299
  activeBranch: null,
9076
9300
  isFallbackMountPending: false,
9077
9301
  pendingBranch: null,
@@ -9089,26 +9313,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9089
9313
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9090
9314
  let hasUpdatedAnchor = false;
9091
9315
  if (delayEnter) activeBranch.transition.afterLeave = () => {
9092
- if (pendingId === suspense.pendingId) {
9316
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9317
+ enterDeferred(suspense, pendingBranch);
9093
9318
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
9094
9319
  queuePostFlushCb(effects);
9095
9320
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
9096
9321
  }
9097
9322
  };
9098
9323
  if (activeBranch && !suspense.isFallbackMountPending) {
9099
- if (parentNode(activeBranch.el) === container) {
9324
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
9100
9325
  anchor = next(activeBranch);
9101
9326
  hasUpdatedAnchor = true;
9102
9327
  }
9103
9328
  unmount(activeBranch, parentComponent, suspense, true);
9104
9329
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
9105
9330
  }
9106
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
9331
+ if (!delayEnter) {
9332
+ enterDeferred(suspense, pendingBranch);
9333
+ move(pendingBranch, container, anchor, 0, parentComponent);
9334
+ }
9107
9335
  }
9336
+ clearTimeout(suspense.timeoutTimer);
9337
+ suspense.timeoutTimer = void 0;
9108
9338
  suspense.isFallbackMountPending = false;
9109
9339
  setActiveBranch(suspense, pendingBranch);
9110
9340
  suspense.pendingBranch = null;
9111
9341
  suspense.isInFallback = false;
9342
+ let kept = 0;
9343
+ for (let i = 0; i < effects.length; i++) {
9344
+ const effect = effects[i];
9345
+ if (effect.flags & 16) queuePostFlushCb(effect);
9346
+ else effects[kept++] = effect;
9347
+ }
9348
+ effects.length = kept;
9112
9349
  let parent = suspense.parent;
9113
9350
  let hasUnresolvedAncestor = false;
9114
9351
  while (parent) {
@@ -9131,13 +9368,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9131
9368
  triggerEvent(vnode, "onResolve");
9132
9369
  },
9133
9370
  fallback(fallbackVNode) {
9134
- if (!suspense.pendingBranch) return;
9371
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
9135
9372
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
9136
9373
  triggerEvent(vnode, "onFallback");
9137
9374
  const anchor = next(activeBranch);
9138
9375
  const mountFallback = () => {
9139
9376
  suspense.isFallbackMountPending = false;
9140
- if (!suspense.isInFallback) return;
9377
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
9141
9378
  const latestFallback = suspense.vnode.ssFallback;
9142
9379
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
9143
9380
  setActiveBranch(suspense, latestFallback);
@@ -9161,24 +9398,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9161
9398
  registerDep(instance, onResolve) {
9162
9399
  const isInPendingSuspense = !!suspense.pendingBranch;
9163
9400
  if (isInPendingSuspense) suspense.deps++;
9401
+ const render = (setupResult) => {
9402
+ instance.asyncResolved = true;
9403
+ onResolve(setupResult);
9404
+ };
9164
9405
  instance.asyncDep.catch((err) => {
9165
- handleError(err, instance, 0);
9406
+ handleError(err, instance, 0, false, true);
9407
+ return () => null;
9166
9408
  }).then((asyncSetupResult) => {
9167
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9409
+ if (instance.isUnmounted || suspense.isUnmounted) return;
9410
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
9168
9411
  setCurrentInstance(null, void 0);
9169
9412
  if (!instance.scope.active) {
9170
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9413
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9171
9414
  return;
9172
9415
  }
9173
- instance.asyncResolved = true;
9174
- onResolve(asyncSetupResult);
9175
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9416
+ if (!isPendingDep && suspense.pendingBranch) {
9417
+ const job = () => {
9418
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
9419
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
9420
+ else render(asyncSetupResult);
9421
+ };
9422
+ job.flags = 24;
9423
+ queueEffectWithSuspense(job, void 0, suspense);
9424
+ return;
9425
+ }
9426
+ render(asyncSetupResult);
9427
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9176
9428
  });
9177
9429
  },
9178
9430
  unmount(parentSuspense, doRemove) {
9179
9431
  suspense.isUnmounted = true;
9432
+ clearTimeout(suspense.timeoutTimer);
9433
+ suspense.timeoutTimer = void 0;
9434
+ if (parentSuspenseId !== void 0) {
9435
+ const parent = suspense.parent;
9436
+ const pendingId = parentSuspenseId;
9437
+ parentSuspenseId = void 0;
9438
+ queuePostFlushCb(() => {
9439
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
9440
+ });
9441
+ }
9180
9442
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
9181
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
9443
+ if (suspense.pendingBranch) {
9444
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
9445
+ discardEffects(suspense);
9446
+ }
9182
9447
  }
9183
9448
  };
9184
9449
  return suspense;
@@ -9219,6 +9484,14 @@ function normalizeSuspenseSlot(s) {
9219
9484
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
9220
9485
  return s;
9221
9486
  }
9487
+ function discardEffects(suspense) {
9488
+ const { effects } = suspense;
9489
+ for (let i = 0; i < effects.length; i++) {
9490
+ const effect = effects[i];
9491
+ if (effect.flags & 8) queuePostFlushCb(effect);
9492
+ }
9493
+ effects.length = 0;
9494
+ }
9222
9495
  function queueEffectWithSuspense(fn, id, suspense) {
9223
9496
  if (suspense && suspense.pendingBranch) {
9224
9497
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -9486,7 +9759,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9486
9759
  }
9487
9760
  function guardReactiveProps(props) {
9488
9761
  if (!props) return null;
9489
- return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
9762
+ if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
9763
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
9490
9764
  }
9491
9765
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
9492
9766
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -9873,7 +10147,8 @@ function setupStatefulComponent(instance, isSSR) {
9873
10147
  setInSSRSetupState(false);
9874
10148
  }
9875
10149
  }).catch((e) => {
9876
- handleError(e, instance, 0);
10150
+ handleError(e, instance, 0, void 0, true);
10151
+ instance.ssrRender = (_, push) => push("<!---->");
9877
10152
  });
9878
10153
  else {
9879
10154
  instance.asyncDep = setupResult;
@@ -9946,11 +10221,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
9946
10221
  else warn$1(`Component is missing template or render function: `, Component);
9947
10222
  }
9948
10223
  }
10224
+ /**
10225
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
10226
+ * @internal
10227
+ */
10228
+ const rawAttrsKey = Symbol();
9949
10229
  const attrsProxyHandlers = {
9950
10230
  get(target, key) {
9951
10231
  markAttrsAccessed();
9952
10232
  track(target, "get", "");
9953
- return target[key];
10233
+ return key === rawAttrsKey ? target : target[key];
9954
10234
  },
9955
10235
  set() {
9956
10236
  warn$1(`setupContext.attrs is readonly.`);
@@ -10248,7 +10528,7 @@ function isMemoSame(cached, memo) {
10248
10528
  }
10249
10529
  //#endregion
10250
10530
  //#region packages/runtime-core/src/index.ts
10251
- const version = "3.6.0-rc.14";
10531
+ const version = "3.6.0-rc.15";
10252
10532
  const warn = warn$1;
10253
10533
  /**
10254
10534
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -11119,7 +11399,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
11119
11399
  }
11120
11400
  this._styleAnchors.delete(this._def);
11121
11401
  this._applyStyles(newStyles);
11122
- if (!this._instance.vapor) this._instance = null;
11402
+ this._instance = null;
11123
11403
  this._update();
11124
11404
  };
11125
11405
  const dispatch = (event, args) => {
@@ -11734,15 +12014,15 @@ const vModelSelect = {
11734
12014
  vModelSelectInit(el, value, number);
11735
12015
  el[assignKey] = getModelAssigner(vnode);
11736
12016
  },
11737
- mounted(el, { value }) {
11738
- vModelSetSelected(el, value);
12017
+ mounted(el, { value, modifiers: { number } }) {
12018
+ vModelSetSelected(el, value, number);
11739
12019
  },
11740
12020
  beforeUpdate(el, { value }, vnode) {
11741
12021
  el._modelValue = value;
11742
12022
  el[assignKey] = getModelAssigner(vnode);
11743
12023
  },
11744
- updated(el, { value }) {
11745
- vModelSetSelected(el, value);
12024
+ updated(el, { value, modifiers: { number } }) {
12025
+ vModelSetSelected(el, value, number);
11746
12026
  }
11747
12027
  };
11748
12028
  /**
@@ -11777,14 +12057,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
11777
12057
  /**
11778
12058
  * @internal
11779
12059
  */
11780
- const vModelSetSelected = (el, value) => {
12060
+ const vModelSetSelected = (el, value, number = false) => {
11781
12061
  el._modelValue = value;
11782
12062
  const pending = el._pendingValue;
11783
12063
  el._pendingValue = void 0;
11784
12064
  if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
11785
- setSelected(el, value);
12065
+ setSelected(el, value, number);
11786
12066
  };
11787
- function setSelected(el, value) {
12067
+ function setSelected(el, value, number) {
11788
12068
  const isMultiple = el.multiple;
11789
12069
  const isArrayValue = isArray(value);
11790
12070
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -11799,7 +12079,7 @@ function setSelected(el, value) {
11799
12079
  const optionType = typeof optionValue;
11800
12080
  if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
11801
12081
  else option.selected = looseIndexOf(value, optionValue) > -1;
11802
- } else option.selected = value.has(optionValue);
12082
+ } else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
11803
12083
  } else if (looseEqual(getValue(option), value)) {
11804
12084
  if (el.selectedIndex !== i) el.selectedIndex = i;
11805
12085
  return;
@@ -14003,7 +14283,11 @@ function getLoc(start, end) {
14003
14283
  };
14004
14284
  }
14005
14285
  function cloneLoc(loc) {
14006
- return getLoc(loc.start.offset, loc.end.offset);
14286
+ return {
14287
+ start: extend({}, loc.start),
14288
+ end: extend({}, loc.end),
14289
+ source: loc.source
14290
+ };
14007
14291
  }
14008
14292
  function setLocEnd(loc, end) {
14009
14293
  loc.end = tokenizer.getPos(end);