@vue/compat 3.5.11 → 3.5.13

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.5.11
2
+ * @vue/compat v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -212,10 +212,9 @@ function parseStringStyle(cssText) {
212
212
  return ret;
213
213
  }
214
214
  function stringifyStyle(styles) {
215
+ if (!styles) return "";
216
+ if (isString(styles)) return styles;
215
217
  let ret = "";
216
- if (!styles || isString(styles)) {
217
- return ret;
218
- }
219
218
  for (const key in styles) {
220
219
  const value = styles[key];
221
220
  if (isString(value) || typeof value === "number") {
@@ -478,17 +477,21 @@ class EffectScope {
478
477
  }
479
478
  stop(fromParent) {
480
479
  if (this._active) {
480
+ this._active = false;
481
481
  let i, l;
482
482
  for (i = 0, l = this.effects.length; i < l; i++) {
483
483
  this.effects[i].stop();
484
484
  }
485
+ this.effects.length = 0;
485
486
  for (i = 0, l = this.cleanups.length; i < l; i++) {
486
487
  this.cleanups[i]();
487
488
  }
489
+ this.cleanups.length = 0;
488
490
  if (this.scopes) {
489
491
  for (i = 0, l = this.scopes.length; i < l; i++) {
490
492
  this.scopes[i].stop(true);
491
493
  }
494
+ this.scopes.length = 0;
492
495
  }
493
496
  if (!this.detached && this.parent && !fromParent) {
494
497
  const last = this.parent.scopes.pop();
@@ -498,7 +501,6 @@ class EffectScope {
498
501
  }
499
502
  }
500
503
  this.parent = void 0;
501
- this._active = false;
502
504
  }
503
505
  }
504
506
  }
@@ -763,16 +765,16 @@ function removeSub(link, soft = false) {
763
765
  nextSub.prevSub = prevSub;
764
766
  link.nextSub = void 0;
765
767
  }
766
- if (dep.subs === link) {
767
- dep.subs = prevSub;
768
- }
769
768
  if (dep.subsHead === link) {
770
769
  dep.subsHead = nextSub;
771
770
  }
772
- if (!dep.subs && dep.computed) {
773
- dep.computed.flags &= ~4;
774
- for (let l = dep.computed.deps; l; l = l.nextDep) {
775
- removeSub(l, true);
771
+ if (dep.subs === link) {
772
+ dep.subs = prevSub;
773
+ if (!prevSub && dep.computed) {
774
+ dep.computed.flags &= ~4;
775
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
776
+ removeSub(l, true);
777
+ }
776
778
  }
777
779
  }
778
780
  if (!soft && !--dep.sc && dep.map) {
@@ -1032,7 +1034,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1032
1034
  }
1033
1035
  });
1034
1036
  } else {
1035
- if (key !== void 0) {
1037
+ if (key !== void 0 || depsMap.has(void 0)) {
1036
1038
  run(depsMap.get(key));
1037
1039
  }
1038
1040
  if (isArrayIndex) {
@@ -1264,6 +1266,7 @@ class BaseReactiveHandler {
1264
1266
  this._isShallow = _isShallow;
1265
1267
  }
1266
1268
  get(target, key, receiver) {
1269
+ if (key === "__v_skip") return target["__v_skip"];
1267
1270
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1268
1271
  if (key === "__v_isReactive") {
1269
1272
  return !isReadonly2;
@@ -1407,117 +1410,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1407
1410
 
1408
1411
  const toShallow = (value) => value;
1409
1412
  const getProto = (v) => Reflect.getPrototypeOf(v);
1410
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1411
- target = target["__v_raw"];
1412
- const rawTarget = toRaw(target);
1413
- const rawKey = toRaw(key);
1414
- if (!isReadonly2) {
1415
- if (hasChanged(key, rawKey)) {
1416
- track(rawTarget, "get", key);
1417
- }
1418
- track(rawTarget, "get", rawKey);
1419
- }
1420
- const { has: has2 } = getProto(rawTarget);
1421
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1422
- if (has2.call(rawTarget, key)) {
1423
- return wrap(target.get(key));
1424
- } else if (has2.call(rawTarget, rawKey)) {
1425
- return wrap(target.get(rawKey));
1426
- } else if (target !== rawTarget) {
1427
- target.get(key);
1428
- }
1429
- }
1430
- function has(key, isReadonly2 = false) {
1431
- const target = this["__v_raw"];
1432
- const rawTarget = toRaw(target);
1433
- const rawKey = toRaw(key);
1434
- if (!isReadonly2) {
1435
- if (hasChanged(key, rawKey)) {
1436
- track(rawTarget, "has", key);
1437
- }
1438
- track(rawTarget, "has", rawKey);
1439
- }
1440
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1441
- }
1442
- function size(target, isReadonly2 = false) {
1443
- target = target["__v_raw"];
1444
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1445
- return Reflect.get(target, "size", target);
1446
- }
1447
- function add(value, _isShallow = false) {
1448
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1449
- value = toRaw(value);
1450
- }
1451
- const target = toRaw(this);
1452
- const proto = getProto(target);
1453
- const hadKey = proto.has.call(target, value);
1454
- if (!hadKey) {
1455
- target.add(value);
1456
- trigger(target, "add", value, value);
1457
- }
1458
- return this;
1459
- }
1460
- function set(key, value, _isShallow = false) {
1461
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1462
- value = toRaw(value);
1463
- }
1464
- const target = toRaw(this);
1465
- const { has: has2, get: get2 } = getProto(target);
1466
- let hadKey = has2.call(target, key);
1467
- if (!hadKey) {
1468
- key = toRaw(key);
1469
- hadKey = has2.call(target, key);
1470
- } else {
1471
- checkIdentityKeys(target, has2, key);
1472
- }
1473
- const oldValue = get2.call(target, key);
1474
- target.set(key, value);
1475
- if (!hadKey) {
1476
- trigger(target, "add", key, value);
1477
- } else if (hasChanged(value, oldValue)) {
1478
- trigger(target, "set", key, value, oldValue);
1479
- }
1480
- return this;
1481
- }
1482
- function deleteEntry(key) {
1483
- const target = toRaw(this);
1484
- const { has: has2, get: get2 } = getProto(target);
1485
- let hadKey = has2.call(target, key);
1486
- if (!hadKey) {
1487
- key = toRaw(key);
1488
- hadKey = has2.call(target, key);
1489
- } else {
1490
- checkIdentityKeys(target, has2, key);
1491
- }
1492
- const oldValue = get2 ? get2.call(target, key) : void 0;
1493
- const result = target.delete(key);
1494
- if (hadKey) {
1495
- trigger(target, "delete", key, void 0, oldValue);
1496
- }
1497
- return result;
1498
- }
1499
- function clear() {
1500
- const target = toRaw(this);
1501
- const hadItems = target.size !== 0;
1502
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1503
- const result = target.clear();
1504
- if (hadItems) {
1505
- trigger(target, "clear", void 0, void 0, oldTarget);
1506
- }
1507
- return result;
1508
- }
1509
- function createForEach(isReadonly2, isShallow2) {
1510
- return function forEach(callback, thisArg) {
1511
- const observed = this;
1512
- const target = observed["__v_raw"];
1513
- const rawTarget = toRaw(target);
1514
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1515
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1516
- return target.forEach((value, key) => {
1517
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1518
- });
1519
- };
1520
- }
1521
1413
  function createIterableMethod(method, isReadonly2, isShallow2) {
1522
1414
  return function(...args) {
1523
1415
  const target = this["__v_raw"];
@@ -1560,71 +1452,134 @@ function createReadonlyMethod(type) {
1560
1452
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1561
1453
  };
1562
1454
  }
1563
- function createInstrumentations() {
1564
- const mutableInstrumentations2 = {
1565
- get(key) {
1566
- return get(this, key);
1567
- },
1568
- get size() {
1569
- return size(this);
1570
- },
1571
- has,
1572
- add,
1573
- set,
1574
- delete: deleteEntry,
1575
- clear,
1576
- forEach: createForEach(false, false)
1577
- };
1578
- const shallowInstrumentations2 = {
1579
- get(key) {
1580
- return get(this, key, false, true);
1581
- },
1582
- get size() {
1583
- return size(this);
1584
- },
1585
- has,
1586
- add(value) {
1587
- return add.call(this, value, true);
1588
- },
1589
- set(key, value) {
1590
- return set.call(this, key, value, true);
1591
- },
1592
- delete: deleteEntry,
1593
- clear,
1594
- forEach: createForEach(false, true)
1595
- };
1596
- const readonlyInstrumentations2 = {
1455
+ function createInstrumentations(readonly, shallow) {
1456
+ const instrumentations = {
1597
1457
  get(key) {
1598
- return get(this, key, true);
1599
- },
1600
- get size() {
1601
- return size(this, true);
1602
- },
1603
- has(key) {
1604
- return has.call(this, key, true);
1605
- },
1606
- add: createReadonlyMethod("add"),
1607
- set: createReadonlyMethod("set"),
1608
- delete: createReadonlyMethod("delete"),
1609
- clear: createReadonlyMethod("clear"),
1610
- forEach: createForEach(true, false)
1611
- };
1612
- const shallowReadonlyInstrumentations2 = {
1613
- get(key) {
1614
- return get(this, key, true, true);
1458
+ const target = this["__v_raw"];
1459
+ const rawTarget = toRaw(target);
1460
+ const rawKey = toRaw(key);
1461
+ if (!readonly) {
1462
+ if (hasChanged(key, rawKey)) {
1463
+ track(rawTarget, "get", key);
1464
+ }
1465
+ track(rawTarget, "get", rawKey);
1466
+ }
1467
+ const { has } = getProto(rawTarget);
1468
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1469
+ if (has.call(rawTarget, key)) {
1470
+ return wrap(target.get(key));
1471
+ } else if (has.call(rawTarget, rawKey)) {
1472
+ return wrap(target.get(rawKey));
1473
+ } else if (target !== rawTarget) {
1474
+ target.get(key);
1475
+ }
1615
1476
  },
1616
1477
  get size() {
1617
- return size(this, true);
1478
+ const target = this["__v_raw"];
1479
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1480
+ return Reflect.get(target, "size", target);
1618
1481
  },
1619
1482
  has(key) {
1620
- return has.call(this, key, true);
1483
+ const target = this["__v_raw"];
1484
+ const rawTarget = toRaw(target);
1485
+ const rawKey = toRaw(key);
1486
+ if (!readonly) {
1487
+ if (hasChanged(key, rawKey)) {
1488
+ track(rawTarget, "has", key);
1489
+ }
1490
+ track(rawTarget, "has", rawKey);
1491
+ }
1492
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1621
1493
  },
1622
- add: createReadonlyMethod("add"),
1623
- set: createReadonlyMethod("set"),
1624
- delete: createReadonlyMethod("delete"),
1625
- clear: createReadonlyMethod("clear"),
1626
- forEach: createForEach(true, true)
1494
+ forEach(callback, thisArg) {
1495
+ const observed = this;
1496
+ const target = observed["__v_raw"];
1497
+ const rawTarget = toRaw(target);
1498
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1499
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1500
+ return target.forEach((value, key) => {
1501
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1502
+ });
1503
+ }
1627
1504
  };
1505
+ extend(
1506
+ instrumentations,
1507
+ readonly ? {
1508
+ add: createReadonlyMethod("add"),
1509
+ set: createReadonlyMethod("set"),
1510
+ delete: createReadonlyMethod("delete"),
1511
+ clear: createReadonlyMethod("clear")
1512
+ } : {
1513
+ add(value) {
1514
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1515
+ value = toRaw(value);
1516
+ }
1517
+ const target = toRaw(this);
1518
+ const proto = getProto(target);
1519
+ const hadKey = proto.has.call(target, value);
1520
+ if (!hadKey) {
1521
+ target.add(value);
1522
+ trigger(target, "add", value, value);
1523
+ }
1524
+ return this;
1525
+ },
1526
+ set(key, value) {
1527
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1528
+ value = toRaw(value);
1529
+ }
1530
+ const target = toRaw(this);
1531
+ const { has, get } = getProto(target);
1532
+ let hadKey = has.call(target, key);
1533
+ if (!hadKey) {
1534
+ key = toRaw(key);
1535
+ hadKey = has.call(target, key);
1536
+ } else {
1537
+ checkIdentityKeys(target, has, key);
1538
+ }
1539
+ const oldValue = get.call(target, key);
1540
+ target.set(key, value);
1541
+ if (!hadKey) {
1542
+ trigger(target, "add", key, value);
1543
+ } else if (hasChanged(value, oldValue)) {
1544
+ trigger(target, "set", key, value, oldValue);
1545
+ }
1546
+ return this;
1547
+ },
1548
+ delete(key) {
1549
+ const target = toRaw(this);
1550
+ const { has, get } = getProto(target);
1551
+ let hadKey = has.call(target, key);
1552
+ if (!hadKey) {
1553
+ key = toRaw(key);
1554
+ hadKey = has.call(target, key);
1555
+ } else {
1556
+ checkIdentityKeys(target, has, key);
1557
+ }
1558
+ const oldValue = get ? get.call(target, key) : void 0;
1559
+ const result = target.delete(key);
1560
+ if (hadKey) {
1561
+ trigger(target, "delete", key, void 0, oldValue);
1562
+ }
1563
+ return result;
1564
+ },
1565
+ clear() {
1566
+ const target = toRaw(this);
1567
+ const hadItems = target.size !== 0;
1568
+ const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1569
+ const result = target.clear();
1570
+ if (hadItems) {
1571
+ trigger(
1572
+ target,
1573
+ "clear",
1574
+ void 0,
1575
+ void 0,
1576
+ oldTarget
1577
+ );
1578
+ }
1579
+ return result;
1580
+ }
1581
+ }
1582
+ );
1628
1583
  const iteratorMethods = [
1629
1584
  "keys",
1630
1585
  "values",
@@ -1632,30 +1587,12 @@ function createInstrumentations() {
1632
1587
  Symbol.iterator
1633
1588
  ];
1634
1589
  iteratorMethods.forEach((method) => {
1635
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1636
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1637
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1638
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1639
- method,
1640
- true,
1641
- true
1642
- );
1590
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1643
1591
  });
1644
- return [
1645
- mutableInstrumentations2,
1646
- readonlyInstrumentations2,
1647
- shallowInstrumentations2,
1648
- shallowReadonlyInstrumentations2
1649
- ];
1592
+ return instrumentations;
1650
1593
  }
1651
- const [
1652
- mutableInstrumentations,
1653
- readonlyInstrumentations,
1654
- shallowInstrumentations,
1655
- shallowReadonlyInstrumentations
1656
- ] = /* @__PURE__ */ createInstrumentations();
1657
1594
  function createInstrumentationGetter(isReadonly2, shallow) {
1658
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1595
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1659
1596
  return (target, key, receiver) => {
1660
1597
  if (key === "__v_isReactive") {
1661
1598
  return !isReadonly2;
@@ -1683,9 +1620,9 @@ const readonlyCollectionHandlers = {
1683
1620
  const shallowReadonlyCollectionHandlers = {
1684
1621
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1685
1622
  };
1686
- function checkIdentityKeys(target, has2, key) {
1623
+ function checkIdentityKeys(target, has, key) {
1687
1624
  const rawKey = toRaw(key);
1688
- if (rawKey !== key && has2.call(target, rawKey)) {
1625
+ if (rawKey !== key && has.call(target, rawKey)) {
1689
1626
  const type = toRawType(target);
1690
1627
  warn$2(
1691
1628
  `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
@@ -2166,7 +2103,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2166
2103
  const scope = getCurrentScope();
2167
2104
  const watchHandle = () => {
2168
2105
  effect.stop();
2169
- if (scope) {
2106
+ if (scope && scope.active) {
2170
2107
  remove(scope.effects, effect);
2171
2108
  }
2172
2109
  };
@@ -3639,7 +3576,7 @@ const TeleportImpl = {
3639
3576
  }
3640
3577
  if (!disabled) {
3641
3578
  mount(target, targetAnchor);
3642
- updateCssVars(n2);
3579
+ updateCssVars(n2, false);
3643
3580
  }
3644
3581
  } else if (!disabled) {
3645
3582
  warn$1(
@@ -3651,14 +3588,35 @@ const TeleportImpl = {
3651
3588
  };
3652
3589
  if (disabled) {
3653
3590
  mount(container, mainAnchor);
3654
- updateCssVars(n2);
3591
+ updateCssVars(n2, true);
3655
3592
  }
3656
3593
  if (isTeleportDeferred(n2.props)) {
3657
- queuePostRenderEffect(mountToTarget, parentSuspense);
3594
+ queuePostRenderEffect(() => {
3595
+ mountToTarget();
3596
+ n2.el.__isMounted = true;
3597
+ }, parentSuspense);
3658
3598
  } else {
3659
3599
  mountToTarget();
3660
3600
  }
3661
3601
  } else {
3602
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3603
+ queuePostRenderEffect(() => {
3604
+ TeleportImpl.process(
3605
+ n1,
3606
+ n2,
3607
+ container,
3608
+ anchor,
3609
+ parentComponent,
3610
+ parentSuspense,
3611
+ namespace,
3612
+ slotScopeIds,
3613
+ optimized,
3614
+ internals
3615
+ );
3616
+ delete n1.el.__isMounted;
3617
+ }, parentSuspense);
3618
+ return;
3619
+ }
3662
3620
  n2.el = n1.el;
3663
3621
  n2.targetStart = n1.targetStart;
3664
3622
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3741,7 +3699,7 @@ const TeleportImpl = {
3741
3699
  );
3742
3700
  }
3743
3701
  }
3744
- updateCssVars(n2);
3702
+ updateCssVars(n2, disabled);
3745
3703
  }
3746
3704
  },
3747
3705
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3809,9 +3767,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3809
3767
  querySelector
3810
3768
  );
3811
3769
  if (target) {
3770
+ const disabled = isTeleportDisabled(vnode.props);
3812
3771
  const targetNode = target._lpa || target.firstChild;
3813
3772
  if (vnode.shapeFlag & 16) {
3814
- if (isTeleportDisabled(vnode.props)) {
3773
+ if (disabled) {
3815
3774
  vnode.anchor = hydrateChildren(
3816
3775
  nextSibling(node),
3817
3776
  vnode,
@@ -3852,16 +3811,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3852
3811
  );
3853
3812
  }
3854
3813
  }
3855
- updateCssVars(vnode);
3814
+ updateCssVars(vnode, disabled);
3856
3815
  }
3857
3816
  return vnode.anchor && nextSibling(vnode.anchor);
3858
3817
  }
3859
3818
  const Teleport = TeleportImpl;
3860
- function updateCssVars(vnode) {
3819
+ function updateCssVars(vnode, isDisabled) {
3861
3820
  const ctx = vnode.ctx;
3862
3821
  if (ctx && ctx.ut) {
3863
- let node = vnode.targetStart;
3864
- while (node && node !== vnode.targetAnchor) {
3822
+ let node, anchor;
3823
+ if (isDisabled) {
3824
+ node = vnode.el;
3825
+ anchor = vnode.anchor;
3826
+ } else {
3827
+ node = vnode.targetStart;
3828
+ anchor = vnode.targetAnchor;
3829
+ }
3830
+ while (node && node !== anchor) {
3865
3831
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3866
3832
  node = node.nextSibling;
3867
3833
  }
@@ -3956,10 +3922,9 @@ const BaseTransitionImpl = {
3956
3922
  if (innerChild.type !== Comment) {
3957
3923
  setTransitionHooks(innerChild, enterHooks);
3958
3924
  }
3959
- const oldChild = instance.subTree;
3960
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3925
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3961
3926
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3962
- const leavingHooks = resolveTransitionHooks(
3927
+ let leavingHooks = resolveTransitionHooks(
3963
3928
  oldInnerChild,
3964
3929
  rawProps,
3965
3930
  state,
@@ -3974,6 +3939,7 @@ const BaseTransitionImpl = {
3974
3939
  instance.update();
3975
3940
  }
3976
3941
  delete leavingHooks.afterLeave;
3942
+ oldInnerChild = void 0;
3977
3943
  };
3978
3944
  return emptyPlaceholder(child);
3979
3945
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3987,10 +3953,19 @@ const BaseTransitionImpl = {
3987
3953
  earlyRemove();
3988
3954
  el[leaveCbKey] = void 0;
3989
3955
  delete enterHooks.delayedLeave;
3956
+ oldInnerChild = void 0;
3957
+ };
3958
+ enterHooks.delayedLeave = () => {
3959
+ delayedLeave();
3960
+ delete enterHooks.delayedLeave;
3961
+ oldInnerChild = void 0;
3990
3962
  };
3991
- enterHooks.delayedLeave = delayedLeave;
3992
3963
  };
3964
+ } else {
3965
+ oldInnerChild = void 0;
3993
3966
  }
3967
+ } else if (oldInnerChild) {
3968
+ oldInnerChild = void 0;
3994
3969
  }
3995
3970
  return child;
3996
3971
  };
@@ -4298,6 +4273,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4298
4273
  return;
4299
4274
  }
4300
4275
  if (isAsyncWrapper(vnode) && !isUnmount) {
4276
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
4277
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
4278
+ }
4301
4279
  return;
4302
4280
  }
4303
4281
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -4314,8 +4292,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4314
4292
  const setupState = owner.setupState;
4315
4293
  const rawSetupState = toRaw(setupState);
4316
4294
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4317
- if (knownTemplateRefs.has(rawSetupState[key])) {
4318
- return false;
4295
+ {
4296
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4297
+ warn$1(
4298
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4299
+ );
4300
+ }
4301
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4302
+ return false;
4303
+ }
4319
4304
  }
4320
4305
  return hasOwn(rawSetupState, key);
4321
4306
  };
@@ -4555,7 +4540,7 @@ function createHydrationFunctions(rendererInternals) {
4555
4540
  getContainerType(container),
4556
4541
  optimized
4557
4542
  );
4558
- if (isAsyncWrapper(vnode)) {
4543
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4559
4544
  let subTree;
4560
4545
  if (isFragmentStart) {
4561
4546
  subTree = createVNode(Fragment);
@@ -4612,7 +4597,11 @@ function createHydrationFunctions(rendererInternals) {
4612
4597
  }
4613
4598
  let needCallTransitionHooks = false;
4614
4599
  if (isTemplateNode(el)) {
4615
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4600
+ needCallTransitionHooks = needTransition(
4601
+ null,
4602
+ // no need check parentSuspense in hydration
4603
+ transition
4604
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4616
4605
  const content = el.content.firstChild;
4617
4606
  if (needCallTransitionHooks) {
4618
4607
  transition.beforeEnter(content);
@@ -4820,6 +4809,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4820
4809
  getContainerType(container),
4821
4810
  slotScopeIds
4822
4811
  );
4812
+ if (parentComponent) {
4813
+ parentComponent.vnode.el = vnode.el;
4814
+ updateHOCHostEl(parentComponent, vnode.el);
4815
+ }
4823
4816
  return next;
4824
4817
  };
4825
4818
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -5005,6 +4998,8 @@ function isMismatchAllowed(el, allowedType) {
5005
4998
  }
5006
4999
  }
5007
5000
 
5001
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
5002
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
5008
5003
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
5009
5004
  const id = requestIdleCallback(hydrate, { timeout });
5010
5005
  return () => cancelIdleCallback(id);
@@ -5998,12 +5993,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5998
5993
  }
5999
5994
  openBlock();
6000
5995
  const validSlotContent = slot && ensureValidVNode(slot(props));
5996
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5997
+ // key attached in the `createSlots` helper, respect that
5998
+ validSlotContent && validSlotContent.key;
6001
5999
  const rendered = createBlock(
6002
6000
  Fragment,
6003
6001
  {
6004
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
6005
- // key attached in the `createSlots` helper, respect that
6006
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
6002
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6007
6003
  (!validSlotContent && fallback ? "_fb" : "")
6008
6004
  },
6009
6005
  validSlotContent || (fallback ? fallback() : []),
@@ -7172,7 +7168,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7172
7168
  return vm;
7173
7169
  }
7174
7170
  }
7175
- Vue.version = `2.6.14-compat:${"3.5.11"}`;
7171
+ Vue.version = `2.6.14-compat:${"3.5.13"}`;
7176
7172
  Vue.config = singletonApp.config;
7177
7173
  Vue.use = (plugin, ...options) => {
7178
7174
  if (plugin && isFunction(plugin.install)) {
@@ -8160,6 +8156,7 @@ function getType(ctor) {
8160
8156
  function validateProps(rawProps, props, instance) {
8161
8157
  const resolvedValues = toRaw(props);
8162
8158
  const options = instance.propsOptions[0];
8159
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8163
8160
  for (const key in options) {
8164
8161
  let opt = options[key];
8165
8162
  if (opt == null) continue;
@@ -8168,7 +8165,7 @@ function validateProps(rawProps, props, instance) {
8168
8165
  resolvedValues[key],
8169
8166
  opt,
8170
8167
  shallowReadonly(resolvedValues) ,
8171
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8168
+ !camelizePropsKey.includes(key)
8172
8169
  );
8173
8170
  }
8174
8171
  }
@@ -9982,14 +9979,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9982
9979
  }
9983
9980
  const baseWatchOptions = extend({}, options);
9984
9981
  baseWatchOptions.onWarn = warn$1;
9982
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
9985
9983
  let ssrCleanup;
9986
9984
  if (isInSSRComponentSetup) {
9987
9985
  if (flush === "sync") {
9988
9986
  const ctx = useSSRContext();
9989
9987
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
9990
- } else if (!cb || immediate) {
9991
- baseWatchOptions.once = true;
9992
- } else {
9988
+ } else if (!runsImmediately) {
9993
9989
  const watchStopHandle = () => {
9994
9990
  };
9995
9991
  watchStopHandle.stop = NOOP;
@@ -10028,7 +10024,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10028
10024
  }
10029
10025
  };
10030
10026
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10031
- if (ssrCleanup) ssrCleanup.push(watchHandle);
10027
+ if (isInSSRComponentSetup) {
10028
+ if (ssrCleanup) {
10029
+ ssrCleanup.push(watchHandle);
10030
+ } else if (runsImmediately) {
10031
+ watchHandle();
10032
+ }
10033
+ }
10032
10034
  return watchHandle;
10033
10035
  }
10034
10036
  function instanceWatch(source, value, options) {
@@ -10063,19 +10065,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10063
10065
  warn$1(`useModel() called without active instance.`);
10064
10066
  return ref();
10065
10067
  }
10066
- if (!i.propsOptions[0][name]) {
10068
+ const camelizedName = camelize(name);
10069
+ if (!i.propsOptions[0][camelizedName]) {
10067
10070
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10068
10071
  return ref();
10069
10072
  }
10070
- const camelizedName = camelize(name);
10071
10073
  const hyphenatedName = hyphenate(name);
10072
- const modifiers = getModelModifiers(props, name);
10074
+ const modifiers = getModelModifiers(props, camelizedName);
10073
10075
  const res = customRef((track, trigger) => {
10074
10076
  let localValue;
10075
10077
  let prevSetValue = EMPTY_OBJ;
10076
10078
  let prevEmittedValue;
10077
10079
  watchSyncEffect(() => {
10078
- const propValue = props[name];
10080
+ const propValue = props[camelizedName];
10079
10081
  if (hasChanged(localValue, propValue)) {
10080
10082
  localValue = propValue;
10081
10083
  trigger();
@@ -10381,7 +10383,7 @@ function renderComponentRoot(instance) {
10381
10383
  }
10382
10384
  if (extraAttrs.length) {
10383
10385
  warn$1(
10384
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
10386
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
10385
10387
  );
10386
10388
  }
10387
10389
  if (eventAttrs.length) {
@@ -11242,9 +11244,9 @@ function closeBlock() {
11242
11244
  currentBlock = blockStack[blockStack.length - 1] || null;
11243
11245
  }
11244
11246
  let isBlockTreeEnabled = 1;
11245
- function setBlockTracking(value) {
11247
+ function setBlockTracking(value, inVOnce = false) {
11246
11248
  isBlockTreeEnabled += value;
11247
- if (value < 0 && currentBlock) {
11249
+ if (value < 0 && currentBlock && inVOnce) {
11248
11250
  currentBlock.hasOnce = true;
11249
11251
  }
11250
11252
  }
@@ -11797,9 +11799,9 @@ function setupStatefulComponent(instance, isSSR) {
11797
11799
  }
11798
11800
  const { setup } = Component;
11799
11801
  if (setup) {
11802
+ pauseTracking();
11800
11803
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11801
11804
  const reset = setCurrentInstance(instance);
11802
- pauseTracking();
11803
11805
  const setupResult = callWithErrorHandling(
11804
11806
  setup,
11805
11807
  instance,
@@ -11809,10 +11811,13 @@ function setupStatefulComponent(instance, isSSR) {
11809
11811
  setupContext
11810
11812
  ]
11811
11813
  );
11814
+ const isAsyncSetup = isPromise(setupResult);
11812
11815
  resetTracking();
11813
11816
  reset();
11814
- if (isPromise(setupResult)) {
11815
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11817
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11818
+ markAsyncBoundary(instance);
11819
+ }
11820
+ if (isAsyncSetup) {
11816
11821
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11817
11822
  if (isSSR) {
11818
11823
  return setupResult.then((resolvedResult) => {
@@ -12287,7 +12292,7 @@ function isMemoSame(cached, memo) {
12287
12292
  return true;
12288
12293
  }
12289
12294
 
12290
- const version = "3.5.11";
12295
+ const version = "3.5.13";
12291
12296
  const warn = warn$1 ;
12292
12297
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12293
12298
  const devtools = devtools$1 ;
@@ -12497,7 +12502,8 @@ function resolveTransitionProps(rawProps) {
12497
12502
  onAppear = onEnter,
12498
12503
  onAppearCancelled = onEnterCancelled
12499
12504
  } = baseProps;
12500
- const finishEnter = (el, isAppear, done) => {
12505
+ const finishEnter = (el, isAppear, done, isCancelled) => {
12506
+ el._enterCancelled = isCancelled;
12501
12507
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
12502
12508
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12503
12509
  done && done();
@@ -12555,8 +12561,13 @@ function resolveTransitionProps(rawProps) {
12555
12561
  if (legacyClassEnabled && legacyLeaveFromClass) {
12556
12562
  addTransitionClass(el, legacyLeaveFromClass);
12557
12563
  }
12558
- addTransitionClass(el, leaveActiveClass);
12559
- forceReflow();
12564
+ if (!el._enterCancelled) {
12565
+ forceReflow();
12566
+ addTransitionClass(el, leaveActiveClass);
12567
+ } else {
12568
+ addTransitionClass(el, leaveActiveClass);
12569
+ forceReflow();
12570
+ }
12560
12571
  nextFrame(() => {
12561
12572
  if (!el._isLeaving) {
12562
12573
  return;
@@ -12573,11 +12584,11 @@ function resolveTransitionProps(rawProps) {
12573
12584
  callHook(onLeave, [el, resolve]);
12574
12585
  },
12575
12586
  onEnterCancelled(el) {
12576
- finishEnter(el, false);
12587
+ finishEnter(el, false, void 0, true);
12577
12588
  callHook(onEnterCancelled, [el]);
12578
12589
  },
12579
12590
  onAppearCancelled(el) {
12580
- finishEnter(el, true);
12591
+ finishEnter(el, true, void 0, true);
12581
12592
  callHook(onAppearCancelled, [el]);
12582
12593
  },
12583
12594
  onLeaveCancelled(el) {
@@ -12797,10 +12808,11 @@ function useCssVars(getter) {
12797
12808
  }
12798
12809
  updateTeleports(vars);
12799
12810
  };
12800
- onBeforeMount(() => {
12801
- watchPostEffect(setVars);
12811
+ onBeforeUpdate(() => {
12812
+ queuePostFlushCb(setVars);
12802
12813
  });
12803
12814
  onMounted(() => {
12815
+ watch(setVars, NOOP, { flush: "post" });
12804
12816
  const ob = new MutationObserver(setVars);
12805
12817
  ob.observe(instance.subTree.el.parentNode, { childList: true });
12806
12818
  onUnmounted(() => ob.disconnect());
@@ -12992,7 +13004,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
12992
13004
  return false;
12993
13005
  }
12994
13006
 
12995
- function patchDOMProp(el, key, value, parentComponent) {
13007
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
12996
13008
  if (key === "innerHTML" || key === "textContent") {
12997
13009
  if (value != null) {
12998
13010
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13056,7 +13068,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13056
13068
  );
13057
13069
  }
13058
13070
  }
13059
- needRemove && el.removeAttribute(key);
13071
+ needRemove && el.removeAttribute(attrName || key);
13060
13072
  }
13061
13073
 
13062
13074
  function addEventListener(el, event, handler, options) {
@@ -13166,7 +13178,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13166
13178
  // #11081 force set props for possible async custom element
13167
13179
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13168
13180
  ) {
13169
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13181
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13170
13182
  } else {
13171
13183
  if (key === "true-value") {
13172
13184
  el._trueValue = nextValue;
@@ -13451,6 +13463,8 @@ class VueElement extends BaseClass {
13451
13463
  this._update();
13452
13464
  }
13453
13465
  if (shouldReflect) {
13466
+ const ob = this._ob;
13467
+ ob && ob.disconnect();
13454
13468
  if (val === true) {
13455
13469
  this.setAttribute(hyphenate(key), "");
13456
13470
  } else if (typeof val === "string" || typeof val === "number") {
@@ -13458,6 +13472,7 @@ class VueElement extends BaseClass {
13458
13472
  } else if (!val) {
13459
13473
  this.removeAttribute(hyphenate(key));
13460
13474
  }
13475
+ ob && ob.observe(this, { attributes: true });
13461
13476
  }
13462
13477
  }
13463
13478
  }
@@ -13893,7 +13908,7 @@ const vModelCheckbox = {
13893
13908
  setChecked(el, binding, vnode);
13894
13909
  }
13895
13910
  };
13896
- function setChecked(el, { value }, vnode) {
13911
+ function setChecked(el, { value, oldValue }, vnode) {
13897
13912
  el._modelValue = value;
13898
13913
  let checked;
13899
13914
  if (isArray(value)) {
@@ -13901,6 +13916,7 @@ function setChecked(el, { value }, vnode) {
13901
13916
  } else if (isSet(value)) {
13902
13917
  checked = value.has(vnode.props.value);
13903
13918
  } else {
13919
+ if (value === oldValue) return;
13904
13920
  checked = looseEqual(value, getCheckboxValue(el, true));
13905
13921
  }
13906
13922
  if (el.checked !== checked) {
@@ -14732,12 +14748,13 @@ function createConditionalExpression(test, consequent, alternate, newline = true
14732
14748
  loc: locStub
14733
14749
  };
14734
14750
  }
14735
- function createCacheExpression(index, value, needPauseTracking = false) {
14751
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
14736
14752
  return {
14737
14753
  type: 20,
14738
14754
  index,
14739
14755
  value,
14740
14756
  needPauseTracking,
14757
+ inVOnce,
14741
14758
  needArraySpread: false,
14742
14759
  loc: locStub
14743
14760
  };
@@ -16610,6 +16627,9 @@ function getLoc(start, end) {
16610
16627
  source: end == null ? end : getSlice(start, end)
16611
16628
  };
16612
16629
  }
16630
+ function cloneLoc(loc) {
16631
+ return getLoc(loc.start.offset, loc.end.offset);
16632
+ }
16613
16633
  function setLocEnd(loc, end) {
16614
16634
  loc.end = tokenizer.getPos(end);
16615
16635
  loc.source = getSlice(loc.start.offset, end);
@@ -17118,11 +17138,12 @@ function createTransformContext(root, {
17118
17138
  identifier.hoisted = exp;
17119
17139
  return identifier;
17120
17140
  },
17121
- cache(exp, isVNode = false) {
17141
+ cache(exp, isVNode = false, inVOnce = false) {
17122
17142
  const cacheExp = createCacheExpression(
17123
17143
  context.cached.length,
17124
17144
  exp,
17125
- isVNode
17145
+ isVNode,
17146
+ inVOnce
17126
17147
  );
17127
17148
  context.cached.push(cacheExp);
17128
17149
  return cacheExp;
@@ -17835,7 +17856,9 @@ function genCacheExpression(node, context) {
17835
17856
  push(`_cache[${node.index}] || (`);
17836
17857
  if (needPauseTracking) {
17837
17858
  indent();
17838
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
17859
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
17860
+ if (node.inVOnce) push(`, true`);
17861
+ push(`),`);
17839
17862
  newline();
17840
17863
  push(`(`);
17841
17864
  }
@@ -17892,12 +17915,14 @@ const transformExpression = (node, context) => {
17892
17915
  context
17893
17916
  );
17894
17917
  } else if (node.type === 1) {
17918
+ const memo = findDir(node, "memo");
17895
17919
  for (let i = 0; i < node.props.length; i++) {
17896
17920
  const dir = node.props[i];
17897
17921
  if (dir.type === 7 && dir.name !== "for") {
17898
17922
  const exp = dir.exp;
17899
17923
  const arg = dir.arg;
17900
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
17924
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
17925
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
17901
17926
  dir.exp = processExpression(
17902
17927
  exp,
17903
17928
  context,
@@ -17968,7 +17993,7 @@ function processIf(node, dir, context, processCodegen) {
17968
17993
  const branch = createIfBranch(node, dir);
17969
17994
  const ifNode = {
17970
17995
  type: 9,
17971
- loc: node.loc,
17996
+ loc: cloneLoc(node.loc),
17972
17997
  branches: [branch]
17973
17998
  };
17974
17999
  context.replaceNode(ifNode);
@@ -18225,10 +18250,11 @@ const transformFor = createStructuralDirectiveTransform(
18225
18250
  const isTemplate = isTemplateNode(node);
18226
18251
  const memo = findDir(node, "memo");
18227
18252
  const keyProp = findProp(node, `key`, false, true);
18228
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
18253
+ const isDirKey = keyProp && keyProp.type === 7;
18254
+ if (isDirKey && !keyProp.exp) {
18229
18255
  transformBindShorthand(keyProp);
18230
18256
  }
18231
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
18257
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
18232
18258
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
18233
18259
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
18234
18260
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -19467,8 +19493,8 @@ const transformOnce = (node, context) => {
19467
19493
  if (cur.codegenNode) {
19468
19494
  cur.codegenNode = context.cache(
19469
19495
  cur.codegenNode,
19496
+ true,
19470
19497
  true
19471
- /* isVNode */
19472
19498
  );
19473
19499
  }
19474
19500
  };