@vue/compat 3.6.0-rc.13 → 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.13
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
  **/
@@ -73,10 +73,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
73
73
  const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
74
74
  const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
75
75
  const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
76
+ const STRING_CACHE_MAX_SIZE = 1e4;
76
77
  const cacheStringFunction = (fn) => {
77
- const cache = Object.create(null);
78
+ let cache = Object.create(null);
79
+ let size = 0;
78
80
  return ((str) => {
79
- return cache[str] || (cache[str] = fn(str));
81
+ const hit = cache[str];
82
+ if (hit !== void 0) return hit;
83
+ if (++size > STRING_CACHE_MAX_SIZE) {
84
+ cache = Object.create(null);
85
+ size = 1;
86
+ }
87
+ return cache[str] = fn(str);
80
88
  });
81
89
  };
82
90
  const camelizeRE = /-(\w)/g;
@@ -84,22 +92,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
84
92
  /**
85
93
  * @private
86
94
  */
87
- const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
95
+ const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
88
96
  const hyphenateRE = /\B([A-Z])/g;
89
97
  /**
90
98
  * @private
91
99
  */
92
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
100
+ const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
93
101
  /**
94
102
  * @private
95
103
  */
96
- const capitalize = cacheStringFunction((str) => {
104
+ const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
97
105
  return str.charAt(0).toUpperCase() + str.slice(1);
98
106
  });
99
107
  /**
100
108
  * @private
101
109
  */
102
- const toHandlerKey = cacheStringFunction((str) => {
110
+ const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
103
111
  return str ? `on${capitalize(str)}` : ``;
104
112
  });
105
113
  /**
@@ -307,26 +315,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
307
315
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
308
316
  */
309
317
  const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
310
- //#endregion
311
- //#region packages/shared/src/domAttrConfig.ts
312
- /**
313
- * On the client we only need to offer special cases for boolean attributes that
314
- * have different names from their corresponding dom properties:
315
- * - itemscope -> N/A
316
- * - allowfullscreen -> allowFullscreen
317
- * - formnovalidate -> formNoValidate
318
- * - ismap -> isMap
319
- * - nomodule -> noModule
320
- * - novalidate -> noValidate
321
- * - playsinline -> playsInline
322
- * - readonly -> readOnly
323
- */
324
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
325
- const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
318
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
326
319
  /**
327
320
  * The full list is needed during SSR to produce the correct initial markup.
328
321
  */
329
- const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
322
+ 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");
330
323
  /**
331
324
  * Boolean attributes should be included if the value is truthy or ''.
332
325
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -561,39 +554,30 @@ function normalizeCssVarValue(value) {
561
554
  return String(value);
562
555
  }
563
556
  //#endregion
564
- //#region packages/reactivity/src/debug.ts
565
- const triggerEventInfos = [];
566
- function onTrack(sub, debugInfo) {
567
- if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
568
- }
569
- function onTrigger(sub) {
570
- if (sub.onTrigger) {
571
- const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
572
- sub.onTrigger(extend({ effect: sub }, debugInfo));
557
+ //#region packages/shared/src/vaporFlags.ts
558
+ /**
559
+ * The data of the comment a vapor server render opens the branch of a `v-if`
560
+ * chain with, `<!--[1-->`: the digits are the branch's position in the chain,
561
+ * and `<!--]-->` closes it like a fragment.
562
+ */
563
+ function isVaporBranchStart(data) {
564
+ if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
565
+ for (let i = 1; i < data.length; i++) {
566
+ const c = data.charCodeAt(i);
567
+ if (c < 48 || c > 57) return false;
573
568
  }
569
+ return true;
574
570
  }
