@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.
@@ -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
  **/
@@ -72,10 +72,18 @@ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
72
72
  const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
73
73
  const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
74
74
  const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
75
+ const STRING_CACHE_MAX_SIZE = 1e4;
75
76
  const cacheStringFunction = (fn) => {
76
- const cache = Object.create(null);
77
+ let cache = Object.create(null);
78
+ let size = 0;
77
79
  return ((str) => {
78
- return cache[str] || (cache[str] = fn(str));
80
+ const hit = cache[str];
81
+ if (hit !== void 0) return hit;
82
+ if (++size > STRING_CACHE_MAX_SIZE) {
83
+ cache = Object.create(null);
84
+ size = 1;
85
+ }
86
+ return cache[str] = fn(str);
79
87
  });
80
88
  };
81
89
  const camelizeRE = /-(\w)/g;
@@ -83,22 +91,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
83
91
  /**
84
92
  * @private
85
93
  */
86
- const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
94
+ const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
87
95
  const hyphenateRE = /\B([A-Z])/g;
88
96
  /**
89
97
  * @private
90
98
  */
91
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
99
+ const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
92
100
  /**
93
101
  * @private
94
102
  */
95
- const capitalize = cacheStringFunction((str) => {
103
+ const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
96
104
  return str.charAt(0).toUpperCase() + str.slice(1);
97
105
  });
98
106
  /**
99
107
  * @private
100
108
  */
101
- const toHandlerKey = cacheStringFunction((str) => {
109
+ const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
102
110
  return str ? `on${capitalize(str)}` : ``;
103
111
  });
104
112
  /**
@@ -237,26 +245,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
237
245
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
238
246
  */
239
247
  const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
240
- //#endregion
241
- //#region packages/shared/src/domAttrConfig.ts
242
- /**
243
- * On the client we only need to offer special cases for boolean attributes that
244
- * have different names from their corresponding dom properties:
245
- * - itemscope -> N/A
246
- * - allowfullscreen -> allowFullscreen
247
- * - formnovalidate -> formNoValidate
248
- * - ismap -> isMap
249
- * - nomodule -> noModule
250
- * - novalidate -> noValidate
251
- * - playsinline -> playsInline
252
- * - readonly -> readOnly
253
- */
254
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
255
- const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
248
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
256
249
  /**
257
250
  * The full list is needed during SSR to produce the correct initial markup.
258
251
  */
259
- const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
252
+ 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");
260
253
  /**
261
254
  * Boolean attributes should be included if the value is truthy or ''.
262
255
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -467,17 +460,37 @@ function getSequence(arr) {
467
460
  return result;
468
461
  }
469
462
  //#endregion
463
+ //#region packages/shared/src/vaporFlags.ts
464
+ /**
465
+ * The data of the comment a vapor server render opens the branch of a `v-if`
466
+ * chain with, `<!--[1-->`: the digits are the branch's position in the chain,
467
+ * and `<!--]-->` closes it like a fragment.
468
+ */
469
+ function isVaporBranchStart(data) {
470
+ if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
471
+ for (let i = 1; i < data.length; i++) {
472
+ const c = data.charCodeAt(i);
473
+ if (c < 48 || c > 57) return false;
474
+ }
475
+ return true;
476
+ }
477
+ /**
478
+ * The data of a comment opening a range only a vapor server render emits:
479
+ * `<!--{-->` around the render of a component, or a v-if branch's.
480
+ */
481
+ function isVaporRangeStart(data) {
482
+ return data === "{" || isVaporBranchStart(data);
483
+ }
484
+ /** The data of the comment closing the range `open` opens. */
485
+ function rangeCloseOf(open) {
486
+ return open === "(" ? ")" : open === "{" ? "}" : "]";
487
+ }
488
+ //#endregion
470
489
  //#region packages/reactivity/src/system.ts
471
490
  const notifyBuffer = [];
472
491
  let batchDepth = 0;
473
492
  let activeSub = void 0;
474
- let runDepth = 0;
475
- function incRunDepth() {
476
- ++runDepth;
477
- }
478
- function decRunDepth() {
479
- --runDepth;
480
- }
493
+ const CHECKING = 512;
481
494
  let globalVersion = 0;
482
495
  let notifyIndex = 0;
483
496
  let notifyBufferLength = 0;
