@vue/compat 3.4.26 → 3.5.0-alpha.1

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.4.26
2
+ * @vue/compat v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -25,7 +25,7 @@ const NO = () => false;
25
25
  const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
26
26
  (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
27
27
  const isModelListener = (key) => key.startsWith("onUpdate:");
28
- const extend = Object.assign;
28
+ const extend$1 = Object.assign;
29
29
  const remove = (arr, el) => {
30
30
  const i = arr.indexOf(el);
31
31
  if (i > -1) {
@@ -88,11 +88,10 @@ const invokeArrayFns = (fns, arg) => {
88
88
  fns[i](arg);
89
89
  }
90
90
  };
91
- const def = (obj, key, value, writable = false) => {
91
+ const def = (obj, key, value) => {
92
92
  Object.defineProperty(obj, key, {
93
93
  configurable: true,
94
94
  enumerable: false,
95
- writable,
96
95
  value
97
96
  });
98
97
  };
@@ -425,152 +424,271 @@ class EffectScope {
425
424
  function effectScope(detached) {
426
425
  return new EffectScope(detached);
427
426
  }
428
- function recordEffectScope(effect, scope = activeEffectScope) {
429
- if (scope && scope.active) {
430
- scope.effects.push(effect);
431
- }
432
- }
433
427
  function getCurrentScope() {
434
428
  return activeEffectScope;
435
429
  }
436
- function onScopeDispose(fn) {
430
+ function onScopeDispose(fn, failSilently = false) {
437
431
  if (activeEffectScope) {
438
432
  activeEffectScope.cleanups.push(fn);
439
433
  }
440
434
  }
441
435
 
442
- let activeEffect;
436
+ let activeSub;
443
437
  class ReactiveEffect {
444
- constructor(fn, trigger, scheduler, scope) {
438
+ constructor(fn) {
445
439
  this.fn = fn;
446
- this.trigger = trigger;
447
- this.scheduler = scheduler;
448
- this.active = true;
449
- this.deps = [];
450
440
  /**
451
441
  * @internal
452
442
  */
453
- this._dirtyLevel = 4;
443
+ this.deps = void 0;
454
444
  /**
455
445
  * @internal
456
446
  */
457
- this._trackId = 0;
447
+ this.depsTail = void 0;
458
448
  /**
459
449
  * @internal
460
450
  */
461
- this._runnings = 0;
451
+ this.flags = 1 | 4;
462
452
  /**
463
453
  * @internal
464
454
  */
465
- this._shouldSchedule = false;
455
+ this.nextEffect = void 0;
466
456
  /**
467
457
  * @internal
468
458
  */
469
- this._depsLength = 0;
470
- recordEffectScope(this, scope);
471
- }
472
- get dirty() {
473
- if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
474
- this._dirtyLevel = 1;
475
- pauseTracking();
476
- for (let i = 0; i < this._depsLength; i++) {
477
- const dep = this.deps[i];
478
- if (dep.computed) {
479
- triggerComputed(dep.computed);
480
- if (this._dirtyLevel >= 4) {
481
- break;
482
- }
483
- }
484
- }
485
- if (this._dirtyLevel === 1) {
486
- this._dirtyLevel = 0;
487
- }
488
- resetTracking();
459
+ this.cleanup = void 0;
460
+ this.scheduler = void 0;
461
+ if (activeEffectScope && activeEffectScope.active) {
462
+ activeEffectScope.effects.push(this);
489
463
  }
490
- return this._dirtyLevel >= 4;
491
464
  }
492
- set dirty(v) {
493
- this._dirtyLevel = v ? 4 : 0;
465
+ /**
466
+ * @internal
467
+ */
468
+ notify() {
469
+ if (this.flags & 2 && !(this.flags & 32)) {
470
+ return;
471
+ }
472
+ if (this.flags & 64) {
473
+ return this.trigger();
474
+ }
475
+ if (!(this.flags & 8)) {
476
+ this.flags |= 8;
477
+ this.nextEffect = batchedEffect;
478
+ batchedEffect = this;
479
+ }
494
480
  }
495
481
  run() {
496
- this._dirtyLevel = 0;
497
- if (!this.active) {
482
+ if (!(this.flags & 1)) {
498
483
  return this.fn();
499
484
  }
500
- let lastShouldTrack = shouldTrack;
501
- let lastEffect = activeEffect;
485
+ this.flags |= 2;
486
+ cleanupEffect(this);
487
+ prepareDeps(this);
488
+ const prevEffect = activeSub;
489
+ const prevShouldTrack = shouldTrack;
490
+ activeSub = this;
491
+ shouldTrack = true;
502
492
  try {
503
- shouldTrack = true;
504
- activeEffect = this;
505
- this._runnings++;
506
- preCleanupEffect(this);
507
493
  return this.fn();
508
494
  } finally {
509
- postCleanupEffect(this);
510
- this._runnings--;
511
- activeEffect = lastEffect;
512
- shouldTrack = lastShouldTrack;
495
+ cleanupDeps(this);
496
+ activeSub = prevEffect;
497
+ shouldTrack = prevShouldTrack;
498
+ this.flags &= ~2;
513
499
  }
514
500
  }
515
501
  stop() {
516
- if (this.active) {
517
- preCleanupEffect(this);
518
- postCleanupEffect(this);
502
+ if (this.flags & 1) {
503
+ for (let link = this.deps; link; link = link.nextDep) {
504
+ removeSub(link);
505
+ }
506
+ this.deps = this.depsTail = void 0;
507
+ cleanupEffect(this);
519
508
  this.onStop && this.onStop();
520
- this.active = false;
509
+ this.flags &= ~1;
521
510
  }
522
511
  }
512
+ trigger() {
513
+ if (this.scheduler) {
514
+ this.scheduler();
515
+ } else {
516
+ this.runIfDirty();
517
+ }
518
+ }
519
+ /**
520
+ * @internal
521
+ */
522
+ runIfDirty() {
523
+ if (isDirty(this)) {
524
+ this.run();
525
+ }
526
+ }
527
+ get dirty() {
528
+ return isDirty(this);
529
+ }
523
530
  }
524
- function triggerComputed(computed) {
525
- return computed.value;
531
+ let batchDepth = 0;
532
+ let batchedEffect;
533
+ function startBatch() {
534
+ batchDepth++;
535
+ }
536
+ function endBatch() {
537
+ if (batchDepth > 1) {
538
+ batchDepth--;
539
+ return;
540
+ }
541
+ let error;
542
+ while (batchedEffect) {
543
+ let e = batchedEffect;
544
+ batchedEffect = void 0;
545
+ while (e) {
546
+ const next = e.nextEffect;
547
+ e.nextEffect = void 0;
548
+ e.flags &= ~8;
549
+ if (e.flags & 1) {
550
+ try {
551
+ e.trigger();
552
+ } catch (err) {
553
+ if (!error)
554
+ error = err;
555
+ }
556
+ }
557
+ e = next;
558
+ }
559
+ }
560
+ batchDepth--;
561
+ if (error)
562
+ throw error;
526
563
  }
527
- function preCleanupEffect(effect2) {
528
- effect2._trackId++;
529
- effect2._depsLength = 0;
564
+ function prepareDeps(sub) {
565
+ for (let link = sub.deps; link; link = link.nextDep) {
566
+ link.version = -1;
567
+ link.prevActiveLink = link.dep.activeLink;
568
+ link.dep.activeLink = link;
569
+ }
530
570
  }
531
- function postCleanupEffect(effect2) {
532
- if (effect2.deps.length > effect2._depsLength) {
533
- for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
534
- cleanupDepEffect(effect2.deps[i], effect2);
571
+ function cleanupDeps(sub) {
572
+ let head;
573
+ let tail = sub.depsTail;
574
+ for (let link = tail; link; link = link.prevDep) {
575
+ if (link.version === -1) {
576
+ if (link === tail)
577
+ tail = link.prevDep;
578
+ removeSub(link);
579
+ removeDep(link);
580
+ } else {
581
+ head = link;
535
582
  }
536
- effect2.deps.length = effect2._depsLength;
583
+ link.dep.activeLink = link.prevActiveLink;
584
+ link.prevActiveLink = void 0;
537
585
  }
586
+ sub.deps = head;
587
+ sub.depsTail = tail;
538
588
  }
539
- function cleanupDepEffect(dep, effect2) {
540
- const trackId = dep.get(effect2);
541
- if (trackId !== void 0 && effect2._trackId !== trackId) {
542
- dep.delete(effect2);
543
- if (dep.size === 0) {
544
- dep.cleanup();
589
+ function isDirty(sub) {
590
+ for (let link = sub.deps; link; link = link.nextDep) {
591
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
592
+ return true;
545
593
  }
546
594
  }
595
+ if (sub._dirty) {
596
+ return true;
597
+ }
598
+ return false;
599
+ }
600
+ function refreshComputed(computed) {
601
+ if (computed.flags & 2) {
602
+ return false;
603
+ }
604
+ if (computed.flags & 4 && !(computed.flags & 16)) {
605
+ return;
606
+ }
607
+ computed.flags &= ~16;
608
+ if (computed.globalVersion === globalVersion) {
609
+ return;
610
+ }
611
+ computed.globalVersion = globalVersion;
612
+ const dep = computed.dep;
613
+ computed.flags |= 2;
614
+ if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
615
+ computed.flags &= ~2;
616
+ return;
617
+ }
618
+ const prevSub = activeSub;
619
+ const prevShouldTrack = shouldTrack;
620
+ activeSub = computed;
621
+ shouldTrack = true;
622
+ try {
623
+ prepareDeps(computed);
624
+ const value = computed.fn();
625
+ if (dep.version === 0 || hasChanged(value, computed._value)) {
626
+ computed._value = value;
627
+ dep.version++;
628
+ }
629
+ } catch (err) {
630
+ dep.version++;
631
+ throw err;
632
+ } finally {
633
+ activeSub = prevSub;
634
+ shouldTrack = prevShouldTrack;
635
+ cleanupDeps(computed);
636
+ computed.flags &= ~2;
637
+ }
638
+ }
639
+ function removeSub(link) {
640
+ const { dep, prevSub, nextSub } = link;
641
+ if (prevSub) {
642
+ prevSub.nextSub = nextSub;
643
+ link.prevSub = void 0;
644
+ }
645
+ if (nextSub) {
646
+ nextSub.prevSub = prevSub;
647
+ link.nextSub = void 0;
648
+ }
649
+ if (dep.subs === link) {
650
+ dep.subs = prevSub;
651
+ }
652
+ if (!dep.subs && dep.computed) {
653
+ dep.computed.flags &= ~4;
654
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
655
+ removeSub(l);
656
+ }
657
+ }
658
+ }
659
+ function removeDep(link) {
660
+ const { prevDep, nextDep } = link;
661
+ if (prevDep) {
662
+ prevDep.nextDep = nextDep;
663
+ link.prevDep = void 0;
664
+ }
665
+ if (nextDep) {
666
+ nextDep.prevDep = prevDep;
667
+ link.nextDep = void 0;
668
+ }
547
669
  }
548
670
  function effect(fn, options) {
549
671
  if (fn.effect instanceof ReactiveEffect) {
550
672
  fn = fn.effect.fn;
551
673
  }
552
- const _effect = new ReactiveEffect(fn, NOOP, () => {
553
- if (_effect.dirty) {
554
- _effect.run();
555
- }
556
- });
674
+ const e = new ReactiveEffect(fn);
557
675
  if (options) {
558
- extend(_effect, options);
559
- if (options.scope)
560
- recordEffectScope(_effect, options.scope);
676
+ extend$1(e, options);
561
677
  }
562
- if (!options || !options.lazy) {
563
- _effect.run();
678
+ try {
679
+ e.run();
680
+ } catch (err) {
681
+ e.stop();
682
+ throw err;
564
683
  }
565
- const runner = _effect.run.bind(_effect);
566
- runner.effect = _effect;
684
+ const runner = e.run.bind(e);
685
+ runner.effect = e;
567
686
  return runner;
568
687
  }
569
688
  function stop(runner) {
570
689
  runner.effect.stop();
571
690
  }
572
691
  let shouldTrack = true;
573
- let pauseScheduleStack = 0;
574
692
  const trackStack = [];
575
693
  function pauseTracking() {
576
694
  trackStack.push(shouldTrack);
@@ -580,169 +698,374 @@ function resetTracking() {
580
698
  const last = trackStack.pop();
581
699
  shouldTrack = last === void 0 ? true : last;
582
700
  }
583
- function pauseScheduling() {
584
- pauseScheduleStack++;
585
- }
586
- function resetScheduling() {
587
- pauseScheduleStack--;
588
- while (!pauseScheduleStack && queueEffectSchedulers.length) {
589
- queueEffectSchedulers.shift()();
590
- }
591
- }
592
- function trackEffect(effect2, dep, debuggerEventExtraInfo) {
593
- if (dep.get(effect2) !== effect2._trackId) {
594
- dep.set(effect2, effect2._trackId);
595
- const oldDep = effect2.deps[effect2._depsLength];
596
- if (oldDep !== dep) {
597
- if (oldDep) {
598
- cleanupDepEffect(oldDep, effect2);
599
- }
600
- effect2.deps[effect2._depsLength++] = dep;
601
- } else {
602
- effect2._depsLength++;
701
+ function cleanupEffect(e) {
702
+ const { cleanup } = e;
703
+ e.cleanup = void 0;
704
+ if (cleanup) {
705
+ const prevSub = activeSub;
706
+ activeSub = void 0;
707
+ try {
708
+ cleanup();
709
+ } finally {
710
+ activeSub = prevSub;
603
711
  }
604
712
  }
605
713
  }
606
- const queueEffectSchedulers = [];
607
- function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
608
- pauseScheduling();
609
- for (const effect2 of dep.keys()) {
610
- let tracking;
611
- if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
612
- effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
613
- effect2._dirtyLevel = dirtyLevel;
714
+
715
+ let globalVersion = 0;
716
+ class Dep {
717
+ constructor(computed) {
718
+ this.computed = computed;
719
+ this.version = 0;
720
+ /**
721
+ * Link between this dep and the current active effect
722
+ */
723
+ this.activeLink = void 0;
724
+ /**
725
+ * Doubly linked list representing the subscribing effects (tail)
726
+ */
727
+ this.subs = void 0;
728
+ }
729
+ track(debugInfo) {
730
+ if (!activeSub || !shouldTrack) {
731
+ return;
614
732
  }
615
- if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
616
- effect2.trigger();
617
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
618
- effect2._shouldSchedule = false;
619
- if (effect2.scheduler) {
620
- queueEffectSchedulers.push(effect2.scheduler);
733
+ let link = this.activeLink;
734
+ if (link === void 0 || link.sub !== activeSub) {
735
+ link = this.activeLink = {
736
+ dep: this,
737
+ sub: activeSub,
738
+ version: this.version,
739
+ nextDep: void 0,
740
+ prevDep: void 0,
741
+ nextSub: void 0,
742
+ prevSub: void 0,
743
+ prevActiveLink: void 0
744
+ };
745
+ if (!activeSub.deps) {
746
+ activeSub.deps = activeSub.depsTail = link;
747
+ } else {
748
+ link.prevDep = activeSub.depsTail;
749
+ activeSub.depsTail.nextDep = link;
750
+ activeSub.depsTail = link;
751
+ }
752
+ if (activeSub.flags & 4) {
753
+ addSub(link);
754
+ }
755
+ } else if (link.version === -1) {
756
+ link.version = this.version;
757
+ if (link.nextDep) {
758
+ const next = link.nextDep;
759
+ next.prevDep = link.prevDep;
760
+ if (link.prevDep) {
761
+ link.prevDep.nextDep = next;
762
+ }
763
+ link.prevDep = activeSub.depsTail;
764
+ link.nextDep = void 0;
765
+ activeSub.depsTail.nextDep = link;
766
+ activeSub.depsTail = link;
767
+ if (activeSub.deps === link) {
768
+ activeSub.deps = next;
621
769
  }
622
770
  }
623
771
  }
772
+ return link;
773
+ }
774
+ trigger(debugInfo) {
775
+ this.version++;
776
+ globalVersion++;
777
+ this.notify(debugInfo);
778
+ }
779
+ notify(debugInfo) {
780
+ startBatch();
781
+ try {
782
+ if (false) ;
783
+ for (let link = this.subs; link; link = link.prevSub) {
784
+ link.sub.notify();
785
+ }
786
+ } finally {
787
+ endBatch();
788
+ }
624
789
  }
625
- resetScheduling();
626
790
  }
627
-
628
- const createDep = (cleanup, computed) => {
629
- const dep = /* @__PURE__ */ new Map();
630
- dep.cleanup = cleanup;
631
- dep.computed = computed;
632
- return dep;
633
- };
634
-
791
+ function addSub(link) {
792
+ const computed = link.dep.computed;
793
+ if (computed && !link.dep.subs) {
794
+ computed.flags |= 4 | 16;
795
+ for (let l = computed.deps; l; l = l.nextDep) {
796
+ addSub(l);
797
+ }
798
+ }
799
+ const currentTail = link.dep.subs;
800
+ if (currentTail !== link) {
801
+ link.prevSub = currentTail;
802
+ if (currentTail)
803
+ currentTail.nextSub = link;
804
+ }
805
+ link.dep.subs = link;
806
+ }
635
807
  const targetMap = /* @__PURE__ */ new WeakMap();
636
808
  const ITERATE_KEY = Symbol("");
637
809
  const MAP_KEY_ITERATE_KEY = Symbol("");
810
+ const ARRAY_ITERATE_KEY = Symbol("");
638
811
  function track(target, type, key) {
639
- if (shouldTrack && activeEffect) {
812
+ if (shouldTrack && activeSub) {
640
813
  let depsMap = targetMap.get(target);
641
814
  if (!depsMap) {
642
815
  targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
643
816
  }
644
817
  let dep = depsMap.get(key);
645
818
  if (!dep) {
646
- depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
819
+ depsMap.set(key, dep = new Dep());
820
+ }
821
+ {
822
+ dep.track();
647
823
  }
648
- trackEffect(
649
- activeEffect,
650
- dep);
651
824
  }
652
825
  }
653
826
  function trigger(target, type, key, newValue, oldValue, oldTarget) {
654
827
  const depsMap = targetMap.get(target);
655
828
  if (!depsMap) {
829
+ globalVersion++;
656
830
  return;
657
831
  }
658
832
  let deps = [];
659
833
  if (type === "clear") {
660
834
  deps = [...depsMap.values()];
661
- } else if (key === "length" && isArray(target)) {
662
- const newLength = Number(newValue);
663
- depsMap.forEach((dep, key2) => {
664
- if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
665
- deps.push(dep);
666
- }
667
- });
668
835
  } else {
669
- if (key !== void 0) {
670
- deps.push(depsMap.get(key));
671
- }
672
- switch (type) {
673
- case "add":
674
- if (!isArray(target)) {
675
- deps.push(depsMap.get(ITERATE_KEY));
676
- if (isMap(target)) {
677
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
678
- }
679
- } else if (isIntegerKey(key)) {
680
- deps.push(depsMap.get("length"));
836
+ const targetIsArray = isArray(target);
837
+ const isArrayIndex = targetIsArray && isIntegerKey(key);
838
+ if (targetIsArray && key === "length") {
839
+ const newLength = Number(newValue);
840
+ depsMap.forEach((dep, key2) => {
841
+ if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
842
+ deps.push(dep);
681
843
  }
682
- break;
683
- case "delete":
684
- if (!isArray(target)) {
685
- deps.push(depsMap.get(ITERATE_KEY));
844
+ });
845
+ } else {
846
+ const push = (dep) => dep && deps.push(dep);
847
+ if (key !== void 0) {
848
+ push(depsMap.get(key));
849
+ }
850
+ if (isArrayIndex) {
851
+ push(depsMap.get(ARRAY_ITERATE_KEY));
852
+ }
853
+ switch (type) {
854
+ case "add":
855
+ if (!targetIsArray) {
856
+ push(depsMap.get(ITERATE_KEY));
857
+ if (isMap(target)) {
858
+ push(depsMap.get(MAP_KEY_ITERATE_KEY));
859
+ }
860
+ } else if (isArrayIndex) {
861
+ push(depsMap.get("length"));
862
+ }
863
+ break;
864
+ case "delete":
865
+ if (!targetIsArray) {
866
+ push(depsMap.get(ITERATE_KEY));
867
+ if (isMap(target)) {
868
+ push(depsMap.get(MAP_KEY_ITERATE_KEY));
869
+ }
870
+ }
871
+ break;
872
+ case "set":
686
873
  if (isMap(target)) {
687
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
874
+ push(depsMap.get(ITERATE_KEY));
688
875
  }
689
- }
690
- break;
691
- case "set":
692
- if (isMap(target)) {
693
- deps.push(depsMap.get(ITERATE_KEY));
694
- }
695
- break;
876
+ break;
877
+ }
696
878
  }
697
879
  }
698
- pauseScheduling();
880
+ startBatch();
699
881
  for (const dep of deps) {
700
- if (dep) {
701
- triggerEffects(
702
- dep,
703
- 4);
882
+ {
883
+ dep.trigger();
704
884
  }
705
885
  }
706
- resetScheduling();
886
+ endBatch();
707
887
  }
708
888
  function getDepFromReactive(object, key) {
709
- const depsMap = targetMap.get(object);
710
- return depsMap && depsMap.get(key);
889
+ var _a;
890
+ return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
891
+ }
892
+
893
+ function reactiveReadArray(array) {
894
+ const raw = toRaw(array);
895
+ if (raw === array)
896
+ return raw;
897
+ track(raw, "iterate", ARRAY_ITERATE_KEY);
898
+ return isShallow(array) ? raw : raw.map(toReactive);
899
+ }
900
+ function shallowReadArray(arr) {
901
+ track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
902
+ return arr;
903
+ }
904
+ const arrayInstrumentations = {
905
+ __proto__: null,
906
+ [Symbol.iterator]() {
907
+ return iterator(this, Symbol.iterator, toReactive);
908
+ },
909
+ concat(...args) {
910
+ return reactiveReadArray(this).concat(
911
+ ...args.map((x) => reactiveReadArray(x))
912
+ );
913
+ },
914
+ entries() {
915
+ return iterator(this, "entries", (value) => {
916
+ value[1] = toReactive(value[1]);
917
+ return value;
918
+ });
919
+ },
920
+ every(fn, thisArg) {
921
+ return apply(this, "every", fn, thisArg);
922
+ },
923
+ filter(fn, thisArg) {
924
+ const result = apply(this, "filter", fn, thisArg);
925
+ return isProxy(this) && !isShallow(this) ? result.map(toReactive) : result;
926
+ },
927
+ find(fn, thisArg) {
928
+ const result = apply(this, "find", fn, thisArg);
929
+ return isProxy(this) && !isShallow(this) ? toReactive(result) : result;
930
+ },
931
+ findIndex(fn, thisArg) {
932
+ return apply(this, "findIndex", fn, thisArg);
933
+ },
934
+ findLast(fn, thisArg) {
935
+ const result = apply(this, "findLast", fn, thisArg);
936
+ return isProxy(this) && !isShallow(this) ? toReactive(result) : result;
937
+ },
938
+ findLastIndex(fn, thisArg) {
939
+ return apply(this, "findLastIndex", fn, thisArg);
940
+ },
941
+ // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
942
+ forEach(fn, thisArg) {
943
+ return apply(this, "forEach", fn, thisArg);
944
+ },
945
+ includes(...args) {
946
+ return searchProxy(this, "includes", args);
947
+ },
948
+ indexOf(...args) {
949
+ return searchProxy(this, "indexOf", args);
950
+ },
951
+ join(separator) {
952
+ return reactiveReadArray(this).join(separator);
953
+ },
954
+ // keys() iterator only reads `length`, no optimisation required
955
+ lastIndexOf(...args) {
956
+ return searchProxy(this, "lastIndexOf", args);
957
+ },
958
+ map(fn, thisArg) {
959
+ return apply(this, "map", fn, thisArg);
960
+ },
961
+ pop() {
962
+ return noTracking(this, "pop");
963
+ },
964
+ push(...args) {
965
+ return noTracking(this, "push", args);
966
+ },
967
+ reduce(fn, ...args) {
968
+ return reduce(this, "reduce", fn, args);
969
+ },
970
+ reduceRight(fn, ...args) {
971
+ return reduce(this, "reduceRight", fn, args);
972
+ },
973
+ shift() {
974
+ return noTracking(this, "shift");
975
+ },
976
+ // slice could use ARRAY_ITERATE but also seems to beg for range tracking
977
+ some(fn, thisArg) {
978
+ return apply(this, "some", fn, thisArg);
979
+ },
980
+ splice(...args) {
981
+ return noTracking(this, "splice", args);
982
+ },
983
+ toReversed() {
984
+ return reactiveReadArray(this).toReversed();
985
+ },
986
+ toSorted(comparer) {
987
+ return reactiveReadArray(this).toSorted(comparer);
988
+ },
989
+ toSpliced(...args) {
990
+ return reactiveReadArray(this).toSpliced(...args);
991
+ },
992
+ unshift(...args) {
993
+ return noTracking(this, "unshift", args);
994
+ },
995
+ values() {
996
+ return iterator(this, "values", toReactive);
997
+ }
998
+ };
999
+ function iterator(self, method, wrapValue) {
1000
+ const arr = shallowReadArray(self);
1001
+ const iter = arr[method]();
1002
+ if (arr !== self && !isShallow(self)) {
1003
+ iter._next = iter.next;
1004
+ iter.next = () => {
1005
+ const result = iter._next();
1006
+ if (result.value) {
1007
+ result.value = wrapValue(result.value);
1008
+ }
1009
+ return result;
1010
+ };
1011
+ }
1012
+ return iter;
1013
+ }
1014
+ function apply(self, method, fn, thisArg) {
1015
+ const arr = shallowReadArray(self);
1016
+ let wrappedFn = fn;
1017
+ if (arr !== self) {
1018
+ if (!isShallow(self)) {
1019
+ wrappedFn = function(item, index) {
1020
+ return fn.call(this, toReactive(item), index, self);
1021
+ };
1022
+ } else if (fn.length > 2) {
1023
+ wrappedFn = function(item, index) {
1024
+ return fn.call(this, item, index, self);
1025
+ };
1026
+ }
1027
+ }
1028
+ return arr[method](wrappedFn, thisArg);
1029
+ }
1030
+ function reduce(self, method, fn, args) {
1031
+ const arr = shallowReadArray(self);
1032
+ let wrappedFn = fn;
1033
+ if (arr !== self) {
1034
+ if (!isShallow(self)) {
1035
+ wrappedFn = function(acc, item, index) {
1036
+ return fn.call(this, acc, toReactive(item), index, self);
1037
+ };
1038
+ } else if (fn.length > 3) {
1039
+ wrappedFn = function(acc, item, index) {
1040
+ return fn.call(this, acc, item, index, self);
1041
+ };
1042
+ }
1043
+ }
1044
+ return arr[method](wrappedFn, ...args);
1045
+ }
1046
+ function searchProxy(self, method, args) {
1047
+ const arr = toRaw(self);
1048
+ track(arr, "iterate", ARRAY_ITERATE_KEY);
1049
+ const res = arr[method](...args);
1050
+ if ((res === -1 || res === false) && isProxy(args[0])) {
1051
+ args[0] = toRaw(args[0]);
1052
+ return arr[method](...args);
1053
+ }
1054
+ return res;
1055
+ }
1056
+ function noTracking(self, method, args = []) {
1057
+ pauseTracking();
1058
+ startBatch();
1059
+ const res = toRaw(self)[method].apply(self, args);
1060
+ endBatch();
1061
+ resetTracking();
1062
+ return res;
711
1063
  }
712
1064
 
713
1065
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
714
1066
  const builtInSymbols = new Set(
715
1067
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
716
1068
  );
717
- const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
718
- function createArrayInstrumentations() {
719
- const instrumentations = {};
720
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
721
- instrumentations[key] = function(...args) {
722
- const arr = toRaw(this);
723
- for (let i = 0, l = this.length; i < l; i++) {
724
- track(arr, "get", i + "");
725
- }
726
- const res = arr[key](...args);
727
- if (res === -1 || res === false) {
728
- return arr[key](...args.map(toRaw));
729
- } else {
730
- return res;
731
- }
732
- };
733
- });
734
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
735
- instrumentations[key] = function(...args) {
736
- pauseTracking();
737
- pauseScheduling();
738
- const res = toRaw(this)[key].apply(this, args);
739
- resetScheduling();
740
- resetTracking();
741
- return res;
742
- };
743
- });
744
- return instrumentations;
745
- }
746
1069
  function hasOwnProperty(key) {
747
1070
  if (!isSymbol(key))
748
1071
  key = String(key);
@@ -773,14 +1096,22 @@ class BaseReactiveHandler {
773
1096
  }
774
1097
  const targetIsArray = isArray(target);
775
1098
  if (!isReadonly2) {
776
- if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
777
- return Reflect.get(arrayInstrumentations, key, receiver);
1099
+ let fn;
1100
+ if (targetIsArray && (fn = arrayInstrumentations[key])) {
1101
+ return fn;
778
1102
  }
779
1103
  if (key === "hasOwnProperty") {
780
1104
  return hasOwnProperty;
781
1105
  }
782
1106
  }
783
- const res = Reflect.get(target, key, receiver);
1107
+ const res = Reflect.get(
1108
+ target,
1109
+ key,
1110
+ // if this is a proxy wrapping a ref, return methods using the raw ref
1111
+ // as receiver so that we don't have to call `toRaw` on the ref in all
1112
+ // its class methods
1113
+ isRef(target) ? target : receiver
1114
+ );
784
1115
  if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
785
1116
  return res;
786
1117
  }
@@ -1243,85 +1574,8 @@ function markRaw(value) {
1243
1574
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
1244
1575
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1245
1576
 
1246
- class ComputedRefImpl {
1247
- constructor(getter, _setter, isReadonly, isSSR) {
1248
- this.getter = getter;
1249
- this._setter = _setter;
1250
- this.dep = void 0;
1251
- this.__v_isRef = true;
1252
- this["__v_isReadonly"] = false;
1253
- this.effect = new ReactiveEffect(
1254
- () => getter(this._value),
1255
- () => triggerRefValue(
1256
- this,
1257
- this.effect._dirtyLevel === 2 ? 2 : 3
1258
- )
1259
- );
1260
- this.effect.computed = this;
1261
- this.effect.active = this._cacheable = !isSSR;
1262
- this["__v_isReadonly"] = isReadonly;
1263
- }
1264
- get value() {
1265
- const self = toRaw(this);
1266
- if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1267
- triggerRefValue(self, 4);
1268
- }
1269
- trackRefValue(self);
1270
- if (self.effect._dirtyLevel >= 2) {
1271
- triggerRefValue(self, 2);
1272
- }
1273
- return self._value;
1274
- }
1275
- set value(newValue) {
1276
- this._setter(newValue);
1277
- }
1278
- // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
1279
- get _dirty() {
1280
- return this.effect.dirty;
1281
- }
1282
- set _dirty(v) {
1283
- this.effect.dirty = v;
1284
- }
1285
- // #endregion
1286
- }
1287
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1288
- let getter;
1289
- let setter;
1290
- const onlyGetter = isFunction(getterOrOptions);
1291
- if (onlyGetter) {
1292
- getter = getterOrOptions;
1293
- setter = NOOP;
1294
- } else {
1295
- getter = getterOrOptions.get;
1296
- setter = getterOrOptions.set;
1297
- }
1298
- const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
1299
- return cRef;
1300
- }
1301
-
1302
- function trackRefValue(ref2) {
1303
- var _a;
1304
- if (shouldTrack && activeEffect) {
1305
- ref2 = toRaw(ref2);
1306
- trackEffect(
1307
- activeEffect,
1308
- (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1309
- () => ref2.dep = void 0,
1310
- ref2 instanceof ComputedRefImpl ? ref2 : void 0
1311
- ));
1312
- }
1313
- }
1314
- function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1315
- ref2 = toRaw(ref2);
1316
- const dep = ref2.dep;
1317
- if (dep) {
1318
- triggerEffects(
1319
- dep,
1320
- dirtyLevel);
1321
- }
1322
- }
1323
1577
  function isRef(r) {
1324
- return !!(r && r.__v_isRef === true);
1578
+ return r ? r.__v_isRef === true : false;
1325
1579
  }
1326
1580
  function ref(value) {
1327
1581
  return createRef(value, false);
@@ -1338,27 +1592,34 @@ function createRef(rawValue, shallow) {
1338
1592
  class RefImpl {
1339
1593
  constructor(value, __v_isShallow) {
1340
1594
  this.__v_isShallow = __v_isShallow;
1341
- this.dep = void 0;
1595
+ this.dep = new Dep();
1342
1596
  this.__v_isRef = true;
1343
1597
  this._rawValue = __v_isShallow ? value : toRaw(value);
1344
1598
  this._value = __v_isShallow ? value : toReactive(value);
1345
1599
  }
1346
1600
  get value() {
1347
- trackRefValue(this);
1601
+ {
1602
+ this.dep.track();
1603
+ }
1348
1604
  return this._value;
1349
1605
  }
1350
- set value(newVal) {
1351
- const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1352
- newVal = useDirectValue ? newVal : toRaw(newVal);
1353
- if (hasChanged(newVal, this._rawValue)) {
1354
- this._rawValue = newVal;
1355
- this._value = useDirectValue ? newVal : toReactive(newVal);
1356
- triggerRefValue(this, 4);
1606
+ set value(newValue) {
1607
+ const oldValue = this._rawValue;
1608
+ const useDirectValue = this.__v_isShallow || isShallow(newValue) || isReadonly(newValue);
1609
+ newValue = useDirectValue ? newValue : toRaw(newValue);
1610
+ if (hasChanged(newValue, oldValue)) {
1611
+ this._rawValue = newValue;
1612
+ this._value = useDirectValue ? newValue : toReactive(newValue);
1613
+ {
1614
+ this.dep.trigger();
1615
+ }
1357
1616
  }
1358
1617
  }
1359
1618
  }
1360
1619
  function triggerRef(ref2) {
1361
- triggerRefValue(ref2, 4);
1620
+ {
1621
+ ref2.dep.trigger();
1622
+ }
1362
1623
  }
1363
1624
  function unref(ref2) {
1364
1625
  return isRef(ref2) ? ref2.value : ref2;
@@ -1383,12 +1644,9 @@ function proxyRefs(objectWithRefs) {
1383
1644
  }
1384
1645
  class CustomRefImpl {
1385
1646
  constructor(factory) {
1386
- this.dep = void 0;
1387
1647
  this.__v_isRef = true;
1388
- const { get, set } = factory(
1389
- () => trackRefValue(this),
1390
- () => triggerRefValue(this)
1391
- );
1648
+ const dep = this.dep = new Dep();
1649
+ const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
1392
1650
  this._get = get;
1393
1651
  this._set = set;
1394
1652
  }
@@ -1453,6 +1711,80 @@ function propertyToRef(source, key, defaultValue) {
1453
1711
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1454
1712
  }
1455
1713
 
1714
+ class ComputedRefImpl {
1715
+ constructor(fn, setter, isSSR) {
1716
+ this.fn = fn;
1717
+ this.setter = setter;
1718
+ /**
1719
+ * @internal
1720
+ */
1721
+ this._value = void 0;
1722
+ /**
1723
+ * @internal
1724
+ */
1725
+ this.dep = new Dep(this);
1726
+ /**
1727
+ * @internal
1728
+ */
1729
+ this.__v_isRef = true;
1730
+ // A computed is also a subscriber that tracks other deps
1731
+ /**
1732
+ * @internal
1733
+ */
1734
+ this.deps = void 0;
1735
+ /**
1736
+ * @internal
1737
+ */
1738
+ this.depsTail = void 0;
1739
+ /**
1740
+ * @internal
1741
+ */
1742
+ this.flags = 16;
1743
+ /**
1744
+ * @internal
1745
+ */
1746
+ this.globalVersion = globalVersion - 1;
1747
+ // for backwards compat
1748
+ this.effect = this;
1749
+ this.__v_isReadonly = !setter;
1750
+ this.isSSR = isSSR;
1751
+ }
1752
+ /**
1753
+ * @internal
1754
+ */
1755
+ notify() {
1756
+ if (activeSub !== this) {
1757
+ this.flags |= 16;
1758
+ this.dep.notify();
1759
+ }
1760
+ }
1761
+ get value() {
1762
+ const link = this.dep.track();
1763
+ refreshComputed(this);
1764
+ if (link) {
1765
+ link.version = this.dep.version;
1766
+ }
1767
+ return this._value;
1768
+ }
1769
+ set value(newValue) {
1770
+ if (this.setter) {
1771
+ this.setter(newValue);
1772
+ }
1773
+ }
1774
+ }
1775
+ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1776
+ let getter;
1777
+ let setter;
1778
+ if (isFunction(getterOrOptions)) {
1779
+ getter = getterOrOptions;
1780
+ } else {
1781
+ getter = getterOrOptions.get;
1782
+ setter = getterOrOptions.set;
1783
+ }
1784
+ const cRef = new ComputedRefImpl(getter, setter, isSSR);
1785
+ return cRef;
1786
+ }
1787
+
1456
1788
  const TrackOpTypes = {
1457
1789
  "GET": "get",
1458
1790
  "HAS": "has",
@@ -1615,7 +1947,7 @@ function findInsertionIndex(id) {
1615
1947
  const middle = start + end >>> 1;
1616
1948
  const middleJob = queue[middle];
1617
1949
  const middleJobId = getId(middleJob);
1618
- if (middleJobId < id || middleJobId === id && middleJob.pre) {
1950
+ if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
1619
1951
  start = middle + 1;
1620
1952
  } else {
1621
1953
  end = middle;
@@ -1624,15 +1956,21 @@ function findInsertionIndex(id) {
1624
1956
  return start;
1625
1957
  }
1626
1958
  function queueJob(job) {
1627
- if (!queue.length || !queue.includes(
1628
- job,
1629
- isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
1630
- )) {
1959
+ var _a;
1960
+ if (!(job.flags & 1)) {
1631
1961
  if (job.id == null) {
1632
1962
  queue.push(job);
1963
+ } else if (
1964
+ // fast path when the job id is larger than the tail
1965
+ !(job.flags & 2) && job.id >= (((_a = queue[queue.length - 1]) == null ? void 0 : _a.id) || 0)
1966
+ ) {
1967
+ queue.push(job);
1633
1968
  } else {
1634
1969
  queue.splice(findInsertionIndex(job.id), 0, job);
1635
1970
  }
1971
+ if (!(job.flags & 4)) {
1972
+ job.flags |= 1;
1973
+ }
1636
1974
  queueFlush();
1637
1975
  }
1638
1976
  }
@@ -1650,11 +1988,11 @@ function invalidateJob(job) {
1650
1988
  }
1651
1989
  function queuePostFlushCb(cb) {
1652
1990
  if (!isArray(cb)) {
1653
- if (!activePostFlushCbs || !activePostFlushCbs.includes(
1654
- cb,
1655
- cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
1656
- )) {
1991
+ if (!(cb.flags & 1)) {
1657
1992
  pendingPostFlushCbs.push(cb);
1993
+ if (!(cb.flags & 4)) {
1994
+ cb.flags |= 1;
1995
+ }
1658
1996
  }
1659
1997
  } else {
1660
1998
  pendingPostFlushCbs.push(...cb);
@@ -1664,13 +2002,14 @@ function queuePostFlushCb(cb) {
1664
2002
  function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1665
2003
  for (; i < queue.length; i++) {
1666
2004
  const cb = queue[i];
1667
- if (cb && cb.pre) {
2005
+ if (cb && cb.flags & 2) {
1668
2006
  if (instance && cb.id !== instance.uid) {
1669
2007
  continue;
1670
2008
  }
1671
2009
  queue.splice(i, 1);
1672
2010
  i--;
1673
2011
  cb();
2012
+ cb.flags &= ~1;
1674
2013
  }
1675
2014
  }
1676
2015
  }
@@ -1687,6 +2026,7 @@ function flushPostFlushCbs(seen) {
1687
2026
  activePostFlushCbs = deduped;
1688
2027
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1689
2028
  activePostFlushCbs[postFlushIndex]();
2029
+ activePostFlushCbs[postFlushIndex].flags &= ~1;
1690
2030
  }
1691
2031
  activePostFlushCbs = null;
1692
2032
  postFlushIndex = 0;
@@ -1696,9 +2036,11 @@ const getId = (job) => job.id == null ? Infinity : job.id;
1696
2036
  const comparator = (a, b) => {
1697
2037
  const diff = getId(a) - getId(b);
1698
2038
  if (diff === 0) {
1699
- if (a.pre && !b.pre)
2039
+ const isAPre = a.flags & 2;
2040
+ const isBPre = b.flags & 2;
2041
+ if (isAPre && !isBPre)
1700
2042
  return -1;
1701
- if (b.pre && !a.pre)
2043
+ if (isBPre && !isAPre)
1702
2044
  return 1;
1703
2045
  }
1704
2046
  return diff;
@@ -1710,9 +2052,10 @@ function flushJobs(seen) {
1710
2052
  try {
1711
2053
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1712
2054
  const job = queue[flushIndex];
1713
- if (job && job.active !== false) {
2055
+ if (job && !(job.flags & 8)) {
1714
2056
  if (false) ;
1715
2057
  callWithErrorHandling(job, null, 14);
2058
+ job.flags &= ~1;
1716
2059
  }
1717
2060
  }
1718
2061
  } finally {
@@ -1780,7 +2123,7 @@ const globalCompatConfig = {
1780
2123
  MODE: 2
1781
2124
  };
1782
2125
  function configureCompat(config) {
1783
- extend(globalCompatConfig, config);
2126
+ extend$1(globalCompatConfig, config);
1784
2127
  }
1785
2128
  function getCompatConfigForKey(key, instance) {
1786
2129
  const instanceConfig = instance && instance.type.compatConfig;
@@ -1918,7 +2261,7 @@ function applyModelFromMixins(model, mixins) {
1918
2261
  if (mixins) {
1919
2262
  mixins.forEach((m) => {
1920
2263
  if (m.model)
1921
- extend(model, m.model);
2264
+ extend$1(model, m.model);
1922
2265
  if (m.mixins)
1923
2266
  applyModelFromMixins(model, m.mixins);
1924
2267
  });
@@ -2005,7 +2348,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2005
2348
  const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
2006
2349
  if (normalizedFromExtend) {
2007
2350
  hasExtends = true;
2008
- extend(normalized, normalizedFromExtend);
2351
+ extend$1(normalized, normalizedFromExtend);
2009
2352
  }
2010
2353
  };
2011
2354
  if (!asMixin && appContext.mixins.length) {
@@ -2027,7 +2370,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2027
2370
  if (isArray(raw)) {
2028
2371
  raw.forEach((key) => normalized[key] = null);
2029
2372
  } else {
2030
- extend(normalized, raw);
2373
+ extend$1(normalized, raw);
2031
2374
  }
2032
2375
  if (isObject(comp)) {
2033
2376
  cache.set(comp, normalized);
@@ -2151,7 +2494,7 @@ function renderComponentRoot(instance) {
2151
2494
  false ? {
2152
2495
  get attrs() {
2153
2496
  markAttrsAccessed();
2154
- return shallowReadonly(attrs);
2497
+ return attrs;
2155
2498
  },
2156
2499
  slots,
2157
2500
  emit
@@ -2180,26 +2523,21 @@ function renderComponentRoot(instance) {
2180
2523
  propsOptions
2181
2524
  );
2182
2525
  }
2183
- root = cloneVNode(root, fallthroughAttrs, false, true);
2526
+ root = cloneVNode(root, fallthroughAttrs);
2184
2527
  }
2185
2528
  }
2186
2529
  }
2187
2530
  if (isCompatEnabled$1("INSTANCE_ATTRS_CLASS_STYLE", instance) && vnode.shapeFlag & 4 && root.shapeFlag & (1 | 6)) {
2188
2531
  const { class: cls, style } = vnode.props || {};
2189
2532
  if (cls || style) {
2190
- root = cloneVNode(
2191
- root,
2192
- {
2193
- class: cls,
2194
- style
2195
- },
2196
- false,
2197
- true
2198
- );
2533
+ root = cloneVNode(root, {
2534
+ class: cls,
2535
+ style
2536
+ });
2199
2537
  }
2200
2538
  }
2201
2539
  if (vnode.dirs) {
2202
- root = cloneVNode(root, null, false, true);
2540
+ root = cloneVNode(root);
2203
2541
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2204
2542
  }
2205
2543
  if (vnode.transition) {
@@ -2639,7 +2977,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2639
2977
  let parentSuspenseId;
2640
2978
  const isSuspensible = isVNodeSuspensible(vnode);
2641
2979
  if (isSuspensible) {
2642
- if (parentSuspense && parentSuspense.pendingBranch) {
2980
+ if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
2643
2981
  parentSuspenseId = parentSuspense.pendingId;
2644
2982
  parentSuspense.deps++;
2645
2983
  }
@@ -2927,8 +3265,8 @@ function setActiveBranch(suspense, branch) {
2927
3265
  }
2928
3266
  }
2929
3267
  function isVNodeSuspensible(vnode) {
2930
- const suspensible = vnode.props && vnode.props.suspensible;
2931
- return suspensible != null && suspensible !== false;
3268
+ var _a;
3269
+ return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
2932
3270
  }
2933
3271
 
2934
3272
  const legacyDirectiveHookMap = {
@@ -3099,8 +3437,8 @@ function doWatch(source, cb, {
3099
3437
  }
3100
3438
  }
3101
3439
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
3102
- const job = () => {
3103
- if (!effect.active || !effect.dirty) {
3440
+ const job = (immediateFirstRun) => {
3441
+ if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
3104
3442
  return;
3105
3443
  }
3106
3444
  if (cb) {
@@ -3121,19 +3459,22 @@ function doWatch(source, cb, {
3121
3459
  effect.run();
3122
3460
  }
3123
3461
  };
3124
- job.allowRecurse = !!cb;
3462
+ if (cb)
3463
+ job.flags |= 4;
3464
+ const effect = new ReactiveEffect(getter);
3125
3465
  let scheduler;
3126
3466
  if (flush === "sync") {
3467
+ effect.flags |= 64;
3127
3468
  scheduler = job;
3128
3469
  } else if (flush === "post") {
3129
3470
  scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
3130
3471
  } else {
3131
- job.pre = true;
3472
+ job.flags |= 2;
3132
3473
  if (instance)
3133
3474
  job.id = instance.uid;
3134
3475
  scheduler = () => queueJob(job);
3135
3476
  }
3136
- const effect = new ReactiveEffect(getter, NOOP, scheduler);
3477
+ effect.scheduler = scheduler;
3137
3478
  const scope = getCurrentScope();
3138
3479
  const unwatch = () => {
3139
3480
  effect.stop();
@@ -3143,7 +3484,7 @@ function doWatch(source, cb, {
3143
3484
  };
3144
3485
  if (cb) {
3145
3486
  if (immediate) {
3146
- job();
3487
+ job(true);
3147
3488
  } else {
3148
3489
  oldValue = effect.run();
3149
3490
  }
@@ -3184,29 +3525,34 @@ function createPathGetter(ctx, path) {
3184
3525
  return cur;
3185
3526
  };
3186
3527
  }
3187
- function traverse(value, depth = Infinity, seen) {
3188
- if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
3528
+ function traverse(value, depth, currentDepth = 0, seen) {
3529
+ if (!isObject(value) || value["__v_skip"]) {
3189
3530
  return value;
3190
3531
  }
3532
+ if (depth && depth > 0) {
3533
+ if (currentDepth >= depth) {
3534
+ return value;
3535
+ }
3536
+ currentDepth++;
3537
+ }
3191
3538
  seen = seen || /* @__PURE__ */ new Set();
3192
3539
  if (seen.has(value)) {
3193
3540
  return value;
3194
3541
  }
3195
3542
  seen.add(value);
3196
- depth--;
3197
3543
  if (isRef(value)) {
3198
- traverse(value.value, depth, seen);
3544
+ traverse(value.value, depth, currentDepth, seen);
3199
3545
  } else if (isArray(value)) {
3200
3546
  for (let i = 0; i < value.length; i++) {
3201
- traverse(value[i], depth, seen);
3547
+ traverse(value[i], depth, currentDepth, seen);
3202
3548
  }
3203
3549
  } else if (isSet(value) || isMap(value)) {
3204
3550
  value.forEach((v) => {
3205
- traverse(v, depth, seen);
3551
+ traverse(v, depth, currentDepth, seen);
3206
3552
  });
3207
3553
  } else if (isPlainObject(value)) {
3208
3554
  for (const key in value) {
3209
- traverse(value[key], depth, seen);
3555
+ traverse(value[key], depth, currentDepth, seen);
3210
3556
  }
3211
3557
  }
3212
3558
  return value;
@@ -3316,21 +3662,13 @@ const BaseTransitionImpl = {
3316
3662
  if (!children || !children.length) {
3317
3663
  return;
3318
3664
  }
3319
- let child = children[0];
3320
- if (children.length > 1) {
3321
- for (const c of children) {
3322
- if (c.type !== Comment) {
3323
- child = c;
3324
- break;
3325
- }
3326
- }
3327
- }
3665
+ const child = findNonCommentChild(children);
3328
3666
  const rawProps = toRaw(props);
3329
3667
  const { mode } = rawProps;
3330
3668
  if (state.isLeaving) {
3331
3669
  return emptyPlaceholder(child);
3332
3670
  }
3333
- const innerChild = getKeepAliveChild(child);
3671
+ const innerChild = getInnerChild$1(child);
3334
3672
  if (!innerChild) {
3335
3673
  return emptyPlaceholder(child);
3336
3674
  }
@@ -3342,7 +3680,7 @@ const BaseTransitionImpl = {
3342
3680
  );
3343
3681
  setTransitionHooks(innerChild, enterHooks);
3344
3682
  const oldChild = instance.subTree;
3345
- const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3683
+ const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3346
3684
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3347
3685
  const leavingHooks = resolveTransitionHooks(
3348
3686
  oldInnerChild,
@@ -3351,12 +3689,11 @@ const BaseTransitionImpl = {
3351
3689
  instance
3352
3690
  );
3353
3691
  setTransitionHooks(oldInnerChild, leavingHooks);
3354
- if (mode === "out-in" && innerChild.type !== Comment) {
3692
+ if (mode === "out-in") {
3355
3693
  state.isLeaving = true;
3356
3694
  leavingHooks.afterLeave = () => {
3357
3695
  state.isLeaving = false;
3358
- if (instance.update.active !== false) {
3359
- instance.effect.dirty = true;
3696
+ if (!(instance.job.flags & 8)) {
3360
3697
  instance.update();
3361
3698
  }
3362
3699
  };
@@ -3384,6 +3721,18 @@ const BaseTransitionImpl = {
3384
3721
  {
3385
3722
  BaseTransitionImpl.__isBuiltIn = true;
3386
3723
  }
3724
+ function findNonCommentChild(children) {
3725
+ let child = children[0];
3726
+ if (children.length > 1) {
3727
+ for (const c of children) {
3728
+ if (c.type !== Comment) {
3729
+ child = c;
3730
+ break;
3731
+ }
3732
+ }
3733
+ }
3734
+ return child;
3735
+ }
3387
3736
  const BaseTransition = BaseTransitionImpl;
3388
3737
  function getLeavingNodesForType(state, vnode) {
3389
3738
  const { leavingVNodes } = state;
@@ -3538,8 +3887,11 @@ function emptyPlaceholder(vnode) {
3538
3887
  return vnode;
3539
3888
  }
3540
3889
  }
3541
- function getKeepAliveChild(vnode) {
3890
+ function getInnerChild$1(vnode) {
3542
3891
  if (!isKeepAlive(vnode)) {
3892
+ if (isTeleport(vnode.type) && vnode.children) {
3893
+ return findNonCommentChild(vnode.children);
3894
+ }
3543
3895
  return vnode;
3544
3896
  }
3545
3897
  const { shapeFlag, children } = vnode;
@@ -3592,7 +3944,7 @@ function defineComponent(options, extraOptions) {
3592
3944
  return isFunction(options) ? (
3593
3945
  // #8326: extend call and options.name access are considered side-effects
3594
3946
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3595
- /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3947
+ /* @__PURE__ */ (() => extend$1({ name: options.name }, extraOptions, { setup: options }))()
3596
3948
  ) : options;
3597
3949
  }
3598
3950
 
@@ -3697,7 +4049,6 @@ function defineAsyncComponent(source) {
3697
4049
  load().then(() => {
3698
4050
  loaded.value = true;
3699
4051
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
3700
- instance.parent.effect.dirty = true;
3701
4052
  queueJob(instance.parent.update);
3702
4053
  }
3703
4054
  }).catch((err) => {
@@ -3855,7 +4206,7 @@ const KeepAliveImpl = {
3855
4206
  return () => {
3856
4207
  pendingCacheKey = null;
3857
4208
  if (!slots.default) {
3858
- return null;
4209
+ return current = null;
3859
4210
  }
3860
4211
  const children = slots.default();
3861
4212
  const rawVNode = children[0];
@@ -4112,7 +4463,7 @@ function convertLegacyProps(legacyProps, type) {
4112
4463
  const converted = {};
4113
4464
  for (const key in legacyProps) {
4114
4465
  if (key === "attrs" || key === "domProps" || key === "props") {
4115
- extend(converted, legacyProps[key]);
4466
+ extend$1(converted, legacyProps[key]);
4116
4467
  } else if (key === "on" || key === "nativeOn") {
4117
4468
  const listeners = legacyProps[key];
4118
4469
  for (const event in listeners) {
@@ -4201,7 +4552,7 @@ function convertLegacySlots(vnode) {
4201
4552
  if (scopedSlots) {
4202
4553
  delete props.scopedSlots;
4203
4554
  if (slots) {
4204
- extend(slots, scopedSlots);
4555
+ extend$1(slots, scopedSlots);
4205
4556
  } else {
4206
4557
  slots = scopedSlots;
4207
4558
  }
@@ -4298,10 +4649,20 @@ function convertLegacyFunctionalComponent(comp) {
4298
4649
  function renderList(source, renderItem, cache, index) {
4299
4650
  let ret;
4300
4651
  const cached = cache && cache[index];
4301
- if (isArray(source) || isString(source)) {
4652
+ const sourceIsArray = isArray(source);
4653
+ const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4654
+ if (sourceIsArray || isString(source)) {
4655
+ if (sourceIsReactiveArray) {
4656
+ source = shallowReadArray(source);
4657
+ }
4302
4658
  ret = new Array(source.length);
4303
4659
  for (let i = 0, l = source.length; i < l; i++) {
4304
- ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
4660
+ ret[i] = renderItem(
4661
+ sourceIsReactiveArray ? toReactive(source[i]) : source[i],
4662
+ i,
4663
+ void 0,
4664
+ cached && cached[i]
4665
+ );
4305
4666
  }
4306
4667
  } else if (typeof source === "number") {
4307
4668
  ret = new Array(source);
@@ -4404,7 +4765,7 @@ function toObject(arr) {
4404
4765
  const res = {};
4405
4766
  for (let i = 0; i < arr.length; i++) {
4406
4767
  if (arr[i]) {
4407
- extend(res, arr[i]);
4768
+ extend$1(res, arr[i]);
4408
4769
  }
4409
4770
  }
4410
4771
  return res;
@@ -4523,7 +4884,7 @@ function installCompatInstanceProperties(map) {
4523
4884
  const del = (target, key) => {
4524
4885
  delete target[key];
4525
4886
  };
4526
- extend(map, {
4887
+ extend$1(map, {
4527
4888
  $set: (i) => {
4528
4889
  assertCompatEnabled("INSTANCE_SET", i);
4529
4890
  return set;
@@ -4575,7 +4936,7 @@ function installCompatInstanceProperties(map) {
4575
4936
  if (i.resolvedOptions) {
4576
4937
  return i.resolvedOptions;
4577
4938
  }
4578
- const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
4939
+ const res = i.resolvedOptions = extend$1({}, resolveMergedOptions(i));
4579
4940
  Object.defineProperties(res, {
4580
4941
  parent: {
4581
4942
  get() {
@@ -4640,7 +5001,7 @@ const getPublicInstance = (i) => {
4640
5001
  const publicPropertiesMap = (
4641
5002
  // Move PURE marker to new line to workaround compiler discarding it
4642
5003
  // due to type annotation
4643
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
5004
+ /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
4644
5005
  $: (i) => i,
4645
5006
  $el: (i) => i.vnode.el,
4646
5007
  $data: (i) => i.data,
@@ -4653,7 +5014,6 @@ const publicPropertiesMap = (
4653
5014
  $emit: (i) => i.emit,
4654
5015
  $options: (i) => resolveMergedOptions(i) ,
4655
5016
  $forceUpdate: (i) => i.f || (i.f = () => {
4656
- i.effect.dirty = true;
4657
5017
  queueJob(i.update);
4658
5018
  }),
4659
5019
  $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
@@ -4769,7 +5129,7 @@ const PublicInstanceProxyHandlers = {
4769
5129
  return Reflect.defineProperty(target, key, descriptor);
4770
5130
  }
4771
5131
  };
4772
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
5132
+ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend$1(
4773
5133
  {},
4774
5134
  PublicInstanceProxyHandlers,
4775
5135
  {
@@ -4859,7 +5219,7 @@ function mergeModels(a, b) {
4859
5219
  return a || b;
4860
5220
  if (isArray(a) && isArray(b))
4861
5221
  return a.concat(b);
4862
- return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
5222
+ return extend$1({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
4863
5223
  }
4864
5224
  function createPropsRestProxy(props, excludedKeys) {
4865
5225
  const ret = {};
@@ -5107,7 +5467,7 @@ function resolveMergedOptions(instance) {
5107
5467
  resolved = cached;
5108
5468
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
5109
5469
  if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
5110
- resolved = extend({}, base);
5470
+ resolved = extend$1({}, base);
5111
5471
  resolved.parent = instance.parent && instance.parent.proxy;
5112
5472
  resolved.propsData = instance.vnode.props;
5113
5473
  } else {
@@ -5190,7 +5550,7 @@ function mergeDataFn(to, from) {
5190
5550
  return from;
5191
5551
  }
5192
5552
  return function mergedDataFn() {
5193
- return (isCompatEnabled$1("OPTIONS_DATA_MERGE", null) ? deepMergeData : extend)(
5553
+ return (isCompatEnabled$1("OPTIONS_DATA_MERGE", null) ? deepMergeData : extend$1)(
5194
5554
  isFunction(to) ? to.call(this, this) : to,
5195
5555
  isFunction(from) ? from.call(this, this) : from
5196
5556
  );
@@ -5213,14 +5573,14 @@ function mergeAsArray$1(to, from) {
5213
5573
  return to ? [...new Set([].concat(to, from))] : from;
5214
5574
  }
5215
5575
  function mergeObjectOptions(to, from) {
5216
- return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
5576
+ return to ? extend$1(/* @__PURE__ */ Object.create(null), to, from) : from;
5217
5577
  }
5218
5578
  function mergeEmitsOrPropsOptions(to, from) {
5219
5579
  if (to) {
5220
5580
  if (isArray(to) && isArray(from)) {
5221
5581
  return [.../* @__PURE__ */ new Set([...to, ...from])];
5222
5582
  }
5223
- return extend(
5583
+ return extend$1(
5224
5584
  /* @__PURE__ */ Object.create(null),
5225
5585
  normalizePropsOrEmits(to),
5226
5586
  normalizePropsOrEmits(from != null ? from : {})
@@ -5234,7 +5594,7 @@ function mergeWatchOptions(to, from) {
5234
5594
  return from;
5235
5595
  if (!from)
5236
5596
  return to;
5237
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
5597
+ const merged = extend$1(/* @__PURE__ */ Object.create(null), to);
5238
5598
  for (const key in from) {
5239
5599
  merged[key] = mergeAsArray$1(to[key], from[key]);
5240
5600
  }
@@ -5281,13 +5641,13 @@ function createCompatVue$1(createApp, createSingletonApp) {
5281
5641
  return vm;
5282
5642
  }
5283
5643
  }
5284
- Vue.version = `2.6.14-compat:${"3.4.26"}`;
5644
+ Vue.version = `2.6.14-compat:${"3.5.0-alpha.1"}`;
5285
5645
  Vue.config = singletonApp.config;
5286
- Vue.use = (plugin, ...options) => {
5287
- if (plugin && isFunction(plugin.install)) {
5288
- plugin.install(Vue, ...options);
5289
- } else if (isFunction(plugin)) {
5290
- plugin(Vue, ...options);
5646
+ Vue.use = (p, ...options) => {
5647
+ if (p && isFunction(p.install)) {
5648
+ p.install(Vue, ...options);
5649
+ } else if (isFunction(p)) {
5650
+ p(Vue, ...options);
5291
5651
  }
5292
5652
  return Vue;
5293
5653
  };
@@ -5331,7 +5691,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5331
5691
  } else {
5332
5692
  return createCompatApp(
5333
5693
  mergeOptions(
5334
- extend({}, SubVue.options),
5694
+ extend$1({}, SubVue.options),
5335
5695
  inlineOptions,
5336
5696
  internalOptionMergeStrats
5337
5697
  ),
@@ -5345,7 +5705,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5345
5705
  const mergeBase = {};
5346
5706
  for (const key in Super.options) {
5347
5707
  const superValue = Super.options[key];
5348
- mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
5708
+ mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend$1(/* @__PURE__ */ Object.create(null), superValue) : superValue;
5349
5709
  }
5350
5710
  SubVue.options = mergeOptions(
5351
5711
  mergeBase,
@@ -5383,7 +5743,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5383
5743
  };
5384
5744
  const util = {
5385
5745
  warn: NOOP,
5386
- extend,
5746
+ extend: extend$1,
5387
5747
  mergeOptions: (parent, child, vm) => mergeOptions(
5388
5748
  parent,
5389
5749
  child,
@@ -5640,7 +6000,7 @@ let uid$1 = 0;
5640
6000
  function createAppAPI(render, hydrate) {
5641
6001
  return function createApp(rootComponent, rootProps = null) {
5642
6002
  if (!isFunction(rootComponent)) {
5643
- rootComponent = extend({}, rootComponent);
6003
+ rootComponent = extend$1({}, rootComponent);
5644
6004
  }
5645
6005
  if (rootProps != null && !isObject(rootProps)) {
5646
6006
  rootProps = null;
@@ -6039,7 +6399,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6039
6399
  }
6040
6400
  hasExtends = true;
6041
6401
  const [props, keys] = normalizePropsOptions(raw2, appContext, true);
6042
- extend(normalized, props);
6402
+ extend$1(normalized, props);
6043
6403
  if (keys)
6044
6404
  needCastKeys.push(...keys);
6045
6405
  };
@@ -6071,7 +6431,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6071
6431
  const normalizedKey = camelize(key);
6072
6432
  if (validatePropName(normalizedKey)) {
6073
6433
  const opt = raw[key];
6074
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6434
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend$1({}, opt);
6075
6435
  if (prop) {
6076
6436
  const booleanIndex = getTypeIndex(Boolean, prop.type);
6077
6437
  const stringIndex = getTypeIndex(String, prop.type);
@@ -6156,8 +6516,8 @@ const initSlots = (instance, children) => {
6156
6516
  if (instance.vnode.shapeFlag & 32) {
6157
6517
  const type = children._;
6158
6518
  if (type) {
6159
- extend(slots, children);
6160
- def(slots, "_", type, true);
6519
+ extend$1(slots, children);
6520
+ def(slots, "_", type);
6161
6521
  } else {
6162
6522
  normalizeObjectSlots(children, slots);
6163
6523
  }
@@ -6175,7 +6535,7 @@ const updateSlots = (instance, children, optimized) => {
6175
6535
  if (optimized && type === 1) {
6176
6536
  needDeletionCheck = false;
6177
6537
  } else {
6178
- extend(slots, children);
6538
+ extend$1(slots, children);
6179
6539
  if (!optimized && type === 1) {
6180
6540
  delete slots._;
6181
6541
  }
@@ -7306,7 +7666,6 @@ function baseCreateRenderer(options, createHydrationFns) {
7306
7666
  } else {
7307
7667
  instance.next = n2;
7308
7668
  invalidateJob(instance.update);
7309
- instance.effect.dirty = true;
7310
7669
  instance.update();
7311
7670
  }
7312
7671
  } else {
@@ -7465,19 +7824,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7465
7824
  }
7466
7825
  }
7467
7826
  };
7468
- const effect = instance.effect = new ReactiveEffect(
7469
- componentUpdateFn,
7470
- NOOP,
7471
- () => queueJob(update),
7472
- instance.scope
7473
- // track it in component's effect scope
7474
- );
7475
- const update = instance.update = () => {
7476
- if (effect.dirty) {
7477
- effect.run();
7478
- }
7479
- };
7480
- update.id = instance.uid;
7827
+ instance.scope.on();
7828
+ const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
7829
+ instance.scope.off();
7830
+ const update = instance.update = effect.run.bind(effect);
7831
+ const job = instance.job = effect.runIfDirty.bind(effect);
7832
+ job.id = instance.uid;
7833
+ effect.scheduler = () => queueJob(job);
7481
7834
  toggleRecurse(instance, true);
7482
7835
  update();
7483
7836
  };
@@ -7926,7 +8279,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7926
8279
  hostRemove(end);
7927
8280
  };
7928
8281
  const unmountComponent = (instance, parentSuspense, doRemove) => {
7929
- const { bum, scope, update, subTree, um } = instance;
8282
+ const { bum, scope, job, subTree, um } = instance;
7930
8283
  if (bum) {
7931
8284
  invokeArrayFns(bum);
7932
8285
  }
@@ -7934,8 +8287,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7934
8287
  instance.emit("hook:beforeDestroy");
7935
8288
  }
7936
8289
  scope.stop();
7937
- if (update) {
7938
- update.active = false;
8290
+ if (job) {
8291
+ job.flags |= 8;
7939
8292
  unmount(subTree, instance, parentSuspense, doRemove);
7940
8293
  }
7941
8294
  if (um) {
@@ -8024,8 +8377,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8024
8377
  function resolveChildrenNamespace({ type, props }, currentNamespace) {
8025
8378
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8026
8379
  }
8027
- function toggleRecurse({ effect, update }, allowed) {
8028
- effect.allowRecurse = update.allowRecurse = allowed;
8380
+ function toggleRecurse({ effect, job }, allowed) {
8381
+ if (allowed) {
8382
+ effect.flags |= 32;
8383
+ job.flags |= 4;
8384
+ } else {
8385
+ effect.flags &= ~32;
8386
+ job.flags &= ~4;
8387
+ }
8029
8388
  }
8030
8389
  function needTransition(parentSuspense, transition) {
8031
8390
  return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
@@ -8566,7 +8925,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8566
8925
  }
8567
8926
  if (isObject(style)) {
8568
8927
  if (isProxy(style) && !isArray(style)) {
8569
- style = extend({}, style);
8928
+ style = extend$1({}, style);
8570
8929
  }
8571
8930
  props.style = normalizeStyle(style);
8572
8931
  }
@@ -8586,10 +8945,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8586
8945
  function guardReactiveProps(props) {
8587
8946
  if (!props)
8588
8947
  return null;
8589
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8948
+ return isProxy(props) || isInternalObject(props) ? extend$1({}, props) : props;
8590
8949
  }
8591
- function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
8592
- const { props, ref, patchFlag, children, transition } = vnode;
8950
+ function cloneVNode(vnode, extraProps, mergeRef = false) {
8951
+ const { props, ref, patchFlag, children } = vnode;
8593
8952
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8594
8953
  const cloned = {
8595
8954
  __v_isVNode: true,
@@ -8619,7 +8978,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8619
8978
  dynamicChildren: vnode.dynamicChildren,
8620
8979
  appContext: vnode.appContext,
8621
8980
  dirs: vnode.dirs,
8622
- transition,
8981
+ transition: vnode.transition,
8623
8982
  // These should technically only be non-null on mounted VNodes. However,
8624
8983
  // they *should* be copied for kept-alive vnodes. So we just always copy
8625
8984
  // them since them being non-null during a mount doesn't affect the logic as
@@ -8633,9 +8992,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8633
8992
  ctx: vnode.ctx,
8634
8993
  ce: vnode.ce
8635
8994
  };
8636
- if (transition && cloneTransition) {
8637
- cloned.transition = transition.clone(cloned);
8638
- }
8639
8995
  {
8640
8996
  defineLegacyVNodeProperties(cloned);
8641
8997
  }
@@ -8766,6 +9122,7 @@ function createComponentInstance(vnode, parent, suspense) {
8766
9122
  effect: null,
8767
9123
  update: null,
8768
9124
  // will be set synchronously right after creation
9125
+ job: null,
8769
9126
  scope: new EffectScope(
8770
9127
  true
8771
9128
  /* detached */
@@ -8964,8 +9321,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8964
9321
  if (template) {
8965
9322
  const { isCustomElement, compilerOptions } = instance.appContext.config;
8966
9323
  const { delimiters, compilerOptions: componentCompilerOptions } = Component;
8967
- const finalCompilerOptions = extend(
8968
- extend(
9324
+ const finalCompilerOptions = extend$1(
9325
+ extend$1(
8969
9326
  {
8970
9327
  isCustomElement,
8971
9328
  delimiters
@@ -8977,7 +9334,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8977
9334
  {
8978
9335
  finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
8979
9336
  if (Component.compatConfig) {
8980
- extend(finalCompilerOptions.compatConfig, Component.compatConfig);
9337
+ extend$1(finalCompilerOptions.compatConfig, Component.compatConfig);
8981
9338
  }
8982
9339
  }
8983
9340
  Component.render = compile$1(template, finalCompilerOptions);
@@ -9143,7 +9500,7 @@ function isMemoSame(cached, memo) {
9143
9500
  return true;
9144
9501
  }
9145
9502
 
9146
- const version = "3.4.26";
9503
+ const version = "3.5.0-alpha.1";
9147
9504
  const warn$1 = NOOP;
9148
9505
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9149
9506
  const devtools = void 0;
@@ -9262,7 +9619,7 @@ const DOMTransitionPropsValidators = {
9262
9619
  leaveActiveClass: String,
9263
9620
  leaveToClass: String
9264
9621
  };
9265
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9622
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend$1(
9266
9623
  {},
9267
9624
  BaseTransitionPropsValidators,
9268
9625
  DOMTransitionPropsValidators
@@ -9362,7 +9719,7 @@ function resolveTransitionProps(rawProps) {
9362
9719
  });
9363
9720
  };
9364
9721
  };
9365
- return extend(baseProps, {
9722
+ return extend$1(baseProps, {
9366
9723
  onBeforeEnter(el) {
9367
9724
  callHook(onBeforeEnter, [el]);
9368
9725
  addTransitionClass(el, enterFromClass);
@@ -10101,7 +10458,7 @@ class VueElement extends BaseClass {
10101
10458
  render(this._createVNode(), this.shadowRoot);
10102
10459
  }
10103
10460
  _createVNode() {
10104
- const vnode = createVNode(this._def, extend({}, this._props));
10461
+ const vnode = createVNode(this._def, extend$1({}, this._props));
10105
10462
  if (!this._instance) {
10106
10463
  vnode.ce = (instance) => {
10107
10464
  this._instance = instance;
@@ -10166,7 +10523,7 @@ const moveCbKey = Symbol("_moveCb");
10166
10523
  const enterCbKey = Symbol("_enterCb");
10167
10524
  const TransitionGroupImpl = {
10168
10525
  name: "TransitionGroup",
10169
- props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
10526
+ props: /* @__PURE__ */ extend$1({}, TransitionPropsValidators, {
10170
10527
  tag: String,
10171
10528
  moveClass: String
10172
10529
  }),
@@ -10630,7 +10987,9 @@ const withKeys = (fn, modifiers) => {
10630
10987
  return;
10631
10988
  }
10632
10989
  const eventKey = hyphenate(event.key);
10633
- if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10990
+ if (modifiers.some(
10991
+ (k) => k === eventKey || keyNames[k] === eventKey
10992
+ )) {
10634
10993
  return fn(event);
10635
10994
  }
10636
10995
  {
@@ -10656,7 +11015,7 @@ const withKeys = (fn, modifiers) => {
10656
11015
  });
10657
11016
  };
10658
11017
 
10659
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
11018
+ const rendererOptions = /* @__PURE__ */ extend$1({ patchProp }, nodeOps);
10660
11019
  let renderer;
10661
11020
  let enabledHydration = false;
10662
11021
  function ensureRenderer() {
@@ -10904,7 +11263,7 @@ function wrappedCreateApp(...args) {
10904
11263
  }
10905
11264
  function createCompatVue() {
10906
11265
  const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
10907
- extend(Vue, runtimeDom);
11266
+ extend$1(Vue, runtimeDom);
10908
11267
  return Vue;
10909
11268
  }
10910
11269
 
@@ -12720,10 +13079,11 @@ const tokenizer = new Tokenizer(stack, {
12720
13079
  }
12721
13080
  },
12722
13081
  onselfclosingtag(end) {
13082
+ var _a;
12723
13083
  const name = currentOpenTag.tag;
12724
13084
  currentOpenTag.isSelfClosing = true;
12725
13085
  endOpenTag(end);
12726
- if (stack[0] && stack[0].tag === name) {
13086
+ if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
12727
13087
  onCloseTag(stack.shift(), end);
12728
13088
  }
12729
13089
  },
@@ -13039,7 +13399,7 @@ function endOpenTag(end) {
13039
13399
  function onText(content, start, end) {
13040
13400
  const parent = stack[0] || currentRoot;
13041
13401
  const lastNode = parent.children[parent.children.length - 1];
13042
- if (lastNode && lastNode.type === 2) {
13402
+ if ((lastNode == null ? void 0 : lastNode.type) === 2) {
13043
13403
  lastNode.content += content;
13044
13404
  setLocEnd(lastNode.loc, end);
13045
13405
  } else {
@@ -13058,9 +13418,9 @@ function onCloseTag(el, end, isImplied = false) {
13058
13418
  }
13059
13419
  if (tokenizer.inSFCRoot) {
13060
13420
  if (el.children.length) {
13061
- el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
13421
+ el.innerLoc.end = extend$1({}, el.children[el.children.length - 1].loc.end);
13062
13422
  } else {
13063
- el.innerLoc.end = extend({}, el.innerLoc.start);
13423
+ el.innerLoc.end = extend$1({}, el.innerLoc.start);
13064
13424
  }
13065
13425
  el.innerLoc.source = getSlice(
13066
13426
  el.innerLoc.start.offset,
@@ -13143,10 +13503,11 @@ function isFragmentTemplate({ tag, props }) {
13143
13503
  return false;
13144
13504
  }
13145
13505
  function isComponent({ tag, props }) {
13506
+ var _a;
13146
13507
  if (currentOptions.isCustomElement(tag)) {
13147
13508
  return false;
13148
13509
  }
13149
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13510
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13150
13511
  return true;
13151
13512
  }
13152
13513
  for (let i = 0; i < props.length; i++) {
@@ -13179,6 +13540,7 @@ function isUpperCase(c) {
13179
13540
  }
13180
13541
  const windowsNewlineRE = /\r\n/g;
13181
13542
  function condenseWhitespace(nodes, tag) {
13543
+ var _a, _b;
13182
13544
  const shouldCondense = currentOptions.whitespace !== "preserve";
13183
13545
  let removedWhitespace = false;
13184
13546
  for (let i = 0; i < nodes.length; i++) {
@@ -13186,8 +13548,8 @@ function condenseWhitespace(nodes, tag) {
13186
13548
  if (node.type === 2) {
13187
13549
  if (!inPre) {
13188
13550
  if (isAllWhitespace(node.content)) {
13189
- const prev = nodes[i - 1] && nodes[i - 1].type;
13190
- const next = nodes[i + 1] && nodes[i + 1].type;
13551
+ const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
13552
+ const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
13191
13553
  if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13192
13554
  removedWhitespace = true;
13193
13555
  nodes[i] = null;
@@ -13329,7 +13691,7 @@ function reset() {
13329
13691
  function baseParse(input, options) {
13330
13692
  reset();
13331
13693
  currentInput = input;
13332
- currentOptions = extend({}, defaultParserOptions);
13694
+ currentOptions = extend$1({}, defaultParserOptions);
13333
13695
  if (options) {
13334
13696
  let key;
13335
13697
  for (key in options) {
@@ -13340,7 +13702,7 @@ function baseParse(input, options) {
13340
13702
  }
13341
13703
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
13342
13704
  tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
13343
- const delimiters = options && options.delimiters;
13705
+ const delimiters = options == null ? void 0 : options.delimiters;
13344
13706
  if (delimiters) {
13345
13707
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
13346
13708
  tokenizer.delimiterClose = toCharCodes(delimiters[1]);
@@ -14667,6 +15029,7 @@ function genReturnStatement({ returns }, context) {
14667
15029
  }
14668
15030
 
14669
15031
  const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
15032
+ const constantBailRE = /\w\s*\(|\.[^\d]/;
14670
15033
  const transformExpression = (node, context) => {
14671
15034
  if (node.type === 5) {
14672
15035
  node.content = processExpression(
@@ -14761,6 +15124,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
14761
15124
  return `_ctx.${raw}`;
14762
15125
  };
14763
15126
  const rawExp = node.content;
15127
+ const bailConstant = constantBailRE.test(rawExp);
14764
15128
  let ast = node.ast;
14765
15129
  if (ast === false) {
14766
15130
  return node;
@@ -14822,7 +15186,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
14822
15186
  node2.name = rewriteIdentifier(node2.name, parent, node2);
14823
15187
  ids.push(node2);
14824
15188
  } else {
14825
- if (!(needPrefix && isLocal) && parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression") {
15189
+ if (!(needPrefix && isLocal) && !bailConstant) {
14826
15190
  node2.isConstant = true;
14827
15191
  }
14828
15192
  ids.push(node2);
@@ -14866,7 +15230,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
14866
15230
  ret.ast = ast;
14867
15231
  } else {
14868
15232
  ret = node;
14869
- ret.constType = 3;
15233
+ ret.constType = bailConstant ? 0 : 3;
14870
15234
  }
14871
15235
  ret.identifiers = Object.keys(knownIds);
14872
15236
  return ret;
@@ -16864,7 +17228,7 @@ function baseCompile(source, options = {}) {
16864
17228
  if (options.scopeId && !isModuleMode) {
16865
17229
  onError(createCompilerError(50));
16866
17230
  }
16867
- const resolvedOptions = extend({}, options, {
17231
+ const resolvedOptions = extend$1({}, options, {
16868
17232
  prefixIdentifiers
16869
17233
  });
16870
17234
  const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
@@ -16877,13 +17241,13 @@ function baseCompile(source, options = {}) {
16877
17241
  }
16878
17242
  transform(
16879
17243
  ast,
16880
- extend({}, resolvedOptions, {
17244
+ extend$1({}, resolvedOptions, {
16881
17245
  nodeTransforms: [
16882
17246
  ...nodeTransforms,
16883
17247
  ...options.nodeTransforms || []
16884
17248
  // user transforms
16885
17249
  ],
16886
- directiveTransforms: extend(
17250
+ directiveTransforms: extend$1(
16887
17251
  {},
16888
17252
  directiveTransforms,
16889
17253
  options.directiveTransforms || {}
@@ -17469,7 +17833,7 @@ const DOMDirectiveTransforms = {
17469
17833
  function compile(src, options = {}) {
17470
17834
  return baseCompile(
17471
17835
  src,
17472
- extend({}, parserOptions, options, {
17836
+ extend$1({}, parserOptions, options, {
17473
17837
  nodeTransforms: [
17474
17838
  // ignore <script> and <tag>
17475
17839
  // this is not put inside DOMNodeTransforms because that list is used
@@ -17478,7 +17842,7 @@ function compile(src, options = {}) {
17478
17842
  ...DOMNodeTransforms,
17479
17843
  ...options.nodeTransforms || []
17480
17844
  ],
17481
- directiveTransforms: extend(
17845
+ directiveTransforms: extend$1(
17482
17846
  {},
17483
17847
  DOMDirectiveTransforms,
17484
17848
  options.directiveTransforms || {}
@@ -17508,7 +17872,7 @@ function compileToFunction(template, options) {
17508
17872
  }
17509
17873
  const { code } = compile(
17510
17874
  template,
17511
- extend(
17875
+ extend$1(
17512
17876
  {
17513
17877
  hoistStatic: true,
17514
17878
  whitespace: "preserve",