@vue/runtime-core 3.6.0-beta.9 → 3.6.0-rc.10

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/runtime-core v3.6.0-beta.9
2
+ * @vue/runtime-core v3.6.0-rc.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -256,7 +256,7 @@ let currentFlushPromise = null;
256
256
  let jobsLength = 0;
257
257
  let flushIndex = 0;
258
258
  let postFlushIndex = 0;
259
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
259
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
260
260
  const RECURSION_LIMIT = 100;
261
261
  function nextTick(fn) {
262
262
  const p = currentFlushPromise || resolvedPromise;
@@ -273,8 +273,8 @@ function findInsertionIndex(order, queue, start, end) {
273
273
  /**
274
274
  * @internal for runtime-vapor only
275
275
  */
276
- function queueJob(job, id, isPre = false) {
277
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
276
+ function queueJob(job, id, isPre = false, order = 0) {
277
+ if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
278
278
  jobsLength++;
279
279
  queueFlush();
280
280
  }
@@ -295,6 +295,7 @@ const doFlushJobs = () => {
295
295
  flushJobs();
296
296
  } catch (e) {
297
297
  currentFlushPromise = null;
298
+ if (jobsLength || postJobs.length) queueFlush();
298
299
  throw e;
299
300
  }
300
301
  };
@@ -302,9 +303,10 @@ function queueFlush() {
302
303
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
303
304
  }
304
305
  function queuePostFlushCb(jobs, id = Infinity) {
305
- if (!(0, _vue_shared.isArray)(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
306
- else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
307
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
306
+ if (!(0, _vue_shared.isArray)(jobs)) {
307
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
308
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
309
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
308
310
  queueFlush();
309
311
  }
310
312
  function flushPreFlushCbs(instance, seen) {
@@ -318,32 +320,39 @@ function flushPreFlushCbs(instance, seen) {
318
320
  i--;
319
321
  jobsLength--;
320
322
  if (cb.flags & 2) cb.flags &= -2;
321
- cb();
322
- if (!(cb.flags & 2)) cb.flags &= -2;
323
+ try {
324
+ cb();
325
+ } finally {
326
+ if (!(cb.flags & 2)) cb.flags &= -2;
327
+ }
323
328
  }
324
329
  }
325
330
  function flushPostFlushCbs(seen) {
326
331
  if (postJobs.length) {
327
332
  if (activePostJobs) {
328
- activePostJobs.push(...postJobs);
333
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
329
334
  postJobs.length = 0;
330
335
  return;
331
336
  }
332
337
  activePostJobs = postJobs;
333
338
  postJobs = [];
334
339
  seen = seen || /* @__PURE__ */ new Map();
335
- while (postFlushIndex < activePostJobs.length) {
336
- const cb = activePostJobs[postFlushIndex++];
337
- if (checkRecursiveUpdates(seen, cb)) continue;
338
- if (cb.flags & 2) cb.flags &= -2;
339
- if (!(cb.flags & 4)) try {
340
- cb();
341
- } finally {
342
- cb.flags &= -2;
340
+ try {
341
+ while (postFlushIndex < activePostJobs.length) {
342
+ const cb = activePostJobs[postFlushIndex++];
343
+ if (checkRecursiveUpdates(seen, cb)) continue;
344
+ if (cb.flags & 2) cb.flags &= -2;
345
+ if (!(cb.flags & 4)) try {
346
+ cb();
347
+ } finally {
348
+ if (!(cb.flags & 2)) cb.flags &= -2;
349
+ }
343
350
  }
351
+ } finally {
352
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
353
+ activePostJobs = null;
354
+ postFlushIndex = 0;
344
355
  }
345
- activePostJobs = null;
346
- postFlushIndex = 0;
347
356
  }
348
357
  }
349
358
  let isFlushing = false;
@@ -353,9 +362,12 @@ let isFlushing = false;
353
362
  function flushOnAppMount(instance) {
354
363
  if (!isFlushing) {
355
364
  isFlushing = true;
356
- flushPreFlushCbs(instance);
357
- flushPostFlushCbs();
358
- isFlushing = false;
365
+ try {
366
+ flushPreFlushCbs(instance);
367
+ flushPostFlushCbs();
368
+ } finally {
369
+ isFlushing = false;
370
+ }
359
371
  }
360
372
  }
361
373
  function flushJobs(seen) {
@@ -383,9 +395,10 @@ function flushJobs(seen) {
383
395
  }
384
396
  flushIndex = 0;
385
397
  jobsLength = 0;
398
+ jobs.length = 0;
386
399
  flushPostFlushCbs(seen);
387
- currentFlushPromise = null;
388
400
  if (jobsLength || postJobs.length) flushJobs(seen);
401
+ else currentFlushPromise = null;
389
402
  }
390
403
  }
391
404
  function checkRecursiveUpdates(seen, fn) {
@@ -416,6 +429,19 @@ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
416
429
  rerender: tryWrap(rerender),
417
430
  reload: tryWrap(reload)
418
431
  };
432
+ function runWithHmrUpdating(fn) {
433
+ isHmrUpdating = true;
434
+ let done = false;
435
+ try {
436
+ fn();
437
+ done = true;
438
+ } finally {
439
+ if (done) nextTick(() => {
440
+ isHmrUpdating = false;
441
+ });
442
+ else isHmrUpdating = false;
443
+ }
444
+ }
419
445
  const map = /* @__PURE__ */ new Map();
420
446
  function registerHMR(instance) {
421
447
  const id = instance.type.__hmrId;
@@ -440,6 +466,14 @@ function createRecord(id, initialDef) {
440
466
  function normalizeClassComponent(component) {
441
467
  return isClassComponent(component) ? component.__vccOpts : component;
442
468
  }
469
+ function hasDirtyAncestor(instance, dirtyInstances) {
470
+ let parent = instance.parent;
471
+ while (parent) {
472
+ if (dirtyInstances.has(parent)) return true;
473
+ parent = parent.parent;
474
+ }
475
+ return false;
476
+ }
443
477
  function rerender(id, newRender) {
444
478
  const record = map.get(id);
445
479
  if (!record) return;
@@ -449,18 +483,16 @@ function rerender(id, newRender) {
449
483
  instance.render = newRender;
450
484
  normalizeClassComponent(instance.type).render = newRender;
451
485
  }
452
- isHmrUpdating = true;
453
- if (instance.vapor) {
454
- if (!instance.isUnmounted) instance.hmrRerender();
455
- } else {
456
- const i = instance;
457
- if (!(i.effect.flags & 1024)) {
458
- i.renderCache = [];
459
- i.effect.run();
486
+ runWithHmrUpdating(() => {
487
+ if (instance.vapor) {
488
+ if (!instance.isUnmounted) instance.hmrRerender();
489
+ } else {
490
+ const i = instance;
491
+ if (!(i.effect.flags & 1024)) {
492
+ i.renderCache = [];
493
+ i.effect.run();
494
+ }
460
495
  }
461
- }
462
- nextTick(() => {
463
- isHmrUpdating = false;
464
496
  });
465
497
  });
466
498
  }
@@ -471,42 +503,61 @@ function reload(id, newComp) {
471
503
  const isVapor = record.initialDef.__vapor;
472
504
  updateComponentDef(record.initialDef, newComp);
473
505
  const instances = [...record.instances];
474
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
506
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
475
507
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
476
- for (const instance of instances) instance.hmrReload(newComp);
477
- } else for (const instance of instances) {
478
- const oldComp = normalizeClassComponent(instance.type);
479
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
480
- if (!dirtyInstances) {
481
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
482
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
483
- }
484
- dirtyInstances.add(instance);
485
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
486
- instance.appContext.propsCache.delete(instance.type);
487
- instance.appContext.emitsCache.delete(instance.type);
488
- instance.appContext.optionsCache.delete(instance.type);
489
- if (instance.ceReload) {
490
- dirtyInstances.add(instance);
491
- instance.ceReload(newComp.styles);
492
- dirtyInstances.delete(instance);
493
- } else if (instance.parent) queueJob(() => {
494
- isHmrUpdating = true;
495
- const parent = instance.parent;
496
- if (parent.vapor) parent.hmrRerender();
497
- else if (!(parent.effect.flags & 1024)) {
498
- parent.renderCache = [];
499
- parent.effect.run();
508
+ const dirtyInstances = new Set(instances);
509
+ const rerenderedParents = /* @__PURE__ */ new Set();
510
+ runWithHmrUpdating(() => {
511
+ for (const instance of instances) {
512
+ const parent = instance.parent;
513
+ if (parent) {
514
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
515
+ rerenderedParents.add(parent);
516
+ parent.hmrRerender();
517
+ }
518
+ } else instance.hmrReload(newComp);
519
+ }
520
+ });
521
+ } else {
522
+ const parents = /* @__PURE__ */ new Set();
523
+ const dirtyInstanceSet = new Set(instances);
524
+ for (const instance of instances) {
525
+ const oldComp = normalizeClassComponent(instance.type);
526
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
527
+ if (!dirtyInstances) {
528
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
529
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
500
530
  }
501
- nextTick(() => {
502
- isHmrUpdating = false;
531
+ dirtyInstances.add(instance);
532
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
533
+ instance.appContext.propsCache.delete(instance.type);
534
+ instance.appContext.emitsCache.delete(instance.type);
535
+ instance.appContext.optionsCache.delete(instance.type);
536
+ if (instance.ceReload) {
537
+ dirtyInstances.add(instance);
538
+ instance.ceReload(newComp.styles);
539
+ dirtyInstances.delete(instance);
540
+ } else if (instance.parent) {
541
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
542
+ } else if (instance.appContext.reload) instance.appContext.reload();
543
+ else if (typeof window !== "undefined") window.location.reload();
544
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
545
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
546
+ }
547
+ parents.forEach((parent) => {
548
+ queueJob(() => {
549
+ runWithHmrUpdating(() => {
550
+ if (parent.vapor) parent.hmrRerender();
551
+ else {
552
+ const i = parent;
553
+ if (!(i.effect.flags & 1024)) {
554
+ i.renderCache = [];
555
+ i.effect.run();
556
+ }
557
+ }
558
+ });
503
559
  });
504
- dirtyInstances.delete(instance);
505
560
  });
506
- else if (instance.appContext.reload) instance.appContext.reload();
507
- else if (typeof window !== "undefined") window.location.reload();
508
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
509
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
510
561
  }
511
562
  queuePostFlushCb(() => {
512
563
  hmrDirtyComponents.clear();
@@ -573,20 +624,20 @@ function devtoolsInitApp(app, version) {
573
624
  function devtoolsUnmountApp(app) {
574
625
  emit$1("app:unmount", app);
575
626
  }
576
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
577
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
578
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
627
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
628
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
629
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
579
630
  const devtoolsComponentRemoved = (component) => {
580
631
  if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
581
632
  };
582
- /* @__NO_SIDE_EFFECTS__ */
633
+ /*@__NO_SIDE_EFFECTS__*/
583
634
  function createDevtoolsComponentHook(hook) {
584
635
  return (component) => {
585
636
  emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
586
637
  };
587
638
  }
588
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
589
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
639
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
640
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
590
641
  function createDevtoolsPerformanceHook(hook) {
591
642
  return (component, type, time) => {
592
643
  emit$1(hook, component.appContext.app, component.uid, component, type, time);
@@ -649,10 +700,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
649
700
  const renderFnWithContext = (...args) => {
650
701
  if (renderFnWithContext._d) setBlockTracking(-1);
651
702
  const prevInstance = setCurrentRenderingInstance(ctx);
703
+ const prevStackSize = blockStack.length;
652
704
  let res;
653
705
  try {
654
706
  res = fn(...args);
655
707
  } finally {
708
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
656
709
  setCurrentRenderingInstance(prevInstance);
657
710
  if (renderFnWithContext._d) setBlockTracking(1);
658
711
  }
@@ -845,7 +898,7 @@ function instanceWatch(source, value, options) {
845
898
  }
846
899
  const prev = setCurrentInstance(this);
847
900
  const res = doWatch(getter, cb.bind(publicThis), options);
848
- setCurrentInstance(...prev);
901
+ restoreCurrentInstance(prev);
849
902
  return res;
850
903
  }
851
904
  function createPathGetter(ctx, path) {
@@ -858,6 +911,7 @@ function createPathGetter(ctx, path) {
858
911
  }
859
912
  //#endregion
860
913
  //#region packages/runtime-core/src/components/Teleport.ts
914
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
861
915
  const TeleportEndKey = Symbol("_vte");
862
916
  const isTeleport = (type) => type.__isTeleport;
863
917
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -866,15 +920,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
866
920
  const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
867
921
  const resolveTarget = (props, select) => {
868
922
  const targetSelector = props && props.to;
869
- if ((0, _vue_shared.isString)(targetSelector)) if (!select) {
870
- warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
871
- return null;
923
+ if ((0, _vue_shared.isString)(targetSelector)) {
924
+ if (!select) {
925
+ warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
926
+ return null;
927
+ } else {
928
+ const target = select(targetSelector);
929
+ if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
930
+ return target;
931
+ }
872
932
  } else {
873
- const target = select(targetSelector);
874
- if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
875
- return target;
876
- }
877
- else {
878
933
  if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
879
934
  return targetSelector;
880
935
  }
@@ -883,58 +938,71 @@ const TeleportImpl = {
883
938
  name: "Teleport",
884
939
  __isTeleport: true,
885
940
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
886
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
941
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
887
942
  const disabled = isTeleportDisabled(n2.props);
888
- let { shapeFlag, children, dynamicChildren } = n2;
943
+ let { dynamicChildren } = n2;
889
944
  if (isHmrUpdating) {
890
945
  optimized = false;
891
946
  dynamicChildren = null;
892
947
  }
948
+ const mount = (vnode, container, anchor) => {
949
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
950
+ };
951
+ const mountToTarget = (vnode = n2) => {
952
+ const disabled = isTeleportDisabled(vnode.props);
953
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
954
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
955
+ if (target) {
956
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
957
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
958
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
959
+ if (!disabled) {
960
+ mount(vnode, target, targetAnchor);
961
+ updateCssVars(vnode, false);
962
+ }
963
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
964
+ };
965
+ const queuePendingMount = (vnode) => {
966
+ const mountJob = () => {
967
+ if (pendingMounts.get(vnode) !== mountJob) return;
968
+ pendingMounts.delete(vnode);
969
+ if (isTeleportDisabled(vnode.props)) {
970
+ const mountContainer = parentNode(vnode.el) || container;
971
+ mount(vnode, mountContainer, vnode.anchor);
972
+ updateCssVars(vnode, true);
973
+ }
974
+ mountToTarget(vnode);
975
+ };
976
+ pendingMounts.set(vnode, mountJob);
977
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
978
+ };
893
979
  if (n1 == null) {
894
980
  const placeholder = n2.el = createComment("teleport start");
895
981
  const mainAnchor = n2.anchor = createComment("teleport end");
896
982
  insert(placeholder, container, anchor);
897
983
  insert(mainAnchor, container, anchor);
898
- const mount = (container, anchor) => {
899
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
900
- };
901
- const mountToTarget = () => {
902
- const target = n2.target = resolveTarget(n2.props, querySelector);
903
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
904
- if (target) {
905
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
906
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
907
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
908
- if (!disabled) {
909
- mount(target, targetAnchor);
910
- updateCssVars(n2, false);
911
- }
912
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
913
- };
984
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
985
+ queuePendingMount(n2);
986
+ return;
987
+ }
914
988
  if (disabled) {
915
- mount(container, mainAnchor);
989
+ mount(n2, container, mainAnchor);
916
990
  updateCssVars(n2, true);
917
991
  }
918
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
919
- n2.el.__isMounted = false;
920
- queuePostRenderEffect(() => {
921
- if (n2.el.__isMounted !== false) return;
922
- mountToTarget();
923
- delete n2.el.__isMounted;
924
- }, void 0, parentSuspense);
925
- } else mountToTarget();
992
+ mountToTarget();
926
993
  } else {
927
994
  n2.el = n1.el;
928
- n2.targetStart = n1.targetStart;
929
995
  const mainAnchor = n2.anchor = n1.anchor;
930
- const target = n2.target = n1.target;
931
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
932
- if (n1.el.__isMounted === false) {
933
- queuePostRenderEffect(() => {
934
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
935
- }, void 0, parentSuspense);
996
+ const pendingMount = pendingMounts.get(n1);
997
+ if (pendingMount) {
998
+ pendingMount.flags |= 4;
999
+ pendingMounts.delete(n1);
1000
+ queuePendingMount(n2);
936
1001
  return;
937
1002
  }
1003
+ n2.targetStart = n1.targetStart;
1004
+ const target = n2.target = n1.target;
1005
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
938
1006
  const wasDisabled = isTeleportDisabled(n1.props);
939
1007
  const currentContainer = wasDisabled ? container : target;
940
1008
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -948,24 +1016,30 @@ const TeleportImpl = {
948
1016
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
949
1017
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
950
1018
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
951
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
952
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
953
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
1019
+ const nextTarget = resolveTarget(n2.props, querySelector);
1020
+ if (nextTarget) {
1021
+ n2.target = nextTarget;
1022
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
1023
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
954
1024
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
955
1025
  updateCssVars(n2, disabled);
956
1026
  }
957
1027
  },
958
1028
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
959
- const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
1029
+ const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
1030
+ const disabled = isTeleportDisabled(props);
1031
+ const shouldRemove = doRemove || !disabled;
1032
+ const pendingMount = pendingMounts.get(vnode);
1033
+ if (pendingMount) {
1034
+ pendingMount.flags |= 4;
1035
+ pendingMounts.delete(vnode);
1036
+ }
960
1037
  if (targetStart) hostRemove(targetStart);
961
1038
  if (targetAnchor) hostRemove(targetAnchor);
962
1039
  doRemove && hostRemove(anchor);
963
- if (shapeFlag & 16) {
964
- const shouldRemove = doRemove || !isTeleportDisabled(props);
965
- for (let i = 0; i < children.length; i++) {
966
- const child = children[i];
967
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
968
- }
1040
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
1041
+ const child = children[i];
1042
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
969
1043
  }
970
1044
  },
971
1045
  move: moveTeleport,
@@ -976,7 +1050,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
976
1050
  const { el, anchor, shapeFlag, children, props } = vnode;
977
1051
  const isReorder = moveType === 2;
978
1052
  if (isReorder) insert(el, container, parentAnchor);
979
- if (!isReorder || isTeleportDisabled(props)) {
1053
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
980
1054
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
981
1055
  }
982
1056
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -1003,15 +1077,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1003
1077
  const disabled = isTeleportDisabled(vnode.props);
1004
1078
  if (target) {
1005
1079
  const targetNode = target._lpa || target.firstChild;
1006
- if (vnode.shapeFlag & 16) if (disabled) {
1007
- hydrateDisabledTeleport(node, vnode);
1008
- hydrateAnchor(target, targetNode);
1009
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
1010
- } else {
1011
- vnode.anchor = nextSibling(node);
1012
- hydrateAnchor(target, targetNode);
1013
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
1014
- hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
1080
+ if (vnode.shapeFlag & 16) {
1081
+ if (disabled) {
1082
+ hydrateDisabledTeleport(node, vnode);
1083
+ hydrateAnchor(target, targetNode);
1084
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
1085
+ } else {
1086
+ vnode.anchor = nextSibling(node);
1087
+ hydrateAnchor(target, targetNode);
1088
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
1089
+ hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
1090
+ }
1015
1091
  }
1016
1092
  updateCssVars(vnode, disabled);
1017
1093
  } else if (disabled) {
@@ -1099,49 +1175,16 @@ const BaseTransitionImpl = {
1099
1175
  setup(props, { slots }) {
1100
1176
  const instance = getCurrentInstance();
1101
1177
  const state = useTransitionState();
1178
+ let resumeAfterLeave;
1102
1179
  return () => {
1103
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
1104
- if (!children || !children.length) return;
1105
- const child = findNonCommentChild(children);
1180
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
1181
+ if (!child) return;
1106
1182
  const rawProps = (0, _vue_reactivity.toRaw)(props);
1107
1183
  const { mode } = rawProps;
1108
1184
  checkTransitionMode(mode);
1109
- if (state.isLeaving) return emptyPlaceholder(child);
1110
- const innerChild = getInnerChild$1(child);
1111
- if (!innerChild) return emptyPlaceholder(child);
1112
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
1113
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
1114
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1115
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1116
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
1117
- setTransitionHooks(oldInnerChild, leavingHooks);
1118
- if (mode === "out-in" && innerChild.type !== Comment) {
1119
- state.isLeaving = true;
1120
- leavingHooks.afterLeave = () => {
1121
- state.isLeaving = false;
1122
- if (!(instance.job.flags & 4)) instance.update();
1123
- delete leavingHooks.afterLeave;
1124
- oldInnerChild = void 0;
1125
- };
1126
- return emptyPlaceholder(child);
1127
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1128
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
1129
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
1130
- el[leaveCbKey] = () => {
1131
- earlyRemove();
1132
- el[leaveCbKey] = void 0;
1133
- delete enterHooks.delayedLeave;
1134
- oldInnerChild = void 0;
1135
- };
1136
- enterHooks.delayedLeave = () => {
1137
- delayedLeave();
1138
- delete enterHooks.delayedLeave;
1139
- oldInnerChild = void 0;
1140
- };
1141
- };
1142
- else oldInnerChild = void 0;
1143
- } else if (oldInnerChild) oldInnerChild = void 0;
1144
- return child;
1185
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
1186
+ if (!(instance.job.flags & 4)) instance.update();
1187
+ }) : _vue_shared.NOOP);
1145
1188
  };
1146
1189
  }
1147
1190
  };
@@ -1210,8 +1253,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
1210
1253
  persisted,
1211
1254
  beforeEnter(el) {
1212
1255
  let hook = onBeforeEnter;
1213
- if (!state.isMounted) if (appear) hook = onBeforeAppear || onBeforeEnter;
1214
- else return;
1256
+ if (!state.isMounted) {
1257
+ if (appear) hook = onBeforeAppear || onBeforeEnter;
1258
+ else return;
1259
+ }
1215
1260
  if (el[leaveCbKey]) el[leaveCbKey](true);
1216
1261
  earlyRemove();
1217
1262
  callHook(hook, [el]);
@@ -1221,11 +1266,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
1221
1266
  let hook = onEnter;
1222
1267
  let afterHook = onAfterEnter;
1223
1268
  let cancelHook = onEnterCancelled;
1224
- if (!state.isMounted) if (appear) {
1225
- hook = onAppear || onEnter;
1226
- afterHook = onAfterAppear || onAfterEnter;
1227
- cancelHook = onAppearCancelled || onEnterCancelled;
1228
- } else return;
1269
+ if (!state.isMounted) {
1270
+ if (appear) {
1271
+ hook = onAppear || onEnter;
1272
+ afterHook = onAfterAppear || onAfterEnter;
1273
+ cancelHook = onAppearCancelled || onEnterCancelled;
1274
+ } else return;
1275
+ }
1229
1276
  let called = false;
1230
1277
  el[enterCbKey] = (cancelled) => {
1231
1278
  if (called) return;
@@ -1259,7 +1306,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
1259
1306
  else done();
1260
1307
  },
1261
1308
  clone(node) {
1262
- return cloneHooks(node);
1309
+ return cloneHooks ? cloneHooks(node) : hooks;
1263
1310
  }
1264
1311
  };
1265
1312
  return hooks;
@@ -1283,16 +1330,91 @@ function getInnerChild$1(vnode) {
1283
1330
  if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
1284
1331
  }
1285
1332
  }
1333
+ function resolveTransitionChild(children, renderEmpty = false) {
1334
+ const branches = children && getTransitionRawChildren(children, true);
1335
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
1336
+ }
1337
+ /**
1338
+ * @internal
1339
+ */
1340
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
1341
+ if (state.isLeaving) return emptyPlaceholder(next);
1342
+ const nextInner = getInnerChild$1(next);
1343
+ if (!nextInner) return emptyPlaceholder(next);
1344
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
1345
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
1346
+ enterHooks = hooks;
1347
+ });
1348
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
1349
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
1350
+ const mode = props.mode;
1351
+ const previousInner = previous && getInnerChild$1(previous);
1352
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
1353
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
1354
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
1355
+ }
1356
+ return next;
1357
+ }
1358
+ function forwardDelayedLeave(hooks, source) {
1359
+ const delayedLeave = source && source.delayedLeave;
1360
+ if (!delayedLeave) return;
1361
+ hooks.delayedLeave = () => {
1362
+ if (source.delayedLeave === delayedLeave) delayedLeave();
1363
+ delete hooks.delayedLeave;
1364
+ };
1365
+ }
1366
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
1367
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
1368
+ }
1369
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
1370
+ if (props.mode === "out-in") {
1371
+ state.isLeaving = true;
1372
+ leavingHooks.afterLeave = () => {
1373
+ state.isLeaving = false;
1374
+ resumeAfterLeave();
1375
+ delete leavingHooks.afterLeave;
1376
+ };
1377
+ return true;
1378
+ } else if (props.mode === "in-out" && getEnterHooks) {
1379
+ let delayedLeavingVNode = leavingVNode;
1380
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1381
+ const enterHooks = getEnterHooks();
1382
+ if (!enterHooks) {
1383
+ delayedLeave();
1384
+ return;
1385
+ }
1386
+ const vnode = delayedLeavingVNode;
1387
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1388
+ leavingVNodesCache[String(vnode.key)] = vnode;
1389
+ el[leaveCbKey] = () => {
1390
+ earlyRemove();
1391
+ el[leaveCbKey] = void 0;
1392
+ delete enterHooks.delayedLeave;
1393
+ delayedLeavingVNode = void 0;
1394
+ };
1395
+ enterHooks.delayedLeave = () => {
1396
+ delayedLeave();
1397
+ delete enterHooks.delayedLeave;
1398
+ delayedLeavingVNode = void 0;
1399
+ };
1400
+ };
1401
+ }
1402
+ return false;
1403
+ }
1286
1404
  function setTransitionHooks(vnode, hooks) {
1287
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1288
- else {
1405
+ if (vnode.shapeFlag & 6 && vnode.component) {
1289
1406
  vnode.transition = hooks;
1290
- setTransitionHooks(vnode.component.subTree, hooks);
1291
- }
1292
- else if (vnode.shapeFlag & 128) {
1293
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1294
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1407
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1408
+ else {
1409
+ const subTree = vnode.component.subTree;
1410
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
1411
+ }
1412
+ } else if (vnode.shapeFlag & 128) {
1413
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1414
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1415
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
1295
1416
  } else vnode.transition = hooks;
1417
+ return hooks;
1296
1418
  }
1297
1419
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
1298
1420
  let ret = [];
@@ -1316,9 +1438,9 @@ function checkTransitionMode(mode) {
1316
1438
  }
1317
1439
  //#endregion
1318
1440
  //#region packages/runtime-core/src/apiDefineComponent.ts
1319
- /* @__NO_SIDE_EFFECTS__ */
1441
+ /*@__NO_SIDE_EFFECTS__*/
1320
1442
  function defineComponent(options, extraOptions) {
1321
- return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
1443
+ return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
1322
1444
  }
1323
1445
  //#endregion
1324
1446
  //#region packages/runtime-core/src/helpers/useId.ts
@@ -1415,15 +1537,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1415
1537
  if (rawRef.f) {
1416
1538
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
1417
1539
  if (isUnmount) (0, _vue_shared.isArray)(existing) && (0, _vue_shared.remove)(existing, refValue);
1418
- else if (!(0, _vue_shared.isArray)(existing)) if (_isString) {
1419
- refs[ref] = [refValue];
1420
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
1421
- } else {
1422
- const newVal = [refValue];
1423
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
1424
- if (rawRef.k) refs[rawRef.k] = newVal;
1425
- }
1426
- else if (!existing.includes(refValue)) existing.push(refValue);
1540
+ else if (!(0, _vue_shared.isArray)(existing)) {
1541
+ if (_isString) {
1542
+ refs[ref] = [refValue];
1543
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
1544
+ } else {
1545
+ const newVal = [refValue];
1546
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
1547
+ if (rawRef.k) refs[rawRef.k] = newVal;
1548
+ }
1549
+ } else if (!existing.includes(refValue)) existing.push(refValue);
1427
1550
  } else if (_isString) {
1428
1551
  refs[ref] = value;
1429
1552
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -1475,7 +1598,18 @@ const logMismatchError = () => {
1475
1598
  hasLoggedMismatchError = true;
1476
1599
  };
1477
1600
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
1478
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
1601
+ const isMathMLContainer = (container) => {
1602
+ if (!container.namespaceURI.includes("MathML")) return false;
1603
+ if (container.tagName !== "annotation-xml") return true;
1604
+ const encoding = container.getAttribute("encoding");
1605
+ return !encoding || !encoding.includes("html");
1606
+ };
1607
+ /**
1608
+ * Resolve the element namespace a container's children should be created in.
1609
+ * The live DOM is the source of truth, so this also covers containers that are
1610
+ * only known at runtime (interop boundaries, teleport targets).
1611
+ * @internal
1612
+ */
1479
1613
  const getContainerType = (container) => {
1480
1614
  if (container.nodeType !== 1) return void 0;
1481
1615
  if (isSVGContainer(container)) return "svg";
@@ -1499,7 +1633,7 @@ function createHydrationFunctions(rendererInternals) {
1499
1633
  };
1500
1634
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
1501
1635
  optimized = optimized || !!vnode.dynamicChildren;
1502
- const isFragmentStart = isComment(node) && node.data === "[";
1636
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
1503
1637
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
1504
1638
  const { type, ref, shapeFlag, patchFlag } = vnode;
1505
1639
  let domType = node.nodeType;
@@ -1513,11 +1647,12 @@ function createHydrationFunctions(rendererInternals) {
1513
1647
  let nextNode = null;
1514
1648
  switch (type) {
1515
1649
  case Text:
1516
- if (domType !== 3) if (vnode.children === "") {
1517
- insert(vnode.el = createText(""), parentNode(node), node);
1518
- nextNode = node;
1519
- } else nextNode = onMismatch();
1520
- else {
1650
+ if (domType !== 3) {
1651
+ if (vnode.children === "") {
1652
+ insert(vnode.el = createText(""), parentNode(node), node);
1653
+ nextNode = node;
1654
+ } else nextNode = onMismatch();
1655
+ } else {
1521
1656
  if (node.data !== vnode.children) {
1522
1657
  warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
1523
1658
  logMismatchError();
@@ -1554,30 +1689,35 @@ function createHydrationFunctions(rendererInternals) {
1554
1689
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
1555
1690
  break;
1556
1691
  case VaporSlot:
1557
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
1692
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
1558
1693
  break;
1559
- default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
1560
- else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
1561
- else if (shapeFlag & 6) {
1694
+ default: if (shapeFlag & 1) {
1695
+ if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
1696
+ else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
1697
+ } else if (shapeFlag & 6) {
1562
1698
  vnode.slotScopeIds = slotScopeIds;
1563
1699
  const container = parentNode(node);
1564
1700
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
1565
1701
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
1566
1702
  else nextNode = nextSibling(node);
1567
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
1568
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
1569
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
1570
- let subTree;
1571
- if (isFragmentStart) {
1572
- subTree = createVNode(Fragment);
1573
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
1574
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
1575
- subTree.el = node;
1576
- vnode.component.subTree = subTree;
1703
+ if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
1704
+ else {
1705
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
1706
+ const component = vnode.component;
1707
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
1708
+ let subTree;
1709
+ if (isFragmentStart) {
1710
+ subTree = createVNode(Static);
1711
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
1712
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
1713
+ subTree.el = node;
1714
+ component.subTree = subTree;
1715
+ }
1577
1716
  }
1578
- } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
1579
- else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
1580
- else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
1717
+ } else if (shapeFlag & 64) {
1718
+ if (domType !== 8) nextNode = onMismatch();
1719
+ else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
1720
+ } else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
1581
1721
  else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
1582
1722
  }
1583
1723
  if (ref != null) setRef(ref, null, parentSuspense, vnode);
@@ -1585,7 +1725,7 @@ function createHydrationFunctions(rendererInternals) {
1585
1725
  };
1586
1726
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
1587
1727
  optimized = optimized || !!vnode.dynamicChildren;
1588
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
1728
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
1589
1729
  const forcePatch = type === "input" || type === "option";
1590
1730
  {
1591
1731
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -1603,15 +1743,11 @@ function createHydrationFunctions(rendererInternals) {
1603
1743
  }
1604
1744
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
1605
1745
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
1606
- let hasWarned = false;
1746
+ if (next && !isMismatchAllowed(el, 1)) {
1747
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
1748
+ logMismatchError();
1749
+ }
1607
1750
  while (next) {
1608
- if (!isMismatchAllowed(el, 1)) {
1609
- if (!hasWarned) {
1610
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
1611
- hasWarned = true;
1612
- }
1613
- logMismatchError();
1614
- }
1615
1751
  const cur = next;
1616
1752
  next = next.nextSibling;
1617
1753
  remove(cur);
@@ -1630,9 +1766,13 @@ function createHydrationFunctions(rendererInternals) {
1630
1766
  }
1631
1767
  if (props) {
1632
1768
  const isCustomElement = el.tagName.includes("-");
1769
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
1633
1770
  for (const key in props) {
1634
1771
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
1635
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key)) patchProp(el, key, null, props[key], void 0, parentComponent);
1772
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
1773
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
1774
+ patchProp(el, key, null, props[key], namespace, parentComponent);
1775
+ }
1636
1776
  }
1637
1777
  }
1638
1778
  let vnodeHooks;
@@ -1650,7 +1790,7 @@ function createHydrationFunctions(rendererInternals) {
1650
1790
  optimized = optimized || !!parentVNode.dynamicChildren;
1651
1791
  const children = parentVNode.children;
1652
1792
  const l = children.length;
1653
- let hasWarned = false;
1793
+ let hasCheckedMismatch = false;
1654
1794
  for (let i = 0; i < l; i++) {
1655
1795
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
1656
1796
  const isText = vnode.type === Text;
@@ -1664,12 +1804,12 @@ function createHydrationFunctions(rendererInternals) {
1664
1804
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
1665
1805
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
1666
1806
  else {
1667
- if (!isMismatchAllowed(container, 1)) {
1668
- if (!hasWarned) {
1807
+ if (!hasCheckedMismatch) {
1808
+ hasCheckedMismatch = true;
1809
+ if (!isMismatchAllowed(container, 1)) {
1669
1810
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
1670
- hasWarned = true;
1811
+ logMismatchError();
1671
1812
  }
1672
- logMismatchError();
1673
1813
  }
1674
1814
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
1675
1815
  }
@@ -1680,8 +1820,9 @@ function createHydrationFunctions(rendererInternals) {
1680
1820
  const { slotScopeIds: fragmentSlotScopeIds } = vnode;
1681
1821
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
1682
1822
  const container = parentNode(node);
1683
- const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
1684
- if (next && isComment(next) && next.data === "]") return nextSibling(vnode.anchor = next);
1823
+ const first = nextSibling(node);
1824
+ const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
1825
+ if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
1685
1826
  else {
1686
1827
  logMismatchError();
1687
1828
  insert(vnode.anchor = createComment(`]`), container, next);
@@ -1689,8 +1830,8 @@ function createHydrationFunctions(rendererInternals) {
1689
1830
  }
1690
1831
  };
1691
1832
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
1692
- if (!isMismatchAllowed(node.parentElement, 1)) {
1693
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
1833
+ if (!isNodeMismatchAllowed(node, vnode)) {
1834
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
1694
1835
  logMismatchError();
1695
1836
  }
1696
1837
  vnode.el = null;
@@ -1706,20 +1847,22 @@ function createHydrationFunctions(rendererInternals) {
1706
1847
  const container = parentNode(node);
1707
1848
  remove(node);
1708
1849
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
1709
- if (parentComponent) {
1850
+ if (parentComponent && parentComponent.vnode) {
1710
1851
  parentComponent.vnode.el = vnode.el;
1711
1852
  updateHOCHostEl(parentComponent, vnode.el);
1712
1853
  }
1713
1854
  return next;
1714
1855
  };
1715
- const locateClosingAnchor = (node, open = "[", close = "]") => {
1856
+ const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
1716
1857
  let match = 0;
1717
1858
  while (node) {
1718
1859
  node = nextSibling(node);
1719
1860
  if (node && isComment(node)) {
1720
1861
  if (node.data === open) match++;
1721
- if (node.data === close) if (match === 0) return nextSibling(node);
1722
- else match--;
1862
+ if (node.data === close) {
1863
+ if (match === 0) return nextSibling(node);
1864
+ else match--;
1865
+ }
1723
1866
  }
1724
1867
  }
1725
1868
  return node;
@@ -1729,7 +1872,7 @@ function createHydrationFunctions(rendererInternals) {
1729
1872
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
1730
1873
  let parent = parentComponent;
1731
1874
  while (parent) {
1732
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
1875
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
1733
1876
  parent = parent.parent;
1734
1877
  }
1735
1878
  };
@@ -1738,6 +1881,16 @@ function createHydrationFunctions(rendererInternals) {
1738
1881
  const isTemplateNode = (node) => {
1739
1882
  return node.nodeType === 1 && node.tagName === "TEMPLATE";
1740
1883
  };
1884
+ const resourceProps = /*@__PURE__*/ new Set([
1885
+ "src",
1886
+ "srcset",
1887
+ "href",
1888
+ "poster"
1889
+ ]);
1890
+ function isUnchangedResourceProp(el, key, clientValue) {
1891
+ if (!resourceProps.has(key)) return false;
1892
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
1893
+ }
1741
1894
  /**
1742
1895
  * Dev only
1743
1896
  */
@@ -1781,7 +1934,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
1781
1934
  function getAttributeMismatch(el, key, clientValue) {
1782
1935
  let actual;
1783
1936
  let expected;
1784
- if ((0, _vue_shared.isBooleanAttr)(key)) {
1937
+ if (key === "hidden") {
1938
+ actual = normalizeHiddenValue(el.getAttribute(key));
1939
+ expected = normalizeHiddenValue(clientValue);
1940
+ } else if ((0, _vue_shared.isBooleanAttr)(key)) {
1785
1941
  actual = el.hasAttribute(key);
1786
1942
  expected = (0, _vue_shared.includeBooleanAttr)(clientValue);
1787
1943
  } else if (clientValue == null) {
@@ -1809,6 +1965,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
1809
1965
  }
1810
1966
  return false;
1811
1967
  }
1968
+ function normalizeHiddenValue(value) {
1969
+ if (!(0, _vue_shared.isRenderableAttrValue)(value)) return false;
1970
+ if ((0, _vue_shared.isString)(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
1971
+ return (0, _vue_shared.includeBooleanAttr)(value) ? "" : false;
1972
+ }
1812
1973
  function toClassSet(str) {
1813
1974
  return new Set(str.trim().split(/\s+/));
1814
1975
  }
@@ -1853,7 +2014,9 @@ const MismatchTypeString = {
1853
2014
  };
1854
2015
  function isMismatchAllowed(el, allowedType) {
1855
2016
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
1856
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
2017
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
2018
+ }
2019
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
1857
2020
  if (allowedAttr == null) return false;
1858
2021
  else if (allowedAttr === "") return true;
1859
2022
  else {
@@ -1862,6 +2025,16 @@ function isMismatchAllowed(el, allowedType) {
1862
2025
  return list.includes(MismatchTypeString[allowedType]);
1863
2026
  }
1864
2027
  }
2028
+ function isNodeMismatchAllowed(node, vnode) {
2029
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
2030
+ }
2031
+ function isMismatchAllowedByNode(node) {
2032
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
2033
+ }
2034
+ function isMismatchAllowedByVNode({ props }) {
2035
+ const allowedAttr = props && props[allowMismatchAttr];
2036
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
2037
+ }
1865
2038
  //#endregion
1866
2039
  //#region packages/runtime-core/src/hydrationStrategies.ts
1867
2040
  let requestIdleCallback;
@@ -1935,16 +2108,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
1935
2108
  return teardown;
1936
2109
  };
1937
2110
  function forEachElement(node, cb) {
1938
- if (isComment(node) && node.data === "[") {
2111
+ if (isComment(node) && (node.data === "[" || node.data === "(")) {
2112
+ const open = node.data;
2113
+ const close = open === "[" ? "]" : ")";
1939
2114
  let depth = 1;
1940
2115
  let next = node.nextSibling;
1941
2116
  while (next) {
1942
2117
  if (next.nodeType === 1) {
1943
2118
  if (cb(next) === false) break;
1944
2119
  } else if (isComment(next)) {
1945
- if (next.data === "]") {
2120
+ if (next.data === close) {
1946
2121
  if (--depth === 0) break;
1947
- } else if (next.data === "[") depth++;
2122
+ } else if (next.data === open) depth++;
1948
2123
  }
1949
2124
  next = next.nextSibling;
1950
2125
  }
@@ -1953,14 +2128,14 @@ function forEachElement(node, cb) {
1953
2128
  //#endregion
1954
2129
  //#region packages/runtime-core/src/apiAsyncComponent.ts
1955
2130
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
1956
- /* @__NO_SIDE_EFFECTS__ */
2131
+ /*@__NO_SIDE_EFFECTS__*/
1957
2132
  function defineAsyncComponent(source) {
1958
2133
  const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
1959
2134
  return /* @__PURE__ */ defineComponent({
1960
2135
  name: "AsyncComponentWrapper",
1961
2136
  __asyncLoader: load,
1962
2137
  __asyncHydrate(el, instance, hydrate) {
1963
- performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
2138
+ performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
1964
2139
  },
1965
2140
  get __asyncResolved() {
1966
2141
  return getResolvedComp();
@@ -1980,11 +2155,16 @@ function defineAsyncComponent(source) {
1980
2155
  onError(err);
1981
2156
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
1982
2157
  });
1983
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
2158
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
1984
2159
  load().then(() => {
2160
+ if (instance.isUnmounted) return;
1985
2161
  loaded.value = true;
1986
2162
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
1987
2163
  }).catch((err) => {
2164
+ if (instance.isUnmounted) {
2165
+ setPendingRequest(null);
2166
+ return;
2167
+ }
1988
2168
  onError(err);
1989
2169
  error.value = err;
1990
2170
  });
@@ -2042,14 +2222,22 @@ function createAsyncComponentContext(source) {
2042
2222
  setPendingRequest: (request) => pendingRequest = request
2043
2223
  };
2044
2224
  }
2045
- const useAsyncComponentState = (delay, timeout, onError) => {
2225
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
2046
2226
  const loaded = (0, _vue_reactivity.ref)(false);
2047
2227
  const error = (0, _vue_reactivity.ref)();
2048
2228
  const delayed = (0, _vue_reactivity.ref)(!!delay);
2049
- if (delay) setTimeout(() => {
2229
+ let timeoutTimer;
2230
+ let delayTimer;
2231
+ if (instance) onUnmounted(() => {
2232
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
2233
+ if (delayTimer != null) clearTimeout(delayTimer);
2234
+ }, instance);
2235
+ if (delay) delayTimer = setTimeout(() => {
2236
+ if (instance && instance.isUnmounted) return;
2050
2237
  delayed.value = false;
2051
2238
  }, delay);
2052
- if (timeout != null) setTimeout(() => {
2239
+ if (timeout != null) timeoutTimer = setTimeout(() => {
2240
+ if (instance && instance.isUnmounted) return;
2053
2241
  if (!loaded.value && !error.value) {
2054
2242
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
2055
2243
  onError(err);
@@ -2066,9 +2254,10 @@ const useAsyncComponentState = (delay, timeout, onError) => {
2066
2254
  * shared between core and vapor
2067
2255
  * @internal
2068
2256
  */
2069
- function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
2257
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
2258
+ const wasConnected = el.isConnected;
2070
2259
  let patched = false;
2071
- (instance.bu || (instance.bu = [])).push(() => patched = true);
2260
+ if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
2072
2261
  const performHydrate = () => {
2073
2262
  if (patched) {
2074
2263
  {
@@ -2077,6 +2266,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
2077
2266
  }
2078
2267
  return;
2079
2268
  }
2269
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
2080
2270
  hydrate();
2081
2271
  };
2082
2272
  const doHydrate = hydrateStrategy ? () => {
@@ -2157,10 +2347,13 @@ const KeepAlive = {
2157
2347
  });
2158
2348
  let pendingCacheKey = null;
2159
2349
  const cacheSubtree = () => {
2160
- if (pendingCacheKey != null) if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
2161
- cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2162
- }, void 0, keepAliveInstance.subTree.suspense);
2163
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2350
+ if (pendingCacheKey != null) {
2351
+ if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
2352
+ const vnode = getInnerChild(keepAliveInstance.subTree);
2353
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
2354
+ }, void 0, keepAliveInstance.subTree.suspense);
2355
+ else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2356
+ }
2164
2357
  };
2165
2358
  onMounted(cacheSubtree);
2166
2359
  onUpdated(cacheSubtree);
@@ -2317,7 +2510,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2317
2510
  try {
2318
2511
  return callWithAsyncErrorHandling(hook, target, type, args);
2319
2512
  } finally {
2320
- setCurrentInstance(...prev);
2513
+ restoreCurrentInstance(prev);
2321
2514
  (0, _vue_reactivity.setActiveSub)(prevSub);
2322
2515
  }
2323
2516
  });
@@ -2402,23 +2595,25 @@ function renderList(source, renderItem, cache, index) {
2402
2595
  }
2403
2596
  ret = new Array(source.length);
2404
2597
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? (0, _vue_reactivity.toReadonly)((0, _vue_reactivity.toReactive)(source[i])) : (0, _vue_reactivity.toReactive)(source[i]) : source[i], i, void 0, cached && cached[i]);
2405
- } else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
2406
- warn$1(`The v-for range expects a positive integer value but got ${source}.`);
2407
- ret = [];
2408
- } else {
2409
- ret = new Array(source);
2410
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2411
- }
2412
- else if ((0, _vue_shared.isObject)(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
2413
- else {
2414
- const keys = Object.keys(source);
2415
- ret = new Array(keys.length);
2416
- for (let i = 0, l = keys.length; i < l; i++) {
2417
- const key = keys[i];
2418
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
2598
+ } else if (typeof source === "number") {
2599
+ if (!Number.isInteger(source) || source < 0) {
2600
+ warn$1(`The v-for range expects a positive integer value but got ${source}.`);
2601
+ ret = [];
2602
+ } else {
2603
+ ret = new Array(source);
2604
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2419
2605
  }
2420
- }
2421
- else ret = [];
2606
+ } else if ((0, _vue_shared.isObject)(source)) {
2607
+ if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
2608
+ else {
2609
+ const keys = Object.keys(source);
2610
+ ret = new Array(keys.length);
2611
+ for (let i = 0, l = keys.length; i < l; i++) {
2612
+ const key = keys[i];
2613
+ ret[i] = renderItem(source[key], key, i, cached && cached[i]);
2614
+ }
2615
+ }
2616
+ } else ret = [];
2422
2617
  if (cache) cache[index] = ret;
2423
2618
  return ret;
2424
2619
  }
@@ -2443,37 +2638,81 @@ function createSlots(slots, dynamicSlots) {
2443
2638
  //#endregion
2444
2639
  //#region packages/runtime-core/src/helpers/renderSlot.ts
2445
2640
  /**
2641
+ * Links a slot function to its raw vapor slot: a raw vapor slot carries
2642
+ * itself, and the wrapper the interop slots proxy hands out carries the raw
2643
+ * slot it wraps — one lookup answers both "is this a vapor slot" and
2644
+ * "which one". Internal to vapor interop.
2645
+ */
2646
+ const rawVaporSlotKey = Symbol(`rawVaporSlot`);
2647
+ /**
2648
+ * Invokes a VDOM slot fallback under the outlet owner that produced it, the
2649
+ * way `renderSlot` would have rendered it inline. Vapor interop invokes
2650
+ * fallbacks late, outside any render, so it passes the owner recorded on the
2651
+ * vapor slot vnode. Internal to vapor interop.
2652
+ */
2653
+ function invokeSlotFallback(fallback, owner) {
2654
+ if (!owner) return fallback();
2655
+ const prev = setCurrentRenderingInstance(owner);
2656
+ const prevStackSize = blockStack.length;
2657
+ try {
2658
+ return fallback();
2659
+ } finally {
2660
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2661
+ setCurrentRenderingInstance(prev);
2662
+ }
2663
+ }
2664
+ /**
2446
2665
  * Compiler runtime helper for rendering `<slot/>`
2447
2666
  * @private
2448
2667
  */
2449
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2668
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2669
+ if (props == null) props = {};
2450
2670
  let slot = slots[name];
2451
- const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
2671
+ const vaporSlot = slot && slot[rawVaporSlotKey];
2452
2672
  if (vaporSlot) {
2453
2673
  const ret = (openBlock(), createBlock(VaporSlot, props));
2454
2674
  ret.vs = {
2455
2675
  slot: vaporSlot,
2456
- fallback
2676
+ outlets: fallback ? [{
2677
+ fallback,
2678
+ owner: currentRenderingInstance
2679
+ }] : void 0
2457
2680
  };
2681
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
2458
2682
  return ret;
2459
2683
  }
2460
2684
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
2461
- const hasProps = Object.keys(props).length > 0;
2462
- if (name !== "default") props.name = name;
2463
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
2685
+ const slotProps = branchKey != null && props.key == null ? (0, _vue_shared.extend)({}, props, { key: branchKey }) : props;
2686
+ const hasProps = Object.keys(slotProps).length > 0;
2687
+ if (name !== "default") slotProps.name = name;
2688
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
2464
2689
  }
2465
2690
  if (slot && slot.length > 1) {
2466
2691
  warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
2467
2692
  slot = () => [];
2468
2693
  }
2469
2694
  if (slot && slot._c) slot._d = false;
2695
+ const prevStackSize = blockStack.length;
2470
2696
  openBlock();
2471
- const validSlotContent = slot && ensureValidVNode(slot(props));
2472
- ensureVaporSlotFallback(validSlotContent, fallback);
2473
- const slotKey = props.key || validSlotContent && validSlotContent.key;
2474
- const rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
2697
+ let rendered;
2698
+ try {
2699
+ const validSlotContent = slot && ensureValidVNode(slot(props));
2700
+ let attached = false;
2701
+ if (fallback && validSlotContent && currentRenderingInstance) {
2702
+ const interop = currentRenderingInstance.appContext.vapor;
2703
+ if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
2704
+ }
2705
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
2706
+ rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
2707
+ if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
2708
+ if (attached) rendered.vo = true;
2709
+ } catch (err) {
2710
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2711
+ throw err;
2712
+ } finally {
2713
+ if (slot && slot._c) slot._d = true;
2714
+ }
2475
2715
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
2476
- if (slot && slot._c) slot._d = true;
2477
2716
  return rendered;
2478
2717
  }
2479
2718
  function ensureValidVNode(vnodes) {
@@ -2484,12 +2723,6 @@ function ensureValidVNode(vnodes) {
2484
2723
  return true;
2485
2724
  }) ? vnodes : null;
2486
2725
  }
2487
- function ensureVaporSlotFallback(vnodes, fallback) {
2488
- let vaporSlot;
2489
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
2490
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
2491
- }
2492
- }
2493
2726
  //#endregion
2494
2727
  //#region packages/runtime-core/src/helpers/toHandlers.ts
2495
2728
  /**
@@ -2517,11 +2750,38 @@ const getPublicInstance = (i) => {
2517
2750
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
2518
2751
  return getPublicInstance(i.parent);
2519
2752
  };
2753
+ const resolveDevRootEl = (vnode) => {
2754
+ let found = false;
2755
+ while (true) {
2756
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
2757
+ const root = filterSingleRoot(vnode.children);
2758
+ if (!root) return;
2759
+ vnode = root;
2760
+ found = true;
2761
+ continue;
2762
+ }
2763
+ const component = vnode.component;
2764
+ if (component && component.subTree) {
2765
+ vnode = component.subTree;
2766
+ continue;
2767
+ }
2768
+ const suspense = vnode.suspense;
2769
+ if (suspense && suspense.activeBranch) {
2770
+ vnode = suspense.activeBranch;
2771
+ continue;
2772
+ }
2773
+ return found ? vnode.el : void 0;
2774
+ }
2775
+ };
2776
+ const getDevRootFragmentEl = (i) => {
2777
+ const el = i.subTree && resolveDevRootEl(i.subTree);
2778
+ return el === void 0 ? i.vnode.el : el;
2779
+ };
2520
2780
  let publicPropertiesMap;
2521
2781
  const getPublicPropertiesMap = () => {
2522
2782
  if (!publicPropertiesMap) publicPropertiesMap = (0, _vue_shared.extend)(Object.create(null), {
2523
2783
  $: (i) => i,
2524
- $el: (i) => i.vnode.el,
2784
+ $el: (i) => getDevRootFragmentEl(i),
2525
2785
  $data: (i) => i.data,
2526
2786
  $props: (i) => (0, _vue_reactivity.shallowReadonly)(i.props),
2527
2787
  $attrs: (i) => (0, _vue_reactivity.shallowReadonly)(i.attrs),
@@ -2627,7 +2887,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
2627
2887
  warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
2628
2888
  return Reflect.ownKeys(target);
2629
2889
  };
2630
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
2890
+ const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
2631
2891
  get(target, key) {
2632
2892
  if (key === Symbol.unscopables) return;
2633
2893
  return PublicInstanceProxyHandlers.get(target, key, target);
@@ -2799,12 +3059,13 @@ function mergeDefaults(raw, defaults) {
2799
3059
  for (const key in defaults) {
2800
3060
  if (key.startsWith("__skip")) continue;
2801
3061
  let opt = props[key];
2802
- if (opt) if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
2803
- type: opt,
2804
- default: defaults[key]
2805
- };
2806
- else opt.default = defaults[key];
2807
- else if (opt === null) opt = props[key] = { default: defaults[key] };
3062
+ if (opt) {
3063
+ if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
3064
+ type: opt,
3065
+ default: defaults[key]
3066
+ };
3067
+ else opt.default = defaults[key];
3068
+ } else if (opt === null) opt = props[key] = { default: defaults[key] };
2808
3069
  else warn$1(`props default key "${key}" has no corresponding declaration.`);
2809
3070
  if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
2810
3071
  }
@@ -2859,21 +3120,29 @@ function withAsyncContext(getAwaitable) {
2859
3120
  setCurrentInstance(null, void 0);
2860
3121
  if (inSSRSetup) setInSSRSetupState(false);
2861
3122
  const restore = () => {
3123
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
2862
3124
  setCurrentInstance(ctx);
2863
3125
  if (inSSRSetup) setInSSRSetupState(true);
3126
+ return stoppedScope;
2864
3127
  };
2865
3128
  const cleanup = () => {
2866
3129
  setCurrentInstance(null, void 0);
2867
3130
  if (inSSRSetup) setInSSRSetupState(false);
2868
3131
  };
2869
3132
  if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
2870
- restore();
2871
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
3133
+ const stoppedScope = restore();
3134
+ Promise.resolve().then(() => Promise.resolve().then(() => {
3135
+ if (stoppedScope) stoppedScope.reset();
3136
+ cleanup();
3137
+ }));
2872
3138
  throw e;
2873
3139
  });
2874
3140
  return [awaitable, () => {
2875
- restore();
2876
- Promise.resolve().then(cleanup);
3141
+ const stoppedScope = restore();
3142
+ Promise.resolve().then(() => {
3143
+ if (stoppedScope) stoppedScope.reset();
3144
+ cleanup();
3145
+ });
2877
3146
  }];
2878
3147
  }
2879
3148
  //#endregion
@@ -2934,11 +3203,12 @@ function applyOptions(instance) {
2934
3203
  const opt = computedOptions[key];
2935
3204
  const get = (0, _vue_shared.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0, _vue_shared.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared.NOOP;
2936
3205
  if (get === _vue_shared.NOOP) warn$1(`Computed property "${key}" has no getter.`);
3206
+ const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : () => {
3207
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
3208
+ };
2937
3209
  const c = computed({
2938
3210
  get,
2939
- set: !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : () => {
2940
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
2941
- }
3211
+ set
2942
3212
  });
2943
3213
  Object.defineProperty(ctx, key, {
2944
3214
  enumerable: true,
@@ -2995,9 +3265,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
2995
3265
  for (const key in injectOptions) {
2996
3266
  const opt = injectOptions[key];
2997
3267
  let injected;
2998
- if ((0, _vue_shared.isObject)(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
2999
- else injected = inject(opt.from || key);
3000
- else injected = inject(opt);
3268
+ if ((0, _vue_shared.isObject)(opt)) {
3269
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
3270
+ else injected = inject(opt.from || key);
3271
+ } else injected = inject(opt);
3001
3272
  if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
3002
3273
  enumerable: true,
3003
3274
  configurable: true,
@@ -3018,13 +3289,14 @@ function createWatcher(raw, ctx, publicThis, key) {
3018
3289
  if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
3019
3290
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
3020
3291
  } else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
3021
- else if ((0, _vue_shared.isObject)(raw)) if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3022
- else {
3023
- const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3024
- if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
3025
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3026
- }
3027
- else warn$1(`Invalid watch option: "${key}"`, raw);
3292
+ else if ((0, _vue_shared.isObject)(raw)) {
3293
+ if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
3294
+ else {
3295
+ const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
3296
+ if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
3297
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
3298
+ }
3299
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
3028
3300
  }
3029
3301
  /**
3030
3302
  * Resolve merged options and cache it on the component.
@@ -3110,7 +3382,7 @@ function mergeObjectOptions(to, from) {
3110
3382
  }
3111
3383
  function mergeEmitsOrPropsOptions(to, from) {
3112
3384
  if (to) {
3113
- if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [...new Set([...to, ...from])];
3385
+ if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
3114
3386
  return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
3115
3387
  } else return from;
3116
3388
  }
@@ -3229,8 +3501,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
3229
3501
  } else warn$1(`Cannot unmount an app that is not mounted.`);
3230
3502
  },
3231
3503
  provide(key, value) {
3232
- if (key in context.provides) if ((0, _vue_shared.hasOwn)(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
3233
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3504
+ if (key in context.provides) {
3505
+ if ((0, _vue_shared.hasOwn)(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
3506
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
3507
+ }
3234
3508
  context.provides[key] = value;
3235
3509
  return app;
3236
3510
  },
@@ -3269,13 +3543,17 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
3269
3543
  const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
3270
3544
  const res = (0, _vue_reactivity.customRef)((track, trigger) => {
3271
3545
  let localValue;
3546
+ let prevPropValue = _vue_shared.EMPTY_OBJ;
3272
3547
  let prevSetValue = _vue_shared.EMPTY_OBJ;
3273
3548
  let prevEmittedValue;
3274
3549
  watchSyncEffect(() => {
3275
3550
  const propValue = props[camelizedName];
3276
- if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
3277
- localValue = propValue;
3278
- trigger();
3551
+ if ((0, _vue_shared.hasChanged)(prevPropValue, propValue)) {
3552
+ prevPropValue = propValue;
3553
+ if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
3554
+ localValue = propValue;
3555
+ trigger();
3556
+ }
3279
3557
  }
3280
3558
  });
3281
3559
  return {
@@ -3298,12 +3576,13 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
3298
3576
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
3299
3577
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
3300
3578
  }
3301
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
3579
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
3580
+ if (!hasVModel) {
3302
3581
  localValue = value;
3303
3582
  trigger();
3304
3583
  }
3305
3584
  i.emit(`update:${name}`, emittedValue);
3306
- if ((0, _vue_shared.hasChanged)(value, emittedValue) && (0, _vue_shared.hasChanged)(value, prevSetValue) && !(0, _vue_shared.hasChanged)(emittedValue, prevEmittedValue)) trigger();
3585
+ if ((0, _vue_shared.hasChanged)(value, prevSetValue) && ((0, _vue_shared.hasChanged)(value, emittedValue) && !(0, _vue_shared.hasChanged)(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== _vue_shared.EMPTY_OBJ && !(0, _vue_shared.hasChanged)(emittedValue, localValue))) trigger();
3307
3586
  prevSetValue = value;
3308
3587
  prevEmittedValue = emittedValue;
3309
3588
  }
@@ -3336,12 +3615,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3336
3615
  if (instance.isUnmounted) return;
3337
3616
  {
3338
3617
  const { emitsOptions, propsOptions } = instance;
3339
- if (emitsOptions) if (!(event in emitsOptions) && true) {
3340
- if (!propsOptions || !propsOptions[0] || !((0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event))}" prop.`);
3341
- } else {
3342
- const validator = emitsOptions[event];
3343
- if ((0, _vue_shared.isFunction)(validator)) {
3344
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3618
+ if (emitsOptions) {
3619
+ if (!(event in emitsOptions) && true) {
3620
+ if (!propsOptions || !propsOptions[0] || !((0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event))}" prop.`);
3621
+ } else {
3622
+ const validator = emitsOptions[event];
3623
+ if ((0, _vue_shared.isFunction)(validator)) {
3624
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
3625
+ }
3345
3626
  }
3346
3627
  }
3347
3628
  }
@@ -3350,7 +3631,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
3350
3631
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
3351
3632
  if (modifiers) {
3352
3633
  if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
3353
- if (modifiers.number) args = rawArgs.map(_vue_shared.looseToNumber);
3634
+ if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
3354
3635
  }
3355
3636
  devtoolsComponentEmit(instance, event, args);
3356
3637
  {
@@ -3410,7 +3691,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
3410
3691
  */
3411
3692
  function isEmitListener(options, key) {
3412
3693
  if (!options || !(0, _vue_shared.isOn)(key)) return false;
3413
- key = key.slice(2).replace(/Once$/, "");
3694
+ key = key.slice(2);
3695
+ key = key === "Once" ? key : key.replace(/Once$/, "");
3414
3696
  return (0, _vue_shared.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0, _vue_shared.hasOwn)(options, (0, _vue_shared.hyphenate)(key)) || (0, _vue_shared.hasOwn)(options, key);
3415
3697
  }
3416
3698
  //#endregion
@@ -3476,8 +3758,9 @@ function renderComponentRoot(instance) {
3476
3758
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3477
3759
  }
3478
3760
  if (vnode.transition) {
3479
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3480
- setTransitionHooks(root, vnode.transition);
3761
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
3762
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3763
+ setTransitionHooks(child, vnode.transition);
3481
3764
  }
3482
3765
  if (setRoot) setRoot(root);
3483
3766
  else result = root;
@@ -3528,18 +3811,21 @@ function filterSingleRoot(children, recurse = true) {
3528
3811
  for (let i = 0; i < children.length; i++) {
3529
3812
  const child = children[i];
3530
3813
  if (isVNode(child)) {
3531
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
3532
- else {
3533
- singleRoot = child;
3534
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3814
+ if (child.type !== Comment || child.children === "v-if") {
3815
+ if (singleRoot) return;
3816
+ else {
3817
+ singleRoot = child;
3818
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
3819
+ }
3535
3820
  }
3536
3821
  } else return;
3537
3822
  }
3538
3823
  return singleRoot;
3539
3824
  }
3825
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
3540
3826
  const getFunctionalFallthrough = (attrs) => {
3541
3827
  let res;
3542
- for (const key in attrs) if (key === "class" || key === "style" || (0, _vue_shared.isOn)(key)) (res || (res = {}))[key] = attrs[key];
3828
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
3543
3829
  return res;
3544
3830
  };
3545
3831
  const filterModelListeners = (attrs, props) => {
@@ -3651,16 +3937,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3651
3937
  let key = propsToUpdate[i];
3652
3938
  if (isEmitListener(instance.emitsOptions, key)) continue;
3653
3939
  const value = rawProps[key];
3654
- if (options) if ((0, _vue_shared.hasOwn)(attrs, key)) {
3655
- if (value !== attrs[key]) {
3656
- attrs[key] = value;
3657
- hasAttrsChanged = true;
3940
+ if (options) {
3941
+ if ((0, _vue_shared.hasOwn)(attrs, key)) {
3942
+ if (value !== attrs[key]) {
3943
+ attrs[key] = value;
3944
+ hasAttrsChanged = true;
3945
+ }
3946
+ } else {
3947
+ const camelizedKey = (0, _vue_shared.camelize)(key);
3948
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3658
3949
  }
3659
- } else {
3660
- const camelizedKey = (0, _vue_shared.camelize)(key);
3661
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
3662
- }
3663
- else if (value !== attrs[key]) {
3950
+ } else if (value !== attrs[key]) {
3664
3951
  attrs[key] = value;
3665
3952
  hasAttrsChanged = true;
3666
3953
  }
@@ -3669,9 +3956,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3669
3956
  } else {
3670
3957
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
3671
3958
  let kebabKey;
3672
- for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey))) if (options) {
3673
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
3674
- } else delete props[key];
3959
+ for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey))) {
3960
+ if (options) {
3961
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
3962
+ } else delete props[key];
3963
+ }
3675
3964
  if (attrs !== rawCurrentProps) {
3676
3965
  for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
3677
3966
  delete attrs[key];
@@ -3690,9 +3979,10 @@ function setFullProps(instance, rawProps, props, attrs) {
3690
3979
  if ((0, _vue_shared.isReservedProp)(key)) continue;
3691
3980
  const value = rawProps[key];
3692
3981
  let camelKey;
3693
- if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3694
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3695
- else if (!isEmitListener(instance.emitsOptions, key)) {
3982
+ if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
3983
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
3984
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3985
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
3696
3986
  if (!(key in attrs) || value !== attrs[key]) {
3697
3987
  attrs[key] = value;
3698
3988
  hasAttrsChanged = true;
@@ -3739,7 +4029,7 @@ function baseResolveDefault(factory, instance, key) {
3739
4029
  const prev = setCurrentInstance(instance);
3740
4030
  const props = (0, _vue_reactivity.toRaw)(instance.props);
3741
4031
  value = factory.call(null, props);
3742
- setCurrentInstance(...prev);
4032
+ restoreCurrentInstance(prev);
3743
4033
  return value;
3744
4034
  }
3745
4035
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -3855,7 +4145,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
3855
4145
  }
3856
4146
  if (validator && !validator(value, (0, _vue_reactivity.shallowReadonly)(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
3857
4147
  }
3858
- const isSimpleType = /* @__PURE__ */ (0, _vue_shared.makeMap)("String,Number,Boolean,Function,Symbol,BigInt");
4148
+ const isSimpleType = /*@__PURE__*/ (0, _vue_shared.makeMap)("String,Number,Boolean,Function,Symbol,BigInt");
3859
4149
  /**
3860
4150
  * dev only
3861
4151
  */
@@ -3885,7 +4175,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
3885
4175
  const receivedType = (0, _vue_shared.toRawType)(value);
3886
4176
  const expectedValue = styleValue(value, expectedType);
3887
4177
  const receivedValue = styleValue(value, receivedType);
3888
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
4178
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
3889
4179
  message += `, got ${receivedType} `;
3890
4180
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
3891
4181
  return message;
@@ -3894,7 +4184,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
3894
4184
  * dev only
3895
4185
  */
3896
4186
  function styleValue(value, type) {
3897
- if (type === "String") return `"${value}"`;
4187
+ if ((0, _vue_shared.isSymbol)(value)) return value.toString();
4188
+ else if (type === "String") return `"${value}"`;
3898
4189
  else if (type === "Number") return `${Number(value)}`;
3899
4190
  else return `${value}`;
3900
4191
  }
@@ -3911,8 +4202,11 @@ function isExplicable(type) {
3911
4202
  /**
3912
4203
  * dev only
3913
4204
  */
3914
- function isBoolean(...args) {
3915
- return args.some((elem) => elem.toLowerCase() === "boolean");
4205
+ function isCoercible(...args) {
4206
+ return args.every((elem) => {
4207
+ const value = elem.toLowerCase();
4208
+ return value !== "boolean" && value !== "symbol";
4209
+ });
3916
4210
  }
3917
4211
  //#endregion
3918
4212
  //#region packages/runtime-core/src/componentSlots.ts
@@ -3964,12 +4258,13 @@ const updateSlots = (instance, children, optimized) => {
3964
4258
  let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
3965
4259
  if (vnode.shapeFlag & 32) {
3966
4260
  const type = children._;
3967
- if (type) if (isHmrUpdating) {
3968
- assignSlots(slots, children, optimized);
3969
- (0, _vue_reactivity.trigger)(instance, "set", "$slots");
3970
- } else if (optimized && type === 1) needDeletionCheck = false;
3971
- else assignSlots(slots, children, optimized);
3972
- else {
4261
+ if (type) {
4262
+ if (isHmrUpdating) {
4263
+ assignSlots(slots, children, optimized);
4264
+ (0, _vue_reactivity.trigger)(instance, "set", "$slots");
4265
+ } else if (optimized && type === 1) needDeletionCheck = false;
4266
+ else assignSlots(slots, children, optimized);
4267
+ } else {
3973
4268
  needDeletionCheck = !children.$stable;
3974
4269
  normalizeObjectSlots(children, slots, instance);
3975
4270
  }
@@ -3987,7 +4282,7 @@ const updateSlots = (instance, children, optimized) => {
3987
4282
  let supported;
3988
4283
  let perf;
3989
4284
  let cachedNow = 0;
3990
- const p = /* @__PURE__ */ Promise.resolve();
4285
+ const p = /*@__PURE__*/ Promise.resolve();
3991
4286
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
3992
4287
  /**
3993
4288
  * @internal
@@ -4068,6 +4363,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4068
4363
  optimized = false;
4069
4364
  n2.dynamicChildren = null;
4070
4365
  }
4366
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
4367
+ if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
4368
+ n2.dynamicChildren.hasOnce = true;
4369
+ }
4071
4370
  const { type, ref, shapeFlag } = n2;
4072
4371
  switch (type) {
4073
4372
  case Text:
@@ -4084,7 +4383,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4084
4383
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4085
4384
  break;
4086
4385
  case VaporSlot:
4087
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
4386
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
4088
4387
  break;
4089
4388
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4090
4389
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -4203,7 +4502,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4203
4502
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
4204
4503
  };
4205
4504
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
4206
- for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4505
+ for (let i = start; i < children.length; i++) {
4506
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
4507
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4508
+ }
4207
4509
  };
4208
4510
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4209
4511
  const el = n2.el = n1.el;
@@ -4215,9 +4517,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4215
4517
  let vnodeHook;
4216
4518
  parentComponent && toggleRecurse(parentComponent, false);
4217
4519
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4520
+ if (n2.ibu) n2.ibu();
4218
4521
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4219
4522
  parentComponent && toggleRecurse(parentComponent, true);
4220
- if (isHmrUpdating) {
4523
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
4221
4524
  patchFlag = 0;
4222
4525
  optimized = false;
4223
4526
  dynamicChildren = null;
@@ -4248,8 +4551,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4248
4551
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
4249
4552
  }
4250
4553
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
4251
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
4554
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
4252
4555
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4556
+ n2.iu && n2.iu();
4253
4557
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4254
4558
  }, void 0, parentSuspense);
4255
4559
  };
@@ -4257,7 +4561,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4257
4561
  for (let i = 0; i < newChildren.length; i++) {
4258
4562
  const oldVNode = oldChildren[i];
4259
4563
  const newVNode = newChildren[i];
4260
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4564
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
4565
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4261
4566
  }
4262
4567
  };
4263
4568
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -4295,25 +4600,15 @@ function baseCreateRenderer(options, createHydrationFns) {
4295
4600
  };
4296
4601
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4297
4602
  n2.slotScopeIds = slotScopeIds;
4298
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
4299
- else {
4300
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
4301
- if (n2.dirs) {
4302
- invokeDirectiveHook(n2, null, parentComponent, "created");
4303
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
4304
- }
4305
- });
4306
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
4307
- }
4308
- else {
4309
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
4310
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4311
- });
4312
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
4313
- }
4314
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4315
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4316
- else updateComponent(n1, n2, optimized);
4603
+ if (n2.type.__vapor) {
4604
+ if (n1 == null) {
4605
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4606
+ else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
4607
+ } else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
4608
+ } else if (n1 == null) {
4609
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
4610
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
4611
+ } else updateComponent(n1, n2, optimized);
4317
4612
  };
4318
4613
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
4319
4614
  const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
@@ -4354,16 +4649,18 @@ function baseCreateRenderer(options, createHydrationFns) {
4354
4649
  };
4355
4650
  const updateComponent = (n1, n2, optimized) => {
4356
4651
  const instance = n2.component = n1.component;
4357
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
4358
- pushWarningContext(n2);
4359
- updateComponentPreRender(instance, n2, optimized);
4360
- popWarningContext();
4361
- return;
4652
+ if (shouldUpdateComponent(n1, n2, optimized)) {
4653
+ if (instance.asyncDep && !instance.asyncResolved) {
4654
+ pushWarningContext(n2);
4655
+ n2.el = n1.el;
4656
+ updateComponentPreRender(instance, n2, optimized);
4657
+ popWarningContext();
4658
+ return;
4659
+ } else {
4660
+ instance.next = n2;
4661
+ instance.effect.run();
4662
+ }
4362
4663
  } else {
4363
- instance.next = n2;
4364
- instance.effect.run();
4365
- }
4366
- else {
4367
4664
  n2.el = n1.el;
4368
4665
  instance.vnode = n2;
4369
4666
  }
@@ -4461,6 +4758,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4461
4758
  } else next = vnode;
4462
4759
  if (bu) (0, _vue_shared.invokeArrayFns)(bu);
4463
4760
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
4761
+ if (next.ibu) next.ibu();
4464
4762
  toggleRecurse(instance, true);
4465
4763
  startMeasure(instance, `render`);
4466
4764
  const nextTree = renderComponentRoot(instance);
@@ -4473,7 +4771,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4473
4771
  next.el = nextTree.el;
4474
4772
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
4475
4773
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
4476
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
4774
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
4775
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
4776
+ next.iu && next.iu();
4777
+ }, void 0, parentSuspense);
4477
4778
  devtoolsComponentUpdated(instance);
4478
4779
  popWarningContext();
4479
4780
  }
@@ -4513,9 +4814,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4513
4814
  if (shapeFlag & 8) {
4514
4815
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
4515
4816
  if (c2 !== c1) hostSetElementText(container, c2);
4516
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4517
- else unmountChildren(c1, parentComponent, parentSuspense, true);
4518
- else {
4817
+ } else if (prevShapeFlag & 16) {
4818
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4819
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
4820
+ } else {
4519
4821
  if (prevShapeFlag & 8) hostSetElementText(container, "");
4520
4822
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4521
4823
  }
@@ -4614,15 +4916,17 @@ function baseCreateRenderer(options, createHydrationFns) {
4614
4916
  const anchorVNode = c2[nextIndex + 1];
4615
4917
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
4616
4918
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4617
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4618
- else j--;
4919
+ else if (moved) {
4920
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
4921
+ else j--;
4922
+ }
4619
4923
  }
4620
4924
  }
4621
4925
  };
4622
4926
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
4623
4927
  const { el, type, transition, children, shapeFlag } = vnode;
4624
4928
  if (isVaporComponent(type) || type === VaporSlot) {
4625
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
4929
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
4626
4930
  return;
4627
4931
  }
4628
4932
  if (shapeFlag & 6) {
@@ -4647,49 +4951,37 @@ function baseCreateRenderer(options, createHydrationFns) {
4647
4951
  moveStaticNode(vnode, container, anchor);
4648
4952
  return;
4649
4953
  }
4650
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4651
- else {
4652
- const { leave, delayLeave, afterLeave } = transition;
4653
- const remove = () => {
4954
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
4955
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
4956
+ else performTransitionLeave(el, transition, () => {
4654
4957
  if (vnode.ctx.isUnmounted) hostRemove(el);
4655
4958
  else hostInsert(el, container, anchor);
4656
- };
4657
- const performLeave = () => {
4658
- if (el._isLeaving) el[leaveCbKey](true);
4659
- leave(el, () => {
4660
- remove();
4661
- afterLeave && afterLeave();
4662
- });
4663
- };
4664
- if (delayLeave) delayLeave(el, remove, performLeave);
4665
- else performLeave();
4666
- }
4667
- else hostInsert(el, container, anchor);
4959
+ }, true, true);
4960
+ } else hostInsert(el, container, anchor);
4668
4961
  };
4669
4962
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
4670
4963
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
4671
- if (patchFlag === -2) optimized = false;
4964
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
4672
4965
  if (ref != null) {
4673
4966
  const prevSub = (0, _vue_reactivity.setActiveSub)();
4674
4967
  setRef(ref, null, parentSuspense, vnode, true);
4675
4968
  (0, _vue_reactivity.setActiveSub)(prevSub);
4676
4969
  }
4677
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
4970
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
4678
4971
  if (shapeFlag & 256) {
4679
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
4972
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
4680
4973
  else parentComponent.ctx.deactivate(vnode);
4681
4974
  return;
4682
4975
  }
4976
+ if (shapeFlag & 6 && isVaporComponent(type)) {
4977
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4978
+ return;
4979
+ }
4683
4980
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
4684
4981
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
4685
4982
  let vnodeHook;
4686
4983
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
4687
- if (shapeFlag & 6) if (isVaporComponent(type)) {
4688
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4689
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4690
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
4691
- return;
4692
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
4984
+ if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
4693
4985
  else {
4694
4986
  if (shapeFlag & 128) {
4695
4987
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -4700,7 +4992,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4700
4992
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
4701
4993
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
4702
4994
  if (type === VaporSlot) {
4703
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4995
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4704
4996
  return;
4705
4997
  }
4706
4998
  if (doRemove) remove(vnode);
@@ -4724,6 +5016,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4724
5016
  }
4725
5017
  if (type === Static) {
4726
5018
  removeStaticNode(vnode);
5019
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
4727
5020
  return;
4728
5021
  }
4729
5022
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -4748,6 +5041,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4748
5041
  if (effect) {
4749
5042
  effect.stop();
4750
5043
  unmount(subTree, instance, parentSuspense, doRemove);
5044
+ } else if (instance.vnode.el && subTree) {
5045
+ subTree.transition = instance.vnode.transition;
5046
+ unmount(subTree, instance, parentSuspense, doRemove);
4751
5047
  }
4752
5048
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
4753
5049
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
@@ -4822,12 +5118,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
4822
5118
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
4823
5119
  }
4824
5120
  function toggleRecurse({ effect, job, vapor }, allowed) {
4825
- if (!vapor) if (allowed) {
4826
- effect.flags |= 128;
4827
- job.flags |= 2;
4828
- } else {
4829
- effect.flags &= -129;
4830
- job.flags &= -3;
5121
+ if (!vapor) {
5122
+ if (allowed) {
5123
+ effect.flags |= 128;
5124
+ job.flags |= 2;
5125
+ } else {
5126
+ effect.flags &= -129;
5127
+ job.flags &= -3;
5128
+ }
4831
5129
  }
4832
5130
  }
4833
5131
  function needTransition(parentSuspense, transition) {
@@ -4867,13 +5165,19 @@ function traverseStaticChildren(n1, n2, shallow = false) {
4867
5165
  }
4868
5166
  function locateNonHydratedAsyncRoot(instance) {
4869
5167
  const subComponent = instance.subTree && instance.subTree.component;
4870
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
4871
- else return locateNonHydratedAsyncRoot(subComponent);
5168
+ if (subComponent) {
5169
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5170
+ else return locateNonHydratedAsyncRoot(subComponent);
5171
+ }
4872
5172
  }
4873
5173
  function invalidateMount(hooks) {
4874
5174
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
4875
5175
  }
4876
5176
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
5177
+ if (force && transition.persisted && !el[leaveCbKey]) {
5178
+ insert();
5179
+ return;
5180
+ }
4877
5181
  if (force || needTransition(parentSuspense, transition)) {
4878
5182
  transition.beforeEnter(el);
4879
5183
  insert();
@@ -4883,13 +5187,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
4883
5187
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
4884
5188
  const performRemove = () => {
4885
5189
  remove();
4886
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5190
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
4887
5191
  };
4888
5192
  if (force || isElement && transition && !transition.persisted) {
4889
5193
  const { leave, delayLeave } = transition;
4890
5194
  const performLeave = () => {
5195
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
4891
5196
  if (el._isLeaving && force) el[leaveCbKey](true);
4892
- leave(el, performRemove);
5197
+ if (force && transition.persisted && !wasLeaving) remove();
5198
+ else leave(el, performRemove);
4893
5199
  };
4894
5200
  if (delayLeave) delayLeave(el, performRemove, performLeave);
4895
5201
  else performLeave();
@@ -4908,7 +5214,7 @@ function isVaporComponent(type) {
4908
5214
  /**
4909
5215
  * shared between vdom and vapor
4910
5216
  */
4911
- function getInheritedScopeIds(vnode, parentComponent) {
5217
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
4912
5218
  const inheritedScopeIds = [];
4913
5219
  let currentParent = parentComponent;
4914
5220
  let currentVNode = vnode;
@@ -4924,6 +5230,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
4924
5230
  currentParent = currentParent.parent;
4925
5231
  } else break;
4926
5232
  }
5233
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
5234
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
4927
5235
  return inheritedScopeIds;
4928
5236
  }
4929
5237
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -4942,7 +5250,7 @@ const Suspense = {
4942
5250
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
4943
5251
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
4944
5252
  else {
4945
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
5253
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
4946
5254
  n2.suspense = n1.suspense;
4947
5255
  n2.suspense.vnode = n2;
4948
5256
  n2.el = n1.el;
@@ -4980,10 +5288,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
4980
5288
  if (pendingBranch) {
4981
5289
  suspense.pendingBranch = newBranch;
4982
5290
  if (isSameVNodeType(pendingBranch, newBranch)) {
4983
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5291
+ suspense.deps++;
5292
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5293
+ suspense.deps--;
4984
5294
  if (suspense.deps <= 0) suspense.resolve();
4985
5295
  else if (isInFallback) {
4986
- if (!isHydrating) {
5296
+ if (!isHydrating && !suspense.isFallbackMountPending) {
4987
5297
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
4988
5298
  setActiveBranch(suspense, newFallback);
4989
5299
  }
@@ -4995,12 +5305,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
4995
5305
  suspense.activeBranch = pendingBranch;
4996
5306
  } else unmount(pendingBranch, parentComponent, suspense);
4997
5307
  suspense.deps = 0;
5308
+ for (let i = 0; i < suspense.effects.length; i++) {
5309
+ const effect = suspense.effects[i];
5310
+ if (effect.flags & 8) queuePostFlushCb(effect);
5311
+ }
4998
5312
  suspense.effects.length = 0;
4999
5313
  suspense.hiddenContainer = createElement("div");
5000
5314
  if (isInFallback) {
5001
5315
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5002
5316
  if (suspense.deps <= 0) suspense.resolve();
5003
- else {
5317
+ else if (!suspense.isFallbackMountPending) {
5004
5318
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
5005
5319
  setActiveBranch(suspense, newFallback);
5006
5320
  }
@@ -5076,15 +5390,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5076
5390
  if (suspense.isHydrating) suspense.isHydrating = false;
5077
5391
  else if (!resume) {
5078
5392
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
5393
+ let hasUpdatedAnchor = false;
5079
5394
  if (delayEnter) activeBranch.transition.afterLeave = () => {
5080
5395
  if (pendingId === suspense.pendingId) {
5081
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
5396
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
5082
5397
  queuePostFlushCb(effects);
5083
5398
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
5084
5399
  }
5085
5400
  };
5086
5401
  if (activeBranch && !suspense.isFallbackMountPending) {
5087
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
5402
+ if (parentNode(activeBranch.el) === container) {
5403
+ anchor = next(activeBranch);
5404
+ hasUpdatedAnchor = true;
5405
+ }
5088
5406
  unmount(activeBranch, parentComponent, suspense, true);
5089
5407
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
5090
5408
  }
@@ -5098,7 +5416,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5098
5416
  let hasUnresolvedAncestor = false;
5099
5417
  while (parent) {
5100
5418
  if (parent.pendingBranch) {
5101
- parent.effects.push(...effects);
5419
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
5102
5420
  hasUnresolvedAncestor = true;
5103
5421
  break;
5104
5422
  }
@@ -5108,6 +5426,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5108
5426
  suspense.effects = [];
5109
5427
  if (isSuspensible) {
5110
5428
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
5429
+ parentSuspenseId = void 0;
5111
5430
  parentSuspense.deps--;
5112
5431
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
5113
5432
  }
@@ -5122,8 +5441,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5122
5441
  const mountFallback = () => {
5123
5442
  suspense.isFallbackMountPending = false;
5124
5443
  if (!suspense.isInFallback) return;
5125
- patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
5126
- setActiveBranch(suspense, fallbackVNode);
5444
+ const latestFallback = suspense.vnode.ssFallback;
5445
+ patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
5446
+ setActiveBranch(suspense, latestFallback);
5127
5447
  };
5128
5448
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
5129
5449
  if (delayEnter) {
@@ -5144,10 +5464,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5144
5464
  registerDep(instance, onResolve) {
5145
5465
  const isInPendingSuspense = !!suspense.pendingBranch;
5146
5466
  if (isInPendingSuspense) suspense.deps++;
5467
+ const hydratedEl = instance.vnode && instance.vnode.el;
5147
5468
  instance.asyncDep.catch((err) => {
5148
5469
  handleError(err, instance, 0);
5149
5470
  }).then((asyncSetupResult) => {
5150
5471
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
5472
+ setCurrentInstance(null, void 0);
5473
+ if (hydratedEl && !instance.scope.active) {
5474
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5475
+ return;
5476
+ }
5151
5477
  instance.asyncResolved = true;
5152
5478
  onResolve(asyncSetupResult);
5153
5479
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -5198,9 +5524,10 @@ function normalizeSuspenseSlot(s) {
5198
5524
  return s;
5199
5525
  }
5200
5526
  function queueEffectWithSuspense(fn, id, suspense) {
5201
- if (suspense && suspense.pendingBranch) if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
5202
- else suspense.effects.push(fn);
5203
- else queuePostFlushCb(fn, id);
5527
+ if (suspense && suspense.pendingBranch) {
5528
+ if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
5529
+ else suspense.effects.push(fn);
5530
+ } else queuePostFlushCb(fn, id);
5204
5531
  }
5205
5532
  function setActiveBranch(suspense, branch) {
5206
5533
  suspense.activeBranch = branch;
@@ -5367,9 +5694,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
5367
5694
  if (shapeFlag & 128) type.normalize(vnode);
5368
5695
  } else if (children) vnode.shapeFlag |= (0, _vue_shared.isString)(children) ? 8 : 16;
5369
5696
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
5697
+ if (props && vnode.shapeFlag & 1) {
5698
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
5699
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
5700
+ }
5370
5701
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
5371
5702
  return vnode;
5372
5703
  }
5704
+ /**
5705
+ * dev only
5706
+ * Whether children would actually render something. Empty text and empty
5707
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
5708
+ * for `v-html` / `v-text`.
5709
+ */
5710
+ function hasContentChildren(children) {
5711
+ if ((0, _vue_shared.isString)(children)) return children !== "";
5712
+ if ((0, _vue_shared.isArray)(children)) return children.length > 0;
5713
+ return false;
5714
+ }
5373
5715
  const createVNode = createVNodeWithArgsTransform;
5374
5716
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
5375
5717
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -5379,8 +5721,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5379
5721
  if (isVNode(type)) {
5380
5722
  const cloned = cloneVNode(type, props, true);
5381
5723
  if (children) normalizeChildren(cloned, children);
5382
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5383
- else currentBlock.push(cloned);
5724
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
5725
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
5726
+ else currentBlock.push(cloned);
5727
+ }
5384
5728
  cloned.patchFlag = -2;
5385
5729
  return cloned;
5386
5730
  }
@@ -5437,11 +5781,31 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5437
5781
  el: vnode.el,
5438
5782
  anchor: vnode.anchor,
5439
5783
  ctx: vnode.ctx,
5440
- ce: vnode.ce
5784
+ ce: vnode.ce,
5785
+ vi: vnode.vi,
5786
+ vs: cloneVaporSlotMeta(vnode),
5787
+ vb: vnode.vb,
5788
+ ibu: vnode.ibu,
5789
+ iu: vnode.iu,
5790
+ cacheIndex: vnode.cacheIndex
5441
5791
  };
5442
5792
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5443
5793
  return cloned;
5444
5794
  }
5795
+ function cloneVaporSlotMeta(vnode) {
5796
+ const vaporSlot = vnode.vs;
5797
+ if (!vaporSlot) return vaporSlot;
5798
+ const cloned = {
5799
+ slot: vaporSlot.slot,
5800
+ outlets: vaporSlot.outlets
5801
+ };
5802
+ if (vnode.el) {
5803
+ cloned.state = vaporSlot.state;
5804
+ cloned.ref = vaporSlot.ref;
5805
+ cloned.scope = vaporSlot.scope;
5806
+ }
5807
+ return cloned;
5808
+ }
5445
5809
  /**
5446
5810
  * Dev only, for HMR of hoisted vnodes reused in v-for
5447
5811
  * https://github.com/vitejs/vite/issues/2022
@@ -5485,25 +5849,32 @@ function normalizeChildren(vnode, children) {
5485
5849
  const { shapeFlag } = vnode;
5486
5850
  if (children == null) children = null;
5487
5851
  else if ((0, _vue_shared.isArray)(children)) type = 16;
5488
- else if (typeof children === "object") if (shapeFlag & 65) {
5489
- const slot = children.default;
5490
- if (slot) {
5491
- slot._c && (slot._d = false);
5492
- normalizeChildren(vnode, slot());
5493
- slot._c && (slot._d = true);
5852
+ else if (typeof children === "object") {
5853
+ if (shapeFlag & 65) {
5854
+ const slot = children.default;
5855
+ if (slot) {
5856
+ slot._c && (slot._d = false);
5857
+ normalizeChildren(vnode, slot());
5858
+ slot._c && (slot._d = true);
5859
+ }
5860
+ return;
5861
+ } else {
5862
+ type = 32;
5863
+ const slotFlag = children._;
5864
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5865
+ else if (slotFlag === 3 && currentRenderingInstance) {
5866
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
5867
+ else {
5868
+ children._ = 2;
5869
+ vnode.patchFlag |= 1024;
5870
+ }
5871
+ }
5494
5872
  }
5495
- return;
5496
- } else {
5497
- type = 32;
5498
- const slotFlag = children._;
5499
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
5500
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
5501
- else {
5502
- children._ = 2;
5503
- vnode.patchFlag |= 1024;
5873
+ } else if ((0, _vue_shared.isFunction)(children)) {
5874
+ if (shapeFlag & 65) {
5875
+ normalizeChildren(vnode, { default: children });
5876
+ return;
5504
5877
  }
5505
- }
5506
- else if ((0, _vue_shared.isFunction)(children)) {
5507
5878
  children = {
5508
5879
  default: children,
5509
5880
  _ctx: currentRenderingInstance
@@ -5576,6 +5947,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
5576
5947
  simpleSetCurrentInstance(instance);
5577
5948
  }
5578
5949
  };
5950
+ /**
5951
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
5952
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
5953
+ * verbatim instead of re-triggering the `instance.scope` default.
5954
+ * @internal
5955
+ */
5956
+ const restoreCurrentInstance = (prev) => {
5957
+ (0, _vue_reactivity.setCurrentScope)(prev[1]);
5958
+ simpleSetCurrentInstance(prev[0]);
5959
+ };
5579
5960
  const internalOptions = [
5580
5961
  "ce",
5581
5962
  "type",
@@ -5607,7 +5988,7 @@ const useInstanceOption = (key, silent = false) => {
5607
5988
  };
5608
5989
  //#endregion
5609
5990
  //#region packages/runtime-core/src/component.ts
5610
- const emptyAppContext = /* @__PURE__ */ createAppContext();
5991
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
5611
5992
  let uid = 0;
5612
5993
  function createComponentInstance(vnode, parent, suspense) {
5613
5994
  const type = vnode.type;
@@ -5727,7 +6108,7 @@ function setupStatefulComponent(instance, isSSR) {
5727
6108
  const setupResult = callWithErrorHandling(setup, instance, 0, [(0, _vue_reactivity.shallowReadonly)(instance.props), setupContext]);
5728
6109
  const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
5729
6110
  (0, _vue_reactivity.setActiveSub)(prevSub);
5730
- setCurrentInstance(...prev);
6111
+ restoreCurrentInstance(prev);
5731
6112
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
5732
6113
  if (isAsyncSetup) {
5733
6114
  const unsetCurrentInstance = () => {
@@ -5735,7 +6116,12 @@ function setupStatefulComponent(instance, isSSR) {
5735
6116
  };
5736
6117
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
5737
6118
  if (isSSR) return setupResult.then((resolvedResult) => {
5738
- handleSetupResult(instance, resolvedResult, isSSR);
6119
+ setInSSRSetupState(true);
6120
+ try {
6121
+ handleSetupResult(instance, resolvedResult, isSSR);
6122
+ } finally {
6123
+ setInSSRSetupState(false);
6124
+ }
5739
6125
  }).catch((e) => {
5740
6126
  handleError(e, instance, 0);
5741
6127
  });
@@ -5747,9 +6133,10 @@ function setupStatefulComponent(instance, isSSR) {
5747
6133
  } else finishComponentSetup(instance, isSSR);
5748
6134
  }
5749
6135
  function handleSetupResult(instance, setupResult, isSSR) {
5750
- if ((0, _vue_shared.isFunction)(setupResult)) if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
5751
- else instance.render = setupResult;
5752
- else if ((0, _vue_shared.isObject)(setupResult)) {
6136
+ if ((0, _vue_shared.isFunction)(setupResult)) {
6137
+ if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
6138
+ else instance.render = setupResult;
6139
+ } else if ((0, _vue_shared.isObject)(setupResult)) {
5753
6140
  if (isVNode(setupResult)) warn$1("setup() should not return VNodes directly - return a render function instead.");
5754
6141
  instance.devtoolsRawSetupState = setupResult;
5755
6142
  instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
@@ -5797,13 +6184,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
5797
6184
  applyOptions(instance);
5798
6185
  } finally {
5799
6186
  (0, _vue_reactivity.setActiveSub)(prevSub);
5800
- setCurrentInstance(...prevInstance);
6187
+ restoreCurrentInstance(prevInstance);
5801
6188
  }
5802
6189
  }
5803
- if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) if (!compile && Component.template)
6190
+ if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) {
6191
+ if (!compile && Component.template)
5804
6192
  /* v8 ignore start */
5805
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue.");
5806
- else warn$1(`Component is missing template or render function: `, Component);
6193
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue.");
6194
+ else warn$1(`Component is missing template or render function: `, Component);
6195
+ }
5807
6196
  }
5808
6197
  const attrsProxyHandlers = {
5809
6198
  get(target, key) {
@@ -5866,14 +6255,13 @@ function getComponentPublicInstance(instance) {
5866
6255
  if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy((0, _vue_reactivity.proxyRefs)((0, _vue_reactivity.markRaw)(instance.exposed)), {
5867
6256
  get(target, key) {
5868
6257
  if (key in target) return target[key];
5869
- else {
6258
+ else if (!instance.vapor) {
5870
6259
  const publicPropertiesMap = getPublicPropertiesMap();
5871
6260
  if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
5872
6261
  }
5873
6262
  },
5874
6263
  has(target, key) {
5875
- const publicPropertiesMap = getPublicPropertiesMap();
5876
- return key in target || key in publicPropertiesMap;
6264
+ return key in target || !instance.vapor && key in getPublicPropertiesMap();
5877
6265
  }
5878
6266
  }));
5879
6267
  else return instance.proxy;
@@ -5911,11 +6299,12 @@ function h(type, propsOrChildren, children) {
5911
6299
  try {
5912
6300
  setBlockTracking(-1);
5913
6301
  const l = arguments.length;
5914
- if (l === 2) if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
5915
- if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
5916
- return createVNode(type, propsOrChildren);
5917
- } else return createVNode(type, null, propsOrChildren);
5918
- else {
6302
+ if (l === 2) {
6303
+ if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
6304
+ if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
6305
+ return createVNode(type, propsOrChildren);
6306
+ } else return createVNode(type, null, propsOrChildren);
6307
+ } else {
5919
6308
  if (l > 3) children = Array.prototype.slice.call(arguments, 2);
5920
6309
  else if (l === 3 && isVNode(children)) children = [children];
5921
6310
  return createVNode(type, propsOrChildren, children);
@@ -6107,7 +6496,7 @@ function isMemoSame(cached, memo) {
6107
6496
  }
6108
6497
  //#endregion
6109
6498
  //#region packages/runtime-core/src/index.ts
6110
- const version = "3.6.0-beta.9";
6499
+ const version = "3.6.0-rc.10";
6111
6500
  const warn = warn$1;
6112
6501
  /**
6113
6502
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -6130,7 +6519,10 @@ const ssrUtils = {
6130
6519
  getComponentPublicInstance,
6131
6520
  ensureValidVNode,
6132
6521
  pushWarningContext,
6133
- popWarningContext
6522
+ popWarningContext,
6523
+ VaporSlot,
6524
+ rawVaporSlotKey,
6525
+ invokeSlotFallback
6134
6526
  };
6135
6527
  /**
6136
6528
  * @internal only exposed in compat builds