@@ -526,6 +539,7 @@ function unlink(link, sub = link.sub) {
526
539
  const nextDep = link.nextDep;
527
540
  const nextSub = link.nextSub;
528
541
  const prevSub = link.prevSub;
542
+ link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
529
543
  if (nextDep !== void 0) nextDep.prevDep = prevDep;
530
544
  else sub.depsTail = prevDep;
531
545
  if (prevDep !== void 0) prevDep.nextDep = nextDep;
@@ -533,7 +547,7 @@ function unlink(link, sub = link.sub) {
533
547
  if (nextSub !== void 0) nextSub.prevSub = prevSub;
534
548
  else dep.subsTail = prevSub;
535
549
  if (prevSub !== void 0) prevSub.nextSub = nextSub;
536
- else if ((dep.subs = nextSub) === void 0) {
550
+ else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
537
551
  let toRemove = dep.deps;
538
552
  if (toRemove !== void 0) {
539
553
  do
@@ -551,14 +565,12 @@ function propagate(link) {
551
565
  const sub = link.sub;
552
566
  let flags = sub.flags;
553
567
  if (flags & 3) {
554
- if (!(flags & 60)) {
555
- sub.flags = flags | 32;
556
- if (runDepth) sub.flags |= 8;
557
- } else if (!(flags & 12)) flags = 0;
568
+ if (!(flags & 44)) sub.flags = flags | 32;
569
+ else if (!(flags & 12)) flags = 0;
558
570
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
559
571
  else if (!(flags & 48) && isValidLink(link, sub)) {
560
572
  sub.flags = flags | 40;
561
- flags &= 1;
573
+ flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
562
574
  } else flags = 0;
563
575
  if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
564
576
  if (flags & 1) {
@@ -594,15 +606,18 @@ function propagate(link) {
594
606
  function startTracking(sub) {
595
607
  ++globalVersion;
596
608
  sub.depsTail = void 0;
597
- sub.flags = sub.flags & -57 | 4;
609
+ sub.flags = sub.flags & -569 | 4;
598
610
  return setActiveSub(sub);
599
611
  }
600
612
  function endTracking(sub, prevSub) {
601
613
  activeSub = prevSub;
602
614
  const depsTail = sub.depsTail;
603
615
  let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
604
- while (toRemove !== void 0) toRemove = unlink(toRemove, sub);
605
- sub.flags &= -5;
616
+ while (toRemove !== void 0) {
617
+ unlink(toRemove, sub);
618
+ toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
619
+ }
620
+ if ((sub.flags &= -5) & 8) markRecursed(sub);
606
621
  }
607
622
  function flush() {
608
623
  let hasError = false;
@@ -624,45 +639,67 @@ function flush() {
624
639
  if (hasError) throw error;
625
640
  }
626
641
  function checkDirty(link, sub) {
642
+ try {
643
+ return walkDirty(link, sub);
644
+ } catch (err) {
645
+ markStale(sub);
646
+ throw err;
647
+ }
648
+ }
649
+ function walkDirty(link, sub) {
650
+ const root = sub;
627
651
  let stack;
628
652
  let checkDepth = 0;
653
+ let staleDepth = 0;
654
+ let staleFloor = 0;
629
655
  top: do {
630
656
  const dep = link.dep;
631
657
  const depFlags = dep.flags;
632
658
  let dirty = false;
633
659
  if (sub.flags & 16) dirty = true;
634
660
  else if ((depFlags & 17) === 17) {
635
- const subs = dep.subs;
636
661
  if (dep.update()) {
637
- if (subs.nextSub !== void 0) shallowPropagate(subs);
662
+ const subs = dep.subs;
663
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
638
664
  dirty = true;
639
665
  }
640
666
  } else if ((depFlags & 33) === 33) {
641
- stack = {
642
- value: link,
643
- prev: stack
644
- };
645
- link = dep.deps;
646
- sub = dep;
647
- ++checkDepth;
648
- continue;
667
+ const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
668
+ if (depth < 0) {
669
+ if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
670
+ stack = {
671
+ value: link,
672
+ prev: stack
673
+ };
674
+ link = dep.deps;
675
+ sub = dep;
676
+ ++checkDepth;
677
+ continue;
678
+ }
679
+ if (depth < checkDepth) {
680
+ staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
681
+ staleDepth = checkDepth;
682
+ }
649
683
  }
650
684
  if (!dirty && link.nextDep !== void 0) {
651
685
  link = link.nextDep;
652
686
  continue;
653
687
  }
654
688
  while (checkDepth) {
689
+ const stale = checkDepth === staleDepth;
690
+ if (stale && --staleDepth === staleFloor) staleDepth = 0;
655
691
  --checkDepth;
656
692
  link = stack.value;
657
693
  stack = stack.prev;
658
694
  if (dirty) {
659
- const subs = sub.subs;
660
695
  if (sub.update()) {
661
- if (subs.nextSub !== void 0) shallowPropagate(subs);
696
+ const subs = sub.subs;
697
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
662
698
  sub = link.sub;
663
699
  continue;
664
700
  }
665
- } else sub.flags &= -33;
701
+ } else if (stale) sub.flags = sub.flags & -545 | 16;
702
+ else sub.flags &= -545;
666
703
  sub = link.sub;
667
704
  if (link.nextDep !== void 0) {
668
705
  link = link.nextDep;
@@ -670,9 +707,21 @@ function checkDirty(link, sub) {
670
707
  }
671
708
  dirty = false;
672
709
  }
673
- return dirty && !!sub.flags;
710
+ return (dirty || !!(sub.flags & 16)) && !!sub.flags;
674
711
  } while (true);
675
712
  }
713
+ function checkingDepth(dep, stack, depth) {
714
+ for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
715
+ return -1;
716
+ }
717
+ function markStale(sub) {
718
+ const nodes = [sub];
719
+ do {
720
+ sub = nodes.pop();
721
+ sub.flags = sub.flags & -33 | 16;
722
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
723
+ } while (nodes.length);
724
+ }
676
725
  function shallowPropagate(link) {
677
726
  do {
678
727
  const sub = link.sub;
@@ -690,6 +739,19 @@ function isValidLink(checkLink, sub) {
690
739
  }
691
740
  return false;
692
741
  }
742
+ function markRecursed(sub) {
743
+ const nodes = [sub];
744
+ do {
745
+ sub = nodes.pop();
746
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) {
747
+ const dep = link.dep;
748
+ if ((dep.flags & 40) === 32) {
749
+ dep.flags |= 8;
750
+ nodes.push(dep);
751
+ }
752
+ }
753
+ } while (nodes.length);
754
+ }
693
755
  //#endregion
694
756
  //#region packages/reactivity/src/dep.ts
695
757
  var Dep = class {
@@ -992,7 +1054,7 @@ function noTracking(self, method, args = []) {
992
1054
  //#endregion
993
1055
  //#region packages/reactivity/src/baseHandlers.ts
994
1056
  const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
995
- const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1057
+ const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
996
1058
  function hasOwnProperty(key) {
997
1059
  if (!isSymbol(key)) key = String(key);
998
1060
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1781,6 +1843,10 @@ var ReactiveEffect = class {
1781
1843
  get active() {
1782
1844
  return !(this.flags & 1024);
1783
1845
  }
1846
+ /** @internal */
1847
+ get running() {
1848
+ return !!(this.flags & 4);
1849
+ }
1784
1850
  pause() {
1785
1851
  this.flags |= 256;
1786
1852
  }
@@ -1794,11 +1860,9 @@ var ReactiveEffect = class {
1794
1860
  if (!this.active) return this.fn();
1795
1861
  cleanup(this);
1796
1862
  const prevSub = startTracking(this);
1797
- incRunDepth();
1798
1863
  try {
1799
1864
  return this.fn();
1800
1865
  } finally {
1801
- decRunDepth();
1802
1866
  endTracking(this, prevSub);
1803
1867
  const flags = this.flags;
1804
1868
  if ((flags & 136) === 136) {
@@ -1821,9 +1885,9 @@ var ReactiveEffect = class {
1821
1885
  if (flags & 16) return true;
1822
1886
  if (flags & 32) {
1823
1887
  if (checkDirty(this.deps, this)) {
1824
- this.flags = flags | 16;
1888
+ if (this.active) this.flags |= 16;
1825
1889
  return true;
1826
- } else this.flags = flags & -33;
1890
+ } else this.flags &= -33;
1827
1891
  }
1828
1892
  return false;
1829
1893
  }
@@ -1834,20 +1898,15 @@ function effect(fn, options) {
1834
1898
  if (options) {
1835
1899
  const { onStop, scheduler } = options;
1836
1900
  if (onStop) {
1837
- options.onStop = void 0;
1838
1901
  const stop = e.stop.bind(e);
1839
1902
  e.stop = () => {
1840
1903
  stop();
1841
1904
  onStop();
1842
1905
  };
1843
1906
  }
1844
- if (scheduler) {
1845
- options.scheduler = void 0;
1846
- e.notify = () => {
1847
- if (!(e.flags & 256)) scheduler();
1848
- };
1849
- }
1850
- extend(e, options);
1907
+ if (scheduler) e.notify = () => {
1908
+ if (!(e.flags & 1280)) scheduler();
1909
+ };
1851
1910
  }
1852
1911
  try {
1853
1912
  e.run();
@@ -1907,8 +1966,10 @@ var EffectScope = class {
1907
1966
  const flags = this.flags;
1908
1967
  if (flags & 256) {
1909
1968
  this.flags = flags & -257;
1910
- for (let link = this.deps; link !== void 0; link = link.nextDep) {
1911
- const dep = link.dep;
1969
+ const deps = [];
1970
+ for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
1971
+ for (let i = 0; i < deps.length; i++) {
1972
+ const dep = deps[i];
1912
1973
  if ("resume" in dep) dep.resume();
1913
1974
  }
1914
1975
  }
@@ -1937,8 +1998,10 @@ var EffectScope = class {
1937
1998
  while (dep !== void 0) {
1938
1999
  const node = dep.dep;
1939
2000
  if ("stop" in node) {
1940
- dep = dep.nextDep;
2001
+ const prev = dep.prevDep;
1941
2002
  node.stop();
2003
+ const next = prev !== void 0 ? prev.nextDep : this.deps;
2004
+ dep = next === dep ? dep.nextDep : next;
1942
2005
  } else dep = unlink(dep, this);
1943
2006
  }
1944
2007
  cleanup(this);
@@ -1979,10 +2042,14 @@ function setCurrentScope(scope) {
1979
2042
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
1980
2043
  */
1981
2044
  function onScopeDispose(fn, failSilently = false) {
1982
- if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2045
+ if (activeEffectScope !== void 0) {
2046
+ if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2047
+ else fn();
2048
+ }
1983
2049
  }
1984
2050
  //#endregion
1985
2051
  //#region packages/reactivity/src/computed.ts
2052
+ const FAILED = 64;
1986
2053
  /**
1987
2054
  * @private exported by @vue/reactivity for Vue core use, but not exported from
1988
2055
  * the main vue package
@@ -2031,14 +2098,31 @@ var ComputedRefImpl = class {
2031
2098
  }
2032
2099
  get value() {
2033
2100
  const flags = this.flags;
2034
- if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2035
- if (this.update()) {
2036
- const subs = this.subs;
2037
- if (subs !== void 0) shallowPropagate(subs);
2038
- }
2039
- } else if (flags & 32) this.flags = flags & -33;
2101
+ try {
2102
+ if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2103
+ if (this.update()) {
2104
+ const subs = this.subs;
2105
+ if (subs !== void 0) shallowPropagate(subs);
2106
+ }
2107
+ } else if (flags & 32) this.flags = flags & -33;
2108
+ } catch (err) {
2109
+ if (activeSub !== void 0) link(this, activeSub);
2110
+ else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2111
+ throw err;
2112
+ }
2040
2113
  if (activeSub !== void 0) link(this, activeSub);
2041
- else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2114
+ else if (activeEffectScope !== void 0) {
2115
+ if (activeEffectScope.active) link(this, activeEffectScope);
2116
+ else if (this.subs === void 0) {
2117
+ let dep = this.deps;
2118
+ if (dep !== void 0) {
2119
+ do
2120
+ dep = unlink(dep, this);
2121
+ while (dep !== void 0);
2122
+ this.flags |= 16;
2123
+ }
2124
+ }
2125
+ }
2042
2126
  return this._value;
2043
2127
  }
2044
2128
  set value(newValue) {
@@ -2049,11 +2133,15 @@ var ComputedRefImpl = class {
2049
2133
  try {
2050
2134
  const oldValue = this._value;
2051
2135
  const newValue = this.fn(oldValue);
2052
- if (hasChanged(oldValue, newValue)) {
2136
+ if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
2053
2137
  this._value = newValue;
2138
+ this.flags &= -65;
2054
2139
  return true;
2055
2140
  }
2056
2141
  return false;
2142
+ } catch (err) {
2143
+ this.flags |= FAILED;
2144
+ throw err;
2057
2145
  } finally {
2058
2146
  endTracking(this, prevSub);
2059
2147
  }
@@ -2068,7 +2156,9 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2068
2156
  getter = getterOrOptions.get;
2069
2157
  setter = getterOrOptions.set;
2070
2158
  }
2071
- return new ComputedRefImpl(getter, setter);
2159
+ const cRef = new ComputedRefImpl(getter, setter);
2160
+ if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
2161
+ return cRef;
2072
2162
  }
2073
2163
  //#endregion
2074
2164
  //#region packages/reactivity/src/constants.ts
@@ -2332,7 +2422,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2332
2422
  if (isFunction(fn)) {
2333
2423
  const res = callWithErrorHandling(fn, instance, type, args);
2334
2424
  if (res && isPromise(res)) res.catch((err) => {
2335
- handleError(err, instance, type);
2425
+ handleError(err, instance, type, void 0, true);
2336
2426
  });
2337
2427
  return res;
2338
2428
  }
@@ -2342,7 +2432,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2342
2432
  return values;
2343
2433
  }
2344
2434
  }
2345
- function handleError(err, instance, type, throwInDev = true) {
2435
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2346
2436
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2347
2437
  if (instance) {
2348
2438
  let cur = instance.parent;
@@ -2350,7 +2440,7 @@ function handleError(err, instance, type, throwInDev = true) {
2350
2440
  const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
2351
2441
  while (cur) {
2352
2442
  const errorCapturedHooks = cur.ec;
2353
- if (errorCapturedHooks) {
2443
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
2354
2444
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
2355
2445
  }
2356
2446
  cur = cur.parent;
@@ -2805,11 +2895,28 @@ function withDirectives(vnode, directives) {
2805
2895
  return vnode;
2806
2896
  }
2807
2897
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2808
- const bindings = vnode.dirs;
2898
+ let hookVNode = vnode;
2899
+ if (name === "beforeMount") vnode._mount = vnode;
2900
+ else if (name === "beforeUpdate") {
2901
+ const mount = prevVNode && prevVNode._mount;
2902
+ if (mount) {
2903
+ mount._latest = vnode;
2904
+ vnode._mount = mount;
2905
+ }
2906
+ } else if (name === "mounted") {
2907
+ const latest = vnode._latest;
2908
+ vnode._mount = vnode._latest = void 0;
2909
+ if (latest) {
2910
+ hookVNode = latest;
2911
+ latest._mount = void 0;
2912
+ }
2913
+ }
2914
+ const bindings = hookVNode.dirs;
2809
2915
  const oldBindings = prevVNode && prevVNode.dirs;
2810
2916
  for (let i = 0; i < bindings.length; i++) {
2811
- const binding = bindings[i];
2917
+ let binding = bindings[i];
2812
2918
  if (oldBindings) binding.oldValue = oldBindings[i].value;
2919
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
2813
2920
  let hook = binding.dir[name];
2814
2921
  if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
2815
2922
  if (hook) {
@@ -2817,7 +2924,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2817
2924
  callWithAsyncErrorHandling(hook, instance, 8, [
2818
2925
  vnode.el,
2819
2926
  binding,
2820
- vnode,
2927
+ hookVNode,
2821
2928
  prevVNode
2822
2929
  ]);
2823
2930
  setActiveSub(prevSub);
@@ -3237,7 +3344,15 @@ const BaseTransitionImpl = {
3237
3344
  const rawProps = /* @__PURE__ */ toRaw(props);
3238
3345
  const { mode } = rawProps;
3239
3346
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3240
- if (!(instance.effect.flags & 1024)) instance.update();
3347
+ if (!(instance.effect.flags & 1024)) {
3348
+ if (instance.effect.running) {
3349
+ const job = () => {
3350
+ if (!(instance.effect.flags & 1024)) instance.update();
3351
+ };
3352
+ job.i = instance;
3353
+ queueJob(job);
3354
+ } else instance.update();
3355
+ }
3241
3356
  }) : NOOP);
3242
3357
  };
3243
3358
  }
@@ -3263,7 +3378,7 @@ function getLeavingNodesForType(state, vnode) {
3263
3378
  }
3264
3379
  return leavingVNodesCache;
3265
3380
  }
3266
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3381
+ function resolveTransitionHooks(vnode, props, state, instance) {
3267
3382
  const key = String(vnode.key);
3268
3383
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3269
3384
  const hooks = baseResolveTransitionHooks({
@@ -3286,9 +3401,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3286
3401
  }
3287
3402
  },
3288
3403
  cloneHooks: (vnode) => {
3289
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
3290
- if (postClone) postClone(hooks);
3291
- return hooks;
3404
+ return resolveTransitionHooks(vnode, props, state, instance);
3292
3405
  }
3293
3406
  }, props, state, instance);
3294
3407
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -3326,7 +3439,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3326
3439
  callHook(hook, [el]);
3327
3440
  },
3328
3441
  enter(el) {
3329
- if (isLeaving()) return;
3442
+ if (isLeaving(el)) return;
3330
3443
  let hook = onEnter;
3331
3444
  let afterHook = onAfterEnter;
3332
3445
  let cancelHook = onEnterCancelled;
@@ -3370,7 +3483,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3370
3483
  else done();
3371
3484
  },
3372
3485
  clone(node) {
3373
- return cloneHooks ? cloneHooks(node) : hooks;
3486
+ if (!cloneHooks) return hooks;
3487
+ const cloned = cloneHooks(node);
3488
+ cloned.afterLeave = () => {
3489
+ if (hooks.afterLeave) hooks.afterLeave();
3490
+ };
3491
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
3492
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
3493
+ else delayedLeave();
3494
+ };
3495
+ cloned.delayedLeave = () => {
3496
+ if (hooks.delayedLeave) hooks.delayedLeave();
3497
+ };
3498
+ return cloned;
3374
3499
  }
3375
3500
  };
3376
3501
  return hooks;
@@ -3405,10 +3530,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
3405
3530
  if (state.isLeaving) return emptyPlaceholder(next);
3406
3531
  const nextInner = getInnerChild$1(next);
3407
3532
  if (!nextInner) return emptyPlaceholder(next);
3408
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3409
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3410
- enterHooks = hooks;
3411
- });
3533
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
3412
3534
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3413
3535
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3414
3536
  const mode = props.mode;
@@ -3474,9 +3596,14 @@ function setTransitionHooks(vnode, hooks) {
3474
3596
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3475
3597
  }
3476
3598
  } else if (vnode.shapeFlag & 128) {
3477
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3478
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3479
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3599
+ const suspense = vnode.suspense;
3600
+ if (suspense) {
3601
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
3602
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
3603
+ } else {
3604
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3605
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3606
+ }
3480
3607
  } else {
3481
3608
  vnode.transition = hooks;
3482
3609
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -3676,6 +3803,8 @@ const getContainerType = (container) => {
3676
3803
  if (isMathMLContainer(container)) return "mathml";
3677
3804
  };
3678
3805
  const isComment = (node) => node.nodeType === 8;
3806
+ /** The data of a comment opening a range a hydration steps over as one. */
3807
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
3679
3808
  function createHydrationFunctions(rendererInternals) {
3680
3809
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
3681
3810
  const hydrate = (vnode, container) => {
@@ -3692,7 +3821,7 @@ function createHydrationFunctions(rendererInternals) {
3692
3821
  };
3693
3822
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
3694
3823
  optimized = optimized || !!vnode.dynamicChildren;
3695
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
3824
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
3696
3825
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
3697
3826
  const { type, ref, shapeFlag, patchFlag } = vnode;
3698
3827
  let domType = node.nodeType;
@@ -3869,10 +3998,11 @@ function createHydrationFunctions(rendererInternals) {
3869
3998
  const container = parentNode(node);
3870
3999
  const first = nextSibling(node);
3871
4000
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
3872
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4001
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
4002
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
3873
4003
  else {
3874
4004
  logMismatchError();
3875
- insert(vnode.anchor = createComment(`]`), container, next);
4005
+ insert(vnode.anchor = createComment(close), container, next);
3876
4006
  return next;
3877
4007
  }
3878
4008
  };
@@ -3891,18 +4021,18 @@ function createHydrationFunctions(rendererInternals) {
3891
4021
  const container = parentNode(node);
3892
4022
  remove(node);
3893
4023
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3894
- if (parentComponent && parentComponent.vnode) {
4024
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
3895
4025
  parentComponent.vnode.el = vnode.el;
3896
4026
  updateHOCHostEl(parentComponent, vnode.el);
3897
4027
  }
3898
4028
  return next;
3899
4029
  };
3900
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4030
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
3901
4031
  let match = 0;
3902
4032
  while (node) {
3903
4033
  node = nextSibling(node);
3904
4034
  if (node && isComment(node)) {
3905
- if (node.data === open) match++;
4035
+ if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
3906
4036
  if (node.data === close) {
3907
4037
  if (match === 0) return nextSibling(node);
3908
4038
  else match--;
@@ -4045,9 +4175,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4045
4175
  return teardown;
4046
4176
  };
4047
4177
  function forEachElement(node, cb) {
4048
- if (isComment(node) && (node.data === "[" || node.data === "(")) {
4178
+ if (isComment(node) && isRangeStart(node.data)) {
4049
4179
  const open = node.data;
4050
- const close = open === "[" ? "]" : ")";
4180
+ const close = rangeCloseOf(open);
4051
4181
  let depth = 1;
4052
4182
  let next = node.nextSibling;
4053
4183
  while (next) {
@@ -4056,7 +4186,7 @@ function forEachElement(node, cb) {
4056
4186
  } else if (isComment(next)) {
4057
4187
  if (next.data === close) {
4058
4188
  if (--depth === 0) break;
4059
- } else if (next.data === open) depth++;
4189
+ } else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
4060
4190
  }
4061
4191
  next = next.nextSibling;
4062
4192
  }
@@ -4084,7 +4214,7 @@ function defineAsyncComponent(source) {
4084
4214
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
4085
4215
  const onError = (err) => {
4086
4216
  setPendingRequest(null);
4087
- handleError(err, instance, 13, !errorComponent);
4217
+ handleError(err, instance, 13, !errorComponent, true);
4088
4218
  };
4089
4219
  if (suspensible && instance.suspense || isInSSRComponentSetup) return load().then((comp) => {
4090
4220
  return () => createInnerComp(comp, instance);
@@ -4163,10 +4293,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
4163
4293
  const delayed = /* @__PURE__ */ ref(!!delay);
4164
4294
  let timeoutTimer;
4165
4295
  let delayTimer;
4166
- if (instance) onUnmounted(() => {
4167
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
4168
- if (delayTimer != null) clearTimeout(delayTimer);
4169
- }, instance);
4296
+ if (instance) instance.scope.run(() => {
4297
+ onScopeDispose(() => {
4298
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4299
+ if (delayTimer != null) clearTimeout(delayTimer);
4300
+ });
4301
+ });
4170
4302
  if (delay) delayTimer = setTimeout(() => {
4171
4303
  if (instance && instance.isUnmounted) return;
4172
4304
  delayed.value = false;
@@ -4195,7 +4327,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4195
4327
  if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
4196
4328
  const performHydrate = () => {
4197
4329
  if (patched) return;
4198
- if (!el.parentNode || wasConnected && !el.isConnected) return;
4330
+ if (!el.parentNode) return;
4331
+ if (wasConnected && !el.isConnected) {
4332
+ let current = instance;
4333
+ while (current && !current.isDeactivated) current = current.parent;
4334
+ if (!current) return;
4335
+ }
4199
4336
  hydrate();
4200
4337
  };
4201
4338
  const doHydrate = hydrateStrategy ? () => {
@@ -4252,7 +4389,11 @@ const KeepAliveImpl = {
4252
4389
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
4253
4390
  };
4254
4391
  sharedContext.deactivate = (vnode) => {
4255
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
4392
+ const cached = sharedContext.getCachedComponent(vnode);
4393
+ if (!cached || cached.component !== vnode.component) return false;
4394
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
4395
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
4396
+ return true;
4256
4397
  };
4257
4398
  function unmount(vnode) {
4258
4399
  resetShapeFlag(vnode);
@@ -4284,11 +4425,15 @@ const KeepAliveImpl = {
4284
4425
  let pendingCacheKey = null;
4285
4426
  const cacheSubtree = () => {
4286
4427
  if (pendingCacheKey != null) {
4287
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4288
- const vnode = getInnerChild(keepAliveInstance.subTree);
4289
- if (vnode.component) cache.set(pendingCacheKey, vnode);
4290
- }, void 0, keepAliveInstance.subTree.suspense);
4291
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4428
+ if (isSuspense(keepAliveInstance.subTree.type)) {
4429
+ const cacheInnerChild = () => {
4430
+ const vnode = getInnerChild(keepAliveInstance.subTree);
4431
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
4432
+ };
4433
+ const suspense = keepAliveInstance.subTree.suspense;
4434
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
4435
+ else cacheInnerChild();
4436
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4292
4437
  }
4293
4438
  };
4294
4439
  onMounted(cacheSubtree);
@@ -4397,9 +4542,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
4397
4542
  }
4398
4543
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4399
4544
  const injected = injectHook(type, hook, keepAliveRoot, true);
4400
- onUnmounted(() => {
4401
- remove(keepAliveRoot[type], injected);
4402
- }, target);
4545
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
4546
+ removal.flags = 8;
4403
4547
  }
4404
4548
  function resetShapeFlag(vnode) {
4405
4549
  vnode.shapeFlag &= -257;
@@ -4830,6 +4974,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4830
4974
  ret.props = extend({}, ret.props, { key: branchKey });
4831
4975
  ret.key = branchKey;
4832
4976
  }
4977
+ if (isBlockTreeEnabled <= 0) {
4978
+ if (!ret.vs.props) ret.vs.props = ret.props;
4979
+ ret.props = ret.key != null ? { key: ret.key } : null;
4980
+ ret.vs.attrs = EMPTY_OBJ;
4981
+ }
4833
4982
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4834
4983
  return ret;
4835
4984
  }
@@ -5619,7 +5768,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5619
5768
  if (options.el) return vm.$mount(options.el);
5620
5769
  else return vm;
5621
5770
  }
5622
- Vue.version = `2.6.14-compat:3.6.0-rc.13`;
5771
+ Vue.version = `2.6.14-compat:3.6.0-rc.15`;
5623
5772
  Vue.config = singletonApp.config;
5624
5773
  Vue.use = (plugin, ...options) => {
5625
5774
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6735,8 +6884,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6735
6884
  if (vnodeHook = props.onVnodeBeforeMount) invokeVNodeHook(vnodeHook, parentComponent, vnode);
6736
6885
  }
6737
6886
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6738
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
6739
- else hostInsert(el, container, anchor);
6887
+ if (transition) {
6888
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
6889
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
6890
+ } else hostInsert(el, container, anchor);
6740
6891
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) queuePostRenderEffect(() => {
6741
6892
  try {
6742
6893
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -6961,16 +7112,20 @@ function baseCreateRenderer(options, createHydrationFns) {
6961
7112
  } else {
6962
7113
  let { next, bu, u, parent, vnode } = instance;
6963
7114
  {
6964
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
6965
- if (nonHydratedAsyncRoot) {
7115
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
7116
+ if (unresolvedAsyncRoot) {
6966
7117
  if (next) {
6967
7118
  next.el = vnode.el;
6968
7119
  updateComponentPreRender(instance, next, optimized);
6969
7120
  }
6970
- nonHydratedAsyncRoot.asyncDep.then(() => {
6971
- queuePostRenderEffect(() => {
6972
- if (!instance.isUnmounted) instance.update();
6973
- }, void 0, parentSuspense);
7121
+ unresolvedAsyncRoot.asyncDep.then(() => {
7122
+ const retry = () => {
7123
+ if (instance.effect.flags & 1024) return;
7124
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
7125
+ else instance.update();
7126
+ };
7127
+ retry.flags = 24;
7128
+ queuePostRenderEffect(retry, void 0, parentSuspense);
6974
7129
  });
6975
7130
  return;
6976
7131
  }
@@ -6990,7 +7145,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6990
7145
  const nextTree = renderComponentRoot(instance);
6991
7146
  const prevTree = instance.subTree;
6992
7147
  instance.subTree = nextTree;
6993
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
7148
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
6994
7149
  next.el = nextTree.el;
6995
7150
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
6996
7151
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
@@ -7188,9 +7343,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7188
7343
  }
7189
7344
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
7190
7345
  if (shapeFlag & 256) {
7191
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7192
- else parentComponent.ctx.deactivate(vnode);
7193
- return;
7346
+ if (parentComponent.ctx.deactivate(vnode)) return;
7194
7347
  }
7195
7348
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
7196
7349
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -7270,13 +7423,15 @@ function baseCreateRenderer(options, createHydrationFns) {
7270
7423
  if (effect) {
7271
7424
  effect.stop();
7272
7425
  unmount(subTree, instance, parentSuspense, doRemove);
7273
- } else if (instance.vnode.el && subTree) {
7426
+ } else if (subTree) {
7274
7427
  subTree.transition = instance.vnode.transition;
7275
7428
  unmount(subTree, instance, parentSuspense, doRemove);
7276
7429
  }
7277
7430
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
7278
7431
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
7279
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
7432
+ const markUnmounted = () => instance.isUnmounted = true;
7433
+ markUnmounted.flags = 8;
7434
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
7280
7435
  };
7281
7436
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
7282
7437
  for (let i = start; i < children.length; i++) unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
@@ -7383,11 +7538,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7383
7538
  if (c2.type === Comment && !c2.el) c2.el = c1.el;
7384
7539
  }
7385
7540
  }
7386
- function locateNonHydratedAsyncRoot(instance) {
7541
+ function locateUnresolvedAsyncRoot(instance) {
7387
7542
  const subComponent = instance.subTree && instance.subTree.component;
7388
7543
  if (subComponent) {
7389
7544
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7390
- else return locateNonHydratedAsyncRoot(subComponent);
7545
+ else return locateUnresolvedAsyncRoot(subComponent);
7391
7546
  }
7392
7547
  }
7393
7548
  function invalidateMount(hooks) {
@@ -7453,7 +7608,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
7453
7608
  function resolveAsyncComponentPlaceholder(anchorVnode) {
7454
7609
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
7455
7610
  const instance = anchorVnode.component;
7456
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
7611
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
7612
+ const suspense = anchorVnode.suspense;
7613
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
7457
7614
  return null;
7458
7615
  }
7459
7616
  //#endregion
@@ -7465,17 +7622,22 @@ function withSuspenseEnabled(value) {
7465
7622
  return value;
7466
7623
  }
7467
7624
  let suspenseId = 0;
7625
+ const deferredEnterKey = Symbol("_deferredEnter");
7468
7626
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
7469
7627
  name: "Suspense",
7470
7628
  __isSuspense: true,
7471
7629
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7472
7630
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
7473
7631
  else {
7474
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7475
- n2.suspense = n1.suspense;
7476
- n2.suspense.vnode = n2;
7477
- n2.el = n1.el;
7478
- return;
7632
+ const suspense = n1.suspense;
7633
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
7634
+ const owner = suspense.parentComponent;
7635
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
7636
+ n2.suspense = suspense;
7637
+ suspense.vnode = n2;
7638
+ n2.el = n1.el;
7639
+ return;
7640
+ }
7479
7641
  }
7480
7642
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
7481
7643
  }
@@ -7487,6 +7649,36 @@ function triggerEvent(vnode, name) {
7487
7649
  const eventListener = vnode.props && vnode.props[name];
7488
7650
  if (isFunction(eventListener)) eventListener();
7489
7651
  }
7652
+ function enterDeferred(suspense, branch) {
7653
+ const enters = [];
7654
+ collectDeferredEnters(branch, enters, true);
7655
+ if (isVaporInteropEnabled) {
7656
+ const { parentComponent } = suspense;
7657
+ const vapor = parentComponent && parentComponent.appContext.vapor;
7658
+ if (vapor) vapor.enterDeferred(suspense, enters);
7659
+ }
7660
+ if (enters.length) queuePostFlushCb(enters);
7661
+ }
7662
+ function collectDeferredEnters(vnode, enters, isRoot) {
7663
+ const { el, transition, children, shapeFlag } = vnode;
7664
+ if (shapeFlag & 6) {
7665
+ const subTree = vnode.component.subTree;
7666
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
7667
+ return;
7668
+ }
7669
+ if (shapeFlag & 192) return;
7670
+ if (shapeFlag & 1) {
7671
+ if (!isRoot && el && el[deferredEnterKey]) {
7672
+ el[deferredEnterKey] = void 0;
7673
+ if (transition && !transition.persisted) {
7674
+ transition.beforeEnter(el);
7675
+ enters.push(() => transition.enter(el));
7676
+ }
7677
+ }
7678
+ isRoot = false;
7679
+ }
7680
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
7681
+ }
7490
7682
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7491
7683
  const { p: patch, o: { createElement } } = rendererInternals;
7492
7684
  const hiddenContainer = createElement("div");
@@ -7526,11 +7718,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7526
7718
  suspense.activeBranch = pendingBranch;
7527
7719
  } else unmount(pendingBranch, parentComponent, suspense);
7528
7720
  suspense.deps = 0;
7529
- for (let i = 0; i < suspense.effects.length; i++) {
7530
- const effect = suspense.effects[i];
7531
- if (effect.flags & 8) queuePostFlushCb(effect);
7532
- }
7533
- suspense.effects.length = 0;
7721
+ discardEffects(suspense);
7534
7722
  suspense.hiddenContainer = createElement("div");
7535
7723
  if (isInFallback) {
7536
7724
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -7553,14 +7741,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7553
7741
  } else {
7554
7742
  triggerEvent(n2, "onPending");
7555
7743
  suspense.pendingBranch = newBranch;
7556
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
7557
- else suspense.pendingId = suspenseId++;
7744
+ suspense.pendingId = suspenseId++;
7558
7745
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7559
7746
  if (suspense.deps <= 0) suspense.resolve();
7560
7747
  else {
7561
- const { timeout, pendingId } = suspense;
7562
- if (timeout > 0) setTimeout(() => {
7563
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
7748
+ const { timeout } = suspense;
7749
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
7750
+ suspense.timeoutTimer = void 0;
7751
+ suspense.fallback(suspense.vnode.ssFallback);
7564
7752
  }, timeout);
7565
7753
  else if (timeout === 0) suspense.fallback(newFallback);
7566
7754
  }
@@ -7589,6 +7777,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7589
7777
  deps: 0,
7590
7778
  pendingId: suspenseId++,
7591
7779
  timeout: typeof timeout === "number" ? timeout : -1,
7780
+ timeoutTimer: void 0,
7592
7781
  activeBranch: null,
7593
7782
  isFallbackMountPending: false,
7594
7783
  pendingBranch: null,
@@ -7604,26 +7793,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7604
7793
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7605
7794
  let hasUpdatedAnchor = false;
7606
7795
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7607
- if (pendingId === suspense.pendingId) {
7796
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
7797
+ enterDeferred(suspense, pendingBranch);
7608
7798
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7609
7799
  queuePostFlushCb(effects);
7610
7800
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7611
7801
  }
7612
7802
  };
7613
7803
  if (activeBranch && !suspense.isFallbackMountPending) {
7614
- if (parentNode(activeBranch.el) === container) {
7804
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
7615
7805
  anchor = next(activeBranch);
7616
7806
  hasUpdatedAnchor = true;
7617
7807
  }
7618
7808
  unmount(activeBranch, parentComponent, suspense, true);
7619
7809
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7620
7810
  }
7621
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
7811
+ if (!delayEnter) {
7812
+ enterDeferred(suspense, pendingBranch);
7813
+ move(pendingBranch, container, anchor, 0, parentComponent);
7814
+ }
7622
7815
  }
7816
+ clearTimeout(suspense.timeoutTimer);
7817
+ suspense.timeoutTimer = void 0;
7623
7818
  suspense.isFallbackMountPending = false;
7624
7819
  setActiveBranch(suspense, pendingBranch);
7625
7820
  suspense.pendingBranch = null;
7626
7821
  suspense.isInFallback = false;
7822
+ let kept = 0;
7823
+ for (let i = 0; i < effects.length; i++) {
7824
+ const effect = effects[i];
7825
+ if (effect.flags & 16) queuePostFlushCb(effect);
7826
+ else effects[kept++] = effect;
7827
+ }
7828
+ effects.length = kept;
7627
7829
  let parent = suspense.parent;
7628
7830
  let hasUnresolvedAncestor = false;
7629
7831
  while (parent) {
@@ -7646,13 +7848,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7646
7848
  triggerEvent(vnode, "onResolve");
7647
7849
  },
7648
7850
  fallback(fallbackVNode) {
7649
- if (!suspense.pendingBranch) return;
7851
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
7650
7852
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
7651
7853
  triggerEvent(vnode, "onFallback");
7652
7854
  const anchor = next(activeBranch);
7653
7855
  const mountFallback = () => {
7654
7856
  suspense.isFallbackMountPending = false;
7655
- if (!suspense.isInFallback) return;
7857
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
7656
7858
  const latestFallback = suspense.vnode.ssFallback;
7657
7859
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7658
7860
  setActiveBranch(suspense, latestFallback);
@@ -7676,24 +7878,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7676
7878
  registerDep(instance, onResolve) {
7677
7879
  const isInPendingSuspense = !!suspense.pendingBranch;
7678
7880
  if (isInPendingSuspense) suspense.deps++;
7881
+ const render = (setupResult) => {
7882
+ instance.asyncResolved = true;
7883
+ onResolve(setupResult);
7884
+ };
7679
7885
  instance.asyncDep.catch((err) => {
7680
- handleError(err, instance, 0);
7886
+ handleError(err, instance, 0, false, true);
7887
+ return () => null;
7681
7888
  }).then((asyncSetupResult) => {
7682
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7889
+ if (instance.isUnmounted || suspense.isUnmounted) return;
7890
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
7683
7891
  setCurrentInstance(null, void 0);
7684
7892
  if (!instance.scope.active) {
7685
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7893
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
7686
7894
  return;
7687
7895
  }
7688
- instance.asyncResolved = true;
7689
- onResolve(asyncSetupResult);
7690
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7896
+ if (!isPendingDep && suspense.pendingBranch) {
7897
+ const job = () => {
7898
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
7899
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
7900
+ else render(asyncSetupResult);
7901
+ };
7902
+ job.flags = 24;
7903
+ queueEffectWithSuspense(job, void 0, suspense);
7904
+ return;
7905
+ }
7906
+ render(asyncSetupResult);
7907
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
7691
7908
  });
7692
7909
  },
7693
7910
  unmount(parentSuspense, doRemove) {
7694
7911
  suspense.isUnmounted = true;
7912
+ clearTimeout(suspense.timeoutTimer);
7913
+ suspense.timeoutTimer = void 0;
7914
+ if (parentSuspenseId !== void 0) {
7915
+ const parent = suspense.parent;
7916
+ const pendingId = parentSuspenseId;
7917
+ parentSuspenseId = void 0;
7918
+ queuePostFlushCb(() => {
7919
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
7920
+ });
7921
+ }
7695
7922
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
7696
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
7923
+ if (suspense.pendingBranch) {
7924
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
7925
+ discardEffects(suspense);
7926
+ }
7697
7927
  }
7698
7928
  };
7699
7929
  return suspense;
@@ -7730,6 +7960,14 @@ function normalizeSuspenseSlot(s) {
7730
7960
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
7731
7961
  return s;
7732
7962
  }
7963
+ function discardEffects(suspense) {
7964
+ const { effects } = suspense;
7965
+ for (let i = 0; i < effects.length; i++) {
7966
+ const effect = effects[i];
7967
+ if (effect.flags & 8) queuePostFlushCb(effect);
7968
+ }
7969
+ effects.length = 0;
7970
+ }
7733
7971
  function queueEffectWithSuspense(fn, id, suspense) {
7734
7972
  if (suspense && suspense.pendingBranch) {
7735
7973
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -7960,7 +8198,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
7960
8198
  }
7961
8199
  function guardReactiveProps(props) {
7962
8200
  if (!props) return null;
7963
- return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8201
+ if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
8202
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
7964
8203
  }
7965
8204
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7966
8205
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -8065,6 +8304,17 @@ function normalizeVNode(child) {
8065
8304
  function cloneIfMounted(child) {
8066
8305
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
8067
8306
  }
8307
+ let deferElementSlots = false;
8308
+ /**
8309
+ * While enabled, compiled default slots passed as children of plain elements
8310
+ * are kept on the vnode so the server renderer can render them in push mode.
8311
+ * @internal
8312
+ */
8313
+ function setDeferElementSlots(value) {
8314
+ const prev = deferElementSlots;
8315
+ deferElementSlots = value;
8316
+ return prev;
8317
+ }
8068
8318
  function normalizeChildren(vnode, children) {
8069
8319
  let type = 0;
8070
8320
  const { shapeFlag } = vnode;
@@ -8073,6 +8323,11 @@ function normalizeChildren(vnode, children) {
8073
8323
  else if (typeof children === "object") {
8074
8324
  if (shapeFlag & 65) {
8075
8325
  const slot = children.default;
8326
+ if (deferElementSlots && slot && slot._c && shapeFlag & 1) {
8327
+ vnode.children = children;
8328
+ vnode.shapeFlag |= 32;
8329
+ return;
8330
+ }
8076
8331
  if (slot) {
8077
8332
  slot._c && (slot._d = false);
8078
8333
  normalizeChildren(vnode, slot());
@@ -8324,7 +8579,8 @@ function setupStatefulComponent(instance, isSSR) {
8324
8579
  setInSSRSetupState(false);
8325
8580
  }
8326
8581
  }).catch((e) => {
8327
- handleError(e, instance, 0);
8582
+ handleError(e, instance, 0, void 0, true);
8583
+ instance.ssrRender = (_, push) => push("<!---->");
8328
8584
  });
8329
8585
  else instance.asyncDep = setupResult;
8330
8586
  } else handleSetupResult(instance, setupResult, isSSR);
@@ -8382,9 +8638,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8382
8638
  }
8383
8639
  }
8384
8640
  }
8641
+ /**
8642
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
8643
+ * @internal
8644
+ */
8645
+ const rawAttrsKey = Symbol();
8385
8646
  const attrsProxyHandlers = { get(target, key) {
8386
8647
  track(target, "get", "");
8387
- return target[key];
8648
+ return key === rawAttrsKey ? target : target[key];
8388
8649
  } };
8389
8650
  function createSetupContext(instance) {
8390
8651
  return {
@@ -8468,7 +8729,7 @@ function isMemoSame(cached, memo) {
8468
8729
  }
8469
8730
  //#endregion
8470
8731
  //#region packages/runtime-core/src/index.ts
8471
- const version = "3.6.0-rc.13";
8732
+ const version = "3.6.0-rc.15";
8472
8733
  const warn = NOOP;
8473
8734
  /**
8474
8735
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8493,7 +8754,8 @@ const ssrUtils = {
8493
8754
  popWarningContext,
8494
8755
  VaporSlot,
8495
8756
  rawVaporSlotKey,
8496
- invokeSlotFallback
8757
+ invokeSlotFallback,
8758
+ setDeferElementSlots
8497
8759
  };
8498
8760
  /**
8499
8761
  * @internal only exposed in compat builds
@@ -9836,15 +10098,15 @@ const vModelSelect = {
9836
10098
  vModelSelectInit(el, value, number);
9837
10099
  el[assignKey] = getModelAssigner(vnode);
9838
10100
  },
9839
- mounted(el, { value }) {
9840
- vModelSetSelected(el, value);
10101
+ mounted(el, { value, modifiers: { number } }) {
10102
+ vModelSetSelected(el, value, number);
9841
10103
  },
9842
10104
  beforeUpdate(el, { value }, vnode) {
9843
10105
  el._modelValue = value;
9844
10106
  el[assignKey] = getModelAssigner(vnode);
9845
10107
  },
9846
- updated(el, { value }) {
9847
- vModelSetSelected(el, value);
10108
+ updated(el, { value, modifiers: { number } }) {
10109
+ vModelSetSelected(el, value, number);
9848
10110
  }
9849
10111
  };
9850
10112
  /**
@@ -9879,14 +10141,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
9879
10141
  /**
9880
10142
  * @internal
9881
10143
  */
9882
- const vModelSetSelected = (el, value) => {
10144
+ const vModelSetSelected = (el, value, number = false) => {
9883
10145
  el._modelValue = value;
9884
10146
  const pending = el._pendingValue;
9885
10147
  el._pendingValue = void 0;
9886
10148
  if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
9887
- setSelected(el, value);
10149
+ setSelected(el, value, number);
9888
10150
  };
9889
- function setSelected(el, value) {
10151
+ function setSelected(el, value, number) {
9890
10152
  const isMultiple = el.multiple;
9891
10153
  const isArrayValue = isArray(value);
9892
10154
  if (isMultiple && !isArrayValue && !isSet(value)) return;
@@ -9898,7 +10160,7 @@ function setSelected(el, value) {
9898
10160
  const optionType = typeof optionValue;
9899
10161
  if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
9900
10162
  else option.selected = looseIndexOf(value, optionValue) > -1;
9901
- } else option.selected = value.has(optionValue);
10163
+ } else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
9902
10164
  } else if (looseEqual(getValue(option), value)) {
9903
10165
  if (el.selectedIndex !== i) el.selectedIndex = i;
9904
10166
  return;
@@ -12101,7 +12363,15 @@ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
12101
12363
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
12102
12364
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
12103
12365
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
12366
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
12367
+ 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");
12368
+ const isUnparsedIdentifier = (exp) => {
12369
+ if (exp.ast !== null) return false;
12370
+ const content = getExpSource(exp);
12371
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
12372
+ };
12104
12373
  const isMemberExpressionNode = (exp, context) => {
12374
+ if (isUnparsedIdentifier(exp)) return true;
12105
12375
  try {
12106
12376
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
12107
12377
  ret = unwrapTSNode(ret);
@@ -12112,6 +12382,7 @@ const isMemberExpressionNode = (exp, context) => {
12112
12382
  };
12113
12383
  const isMemberExpression = isMemberExpressionNode;
12114
12384
  const isFnExpressionNode = (exp, context) => {
12385
+ if (isUnparsedIdentifier(exp)) return false;
12115
12386
  try {
12116
12387
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
12117
12388
  if (ret.type === "Program") {
@@ -12744,7 +13015,11 @@ function getLoc(start, end) {
12744
13015
  };
12745
13016
  }
12746
13017
  function cloneLoc(loc) {
12747
- return getLoc(loc.start.offset, loc.end.offset);
13018
+ return {
13019
+ start: extend({}, loc.start),
13020
+ end: extend({}, loc.end),
13021
+ source: loc.source
13022
+ };
12748
13023
  }
12749
13024
  function setLocEnd(loc, end) {
12750
13025
  loc.end = tokenizer.getPos(end);
@@ -15516,7 +15791,7 @@ const stringifyStatic = (children, context, parent) => {
15516
15791
  for (; i < children.length; i++) {
15517
15792
  const child = children[i];
15518
15793
  if (isParentCached || getCachedNode(child)) {
15519
- const result = analyzeNode(child);
15794
+ const result = analyzeNode(child, context);
15520
15795
  if (result) {
15521
15796
  nc += result[0];
15522
15797
  ec += result[1];
@@ -15546,7 +15821,7 @@ const isNonStringifiable = /*@__PURE__*/ makeMap(`caption,thead,tr,th,tbody,td,t
15546
15821
  * - nc is the number of nodes inside
15547
15822
  * - ec is the number of element with bindings inside
15548
15823
  */
15549
- function analyzeNode(node) {
15824
+ function analyzeNode(node, context) {
15550
15825
  if (node.type === 1 && isNonStringifiable(node.tag)) return false;
15551
15826
  if (node.type === 1 && findDir(node, "once", true)) return false;
15552
15827
  if (node.type === 12) return [1, 0];
@@ -15565,6 +15840,7 @@ function analyzeNode(node) {
15565
15840
  if (p.type === 7 && p.name === "bind") {
15566
15841
  if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
15567
15842
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
15843
+ if (p.arg && p.arg.isStatic && (isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && context.isCustomElement(node.tag)) return bail();
15568
15844
  if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
15569
15845
  }
15570
15846
  }
@@ -15609,11 +15885,10 @@ function stringifyElement(node, context) {
15609
15885
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
15610
15886
  continue;
15611
15887
  }
15612
- if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") continue;
15613
15888
  let evaluated = evaluateConstant(exp);
15614
15889
  if (evaluated != null) {
15615
- const arg = p.arg && p.arg.content;
15616
- if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) continue;
15890
+ const arg = p.arg.content;
15891
+ if ((isBooleanAttr(arg) || arg === "hidden") && !includeBooleanAttr(evaluated)) continue;
15617
15892
  if (arg === "class") evaluated = normalizeClass(evaluated);
15618
15893
  else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
15619
15894
  res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;