@vue/compat 3.5.10 → 3.5.12

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.10
2
+ * @vue/compat v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -633,8 +633,14 @@ var Vue = (function () {
633
633
  }
634
634
  let batchDepth = 0;
635
635
  let batchedSub;
636
- function batch(sub) {
636
+ let batchedComputed;
637
+ function batch(sub, isComputed = false) {
637
638
  sub.flags |= 8;
639
+ if (isComputed) {
640
+ sub.next = batchedComputed;
641
+ batchedComputed = sub;
642
+ return;
643
+ }
638
644
  sub.next = batchedSub;
639
645
  batchedSub = sub;
640
646
  }
@@ -645,20 +651,22 @@ var Vue = (function () {
645
651
  if (--batchDepth > 0) {
646
652
  return;
647
653
  }
654
+ if (batchedComputed) {
655
+ let e = batchedComputed;
656
+ batchedComputed = void 0;
657
+ while (e) {
658
+ const next = e.next;
659
+ e.next = void 0;
660
+ e.flags &= ~8;
661
+ e = next;
662
+ }
663
+ }
648
664
  let error;
649
665
  while (batchedSub) {
650
666
  let e = batchedSub;
651
- let next;
652
- while (e) {
653
- if (!(e.flags & 1)) {
654
- e.flags &= ~8;
655
- }
656
- e = e.next;
657
- }
658
- e = batchedSub;
659
667
  batchedSub = void 0;
660
668
  while (e) {
661
- next = e.next;
669
+ const next = e.next;
662
670
  e.next = void 0;
663
671
  e.flags &= ~8;
664
672
  if (e.flags & 1) {
@@ -758,16 +766,16 @@ var Vue = (function () {
758
766
  nextSub.prevSub = prevSub;
759
767
  link.nextSub = void 0;
760
768
  }
761
- if (dep.subs === link) {
762
- dep.subs = prevSub;
763
- }
764
769
  if (dep.subsHead === link) {
765
770
  dep.subsHead = nextSub;
766
771
  }
767
- if (!dep.subs && dep.computed) {
768
- dep.computed.flags &= ~4;
769
- for (let l = dep.computed.deps; l; l = l.nextDep) {
770
- removeSub(l, true);
772
+ if (dep.subs === link) {
773
+ dep.subs = prevSub;
774
+ if (!prevSub && dep.computed) {
775
+ dep.computed.flags &= ~4;
776
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
777
+ removeSub(l, true);
778
+ }
771
779
  }
772
780
  }
773
781
  if (!soft && !--dep.sc && dep.map) {
@@ -854,7 +862,6 @@ var Vue = (function () {
854
862
  /**
855
863
  * For object property deps cleanup
856
864
  */
857
- this.target = void 0;
858
865
  this.map = void 0;
859
866
  this.key = void 0;
860
867
  /**
@@ -982,7 +989,6 @@ var Vue = (function () {
982
989
  let dep = depsMap.get(key);
983
990
  if (!dep) {
984
991
  depsMap.set(key, dep = new Dep());
985
- dep.target = target;
986
992
  dep.map = depsMap;
987
993
  dep.key = key;
988
994
  }
@@ -1029,7 +1035,7 @@ var Vue = (function () {
1029
1035
  }
1030
1036
  });
1031
1037
  } else {
1032
- if (key !== void 0) {
1038
+ if (key !== void 0 || depsMap.has(void 0)) {
1033
1039
  run(depsMap.get(key));
1034
1040
  }
1035
1041
  if (isArrayIndex) {
@@ -1404,117 +1410,6 @@ var Vue = (function () {
1404
1410
 
1405
1411
  const toShallow = (value) => value;
1406
1412
  const getProto = (v) => Reflect.getPrototypeOf(v);
1407
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1408
- target = target["__v_raw"];
1409
- const rawTarget = toRaw(target);
1410
- const rawKey = toRaw(key);
1411
- if (!isReadonly2) {
1412
- if (hasChanged(key, rawKey)) {
1413
- track(rawTarget, "get", key);
1414
- }
1415
- track(rawTarget, "get", rawKey);
1416
- }
1417
- const { has: has2 } = getProto(rawTarget);
1418
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1419
- if (has2.call(rawTarget, key)) {
1420
- return wrap(target.get(key));
1421
- } else if (has2.call(rawTarget, rawKey)) {
1422
- return wrap(target.get(rawKey));
1423
- } else if (target !== rawTarget) {
1424
- target.get(key);
1425
- }
1426
- }
1427
- function has(key, isReadonly2 = false) {
1428
- const target = this["__v_raw"];
1429
- const rawTarget = toRaw(target);
1430
- const rawKey = toRaw(key);
1431
- if (!isReadonly2) {
1432
- if (hasChanged(key, rawKey)) {
1433
- track(rawTarget, "has", key);
1434
- }
1435
- track(rawTarget, "has", rawKey);
1436
- }
1437
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1438
- }
1439
- function size(target, isReadonly2 = false) {
1440
- target = target["__v_raw"];
1441
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1442
- return Reflect.get(target, "size", target);
1443
- }
1444
- function add(value, _isShallow = false) {
1445
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1446
- value = toRaw(value);
1447
- }
1448
- const target = toRaw(this);
1449
- const proto = getProto(target);
1450
- const hadKey = proto.has.call(target, value);
1451
- if (!hadKey) {
1452
- target.add(value);
1453
- trigger(target, "add", value, value);
1454
- }
1455
- return this;
1456
- }
1457
- function set(key, value, _isShallow = false) {
1458
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1459
- value = toRaw(value);
1460
- }
1461
- const target = toRaw(this);
1462
- const { has: has2, get: get2 } = getProto(target);
1463
- let hadKey = has2.call(target, key);
1464
- if (!hadKey) {
1465
- key = toRaw(key);
1466
- hadKey = has2.call(target, key);
1467
- } else {
1468
- checkIdentityKeys(target, has2, key);
1469
- }
1470
- const oldValue = get2.call(target, key);
1471
- target.set(key, value);
1472
- if (!hadKey) {
1473
- trigger(target, "add", key, value);
1474
- } else if (hasChanged(value, oldValue)) {
1475
- trigger(target, "set", key, value, oldValue);
1476
- }
1477
- return this;
1478
- }
1479
- function deleteEntry(key) {
1480
- const target = toRaw(this);
1481
- const { has: has2, get: get2 } = getProto(target);
1482
- let hadKey = has2.call(target, key);
1483
- if (!hadKey) {
1484
- key = toRaw(key);
1485
- hadKey = has2.call(target, key);
1486
- } else {
1487
- checkIdentityKeys(target, has2, key);
1488
- }
1489
- const oldValue = get2 ? get2.call(target, key) : void 0;
1490
- const result = target.delete(key);
1491
- if (hadKey) {
1492
- trigger(target, "delete", key, void 0, oldValue);
1493
- }
1494
- return result;
1495
- }
1496
- function clear() {
1497
- const target = toRaw(this);
1498
- const hadItems = target.size !== 0;
1499
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1500
- const result = target.clear();
1501
- if (hadItems) {
1502
- trigger(target, "clear", void 0, void 0, oldTarget);
1503
- }
1504
- return result;
1505
- }
1506
- function createForEach(isReadonly2, isShallow2) {
1507
- return function forEach(callback, thisArg) {
1508
- const observed = this;
1509
- const target = observed["__v_raw"];
1510
- const rawTarget = toRaw(target);
1511
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1512
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1513
- return target.forEach((value, key) => {
1514
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1515
- });
1516
- };
1517
- }
1518
1413
  function createIterableMethod(method, isReadonly2, isShallow2) {
1519
1414
  return function(...args) {
1520
1415
  const target = this["__v_raw"];
@@ -1557,71 +1452,134 @@ var Vue = (function () {
1557
1452
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1558
1453
  };
1559
1454
  }
1560
- function createInstrumentations() {
1561
- const mutableInstrumentations2 = {
1562
- get(key) {
1563
- return get(this, key);
1564
- },
1565
- get size() {
1566
- return size(this);
1567
- },
1568
- has,
1569
- add,
1570
- set,
1571
- delete: deleteEntry,
1572
- clear,
1573
- forEach: createForEach(false, false)
1574
- };
1575
- const shallowInstrumentations2 = {
1576
- get(key) {
1577
- return get(this, key, false, true);
1578
- },
1579
- get size() {
1580
- return size(this);
1581
- },
1582
- has,
1583
- add(value) {
1584
- return add.call(this, value, true);
1585
- },
1586
- set(key, value) {
1587
- return set.call(this, key, value, true);
1588
- },
1589
- delete: deleteEntry,
1590
- clear,
1591
- forEach: createForEach(false, true)
1592
- };
1593
- const readonlyInstrumentations2 = {
1455
+ function createInstrumentations(readonly, shallow) {
1456
+ const instrumentations = {
1594
1457
  get(key) {
1595
- return get(this, key, true);
1596
- },
1597
- get size() {
1598
- return size(this, true);
1599
- },
1600
- has(key) {
1601
- return has.call(this, key, true);
1602
- },
1603
- add: createReadonlyMethod("add"),
1604
- set: createReadonlyMethod("set"),
1605
- delete: createReadonlyMethod("delete"),
1606
- clear: createReadonlyMethod("clear"),
1607
- forEach: createForEach(true, false)
1608
- };
1609
- const shallowReadonlyInstrumentations2 = {
1610
- get(key) {
1611
- 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
+ }
1612
1476
  },
1613
1477
  get size() {
1614
- 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);
1615
1481
  },
1616
1482
  has(key) {
1617
- 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);
1618
1493
  },
1619
- add: createReadonlyMethod("add"),
1620
- set: createReadonlyMethod("set"),
1621
- delete: createReadonlyMethod("delete"),
1622
- clear: createReadonlyMethod("clear"),
1623
- 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
+ }
1624
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
+ );
1625
1583
  const iteratorMethods = [
1626
1584
  "keys",
1627
1585
  "values",
@@ -1629,30 +1587,12 @@ var Vue = (function () {
1629
1587
  Symbol.iterator
1630
1588
  ];
1631
1589
  iteratorMethods.forEach((method) => {
1632
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1633
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1634
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1635
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1636
- method,
1637
- true,
1638
- true
1639
- );
1590
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1640
1591
  });
1641
- return [
1642
- mutableInstrumentations2,
1643
- readonlyInstrumentations2,
1644
- shallowInstrumentations2,
1645
- shallowReadonlyInstrumentations2
1646
- ];
1592
+ return instrumentations;
1647
1593
  }
1648
- const [
1649
- mutableInstrumentations,
1650
- readonlyInstrumentations,
1651
- shallowInstrumentations,
1652
- shallowReadonlyInstrumentations
1653
- ] = /* @__PURE__ */ createInstrumentations();
1654
1594
  function createInstrumentationGetter(isReadonly2, shallow) {
1655
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1595
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1656
1596
  return (target, key, receiver) => {
1657
1597
  if (key === "__v_isReactive") {
1658
1598
  return !isReadonly2;
@@ -1680,9 +1620,9 @@ var Vue = (function () {
1680
1620
  const shallowReadonlyCollectionHandlers = {
1681
1621
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1682
1622
  };
1683
- function checkIdentityKeys(target, has2, key) {
1623
+ function checkIdentityKeys(target, has, key) {
1684
1624
  const rawKey = toRaw(key);
1685
- if (rawKey !== key && has2.call(target, rawKey)) {
1625
+ if (rawKey !== key && has.call(target, rawKey)) {
1686
1626
  const type = toRawType(target);
1687
1627
  warn$2(
1688
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.`
@@ -2018,7 +1958,7 @@ var Vue = (function () {
2018
1958
  this.flags |= 16;
2019
1959
  if (!(this.flags & 8) && // avoid infinite self recursion
2020
1960
  activeSub !== this) {
2021
- batch(this);
1961
+ batch(this, true);
2022
1962
  return true;
2023
1963
  }
2024
1964
  }
@@ -2540,10 +2480,8 @@ var Vue = (function () {
2540
2480
  }
2541
2481
  }
2542
2482
 
2543
- let isFlushing = false;
2544
- let isFlushPending = false;
2545
2483
  const queue = [];
2546
- let flushIndex = 0;
2484
+ let flushIndex = -1;
2547
2485
  const pendingPostFlushCbs = [];
2548
2486
  let activePostFlushCbs = null;
2549
2487
  let postFlushIndex = 0;
@@ -2555,7 +2493,7 @@ var Vue = (function () {
2555
2493
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2556
2494
  }
2557
2495
  function findInsertionIndex(id) {
2558
- let start = isFlushing ? flushIndex + 1 : 0;
2496
+ let start = flushIndex + 1;
2559
2497
  let end = queue.length;
2560
2498
  while (start < end) {
2561
2499
  const middle = start + end >>> 1;
@@ -2584,8 +2522,7 @@ var Vue = (function () {
2584
2522
  }
2585
2523
  }
2586
2524
  function queueFlush() {
2587
- if (!isFlushing && !isFlushPending) {
2588
- isFlushPending = true;
2525
+ if (!currentFlushPromise) {
2589
2526
  currentFlushPromise = resolvedPromise.then(flushJobs);
2590
2527
  }
2591
2528
  }
@@ -2602,7 +2539,7 @@ var Vue = (function () {
2602
2539
  }
2603
2540
  queueFlush();
2604
2541
  }
2605
- function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2542
+ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2606
2543
  {
2607
2544
  seen = seen || /* @__PURE__ */ new Map();
2608
2545
  }
@@ -2658,8 +2595,6 @@ var Vue = (function () {
2658
2595
  }
2659
2596
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2660
2597
  function flushJobs(seen) {
2661
- isFlushPending = false;
2662
- isFlushing = true;
2663
2598
  {
2664
2599
  seen = seen || /* @__PURE__ */ new Map();
2665
2600
  }
@@ -2691,10 +2626,9 @@ var Vue = (function () {
2691
2626
  job.flags &= ~1;
2692
2627
  }
2693
2628
  }
2694
- flushIndex = 0;
2629
+ flushIndex = -1;
2695
2630
  queue.length = 0;
2696
2631
  flushPostFlushCbs(seen);
2697
- isFlushing = false;
2698
2632
  currentFlushPromise = null;
2699
2633
  if (queue.length || pendingPostFlushCbs.length) {
2700
2634
  flushJobs(seen);
@@ -3642,7 +3576,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3642
3576
  }
3643
3577
  if (!disabled) {
3644
3578
  mount(target, targetAnchor);
3645
- updateCssVars(n2);
3579
+ updateCssVars(n2, false);
3646
3580
  }
3647
3581
  } else if (!disabled) {
3648
3582
  warn$1(
@@ -3654,7 +3588,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3654
3588
  };
3655
3589
  if (disabled) {
3656
3590
  mount(container, mainAnchor);
3657
- updateCssVars(n2);
3591
+ updateCssVars(n2, true);
3658
3592
  }
3659
3593
  if (isTeleportDeferred(n2.props)) {
3660
3594
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3744,7 +3678,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3744
3678
  );
3745
3679
  }
3746
3680
  }
3747
- updateCssVars(n2);
3681
+ updateCssVars(n2, disabled);
3748
3682
  }
3749
3683
  },
3750
3684
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3812,9 +3746,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3812
3746
  querySelector
3813
3747
  );
3814
3748
  if (target) {
3749
+ const disabled = isTeleportDisabled(vnode.props);
3815
3750
  const targetNode = target._lpa || target.firstChild;
3816
3751
  if (vnode.shapeFlag & 16) {
3817
- if (isTeleportDisabled(vnode.props)) {
3752
+ if (disabled) {
3818
3753
  vnode.anchor = hydrateChildren(
3819
3754
  nextSibling(node),
3820
3755
  vnode,
@@ -3855,16 +3790,23 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3855
3790
  );
3856
3791
  }
3857
3792
  }
3858
- updateCssVars(vnode);
3793
+ updateCssVars(vnode, disabled);
3859
3794
  }
3860
3795
  return vnode.anchor && nextSibling(vnode.anchor);
3861
3796
  }
3862
3797
  const Teleport = TeleportImpl;
3863
- function updateCssVars(vnode) {
3798
+ function updateCssVars(vnode, isDisabled) {
3864
3799
  const ctx = vnode.ctx;
3865
3800
  if (ctx && ctx.ut) {
3866
- let node = vnode.targetStart;
3867
- while (node && node !== vnode.targetAnchor) {
3801
+ let node, anchor;
3802
+ if (isDisabled) {
3803
+ node = vnode.el;
3804
+ anchor = vnode.anchor;
3805
+ } else {
3806
+ node = vnode.targetStart;
3807
+ anchor = vnode.targetAnchor;
3808
+ }
3809
+ while (node && node !== anchor) {
3868
3810
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3869
3811
  node = node.nextSibling;
3870
3812
  }
@@ -4317,8 +4259,15 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4317
4259
  const setupState = owner.setupState;
4318
4260
  const rawSetupState = toRaw(setupState);
4319
4261
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4320
- if (knownTemplateRefs.has(rawSetupState[key])) {
4321
- return false;
4262
+ {
4263
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4264
+ warn$1(
4265
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4266
+ );
4267
+ }
4268
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4269
+ return false;
4270
+ }
4322
4271
  }
4323
4272
  return hasOwn(rawSetupState, key);
4324
4273
  };
@@ -4615,7 +4564,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4615
4564
  }
4616
4565
  let needCallTransitionHooks = false;
4617
4566
  if (isTemplateNode(el)) {
4618
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4567
+ needCallTransitionHooks = needTransition(
4568
+ null,
4569
+ // no need check parentSuspense in hydration
4570
+ transition
4571
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4619
4572
  const content = el.content.firstChild;
4620
4573
  if (needCallTransitionHooks) {
4621
4574
  transition.beforeEnter(content);
@@ -5008,6 +4961,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5008
4961
  }
5009
4962
  }
5010
4963
 
4964
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4965
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
5011
4966
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
5012
4967
  const id = requestIdleCallback(hydrate, { timeout });
5013
4968
  return () => cancelIdleCallback(id);
@@ -5995,12 +5950,13 @@ If this is a native custom element, make sure to exclude it from component resol
5995
5950
  }
5996
5951
  openBlock();
5997
5952
  const validSlotContent = slot && ensureValidVNode(slot(props));
5953
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5954
+ // key attached in the `createSlots` helper, respect that
5955
+ validSlotContent && validSlotContent.key;
5998
5956
  const rendered = createBlock(
5999
5957
  Fragment,
6000
5958
  {
6001
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
6002
- // key attached in the `createSlots` helper, respect that
6003
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5959
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6004
5960
  (!validSlotContent && fallback ? "_fb" : "")
6005
5961
  },
6006
5962
  validSlotContent || (fallback ? fallback() : []),
@@ -7166,7 +7122,7 @@ If this is a native custom element, make sure to exclude it from component resol
7166
7122
  return vm;
7167
7123
  }
7168
7124
  }
7169
- Vue.version = `2.6.14-compat:${"3.5.10"}`;
7125
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7170
7126
  Vue.config = singletonApp.config;
7171
7127
  Vue.use = (plugin, ...options) => {
7172
7128
  if (plugin && isFunction(plugin.install)) {
@@ -8154,6 +8110,7 @@ If you want to remount the same app, move your app creation logic into a factory
8154
8110
  function validateProps(rawProps, props, instance) {
8155
8111
  const resolvedValues = toRaw(props);
8156
8112
  const options = instance.propsOptions[0];
8113
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8157
8114
  for (const key in options) {
8158
8115
  let opt = options[key];
8159
8116
  if (opt == null) continue;
@@ -8162,7 +8119,7 @@ If you want to remount the same app, move your app creation logic into a factory
8162
8119
  resolvedValues[key],
8163
8120
  opt,
8164
8121
  shallowReadonly(resolvedValues) ,
8165
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8122
+ !camelizePropsKey.includes(key)
8166
8123
  );
8167
8124
  }
8168
8125
  }
@@ -10034,19 +9991,19 @@ If you want to remount the same app, move your app creation logic into a factory
10034
9991
  warn$1(`useModel() called without active instance.`);
10035
9992
  return ref();
10036
9993
  }
10037
- if (!i.propsOptions[0][name]) {
9994
+ const camelizedName = camelize(name);
9995
+ if (!i.propsOptions[0][camelizedName]) {
10038
9996
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10039
9997
  return ref();
10040
9998
  }
10041
- const camelizedName = camelize(name);
10042
9999
  const hyphenatedName = hyphenate(name);
10043
- const modifiers = getModelModifiers(props, name);
10000
+ const modifiers = getModelModifiers(props, camelizedName);
10044
10001
  const res = customRef((track, trigger) => {
10045
10002
  let localValue;
10046
10003
  let prevSetValue = EMPTY_OBJ;
10047
10004
  let prevEmittedValue;
10048
10005
  watchSyncEffect(() => {
10049
- const propValue = props[name];
10006
+ const propValue = props[camelizedName];
10050
10007
  if (hasChanged(localValue, propValue)) {
10051
10008
  localValue = propValue;
10052
10009
  trigger();
@@ -11756,9 +11713,9 @@ Component that was made reactive: `,
11756
11713
  }
11757
11714
  const { setup } = Component;
11758
11715
  if (setup) {
11716
+ pauseTracking();
11759
11717
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11760
11718
  const reset = setCurrentInstance(instance);
11761
- pauseTracking();
11762
11719
  const setupResult = callWithErrorHandling(
11763
11720
  setup,
11764
11721
  instance,
@@ -11768,10 +11725,13 @@ Component that was made reactive: `,
11768
11725
  setupContext
11769
11726
  ]
11770
11727
  );
11728
+ const isAsyncSetup = isPromise(setupResult);
11771
11729
  resetTracking();
11772
11730
  reset();
11773
- if (isPromise(setupResult)) {
11774
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11731
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11732
+ markAsyncBoundary(instance);
11733
+ }
11734
+ if (isAsyncSetup) {
11775
11735
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11776
11736
  if (isSSR) {
11777
11737
  return setupResult.then((resolvedResult) => {
@@ -12244,7 +12204,7 @@ Component that was made reactive: `,
12244
12204
  return true;
12245
12205
  }
12246
12206
 
12247
- const version = "3.5.10";
12207
+ const version = "3.5.12";
12248
12208
  const warn = warn$1 ;
12249
12209
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12250
12210
  const devtools = devtools$1 ;
@@ -12930,7 +12890,7 @@ Component that was made reactive: `,
12930
12890
  return false;
12931
12891
  }
12932
12892
 
12933
- function patchDOMProp(el, key, value, parentComponent) {
12893
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
12934
12894
  if (key === "innerHTML" || key === "textContent") {
12935
12895
  if (value != null) {
12936
12896
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -12994,7 +12954,7 @@ Component that was made reactive: `,
12994
12954
  );
12995
12955
  }
12996
12956
  }
12997
- needRemove && el.removeAttribute(key);
12957
+ needRemove && el.removeAttribute(attrName || key);
12998
12958
  }
12999
12959
 
13000
12960
  function addEventListener(el, event, handler, options) {
@@ -13104,7 +13064,7 @@ Expected function or array of functions, received type ${typeof value}.`
13104
13064
  // #11081 force set props for possible async custom element
13105
13065
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13106
13066
  ) {
13107
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13067
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13108
13068
  } else {
13109
13069
  if (key === "true-value") {
13110
13070
  el._trueValue = nextValue;
@@ -13819,7 +13779,7 @@ Expected function or array of functions, received type ${typeof value}.`
13819
13779
  setChecked(el, binding, vnode);
13820
13780
  }
13821
13781
  };
13822
- function setChecked(el, { value }, vnode) {
13782
+ function setChecked(el, { value, oldValue }, vnode) {
13823
13783
  el._modelValue = value;
13824
13784
  let checked;
13825
13785
  if (isArray(value)) {
@@ -13827,6 +13787,7 @@ Expected function or array of functions, received type ${typeof value}.`
13827
13787
  } else if (isSet(value)) {
13828
13788
  checked = value.has(vnode.props.value);
13829
13789
  } else {
13790
+ if (value === oldValue) return;
13830
13791
  checked = looseEqual(value, getCheckboxValue(el, true));
13831
13792
  }
13832
13793
  if (el.checked !== checked) {
@@ -16495,6 +16456,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16495
16456
  source: end == null ? end : getSlice(start, end)
16496
16457
  };
16497
16458
  }
16459
+ function cloneLoc(loc) {
16460
+ return getLoc(loc.start.offset, loc.end.offset);
16461
+ }
16498
16462
  function setLocEnd(loc, end) {
16499
16463
  loc.end = tokenizer.getPos(end);
16500
16464
  loc.source = getSlice(loc.start.offset, end);
@@ -17853,7 +17817,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17853
17817
  const branch = createIfBranch(node, dir);
17854
17818
  const ifNode = {
17855
17819
  type: 9,
17856
- loc: node.loc,
17820
+ loc: cloneLoc(node.loc),
17857
17821
  branches: [branch]
17858
17822
  };
17859
17823
  context.replaceNode(ifNode);