575
- function setupOnTrigger(target) {
576
- Object.defineProperty(target.prototype, "onTrigger", {
577
- get() {
578
- return this._onTrigger;
579
- },
580
- set(val) {
581
- if (val && !this._onTrigger) setupFlagsHandler(this);
582
- this._onTrigger = val;
583
- }
584
- });
571
+ /**
572
+ * The data of a comment opening a range only a vapor server render emits:
573
+ * `<!--{-->` around the render of a component, or a v-if branch's.
574
+ */
575
+ function isVaporRangeStart(data) {
576
+ return data === "{" || isVaporBranchStart(data);
585
577
  }
586
- function setupFlagsHandler(target) {
587
- target._flags = target.flags;
588
- Object.defineProperty(target, "flags", {
589
- get() {
590
- return target._flags;
591
- },
592
- set(value) {
593
- if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
594
- target._flags = value;
595
- }
596
- });
578
+ /** The data of the comment closing the range `open` opens. */
579
+ function rangeCloseOf(open) {
580
+ return open === "(" ? ")" : open === "{" ? "}" : "]";
597
581
  }
598
582
  //#endregion
599
583
  //#region packages/reactivity/src/warning.ts
@@ -605,13 +589,7 @@ function warn$2(msg, ...args) {
605
589
  const notifyBuffer = [];
606
590
  let batchDepth = 0;
607
591
  let activeSub = void 0;
608
- let runDepth = 0;
609
- function incRunDepth() {
610
- ++runDepth;
611
- }
612
- function decRunDepth() {
613
- --runDepth;
614
- }
592
+ const CHECKING = 512;
615
593
  let globalVersion = 0;
616
594
  let notifyIndex = 0;
617
595
  let notifyBufferLength = 0;
@@ -660,6 +638,7 @@ function unlink(link, sub = link.sub) {
660
638
  const nextDep = link.nextDep;
661
639
  const nextSub = link.nextSub;
662
640
  const prevSub = link.prevSub;
641
+ link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
663
642
  if (nextDep !== void 0) nextDep.prevDep = prevDep;
664
643
  else sub.depsTail = prevDep;
665
644
  if (prevDep !== void 0) prevDep.nextDep = nextDep;
@@ -667,7 +646,7 @@ function unlink(link, sub = link.sub) {
667
646
  if (nextSub !== void 0) nextSub.prevSub = prevSub;
668
647
  else dep.subsTail = prevSub;
669
648
  if (prevSub !== void 0) prevSub.nextSub = nextSub;
670
- else if ((dep.subs = nextSub) === void 0) {
649
+ else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
671
650
  let toRemove = dep.deps;
672
651
  if (toRemove !== void 0) {
673
652
  do
@@ -685,14 +664,12 @@ function propagate(link) {
685
664
  const sub = link.sub;
686
665
  let flags = sub.flags;
687
666
  if (flags & 3) {
688
- if (!(flags & 60)) {
689
- sub.flags = flags | 32;
690
- if (runDepth) sub.flags |= 8;
691
- } else if (!(flags & 12)) flags = 0;
667
+ if (!(flags & 44)) sub.flags = flags | 32;
668
+ else if (!(flags & 12)) flags = 0;
692
669
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
693
670
  else if (!(flags & 48) && isValidLink(link, sub)) {
694
671
  sub.flags = flags | 40;
695
- flags &= 1;
672
+ flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
696
673
  } else flags = 0;
697
674
  if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
698
675
  if (flags & 1) {
@@ -728,7 +705,7 @@ function propagate(link) {
728
705
  function startTracking(sub) {
729
706
  ++globalVersion;
730
707
  sub.depsTail = void 0;
731
- sub.flags = sub.flags & -57 | 4;
708
+ sub.flags = sub.flags & -569 | 4;
732
709
  return setActiveSub(sub);
733
710
  }
734
711
  function endTracking(sub, prevSub) {
@@ -736,8 +713,11 @@ function endTracking(sub, prevSub) {
736
713
  activeSub = prevSub;
737
714
  const depsTail = sub.depsTail;
738
715
  let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
739
- while (toRemove !== void 0) toRemove = unlink(toRemove, sub);
740
- sub.flags &= -5;
716
+ while (toRemove !== void 0) {
717
+ unlink(toRemove, sub);
718
+ toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
719
+ }
720
+ if ((sub.flags &= -5) & 8) markRecursed(sub);
741
721
  }
742
722
  function flush() {
743
723
  let hasError = false;
@@ -759,45 +739,67 @@ function flush() {
759
739
  if (hasError) throw error;
760
740
  }
761
741
  function checkDirty(link, sub) {
742
+ try {
743
+ return walkDirty(link, sub);
744
+ } catch (err) {
745
+ markStale(sub);
746
+ throw err;
747
+ }
748
+ }
749
+ function walkDirty(link, sub) {
750
+ const root = sub;
762
751
  let stack;
763
752
  let checkDepth = 0;
753
+ let staleDepth = 0;
754
+ let staleFloor = 0;
764
755
  top: do {
765
756
  const dep = link.dep;
766
757
  const depFlags = dep.flags;
767
758
  let dirty = false;
768
759
  if (sub.flags & 16) dirty = true;
769
760
  else if ((depFlags & 17) === 17) {
770
- const subs = dep.subs;
771
761
  if (dep.update()) {
772
- if (subs.nextSub !== void 0) shallowPropagate(subs);
762
+ const subs = dep.subs;
763
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
773
764
  dirty = true;
774
765
  }
775
766
  } else if ((depFlags & 33) === 33) {
776
- stack = {
777
- value: link,
778
- prev: stack
779
- };
780
- link = dep.deps;
781
- sub = dep;
782
- ++checkDepth;
783
- continue;
767
+ const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
768
+ if (depth < 0) {
769
+ if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
770
+ stack = {
771
+ value: link,
772
+ prev: stack
773
+ };
774
+ link = dep.deps;
775
+ sub = dep;
776
+ ++checkDepth;
777
+ continue;
778
+ }
779
+ if (depth < checkDepth) {
780
+ staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
781
+ staleDepth = checkDepth;
782
+ }
784
783
  }
785
784
  if (!dirty && link.nextDep !== void 0) {
786
785
  link = link.nextDep;
787
786
  continue;
788
787
  }
789
788
  while (checkDepth) {
789
+ const stale = checkDepth === staleDepth;
790
+ if (stale && --staleDepth === staleFloor) staleDepth = 0;
790
791
  --checkDepth;
791
792
  link = stack.value;
792
793
  stack = stack.prev;
793
794
  if (dirty) {
794
- const subs = sub.subs;
795
795
  if (sub.update()) {
796
- if (subs.nextSub !== void 0) shallowPropagate(subs);
796
+ const subs = sub.subs;
797
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
797
798
  sub = link.sub;
798
799
  continue;
799
800
  }
800
- } else sub.flags &= -33;
801
+ } else if (stale) sub.flags = sub.flags & -545 | 16;
802
+ else sub.flags &= -545;
801
803
  sub = link.sub;
802
804
  if (link.nextDep !== void 0) {
803
805
  link = link.nextDep;
@@ -805,9 +807,21 @@ function checkDirty(link, sub) {
805
807
  }
806
808
  dirty = false;
807
809
  }
808
- return dirty && !!sub.flags;
810
+ return (dirty || !!(sub.flags & 16)) && !!sub.flags;
809
811
  } while (true);
810
812
  }
813
+ function checkingDepth(dep, stack, depth) {
814
+ for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
815
+ return -1;
816
+ }
817
+ function markStale(sub) {
818
+ const nodes = [sub];
819
+ do {
820
+ sub = nodes.pop();
821
+ sub.flags = sub.flags & -33 | 16;
822
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
823
+ } while (nodes.length);
824
+ }
811
825
  function shallowPropagate(link) {
812
826
  do {
813
827
  const sub = link.sub;
@@ -825,6 +839,71 @@ function isValidLink(checkLink, sub) {
825
839
  }
826
840
  return false;
827
841
  }
842
+ function markRecursed(sub) {
843
+ const nodes = [sub];
844
+ do {
845
+ sub = nodes.pop();
846
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) {
847
+ const dep = link.dep;
848
+ if ((dep.flags & 40) === 32) {
849
+ dep.flags |= 8;
850
+ nodes.push(dep);
851
+ }
852
+ }
853
+ } while (nodes.length);
854
+ }
855
+ //#endregion
856
+ //#region packages/reactivity/src/debug.ts
857
+ const triggered = [];
858
+ function onTrack(sub, debugInfo) {
859
+ if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
860
+ }
861
+ function onTrigger(sub, debugInfo) {
862
+ if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
863
+ }
864
+ function startTrigger() {
865
+ triggered.push([]);
866
+ }
867
+ function endTrigger(debugInfo) {
868
+ const subs = triggered.pop();
869
+ if (subs.length) {
870
+ startBatch();
871
+ try {
872
+ for (let i = 0; i < subs.length; i++) {
873
+ const sub = subs[i];
874
+ if (sub.flags & 3) onTrigger(sub, debugInfo);
875
+ }
876
+ } finally {
877
+ endBatch();
878
+ }
879
+ }
880
+ }
881
+ function setupOnTrigger(target) {
882
+ Object.defineProperty(target.prototype, "onTrigger", {
883
+ get() {
884
+ return this._onTrigger;
885
+ },
886
+ set(val) {
887
+ if (val && !this._onTrigger) setupFlagsHandler(this);
888
+ this._onTrigger = val;
889
+ }
890
+ });
891
+ }
892
+ function setupFlagsHandler(target) {
893
+ target._flags = target.flags;
894
+ Object.defineProperty(target, "flags", {
895
+ get() {
896
+ return target._flags;
897
+ },
898
+ set(value) {
899
+ if (!(target._flags & 48) && !!(value & 48)) {
900
+ if (triggered.length) triggered[triggered.length - 1].push(this);
901
+ else onTrigger(this);
902
+ }
903
+ target._flags = value;
904
+ }
905
+ });
906
+ }
828
907
  //#endregion
829
908
  //#region packages/reactivity/src/dep.ts
830
909
  var Dep = class {
@@ -884,20 +963,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
884
963
  if (!depsMap) return;
885
964
  const run = (dep) => {
886
965
  if (dep !== void 0 && dep.subs !== void 0) {
887
- triggerEventInfos.push({
888
- target,
889
- type,
890
- key,
891
- newValue,
892
- oldValue,
893
- oldTarget
894
- });
895
966
  propagate(dep.subs);
896
967
  shallowPropagate(dep.subs);
897
- triggerEventInfos.pop();
898
968
  }
899
969
  };
900
970
  startBatch();
971
+ startTrigger();
901
972
  if (type === "clear") depsMap.forEach(run);
902
973
  else {
903
974
  const targetIsArray = isArray(target);
@@ -927,6 +998,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
927
998
  }
928
999
  }
929
1000
  }
1001
+ endTrigger({
1002
+ target,
1003
+ type,
1004
+ key,
1005
+ newValue,
1006
+ oldValue,
1007
+ oldTarget
1008
+ });
930
1009
  endBatch();
931
1010
  }
932
1011
  function getDepFromReactive(object, key) {
@@ -1141,7 +1220,7 @@ function noTracking(self, method, args = []) {
1141
1220
  //#endregion
1142
1221
  //#region packages/reactivity/src/baseHandlers.ts
1143
1222
  const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1144
- const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1223
+ const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1145
1224
  function hasOwnProperty(key) {
1146
1225
  if (!isSymbol(key)) key = String(key);
1147
1226
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1725,16 +1804,16 @@ var RefImpl = class {
1725
1804
  this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1726
1805
  const subs = this.subs;
1727
1806
  if (subs !== void 0) {
1728
- triggerEventInfos.push({
1807
+ startTrigger();
1808
+ propagate(subs);
1809
+ endTrigger({
1729
1810
  target: this,
1730
1811
  type: "set",
1731
1812
  key: "value",
1732
1813
  newValue,
1733
1814
  oldValue
1734
1815
  });
1735
- propagate(subs);
1736
1816
  if (!batchDepth) flush();
1737
- triggerEventInfos.pop();
1738
1817
  }
1739
1818
  }
1740
1819
  }
@@ -1771,8 +1850,10 @@ var RefImpl = class {
1771
1850
  function triggerRef(ref) {
1772
1851
  const dep = ref.dep;
1773
1852
  if (dep !== void 0 && dep.subs !== void 0) {
1853
+ startTrigger();
1774
1854
  propagate(dep.subs);
1775
1855
  shallowPropagate(dep.subs);
1856
+ endTrigger();
1776
1857
  if (!batchDepth) flush();
1777
1858
  }
1778
1859
  }
@@ -1963,6 +2044,10 @@ var ReactiveEffect = class {
1963
2044
  get active() {
1964
2045
  return !(this.flags & 1024);
1965
2046
  }
2047
+ /** @internal */
2048
+ get running() {
2049
+ return !!(this.flags & 4);
2050
+ }
1966
2051
  pause() {
1967
2052
  this.flags |= 256;
1968
2053
  }
@@ -1976,11 +2061,9 @@ var ReactiveEffect = class {
1976
2061
  if (!this.active) return this.fn();
1977
2062
  cleanup(this);
1978
2063
  const prevSub = startTracking(this);
1979
- incRunDepth();
1980
2064
  try {
1981
2065
  return this.fn();
1982
2066
  } finally {
1983
- decRunDepth();
1984
2067
  endTracking(this, prevSub);
1985
2068
  const flags = this.flags;
1986
2069
  if ((flags & 136) === 136) {
@@ -2003,9 +2086,9 @@ var ReactiveEffect = class {
2003
2086
  if (flags & 16) return true;
2004
2087
  if (flags & 32) {
2005
2088
  if (checkDirty(this.deps, this)) {
2006
- this.flags = flags | 16;
2089
+ if (this.active) this.flags |= 16;
2007
2090
  return true;
2008
- } else this.flags = flags & -33;
2091
+ } else this.flags &= -33;
2009
2092
  }
2010
2093
  return false;
2011
2094
  }
@@ -2017,20 +2100,17 @@ function effect(fn, options) {
2017
2100
  if (options) {
2018
2101
  const { onStop, scheduler } = options;
2019
2102
  if (onStop) {
2020
- options.onStop = void 0;
2021
2103
  const stop = e.stop.bind(e);
2022
2104
  e.stop = () => {
2023
2105
  stop();
2024
2106
  onStop();
2025
2107
  };
2026
2108
  }
2027
- if (scheduler) {
2028
- options.scheduler = void 0;
2029
- e.notify = () => {
2030
- if (!(e.flags & 256)) scheduler();
2031
- };
2032
- }
2033
- extend(e, options);
2109
+ if (scheduler) e.notify = () => {
2110
+ if (!(e.flags & 1280)) scheduler();
2111
+ };
2112
+ e.onTrack = options.onTrack;
2113
+ e.onTrigger = options.onTrigger;
2034
2114
  }
2035
2115
  try {
2036
2116
  e.run();
@@ -2090,8 +2170,10 @@ var EffectScope = class {
2090
2170
  const flags = this.flags;
2091
2171
  if (flags & 256) {
2092
2172
  this.flags = flags & -257;
2093
- for (let link = this.deps; link !== void 0; link = link.nextDep) {
2094
- const dep = link.dep;
2173
+ const deps = [];
2174
+ for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
2175
+ for (let i = 0; i < deps.length; i++) {
2176
+ const dep = deps[i];
2095
2177
  if ("resume" in dep) dep.resume();
2096
2178
  }
2097
2179
  }
@@ -2120,8 +2202,10 @@ var EffectScope = class {
2120
2202
  while (dep !== void 0) {
2121
2203
  const node = dep.dep;
2122
2204
  if ("stop" in node) {
2123
- dep = dep.nextDep;
2205
+ const prev = dep.prevDep;
2124
2206
  node.stop();
2207
+ const next = prev !== void 0 ? prev.nextDep : this.deps;
2208
+ dep = next === dep ? dep.nextDep : next;
2125
2209
  } else dep = unlink(dep, this);
2126
2210
  }
2127
2211
  cleanup(this);
@@ -2162,11 +2246,14 @@ function setCurrentScope(scope) {
2162
2246
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
2163
2247
  */
2164
2248
  function onScopeDispose(fn, failSilently = false) {
2165
- if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2166
- else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2249
+ if (activeEffectScope !== void 0) {
2250
+ if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2251
+ else fn();
2252
+ } else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2167
2253
  }
2168
2254
  //#endregion
2169
2255
  //#region packages/reactivity/src/computed.ts
2256
+ const FAILED = 64;
2170
2257
  /**
2171
2258
  * @private exported by @vue/reactivity for Vue core use, but not exported from
2172
2259
  * the main vue package
@@ -2215,12 +2302,24 @@ var ComputedRefImpl = class {
2215
2302
  }
2216
2303
  get value() {
2217
2304
  const flags = this.flags;
2218
- if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2219
- if (this.update()) {
2220
- const subs = this.subs;
2221
- if (subs !== void 0) shallowPropagate(subs);
2222
- }
2223
- } else if (flags & 32) this.flags = flags & -33;
2305
+ try {
2306
+ if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2307
+ if (this.update()) {
2308
+ const subs = this.subs;
2309
+ if (subs !== void 0) shallowPropagate(subs);
2310
+ }
2311
+ } else if (flags & 32) this.flags = flags & -33;
2312
+ } catch (err) {
2313
+ if (activeSub !== void 0) {
2314
+ onTrack(activeSub, {
2315
+ target: this,
2316
+ type: "get",
2317
+ key: "value"
2318
+ });
2319
+ link(this, activeSub);
2320
+ } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2321
+ throw err;
2322
+ }
2224
2323
  if (activeSub !== void 0) {
2225
2324
  onTrack(activeSub, {
2226
2325
  target: this,
@@ -2228,7 +2327,18 @@ var ComputedRefImpl = class {
2228
2327
  key: "value"
2229
2328
  });
2230
2329
  link(this, activeSub);
2231
- } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2330
+ } else if (activeEffectScope !== void 0) {
2331
+ if (activeEffectScope.active) link(this, activeEffectScope);
2332
+ else if (this.subs === void 0) {
2333
+ let dep = this.deps;
2334
+ if (dep !== void 0) {
2335
+ do
2336
+ dep = unlink(dep, this);
2337
+ while (dep !== void 0);
2338
+ this.flags |= 16;
2339
+ }
2340
+ }
2341
+ }
2232
2342
  return this._value;
2233
2343
  }
2234
2344
  set value(newValue) {
@@ -2240,11 +2350,15 @@ var ComputedRefImpl = class {
2240
2350
  try {
2241
2351
  const oldValue = this._value;
2242
2352
  const newValue = this.fn(oldValue);
2243
- if (hasChanged(oldValue, newValue)) {
2353
+ if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
2244
2354
  this._value = newValue;
2355
+ this.flags &= -65;
2245
2356
  return true;
2246
2357
  }
2247
2358
  return false;
2359
+ } catch (err) {
2360
+ this.flags |= FAILED;
2361
+ throw err;
2248
2362
  } finally {
2249
2363
  endTracking(this, prevSub);
2250
2364
  }
@@ -2265,6 +2379,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2265
2379
  cRef.onTrack = debugOptions.onTrack;
2266
2380
  cRef.onTrigger = debugOptions.onTrigger;
2267
2381
  }
2382
+ if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
2268
2383
  return cRef;
2269
2384
  }
2270
2385
  //#endregion
@@ -2635,7 +2750,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2635
2750
  if (isFunction(fn)) {
2636
2751
  const res = callWithErrorHandling(fn, instance, type, args);
2637
2752
  if (res && isPromise(res)) res.catch((err) => {
2638
- handleError(err, instance, type);
2753
+ handleError(err, instance, type, void 0, true);
2639
2754
  });
2640
2755
  return res;
2641
2756
  }
@@ -2645,7 +2760,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2645
2760
  return values;
2646
2761
  } else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
2647
2762
  }
2648
- function handleError(err, instance, type, throwInDev = true) {
2763
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2649
2764
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2650
2765
  if (instance) {
2651
2766
  let cur = instance.parent;
@@ -2653,7 +2768,7 @@ function handleError(err, instance, type, throwInDev = true) {
2653
2768
  const errorInfo = ErrorTypeStrings$1[type];
2654
2769
  while (cur) {
2655
2770
  const errorCapturedHooks = cur.ec;
2656
- if (errorCapturedHooks) {
2771
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
2657
2772
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
2658
2773
  }
2659
2774
  cur = cur.parent;
@@ -2958,7 +3073,11 @@ function reload(id, newComp) {
2958
3073
  updateComponentDef(record.initialDef, newComp);
2959
3074
  const instances = [...record.instances];
2960
3075
  if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2961
- for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3076
+ for (const instance of instances) {
3077
+ if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3078
+ const oldComp = normalizeClassComponent(instance.type);
3079
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
3080
+ }
2962
3081
  const dirtyInstances = new Set(instances);
2963
3082
  const rerenderedParents = /* @__PURE__ */ new Set();
2964
3083
  runWithHmrUpdating(() => {
@@ -2999,7 +3118,25 @@ function reload(id, newComp) {
2999
3118
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
3000
3119
  }
3001
3120
  parents.forEach((parent) => {
3002
- queueJob(() => {
3121
+ const children = instances.filter((instance) => instance.parent === parent);
3122
+ const update = () => {
3123
+ if (!parent.scope.active) return;
3124
+ const activeChildren = children.filter((instance) => instance.scope.active);
3125
+ if (!activeChildren.length) return;
3126
+ const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
3127
+ if (pending) {
3128
+ pending.asyncDep.catch(NOOP).then(() => {
3129
+ if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
3130
+ });
3131
+ return;
3132
+ }
3133
+ for (const instance of activeChildren) {
3134
+ const oldComp = normalizeClassComponent(instance.type);
3135
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
3136
+ if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3137
+ dirtyInstances.add(instance);
3138
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3139
+ }
3003
3140
  runWithHmrUpdating(() => {
3004
3141
  if (parent.vapor) parent.hmrRerender();
3005
3142
  else {
@@ -3010,7 +3147,12 @@ function reload(id, newComp) {
3010
3147
  }
3011
3148
  }
3012
3149
  });
3013
- });
3150
+ queuePostFlushCb(() => {
3151
+ hmrDirtyComponents.clear();
3152
+ hmrDirtyComponentsMode.clear();
3153
+ });
3154
+ };
3155
+ queueJob(update);
3014
3156
  });
3015
3157
  }
3016
3158
  queuePostFlushCb(() => {
@@ -3559,11 +3701,28 @@ function withDirectives(vnode, directives) {
3559
3701
  return vnode;
3560
3702
  }
3561
3703
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3562
- const bindings = vnode.dirs;
3704
+ let hookVNode = vnode;
3705
+ if (name === "beforeMount") vnode._mount = vnode;
3706
+ else if (name === "beforeUpdate") {
3707
+ const mount = prevVNode && prevVNode._mount;
3708
+ if (mount) {
3709
+ mount._latest = vnode;
3710
+ vnode._mount = mount;
3711
+ }
3712
+ } else if (name === "mounted") {
3713
+ const latest = vnode._latest;
3714
+ vnode._mount = vnode._latest = void 0;
3715
+ if (latest) {
3716
+ hookVNode = latest;
3717
+ latest._mount = void 0;
3718
+ }
3719
+ }
3720
+ const bindings = hookVNode.dirs;
3563
3721
  const oldBindings = prevVNode && prevVNode.dirs;
3564
3722
  for (let i = 0; i < bindings.length; i++) {
3565
- const binding = bindings[i];
3723
+ let binding = bindings[i];
3566
3724
  if (oldBindings) binding.oldValue = oldBindings[i].value;
3725
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
3567
3726
  let hook = binding.dir[name];
3568
3727
  if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
3569
3728
  if (hook) {
@@ -3571,7 +3730,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3571
3730
  callWithAsyncErrorHandling(hook, instance, 8, [
3572
3731
  vnode.el,
3573
3732
  binding,
3574
- vnode,
3733
+ hookVNode,
3575
3734
  prevVNode
3576
3735
  ]);
3577
3736
  setActiveSub(prevSub);
@@ -4014,7 +4173,15 @@ const BaseTransitionImpl = {
4014
4173
  const { mode } = rawProps;
4015
4174
  checkTransitionMode(mode);
4016
4175
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
4017
- if (!(instance.effect.flags & 1024)) instance.update();
4176
+ if (!(instance.effect.flags & 1024)) {
4177
+ if (instance.effect.running) {
4178
+ const job = () => {
4179
+ if (!(instance.effect.flags & 1024)) instance.update();
4180
+ };
4181
+ job.i = instance;
4182
+ queueJob(job);
4183
+ } else instance.update();
4184
+ }
4018
4185
  }) : NOOP);
4019
4186
  };
4020
4187
  }
@@ -4045,7 +4212,7 @@ function getLeavingNodesForType(state, vnode) {
4045
4212
  }
4046
4213
  return leavingVNodesCache;
4047
4214
  }
4048
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4215
+ function resolveTransitionHooks(vnode, props, state, instance) {
4049
4216
  const key = String(vnode.key);
4050
4217
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4051
4218
  const hooks = baseResolveTransitionHooks({
@@ -4068,9 +4235,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4068
4235
  }
4069
4236
  },
4070
4237
  cloneHooks: (vnode) => {
4071
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
4072
- if (postClone) postClone(hooks);
4073
- return hooks;
4238
+ return resolveTransitionHooks(vnode, props, state, instance);
4074
4239
  }
4075
4240
  }, props, state, instance);
4076
4241
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -4108,7 +4273,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
4108
4273
  callHook(hook, [el]);
4109
4274
  },
4110
4275
  enter(el) {
4111
- if (!isHmrUpdating && isLeaving()) return;
4276
+ if (!isHmrUpdating && isLeaving(el)) return;
4112
4277
  let hook = onEnter;
4113
4278
  let afterHook = onAfterEnter;
4114
4279
  let cancelHook = onEnterCancelled;
@@ -4152,7 +4317,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
4152
4317
  else done();
4153
4318
  },
4154
4319
  clone(node) {
4155
- return cloneHooks ? cloneHooks(node) : hooks;
4320
+ if (!cloneHooks) return hooks;
4321
+ const cloned = cloneHooks(node);
4322
+ cloned.afterLeave = () => {
4323
+ if (hooks.afterLeave) hooks.afterLeave();
4324
+ };
4325
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4326
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
4327
+ else delayedLeave();
4328
+ };
4329
+ cloned.delayedLeave = () => {
4330
+ if (hooks.delayedLeave) hooks.delayedLeave();
4331
+ };
4332
+ return cloned;
4156
4333
  }
4157
4334
  };
4158
4335
  return hooks;
@@ -4187,10 +4364,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
4187
4364
  if (state.isLeaving) return emptyPlaceholder(next);
4188
4365
  const nextInner = getInnerChild$1(next);
4189
4366
  if (!nextInner) return emptyPlaceholder(next);
4190
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
4191
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
4192
- enterHooks = hooks;
4193
- });
4367
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
4194
4368
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
4195
4369
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
4196
4370
  const mode = props.mode;
@@ -4256,9 +4430,14 @@ function setTransitionHooks(vnode, hooks) {
4256
4430
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4257
4431
  }
4258
4432
  } else if (vnode.shapeFlag & 128) {
4259
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4260
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4261
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
4433
+ const suspense = vnode.suspense;
4434
+ if (suspense) {
4435
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4436
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
4437
+ } else {
4438
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4439
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4440
+ }
4262
4441
  } else {
4263
4442
  vnode.transition = hooks;
4264
4443
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -4476,6 +4655,8 @@ const getContainerType = (container) => {
4476
4655
  if (isMathMLContainer(container)) return "mathml";
4477
4656
  };
4478
4657
  const isComment = (node) => node.nodeType === 8;
4658
+ /** The data of a comment opening a range a hydration steps over as one. */
4659
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
4479
4660
  function createHydrationFunctions(rendererInternals) {
4480
4661
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4481
4662
  const hydrate = (vnode, container) => {
@@ -4493,7 +4674,7 @@ function createHydrationFunctions(rendererInternals) {
4493
4674
  };
4494
4675
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4495
4676
  optimized = optimized || !!vnode.dynamicChildren;
4496
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
4677
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
4497
4678
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4498
4679
  const { type, ref, shapeFlag, patchFlag } = vnode;
4499
4680
  let domType = node.nodeType;
@@ -4682,16 +4863,17 @@ function createHydrationFunctions(rendererInternals) {
4682
4863
  const container = parentNode(node);
4683
4864
  const first = nextSibling(node);
4684
4865
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4685
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4866
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
4867
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
4686
4868
  else {
4687
4869
  logMismatchError();
4688
- insert(vnode.anchor = createComment(`]`), container, next);
4870
+ insert(vnode.anchor = createComment(close), container, next);
4689
4871
  return next;
4690
4872
  }
4691
4873
  };
4692
4874
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4693
4875
  if (!isNodeMismatchAllowed(node, vnode)) {
4694
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4876
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && isRangeStart(node.data) ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4695
4877
  logMismatchError();
4696
4878
  }
4697
4879
  vnode.el = null;
@@ -4707,18 +4889,18 @@ function createHydrationFunctions(rendererInternals) {
4707
4889
  const container = parentNode(node);
4708
4890
  remove(node);
4709
4891
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4710
- if (parentComponent && parentComponent.vnode) {
4892
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
4711
4893
  parentComponent.vnode.el = vnode.el;
4712
4894
  updateHOCHostEl(parentComponent, vnode.el);
4713
4895
  }
4714
4896
  return next;
4715
4897
  };
4716
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4898
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
4717
4899
  let match = 0;
4718
4900
  while (node) {
4719
4901
  node = nextSibling(node);
4720
4902
  if (node && isComment(node)) {
4721
- if (node.data === open) match++;
4903
+ if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
4722
4904
  if (node.data === close) {
4723
4905
  if (match === 0) return nextSibling(node);
4724
4906
  else match--;
@@ -4974,9 +5156,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4974
5156
  return teardown;
4975
5157
  };
4976
5158
  function forEachElement(node, cb) {
4977
- if (isComment(node) && (node.data === "[" || node.data === "(")) {
5159
+ if (isComment(node) && isRangeStart(node.data)) {
4978
5160
  const open = node.data;
4979
- const close = open === "[" ? "]" : ")";
5161
+ const close = rangeCloseOf(open);
4980
5162
  let depth = 1;
4981
5163
  let next = node.nextSibling;
4982
5164
  while (next) {
@@ -4985,7 +5167,7 @@ function forEachElement(node, cb) {
4985
5167
  } else if (isComment(next)) {
4986
5168
  if (next.data === close) {
4987
5169
  if (--depth === 0) break;
4988
- } else if (next.data === open) depth++;
5170
+ } else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
4989
5171
  }
4990
5172
  next = next.nextSibling;
4991
5173
  }
@@ -5013,7 +5195,7 @@ function defineAsyncComponent(source) {
5013
5195
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
5014
5196
  const onError = (err) => {
5015
5197
  setPendingRequest(null);
5016
- handleError(err, instance, 13, !errorComponent);
5198
+ handleError(err, instance, 13, !errorComponent, true);
5017
5199
  };
5018
5200
  if (suspensible && instance.suspense || isInSSRComponentSetup) return load().then((comp) => {
5019
5201
  return () => createInnerComp(comp, instance);
@@ -5094,10 +5276,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
5094
5276
  const delayed = /* @__PURE__ */ ref(!!delay);
5095
5277
  let timeoutTimer;
5096
5278
  let delayTimer;
5097
- if (instance) onUnmounted(() => {
5098
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
5099
- if (delayTimer != null) clearTimeout(delayTimer);
5100
- }, instance);
5279
+ if (instance) instance.scope.run(() => {
5280
+ onScopeDispose(() => {
5281
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5282
+ if (delayTimer != null) clearTimeout(delayTimer);
5283
+ });
5284
+ });
5101
5285
  if (delay) delayTimer = setTimeout(() => {
5102
5286
  if (instance && instance.isUnmounted) return;
5103
5287
  delayed.value = false;
@@ -5132,7 +5316,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
5132
5316
  }
5133
5317
  return;
5134
5318
  }
5135
- if (!el.parentNode || wasConnected && !el.isConnected) return;
5319
+ if (!el.parentNode) return;
5320
+ if (wasConnected && !el.isConnected) {
5321
+ let current = instance;
5322
+ while (current && !current.isDeactivated) current = current.parent;
5323
+ if (!current) return;
5324
+ }
5136
5325
  hydrate();
5137
5326
  };
5138
5327
  const doHydrate = hydrateStrategy ? () => {
@@ -5190,7 +5379,11 @@ const KeepAliveImpl = {
5190
5379
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
5191
5380
  };
5192
5381
  sharedContext.deactivate = (vnode) => {
5193
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5382
+ const cached = sharedContext.getCachedComponent(vnode);
5383
+ if (!cached || cached.component !== vnode.component) return false;
5384
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
5385
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5386
+ return true;
5194
5387
  };
5195
5388
  function unmount(vnode) {
5196
5389
  resetShapeFlag(vnode);
@@ -5222,11 +5415,15 @@ const KeepAliveImpl = {
5222
5415
  let pendingCacheKey = null;
5223
5416
  const cacheSubtree = () => {
5224
5417
  if (pendingCacheKey != null) {
5225
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
5226
- const vnode = getInnerChild(keepAliveInstance.subTree);
5227
- if (vnode.component) cache.set(pendingCacheKey, vnode);
5228
- }, void 0, keepAliveInstance.subTree.suspense);
5229
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5418
+ if (isSuspense(keepAliveInstance.subTree.type)) {
5419
+ const cacheInnerChild = () => {
5420
+ const vnode = getInnerChild(keepAliveInstance.subTree);
5421
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
5422
+ };
5423
+ const suspense = keepAliveInstance.subTree.suspense;
5424
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
5425
+ else cacheInnerChild();
5426
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5230
5427
  }
5231
5428
  };
5232
5429
  onMounted(cacheSubtree);
@@ -5336,9 +5533,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
5336
5533
  }
5337
5534
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5338
5535
  const injected = injectHook(type, hook, keepAliveRoot, true);
5339
- onUnmounted(() => {
5340
- remove(keepAliveRoot[type], injected);
5341
- }, target);
5536
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
5537
+ removal.flags = 8;
5342
5538
  }
5343
5539
  function resetShapeFlag(vnode) {
5344
5540
  vnode.shapeFlag &= -257;
@@ -5777,6 +5973,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5777
5973
  ret.props = extend({}, ret.props, { key: branchKey });
5778
5974
  ret.key = branchKey;
5779
5975
  }
5976
+ if (isBlockTreeEnabled <= 0) {
5977
+ if (!ret.vs.props) ret.vs.props = ret.props;
5978
+ ret.props = ret.key != null ? { key: ret.key } : null;
5979
+ ret.vs.attrs = EMPTY_OBJ;
5980
+ }
5780
5981
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5781
5982
  return ret;
5782
5983
  }
@@ -6757,7 +6958,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6757
6958
  if (options.el) return vm.$mount(options.el);
6758
6959
  else return vm;
6759
6960
  }
6760
- Vue.version = `2.6.14-compat:3.6.0-rc.13`;
6961
+ Vue.version = `2.6.14-compat:3.6.0-rc.15`;
6761
6962
  Vue.config = singletonApp.config;
6762
6963
  Vue.use = (plugin, ...options) => {
6763
6964
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -8217,8 +8418,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8217
8418
  def(el, "__vnode", vnode, true);
8218
8419
  def(el, "__vueParentComponent", parentComponent, true);
8219
8420
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8220
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8221
- else hostInsert(el, container, anchor);
8421
+ if (transition) {
8422
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
8423
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8424
+ } else hostInsert(el, container, anchor);
8222
8425
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
8223
8426
  const isHmr = isHmrUpdating;
8224
8427
  queuePostRenderEffect(() => {
@@ -8483,16 +8686,20 @@ function baseCreateRenderer(options, createHydrationFns) {
8483
8686
  } else {
8484
8687
  let { next, bu, u, parent, vnode } = instance;
8485
8688
  {
8486
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8487
- if (nonHydratedAsyncRoot) {
8689
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8690
+ if (unresolvedAsyncRoot) {
8488
8691
  if (next) {
8489
8692
  next.el = vnode.el;
8490
8693
  updateComponentPreRender(instance, next, optimized);
8491
8694
  }
8492
- nonHydratedAsyncRoot.asyncDep.then(() => {
8493
- queuePostRenderEffect(() => {
8494
- if (!instance.isUnmounted) instance.update();
8495
- }, void 0, parentSuspense);
8695
+ unresolvedAsyncRoot.asyncDep.then(() => {
8696
+ const retry = () => {
8697
+ if (instance.effect.flags & 1024) return;
8698
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
8699
+ else instance.update();
8700
+ };
8701
+ retry.flags = 24;
8702
+ queuePostRenderEffect(retry, void 0, parentSuspense);
8496
8703
  });
8497
8704
  return;
8498
8705
  }
@@ -8516,7 +8723,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8516
8723
  const prevTree = instance.subTree;
8517
8724
  instance.subTree = nextTree;
8518
8725
  startMeasure(instance, `patch`);
8519
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8726
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8520
8727
  endMeasure(instance, `patch`);
8521
8728
  next.el = nextTree.el;
8522
8729
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
@@ -8720,9 +8927,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8720
8927
  }
8721
8928
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
8722
8929
  if (shapeFlag & 256) {
8723
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
8724
- else parentComponent.ctx.deactivate(vnode);
8725
- return;
8930
+ if (parentComponent.ctx.deactivate(vnode)) return;
8726
8931
  }
8727
8932
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
8728
8933
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -8803,13 +9008,15 @@ function baseCreateRenderer(options, createHydrationFns) {
8803
9008
  if (effect) {
8804
9009
  effect.stop();
8805
9010
  unmount(subTree, instance, parentSuspense, doRemove);
8806
- } else if (instance.vnode.el && subTree) {
9011
+ } else if (subTree) {
8807
9012
  subTree.transition = instance.vnode.transition;
8808
9013
  unmount(subTree, instance, parentSuspense, doRemove);
8809
9014
  }
8810
9015
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8811
9016
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8812
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
9017
+ const markUnmounted = () => instance.isUnmounted = true;
9018
+ markUnmounted.flags = 8;
9019
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
8813
9020
  devtoolsComponentRemoved(instance);
8814
9021
  };
8815
9022
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
@@ -8923,11 +9130,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8923
9130
  c2.el && (c2.el.__vnode = c2);
8924
9131
  }
8925
9132
  }
8926
- function locateNonHydratedAsyncRoot(instance) {
9133
+ function locateUnresolvedAsyncRoot(instance) {
8927
9134
  const subComponent = instance.subTree && instance.subTree.component;
8928
9135
  if (subComponent) {
8929
9136
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
8930
- else return locateNonHydratedAsyncRoot(subComponent);
9137
+ else return locateUnresolvedAsyncRoot(subComponent);
8931
9138
  }
8932
9139
  }
8933
9140
  function invalidateMount(hooks) {
@@ -8997,7 +9204,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
8997
9204
  function resolveAsyncComponentPlaceholder(anchorVnode) {
8998
9205
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
8999
9206
  const instance = anchorVnode.component;
9000
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
9207
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
9208
+ const suspense = anchorVnode.suspense;
9209
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
9001
9210
  return null;
9002
9211
  }
9003
9212
  //#endregion
@@ -9009,17 +9218,22 @@ function withSuspenseEnabled(value) {
9009
9218
  return value;
9010
9219
  }
9011
9220
  let suspenseId = 0;
9221
+ const deferredEnterKey = Symbol("_deferredEnter");
9012
9222
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
9013
9223
  name: "Suspense",
9014
9224
  __isSuspense: true,
9015
9225
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
9016
9226
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
9017
9227
  else {
9018
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9019
- n2.suspense = n1.suspense;
9020
- n2.suspense.vnode = n2;
9021
- n2.el = n1.el;
9022
- return;
9228
+ const suspense = n1.suspense;
9229
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9230
+ const owner = suspense.parentComponent;
9231
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
9232
+ n2.suspense = suspense;
9233
+ suspense.vnode = n2;
9234
+ n2.el = n1.el;
9235
+ return;
9236
+ }
9023
9237
  }
9024
9238
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
9025
9239
  }
@@ -9031,6 +9245,36 @@ function triggerEvent(vnode, name) {
9031
9245
  const eventListener = vnode.props && vnode.props[name];
9032
9246
  if (isFunction(eventListener)) eventListener();
9033
9247
  }
9248
+ function enterDeferred(suspense, branch) {
9249
+ const enters = [];
9250
+ collectDeferredEnters(branch, enters, true);
9251
+ if (isVaporInteropEnabled) {
9252
+ const { parentComponent } = suspense;
9253
+ const vapor = parentComponent && parentComponent.appContext.vapor;
9254
+ if (vapor) vapor.enterDeferred(suspense, enters);
9255
+ }
9256
+ if (enters.length) queuePostFlushCb(enters);
9257
+ }
9258
+ function collectDeferredEnters(vnode, enters, isRoot) {
9259
+ const { el, transition, children, shapeFlag } = vnode;
9260
+ if (shapeFlag & 6) {
9261
+ const subTree = vnode.component.subTree;
9262
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
9263
+ return;
9264
+ }
9265
+ if (shapeFlag & 192) return;
9266
+ if (shapeFlag & 1) {
9267
+ if (!isRoot && el && el[deferredEnterKey]) {
9268
+ el[deferredEnterKey] = void 0;
9269
+ if (transition && !transition.persisted) {
9270
+ transition.beforeEnter(el);
9271
+ enters.push(() => transition.enter(el));
9272
+ }
9273
+ }
9274
+ isRoot = false;
9275
+ }
9276
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
9277
+ }
9034
9278
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
9035
9279
  const { p: patch, o: { createElement } } = rendererInternals;
9036
9280
  const hiddenContainer = createElement("div");
@@ -9070,11 +9314,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9070
9314
  suspense.activeBranch = pendingBranch;
9071
9315
  } else unmount(pendingBranch, parentComponent, suspense);
9072
9316
  suspense.deps = 0;
9073
- for (let i = 0; i < suspense.effects.length; i++) {
9074
- const effect = suspense.effects[i];
9075
- if (effect.flags & 8) queuePostFlushCb(effect);
9076
- }
9077
- suspense.effects.length = 0;
9317
+ discardEffects(suspense);
9078
9318
  suspense.hiddenContainer = createElement("div");
9079
9319
  if (isInFallback) {
9080
9320
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -9097,14 +9337,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9097
9337
  } else {
9098
9338
  triggerEvent(n2, "onPending");
9099
9339
  suspense.pendingBranch = newBranch;
9100
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
9101
- else suspense.pendingId = suspenseId++;
9340
+ suspense.pendingId = suspenseId++;
9102
9341
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
9103
9342
  if (suspense.deps <= 0) suspense.resolve();
9104
9343
  else {
9105
- const { timeout, pendingId } = suspense;
9106
- if (timeout > 0) setTimeout(() => {
9107
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
9344
+ const { timeout } = suspense;
9345
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
9346
+ suspense.timeoutTimer = void 0;
9347
+ suspense.fallback(suspense.vnode.ssFallback);
9108
9348
  }, timeout);
9109
9349
  else if (timeout === 0) suspense.fallback(newFallback);
9110
9350
  }
@@ -9140,6 +9380,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9140
9380
  deps: 0,
9141
9381
  pendingId: suspenseId++,
9142
9382
  timeout: typeof timeout === "number" ? timeout : -1,
9383
+ timeoutTimer: void 0,
9143
9384
  activeBranch: null,
9144
9385
  isFallbackMountPending: false,
9145
9386
  pendingBranch: null,
@@ -9157,26 +9398,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9157
9398
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9158
9399
  let hasUpdatedAnchor = false;
9159
9400
  if (delayEnter) activeBranch.transition.afterLeave = () => {
9160
- if (pendingId === suspense.pendingId) {
9401
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9402
+ enterDeferred(suspense, pendingBranch);
9161
9403
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
9162
9404
  queuePostFlushCb(effects);
9163
9405
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
9164
9406
  }
9165
9407
  };
9166
9408
  if (activeBranch && !suspense.isFallbackMountPending) {
9167
- if (parentNode(activeBranch.el) === container) {
9409
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
9168
9410
  anchor = next(activeBranch);
9169
9411
  hasUpdatedAnchor = true;
9170
9412
  }
9171
9413
  unmount(activeBranch, parentComponent, suspense, true);
9172
9414
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
9173
9415
  }
9174
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
9416
+ if (!delayEnter) {
9417
+ enterDeferred(suspense, pendingBranch);
9418
+ move(pendingBranch, container, anchor, 0, parentComponent);
9419
+ }
9175
9420
  }
9421
+ clearTimeout(suspense.timeoutTimer);
9422
+ suspense.timeoutTimer = void 0;
9176
9423
  suspense.isFallbackMountPending = false;
9177
9424
  setActiveBranch(suspense, pendingBranch);
9178
9425
  suspense.pendingBranch = null;
9179
9426
  suspense.isInFallback = false;
9427
+ let kept = 0;
9428
+ for (let i = 0; i < effects.length; i++) {
9429
+ const effect = effects[i];
9430
+ if (effect.flags & 16) queuePostFlushCb(effect);
9431
+ else effects[kept++] = effect;
9432
+ }
9433
+ effects.length = kept;
9180
9434
  let parent = suspense.parent;
9181
9435
  let hasUnresolvedAncestor = false;
9182
9436
  while (parent) {
@@ -9199,13 +9453,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9199
9453
  triggerEvent(vnode, "onResolve");
9200
9454
  },
9201
9455
  fallback(fallbackVNode) {
9202
- if (!suspense.pendingBranch) return;
9456
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
9203
9457
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
9204
9458
  triggerEvent(vnode, "onFallback");
9205
9459
  const anchor = next(activeBranch);
9206
9460
  const mountFallback = () => {
9207
9461
  suspense.isFallbackMountPending = false;
9208
- if (!suspense.isInFallback) return;
9462
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
9209
9463
  const latestFallback = suspense.vnode.ssFallback;
9210
9464
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
9211
9465
  setActiveBranch(suspense, latestFallback);
@@ -9229,24 +9483,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9229
9483
  registerDep(instance, onResolve) {
9230
9484
  const isInPendingSuspense = !!suspense.pendingBranch;
9231
9485
  if (isInPendingSuspense) suspense.deps++;
9486
+ const render = (setupResult) => {
9487
+ instance.asyncResolved = true;
9488
+ onResolve(setupResult);
9489
+ };
9232
9490
  instance.asyncDep.catch((err) => {
9233
- handleError(err, instance, 0);
9491
+ handleError(err, instance, 0, false, true);
9492
+ return () => null;
9234
9493
  }).then((asyncSetupResult) => {
9235
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9494
+ if (instance.isUnmounted || suspense.isUnmounted) return;
9495
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
9236
9496
  setCurrentInstance(null, void 0);
9237
9497
  if (!instance.scope.active) {
9238
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9498
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9239
9499
  return;
9240
9500
  }
9241
- instance.asyncResolved = true;
9242
- onResolve(asyncSetupResult);
9243
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9501
+ if (!isPendingDep && suspense.pendingBranch) {
9502
+ const job = () => {
9503
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
9504
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
9505
+ else render(asyncSetupResult);
9506
+ };
9507
+ job.flags = 24;
9508
+ queueEffectWithSuspense(job, void 0, suspense);
9509
+ return;
9510
+ }
9511
+ render(asyncSetupResult);
9512
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9244
9513
  });
9245
9514
  },
9246
9515
  unmount(parentSuspense, doRemove) {
9247
9516
  suspense.isUnmounted = true;
9517
+ clearTimeout(suspense.timeoutTimer);
9518
+ suspense.timeoutTimer = void 0;
9519
+ if (parentSuspenseId !== void 0) {
9520
+ const parent = suspense.parent;
9521
+ const pendingId = parentSuspenseId;
9522
+ parentSuspenseId = void 0;
9523
+ queuePostFlushCb(() => {
9524
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
9525
+ });
9526
+ }
9248
9527
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
9249
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
9528
+ if (suspense.pendingBranch) {
9529
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
9530
+ discardEffects(suspense);
9531
+ }
9250
9532
  }
9251
9533
  };
9252
9534
  return suspense;
@@ -9287,6 +9569,14 @@ function normalizeSuspenseSlot(s) {
9287
9569
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
9288
9570
  return s;
9289
9571
  }
9572
+ function discardEffects(suspense) {
9573
+ const { effects } = suspense;
9574
+ for (let i = 0; i < effects.length; i++) {
9575
+ const effect = effects[i];
9576
+ if (effect.flags & 8) queuePostFlushCb(effect);
9577
+ }
9578
+ effects.length = 0;
9579
+ }
9290
9580
  function queueEffectWithSuspense(fn, id, suspense) {
9291
9581
  if (suspense && suspense.pendingBranch) {
9292
9582
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -9554,7 +9844,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9554
9844
  }
9555
9845
  function guardReactiveProps(props) {
9556
9846
  if (!props) return null;
9557
- return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
9847
+ if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
9848
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
9558
9849
  }
9559
9850
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
9560
9851
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -9668,6 +9959,17 @@ function normalizeVNode(child) {
9668
9959
  function cloneIfMounted(child) {
9669
9960
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
9670
9961
  }
9962
+ let deferElementSlots = false;
9963
+ /**
9964
+ * While enabled, compiled default slots passed as children of plain elements
9965
+ * are kept on the vnode so the server renderer can render them in push mode.
9966
+ * @internal
9967
+ */
9968
+ function setDeferElementSlots(value) {
9969
+ const prev = deferElementSlots;
9970
+ deferElementSlots = value;
9971
+ return prev;
9972
+ }
9671
9973
  function normalizeChildren(vnode, children) {
9672
9974
  let type = 0;
9673
9975
  const { shapeFlag } = vnode;
@@ -9676,6 +9978,11 @@ function normalizeChildren(vnode, children) {
9676
9978
  else if (typeof children === "object") {
9677
9979
  if (shapeFlag & 65) {
9678
9980
  const slot = children.default;
9981
+ if (deferElementSlots && slot && slot._c && shapeFlag & 1) {
9982
+ vnode.children = children;
9983
+ vnode.shapeFlag |= 32;
9984
+ return;
9985
+ }
9679
9986
  if (slot) {
9680
9987
  slot._c && (slot._d = false);
9681
9988
  normalizeChildren(vnode, slot());
@@ -9950,7 +10257,8 @@ function setupStatefulComponent(instance, isSSR) {
9950
10257
  setInSSRSetupState(false);
9951
10258
  }
9952
10259
  }).catch((e) => {
9953
- handleError(e, instance, 0);
10260
+ handleError(e, instance, 0, void 0, true);
10261
+ instance.ssrRender = (_, push) => push("<!---->");
9954
10262
  });
9955
10263
  else {
9956
10264
  instance.asyncDep = setupResult;
@@ -10025,11 +10333,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10025
10333
  else warn$1(`Component is missing template or render function: `, Component);
10026
10334
  }
10027
10335
  }
10336
+ /**
10337
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
10338
+ * @internal
10339
+ */
10340
+ const rawAttrsKey = Symbol();
10028
10341
  const attrsProxyHandlers = {
10029
10342
  get(target, key) {
10030
10343
  markAttrsAccessed();
10031
10344
  track(target, "get", "");
10032
- return target[key];
10345
+ return key === rawAttrsKey ? target : target[key];
10033
10346
  },
10034
10347
  set() {
10035
10348
  warn$1(`setupContext.attrs is readonly.`);
@@ -10327,7 +10640,7 @@ function isMemoSame(cached, memo) {
10327
10640
  }
10328
10641
  //#endregion
10329
10642
  //#region packages/runtime-core/src/index.ts
10330
- const version = "3.6.0-rc.13";
10643
+ const version = "3.6.0-rc.15";
10331
10644
  const warn = warn$1;
10332
10645
  /**
10333
10646
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10353,7 +10666,8 @@ const ssrUtils = {
10353
10666
  popWarningContext,
10354
10667
  VaporSlot,
10355
10668
  rawVaporSlotKey,
10356
- invokeSlotFallback
10669
+ invokeSlotFallback,
10670
+ setDeferElementSlots
10357
10671
  };
10358
10672
  /**
10359
10673
  * @internal only exposed in compat builds
@@ -11142,7 +11456,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
11142
11456
  }
11143
11457
  this._styleAnchors.delete(this._def);
11144
11458
  this._applyStyles(newStyles);
11145
- if (!this._instance.vapor) this._instance = null;
11459
+ this._instance = null;
11146
11460
  this._update();
11147
11461
  };
11148
11462
  const dispatch = (event, args) => {
@@ -11757,15 +12071,15 @@ const vModelSelect = {
11757
12071
  vModelSelectInit(el, value, number);
11758
12072
  el[assignKey] = getModelAssigner(vnode);
11759
12073
  },
11760
- mounted(el, { value }) {
11761
- vModelSetSelected(el, value);
12074
+ mounted(el, { value, modifiers: { number } }) {
12075
+ vModelSetSelected(el, value, number);
11762
12076
  },
11763
12077
  beforeUpdate(el, { value }, vnode) {
11764
12078
  el._modelValue = value;
11765
12079
  el[assignKey] = getModelAssigner(vnode);
11766
12080
  },
11767
- updated(el, { value }) {
11768
- vModelSetSelected(el, value);
12081
+ updated(el, { value, modifiers: { number } }) {
12082
+ vModelSetSelected(el, value, number);
11769
12083
  }
11770
12084
  };
11771
12085
  /**
@@ -11800,14 +12114,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
11800
12114
  /**
11801
12115
  * @internal
11802
12116
  */
11803
- const vModelSetSelected = (el, value) => {
12117
+ const vModelSetSelected = (el, value, number = false) => {
11804
12118
  el._modelValue = value;
11805
12119
  const pending = el._pendingValue;
11806
12120
  el._pendingValue = void 0;
11807
12121
  if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
11808
- setSelected(el, value);
12122
+ setSelected(el, value, number);
11809
12123
  };
11810
- function setSelected(el, value) {
12124
+ function setSelected(el, value, number) {
11811
12125
  const isMultiple = el.multiple;
11812
12126
  const isArrayValue = isArray(value);
11813
12127
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -11822,7 +12136,7 @@ function setSelected(el, value) {
11822
12136
  const optionType = typeof optionValue;
11823
12137
  if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
11824
12138
  else option.selected = looseIndexOf(value, optionValue) > -1;
11825
- } else option.selected = value.has(optionValue);
12139
+ } else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
11826
12140
  } else if (looseEqual(getValue(option), value)) {
11827
12141
  if (el.selectedIndex !== i) el.selectedIndex = i;
11828
12142
  return;
@@ -14118,7 +14432,15 @@ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
14118
14432
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
14119
14433
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
14120
14434
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
14435
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
14436
+ const isReservedWord = /*@__PURE__*/ makeMap("await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield");
14437
+ const isUnparsedIdentifier = (exp) => {
14438
+ if (exp.ast !== null) return false;
14439
+ const content = getExpSource(exp);
14440
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
14441
+ };
14121
14442
  const isMemberExpressionNode = (exp, context) => {
14443
+ if (isUnparsedIdentifier(exp)) return true;
14122
14444
  try {
14123
14445
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
14124
14446
  ret = unwrapTSNode(ret);
@@ -14129,6 +14451,7 @@ const isMemberExpressionNode = (exp, context) => {
14129
14451
  };
14130
14452
  const isMemberExpression = isMemberExpressionNode;
14131
14453
  const isFnExpressionNode = (exp, context) => {
14454
+ if (isUnparsedIdentifier(exp)) return false;
14132
14455
  try {
14133
14456
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
14134
14457
  if (ret.type === "Program") {
@@ -14781,7 +15104,11 @@ function getLoc(start, end) {
14781
15104
  };
14782
15105
  }
14783
15106
  function cloneLoc(loc) {
14784
- return getLoc(loc.start.offset, loc.end.offset);
15107
+ return {
15108
+ start: extend({}, loc.start),
15109
+ end: extend({}, loc.end),
15110
+ source: loc.source
15111
+ };
14785
15112
  }
14786
15113
  function setLocEnd(loc, end) {
14787
15114
  loc.end = tokenizer.getPos(end);
@@ -17608,7 +17935,7 @@ const stringifyStatic = (children, context, parent) => {
17608
17935
  for (; i < children.length; i++) {
17609
17936
  const child = children[i];
17610
17937
  if (isParentCached || getCachedNode(child)) {
17611
- const result = analyzeNode(child);
17938
+ const result = analyzeNode(child, context);
17612
17939
  if (result) {
17613
17940
  nc += result[0];
17614
17941
  ec += result[1];
@@ -17638,7 +17965,7 @@ const isNonStringifiable = /*@__PURE__*/ makeMap(`caption,thead,tr,th,tbody,td,t
17638
17965
  * - nc is the number of nodes inside
17639
17966
  * - ec is the number of element with bindings inside
17640
17967
  */
17641
- function analyzeNode(node) {
17968
+ function analyzeNode(node, context) {
17642
17969
  if (node.type === 1 && isNonStringifiable(node.tag)) return false;
17643
17970
  if (node.type === 1 && findDir(node, "once", true)) return false;
17644
17971
  if (node.type === 12) return [1, 0];
@@ -17657,6 +17984,7 @@ function analyzeNode(node) {
17657
17984
  if (p.type === 7 && p.name === "bind") {
17658
17985
  if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
17659
17986
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
17987
+ if (p.arg && p.arg.isStatic && (isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && context.isCustomElement(node.tag)) return bail();
17660
17988
  if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
17661
17989
  }
17662
17990
  }
@@ -17701,11 +18029,10 @@ function stringifyElement(node, context) {
17701
18029
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
17702
18030
  continue;
17703
18031
  }
17704
- if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") continue;
17705
18032
  let evaluated = evaluateConstant(exp);
17706
18033
  if (evaluated != null) {
17707
- const arg = p.arg && p.arg.content;
17708
- if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) continue;
18034
+ const arg = p.arg.content;
18035
+ if ((isBooleanAttr(arg) || arg === "hidden") && !includeBooleanAttr(evaluated)) continue;
17709
18036
  if (arg === "class") evaluated = normalizeClass(evaluated);
17710
18037
  else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
17711
18038
  res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;