vue 3.6.0-beta.13 → 3.6.0-beta.14

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 v3.6.0-beta.13
2
+ * vue v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2645,6 +2645,7 @@ function flushJobs(seen) {
2645
2645
  }
2646
2646
  flushIndex = 0;
2647
2647
  jobsLength = 0;
2648
+ jobs.length = 0;
2648
2649
  flushPostFlushCbs(seen);
2649
2650
  currentFlushPromise = null;
2650
2651
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2702,6 +2703,14 @@ function createRecord(id, initialDef) {
2702
2703
  function normalizeClassComponent(component) {
2703
2704
  return isClassComponent(component) ? component.__vccOpts : component;
2704
2705
  }
2706
+ function hasDirtyAncestor(instance, dirtyInstances) {
2707
+ let parent = instance.parent;
2708
+ while (parent) {
2709
+ if (dirtyInstances.has(parent)) return true;
2710
+ parent = parent.parent;
2711
+ }
2712
+ return false;
2713
+ }
2705
2714
  function rerender(id, newRender) {
2706
2715
  const record = map.get(id);
2707
2716
  if (!record) return;
@@ -2733,42 +2742,69 @@ function reload(id, newComp) {
2733
2742
  const isVapor = record.initialDef.__vapor;
2734
2743
  updateComponentDef(record.initialDef, newComp);
2735
2744
  const instances = [...record.instances];
2736
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2745
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2737
2746
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2738
- for (const instance of instances) instance.hmrReload(newComp);
2739
- } else for (const instance of instances) {
2740
- const oldComp = normalizeClassComponent(instance.type);
2741
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2742
- if (!dirtyInstances) {
2743
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2744
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2745
- }
2746
- dirtyInstances.add(instance);
2747
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2748
- instance.appContext.propsCache.delete(instance.type);
2749
- instance.appContext.emitsCache.delete(instance.type);
2750
- instance.appContext.optionsCache.delete(instance.type);
2751
- if (instance.ceReload) {
2752
- dirtyInstances.add(instance);
2753
- instance.ceReload(newComp.styles);
2754
- dirtyInstances.delete(instance);
2755
- } else if (instance.parent) queueJob(() => {
2756
- isHmrUpdating = true;
2747
+ const dirtyInstances = new Set(instances);
2748
+ const rerenderedParents = /* @__PURE__ */ new Set();
2749
+ for (const instance of instances) {
2757
2750
  const parent = instance.parent;
2758
- if (parent.vapor) parent.hmrRerender();
2759
- else if (!(parent.effect.flags & 1024)) {
2760
- parent.renderCache = [];
2761
- parent.effect.run();
2751
+ if (parent) {
2752
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2753
+ rerenderedParents.add(parent);
2754
+ parent.hmrRerender();
2755
+ }
2756
+ } else instance.hmrReload(newComp);
2757
+ }
2758
+ } else {
2759
+ const parentUpdates = /* @__PURE__ */ new Map();
2760
+ const dirtyInstanceSet = new Set(instances);
2761
+ for (const instance of instances) {
2762
+ const oldComp = normalizeClassComponent(instance.type);
2763
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2764
+ if (!dirtyInstances) {
2765
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2766
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2762
2767
  }
2763
- nextTick(() => {
2764
- isHmrUpdating = false;
2768
+ dirtyInstances.add(instance);
2769
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2770
+ instance.appContext.propsCache.delete(instance.type);
2771
+ instance.appContext.emitsCache.delete(instance.type);
2772
+ instance.appContext.optionsCache.delete(instance.type);
2773
+ if (instance.ceReload) {
2774
+ dirtyInstances.add(instance);
2775
+ instance.ceReload(newComp.styles);
2776
+ dirtyInstances.delete(instance);
2777
+ } else if (instance.parent) {
2778
+ const parent = instance.parent;
2779
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2780
+ let updates = parentUpdates.get(parent);
2781
+ if (!updates) parentUpdates.set(parent, updates = []);
2782
+ updates.push([instance, dirtyInstances]);
2783
+ }
2784
+ } else if (instance.appContext.reload) instance.appContext.reload();
2785
+ else if (typeof window !== "undefined") window.location.reload();
2786
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2787
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2788
+ }
2789
+ parentUpdates.forEach((updates, parent) => {
2790
+ queueJob(() => {
2791
+ isHmrUpdating = true;
2792
+ if (parent.vapor) parent.hmrRerender();
2793
+ else {
2794
+ const i = parent;
2795
+ if (!(i.effect.flags & 1024)) {
2796
+ i.renderCache = [];
2797
+ i.effect.run();
2798
+ }
2799
+ }
2800
+ nextTick(() => {
2801
+ isHmrUpdating = false;
2802
+ });
2803
+ updates.forEach(([instance, dirtyInstances]) => {
2804
+ dirtyInstances.delete(instance);
2805
+ });
2765
2806
  });
2766
- dirtyInstances.delete(instance);
2767
2807
  });
2768
- else if (instance.appContext.reload) instance.appContext.reload();
2769
- else if (typeof window !== "undefined") window.location.reload();
2770
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2771
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2772
2808
  }
2773
2809
  queuePostFlushCb(() => {
2774
2810
  hmrDirtyComponents.clear();
@@ -4741,6 +4777,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4741
4777
  slot: vaporSlot,
4742
4778
  fallback
4743
4779
  };
4780
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4744
4781
  return ret;
4745
4782
  }
4746
4783
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -8468,7 +8505,7 @@ function isMemoSame(cached, memo) {
8468
8505
  }
8469
8506
  //#endregion
8470
8507
  //#region packages/runtime-core/src/index.ts
8471
- const version = "3.6.0-beta.13";
8508
+ const version = "3.6.0-beta.14";
8472
8509
  const warn = warn$1;
8473
8510
  /**
8474
8511
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10580,7 +10617,7 @@ var RenderEffect = class extends ReactiveEffect {
10580
10617
  this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
10581
10618
  this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
10582
10619
  }
10583
- if (instance.type.ce) (instance.renderEffects || (instance.renderEffects = [])).push(this);
10620
+ (instance.renderEffects || (instance.renderEffects = [])).push(this);
10584
10621
  job.i = instance;
10585
10622
  }
10586
10623
  this.job = job;
@@ -10648,7 +10685,10 @@ function resolveFunctionSource(source) {
10648
10685
  }
10649
10686
  function snapshotRawProps(rawProps) {
10650
10687
  const snapshot = Object.create(null);
10651
- for (const key in rawProps) if (key !== "$") snapshot[key] = resolveSource(rawProps[key]);
10688
+ for (const key in rawProps) if (key !== "$") {
10689
+ const value = resolveSource(rawProps[key]);
10690
+ snapshot[key] = () => value;
10691
+ }
10652
10692
  const dynamicSources = rawProps.$;
10653
10693
  if (dynamicSources) {
10654
10694
  const snapshotSources = [];
@@ -10660,7 +10700,10 @@ function snapshotRawProps(rawProps) {
10660
10700
  for (const key in resolved) value[key] = resolved[key];
10661
10701
  snapshotSources[i] = () => value;
10662
10702
  } else {
10663
- for (const key in source) value[key] = resolveSource(source[key]);
10703
+ for (const key in source) {
10704
+ const resolved = resolveSource(source[key]);
10705
+ value[key] = () => resolved;
10706
+ }
10664
10707
  snapshotSources[i] = value;
10665
10708
  }
10666
10709
  }
@@ -11334,22 +11377,77 @@ function setScopeId(block, scopeIds) {
11334
11377
  if (block instanceof Element) for (const id of scopeIds) block.setAttribute(id, "");
11335
11378
  else if (isVaporComponent(block)) setScopeId(block.block, scopeIds);
11336
11379
  else if (isArray(block)) for (const b of block) setScopeId(b, scopeIds);
11337
- else if (isFragment(block)) setScopeId(block.nodes, scopeIds);
11380
+ else if (isFragment(block)) {
11381
+ trackScopeIdFragment(block, scopeIds, false);
11382
+ setScopeId(block.nodes, scopeIds);
11383
+ }
11384
+ }
11385
+ const trackedScopeIdFragments = /* @__PURE__ */ new WeakMap();
11386
+ function trackScopeIdFragment(frag, scopeIds, recursive = true) {
11387
+ if (isInteropEnabled && isInteropFragment(frag)) setInteropFragmentScopeIds(frag, scopeIds);
11388
+ else if (trackFragmentScopeIds(frag, scopeIds)) (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => setScopeId(nodes, scopeIds));
11389
+ if (recursive) trackScopeIdsInBlock(frag.nodes, scopeIds);
11390
+ }
11391
+ function trackFragmentScopeIds(frag, scopeIds) {
11392
+ const key = scopeIds.join(" ");
11393
+ let trackedScopeIds = trackedScopeIdFragments.get(frag);
11394
+ if (!trackedScopeIds) {
11395
+ trackedScopeIds = /* @__PURE__ */ new Set();
11396
+ trackedScopeIdFragments.set(frag, trackedScopeIds);
11397
+ } else if (trackedScopeIds.has(key)) return false;
11398
+ trackedScopeIds.add(key);
11399
+ return true;
11400
+ }
11401
+ function setInteropFragmentScopeIds(frag, scopeIds) {
11402
+ const vnode = frag.vnode;
11403
+ if (!vnode) return;
11404
+ const existing = vnode.slotScopeIds;
11405
+ if (!existing) {
11406
+ vnode.slotScopeIds = scopeIds;
11407
+ return;
11408
+ }
11409
+ for (let i = 0; i < scopeIds.length; i++) if (!existing.includes(scopeIds[i])) existing.push(scopeIds[i]);
11410
+ }
11411
+ function trackScopeIdsInBlock(block, scopeIds) {
11412
+ if (isVaporComponent(block)) trackScopeIdsInBlock(block.block, scopeIds);
11413
+ else if (isArray(block)) for (const b of block) trackScopeIdsInBlock(b, scopeIds);
11414
+ else if (isFragment(block)) trackScopeIdFragment(block, scopeIds);
11415
+ }
11416
+ const trackedInheritedScopeIdFragments = /* @__PURE__ */ new WeakMap();
11417
+ function trackInheritedScopeIdFragment(instance, frag) {
11418
+ let trackedInstances = trackedInheritedScopeIdFragments.get(frag);
11419
+ if (!trackedInstances) {
11420
+ trackedInstances = /* @__PURE__ */ new WeakSet();
11421
+ trackedInheritedScopeIdFragments.set(frag, trackedInstances);
11422
+ } else if (trackedInstances.has(instance)) return;
11423
+ trackedInstances.add(instance);
11424
+ (frag.onUpdated || (frag.onUpdated = [])).push(() => applyInheritedScopeIdToRoot(instance));
11425
+ }
11426
+ function applyInheritedScopeIdToRoot(instance) {
11427
+ const { scopeId } = instance;
11428
+ if (!scopeId) return;
11429
+ const root = getRootElement(instance, (frag) => trackInheritedScopeIdFragment(instance, frag));
11430
+ if (root) root.setAttribute(scopeId, "");
11431
+ return root;
11432
+ }
11433
+ function trackComponentScopeId(instance) {
11434
+ const { parent, scopeId } = instance;
11435
+ if (!parent || !scopeId) return;
11436
+ getRootElement(instance, (frag) => trackInheritedScopeIdFragment(instance, frag));
11338
11437
  }
11339
11438
  function setComponentScopeId(instance) {
11340
11439
  const { parent, scopeId } = instance;
11341
11440
  if (!parent || !scopeId) return;
11342
- if (isArray(instance.block) && instance.block.length > 1) return;
11343
- const scopeIds = [];
11344
- const parentScopeId = parent && parent.type.__scopeId;
11345
- if (parentScopeId !== scopeId) scopeIds.push(scopeId);
11346
- else if (parentScopeId) scopeIds.push(parentScopeId);
11347
- if (isInteropEnabled && parent.subTree && parent.subTree.component === instance && parent.vnode.scopeId) {
11348
- scopeIds.push(parent.vnode.scopeId);
11441
+ const root = applyInheritedScopeIdToRoot(instance);
11442
+ if (isInteropEnabled && root && parent.subTree && parent.subTree.component === instance && parent.vnode.scopeId) {
11443
+ root.setAttribute(parent.vnode.scopeId, "");
11349
11444
  const inheritedScopeIds = getInheritedScopeIds(parent.vnode, parent.parent);
11350
- scopeIds.push(...inheritedScopeIds);
11445
+ for (let i = 0; i < inheritedScopeIds.length; i++) root.setAttribute(inheritedScopeIds[i], "");
11351
11446
  }
11352
- if (scopeIds.length > 0) setScopeId(instance.block, scopeIds);
11447
+ }
11448
+ function getCurrentScopeId() {
11449
+ const scopeOwner = getScopeOwner();
11450
+ return scopeOwner ? scopeOwner.type.__scopeId : void 0;
11353
11451
  }
11354
11452
  //#endregion
11355
11453
  //#region packages/runtime-vapor/src/componentSlots.ts
@@ -11378,6 +11476,36 @@ function setCurrentSlotScopeIds(scopeIds) {
11378
11476
  currentSlotScopeIds = scopeIds;
11379
11477
  }
11380
11478
  }
11479
+ const rawSlotsOwnerMap = /* @__PURE__ */ new WeakMap();
11480
+ const rawSlotWrappersCache = /* @__PURE__ */ new WeakMap();
11481
+ function normalizeRawSlots(rawSlots) {
11482
+ if (!rawSlots) return rawSlots;
11483
+ const normalized = isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
11484
+ if (!rawSlotsOwnerMap.has(normalized)) rawSlotsOwnerMap.set(normalized, getScopeOwner());
11485
+ return normalized;
11486
+ }
11487
+ function withSlotOwner(slots, fn) {
11488
+ if (!rawSlotsOwnerMap.has(slots)) return fn();
11489
+ const prevOwner = setCurrentSlotOwner(rawSlotsOwnerMap.get(slots) || null);
11490
+ try {
11491
+ return fn();
11492
+ } finally {
11493
+ setCurrentSlotOwner(prevOwner);
11494
+ }
11495
+ }
11496
+ function getOwnedSlot(slots, key, slot) {
11497
+ if (!rawSlotsOwnerMap.has(slots)) return slot;
11498
+ let wrappers = rawSlotWrappersCache.get(slots);
11499
+ if (!wrappers) rawSlotWrappersCache.set(slots, wrappers = /* @__PURE__ */ new Map());
11500
+ const cached = wrappers.get(key);
11501
+ if (cached && cached.slot === slot) return cached.wrapped;
11502
+ const wrapped = ((...args) => withSlotOwner(slots, () => slot(...args)));
11503
+ wrappers.set(key, {
11504
+ slot,
11505
+ wrapped
11506
+ });
11507
+ return wrapped;
11508
+ }
11381
11509
  const dynamicSlotsProxyHandlers = {
11382
11510
  get: getSlot,
11383
11511
  has: (target, key) => !!getSlot(target, key),
@@ -11390,17 +11518,14 @@ const dynamicSlotsProxyHandlers = {
11390
11518
  };
11391
11519
  },
11392
11520
  ownKeys(target) {
11393
- let keys = Object.keys(target);
11521
+ const keys = new Set(Object.keys(target).filter((k) => k !== "$"));
11394
11522
  const dynamicSources = target.$;
11395
- if (dynamicSources) {
11396
- keys = keys.filter((k) => k !== "$");
11397
- for (const source of dynamicSources) if (isFunction(source)) {
11398
- const slot = resolveFunctionSource(source);
11399
- if (slot) if (isArray(slot)) for (const s of slot) keys.push(String(s.name));
11400
- else keys.push(String(slot.name));
11401
- } else keys.push(...Object.keys(source));
11402
- }
11403
- return keys;
11523
+ if (dynamicSources) for (const source of dynamicSources) if (isFunction(source)) {
11524
+ const slot = withSlotOwner(target, () => resolveFunctionSource(source));
11525
+ if (slot) if (isArray(slot)) for (const s of slot) keys.add(String(s.name));
11526
+ else keys.add(String(slot.name));
11527
+ } else for (const key of Object.keys(source)) keys.add(key);
11528
+ return [...keys];
11404
11529
  },
11405
11530
  set: NO,
11406
11531
  deleteProperty: NO
@@ -11414,16 +11539,16 @@ function getSlot(target, key) {
11414
11539
  while (i--) {
11415
11540
  source = dynamicSources[i];
11416
11541
  if (isFunction(source)) {
11417
- const slot = resolveFunctionSource(source);
11542
+ const slot = withSlotOwner(target, () => resolveFunctionSource(source));
11418
11543
  if (slot) {
11419
11544
  if (isArray(slot)) {
11420
- for (let j = slot.length - 1; j >= 0; j--) if (String(slot[j].name) === key) return slot[j].fn;
11421
- } else if (String(slot.name) === key) return slot.fn;
11545
+ for (let j = slot.length - 1; j >= 0; j--) if (String(slot[j].name) === key) return getOwnedSlot(target, key, slot[j].fn);
11546
+ } else if (String(slot.name) === key) return getOwnedSlot(target, key, slot.fn);
11422
11547
  }
11423
- } else if (hasOwn(source, key)) return source[key];
11548
+ } else if (hasOwn(source, key)) return getOwnedSlot(target, key, source[key]);
11424
11549
  }
11425
11550
  }
11426
- if (hasOwn(target, key)) return target[key];
11551
+ if (hasOwn(target, key)) return getOwnedSlot(target, key, target[key]);
11427
11552
  }
11428
11553
  /**
11429
11554
  * Tracks the slot owner (the component that defines the slot content).
@@ -11446,24 +11571,6 @@ function setCurrentSlotOwner(owner) {
11446
11571
  function getScopeOwner() {
11447
11572
  return currentSlotOwner || currentInstance;
11448
11573
  }
11449
- /**
11450
- * Wrap a slot function to track the slot owner.
11451
- *
11452
- * This ensures:
11453
- * 1. createSlot gets rawSlots from the correct instance (slot owner)
11454
- * 2. elements inherit the slot owner's scopeId
11455
- */
11456
- function withVaporCtx(fn) {
11457
- const owner = getScopeOwner();
11458
- return (...args) => {
11459
- const prevOwner = setCurrentSlotOwner(owner);
11460
- try {
11461
- return fn(...args);
11462
- } finally {
11463
- setCurrentSlotOwner(prevOwner);
11464
- }
11465
- };
11466
- }
11467
11574
  function createSlot(name = "default", rawProps, fallback, flags = 0) {
11468
11575
  if (isInteropEnabled && isCollectingVdomSlotVNodes) return;
11469
11576
  const _insertionParent = insertionParent;
@@ -11475,6 +11582,7 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
11475
11582
  const scopeId = !(flags & 1) && instance.type.__scopeId;
11476
11583
  const slotScopeIds = scopeId ? [`${scopeId}-s`] : null;
11477
11584
  const once = !!(flags & 2);
11585
+ const slotRoot = !!(flags & 4);
11478
11586
  const slotProps = rawProps ? new Proxy(once ? snapshotRawProps(rawProps) : rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
11479
11587
  if (once && fallback) {
11480
11588
  const originalFallback = fallback;
@@ -11483,15 +11591,24 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
11483
11591
  let fragment;
11484
11592
  if (/* @__PURE__ */ isRef(rawSlots._) && isInteropEnabled) {
11485
11593
  if (isHydrating$1) hydrationCursor = enterHydrationCursor();
11486
- fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once);
11594
+ fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once, slotRoot);
11487
11595
  } else {
11488
11596
  if (isHydrating$1) hydrationCursor = captureHydrationCursor();
11489
- const slotFragment = fragment = new SlotFragment();
11490
- slotFragment.forwarded = currentSlotOwner != null && currentSlotOwner !== currentInstance;
11597
+ const isCustomElementSlot = !!(instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce);
11598
+ const slotFragment = isHydrating$1 || !!fallback || !!getCurrentSlotBoundary() || isCustomElementSlot ? new SlotFragment(slotRoot) : void 0;
11599
+ let dynamicFragment;
11600
+ if (slotFragment) {
11601
+ fragment = slotFragment;
11602
+ if (isHydrating$1) slotFragment.forwarded = currentSlotOwner != null && currentSlotOwner !== currentInstance;
11603
+ } else {
11604
+ dynamicFragment = new DynamicFragment("slot", false, false);
11605
+ dynamicFragment.isSlot = true;
11606
+ fragment = dynamicFragment;
11607
+ }
11491
11608
  const isDynamicName = isFunction(name);
11492
11609
  const renderSlot = () => {
11493
11610
  const slotName = isFunction(name) ? name() : name;
11494
- if (instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce) {
11611
+ if (isCustomElementSlot) {
11495
11612
  const el = /* @__PURE__ */ createElement("slot");
11496
11613
  const setSlotProps = () => {
11497
11614
  setDynamicProps(el, [slotProps, slotName !== "default" ? { name: slotName } : {}]);
@@ -11507,8 +11624,10 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
11507
11624
  return;
11508
11625
  }
11509
11626
  const slot = getSlot(rawSlots, slotName);
11510
- if (slot) slotFragment.updateSlot(getBoundSlot(slot), fallback);
11511
- else slotFragment.updateSlot(void 0, fallback);
11627
+ if (slot) if (slotFragment) slotFragment.updateSlot(getBoundSlot(slot), fallback);
11628
+ else dynamicFragment.update(getBoundSlot(slot));
11629
+ else if (slotFragment) slotFragment.updateSlot(void 0, fallback);
11630
+ else dynamicFragment.update();
11512
11631
  };
11513
11632
  let cachedSlot;
11514
11633
  let cachedBoundSlot;
@@ -11533,7 +11652,8 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
11533
11652
  if (slotScopeIds) setScopeId(fragment, slotScopeIds);
11534
11653
  if (_insertionParent) insert(fragment, _insertionParent, _insertionAnchor);
11535
11654
  } else {
11536
- if (fragment.insert) fragment.hydrate();
11655
+ if (isInteropEnabled && isInteropFragment(fragment)) fragment.hydrate();
11656
+ if (slotScopeIds) trackScopeIdFragment(fragment, slotScopeIds);
11537
11657
  exitHydrationCursor(hydrationCursor);
11538
11658
  }
11539
11659
  return fragment;
@@ -11598,7 +11718,7 @@ function isVaporTransition(component) {
11598
11718
  }
11599
11719
  //#endregion
11600
11720
  //#region packages/runtime-vapor/src/fragment.ts
11601
- const EMPTY_BLOCK = EMPTY_ARR;
11721
+ const EMPTY_BLOCK$1 = EMPTY_ARR;
11602
11722
  var VaporFragment = class {
11603
11723
  constructor(nodes) {
11604
11724
  this.renderInstance = currentInstance;
@@ -11609,30 +11729,32 @@ var VaporFragment = class {
11609
11729
  }
11610
11730
  runWithRenderCtx(fn, scope) {
11611
11731
  const prevInstance = setCurrentInstance(this.renderInstance, scope);
11612
- const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx || null : null;
11613
- if (currentSlotOwner === this.slotOwner && currentSlotBoundary === this.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) try {
11614
- return fn();
11615
- } finally {
11616
- setCurrentInstance(...prevInstance);
11617
- }
11618
- const prevSlotOwner = setCurrentSlotOwner(this.slotOwner);
11619
- let prevKeepAliveCtx = null;
11620
- if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
11621
- const prevBoundary = setCurrentSlotBoundary(this.inheritedSlotBoundary);
11622
11732
  try {
11623
- return fn();
11733
+ return runWithFragmentCtx(this, fn);
11624
11734
  } finally {
11625
- setCurrentSlotBoundary(prevBoundary);
11626
- if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
11627
- setCurrentSlotOwner(prevSlotOwner);
11628
11735
  setCurrentInstance(...prevInstance);
11629
11736
  }
11630
11737
  }
11631
11738
  };
11739
+ function runWithFragmentCtx(fragment, fn) {
11740
+ const keepAliveCtx = isKeepAliveEnabled ? fragment.keepAliveCtx || null : null;
11741
+ if (currentSlotOwner === fragment.slotOwner && currentSlotBoundary === fragment.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) return fn();
11742
+ const prevSlotOwner = setCurrentSlotOwner(fragment.slotOwner);
11743
+ let prevKeepAliveCtx = null;
11744
+ if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
11745
+ const prevBoundary = setCurrentSlotBoundary(fragment.inheritedSlotBoundary);
11746
+ try {
11747
+ return fn();
11748
+ } finally {
11749
+ setCurrentSlotBoundary(prevBoundary);
11750
+ if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
11751
+ setCurrentSlotOwner(prevSlotOwner);
11752
+ }
11753
+ }
11632
11754
  var ForFragment = class extends VaporFragment {
11633
- constructor(nodes) {
11755
+ constructor(nodes, trackSlotBoundary) {
11634
11756
  super(nodes);
11635
- trackSlotBoundaryDirtying(this);
11757
+ if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
11636
11758
  }
11637
11759
  onReset(fn) {
11638
11760
  (this.resetListeners || (this.resetListeners = [])).push(fn);
@@ -11664,8 +11786,8 @@ function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
11664
11786
  });
11665
11787
  }
11666
11788
  var DynamicFragment = class extends VaporFragment {
11667
- constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary = true) {
11668
- super(EMPTY_BLOCK);
11789
+ constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary = false) {
11790
+ super(EMPTY_BLOCK$1);
11669
11791
  if (keyed) this.keyed = true;
11670
11792
  if (isTransitionEnabled && currentInstance && isVaporTransition(currentInstance.type)) this.inTransition = true;
11671
11793
  if (isHydrating$1) {
@@ -11677,12 +11799,17 @@ var DynamicFragment = class extends VaporFragment {
11677
11799
  }
11678
11800
  if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
11679
11801
  }
11680
- update(render, key = render, noScope = false) {
11802
+ update(render, key = render, noScope = false, shouldInsert = true) {
11681
11803
  if (key === this.current) {
11682
- if (isHydrating$1 && this.anchorLabel !== "slot") this.hydrate(true);
11804
+ if (isHydrating$1 && !this.isSlot) this.hydrate(true);
11683
11805
  return;
11684
11806
  }
11685
11807
  const transition = isTransitionEnabled ? this.$transition : void 0;
11808
+ const wasMounted = this.current !== void 0;
11809
+ if (wasMounted) {
11810
+ const onBeforeUpdate = this.onBeforeUpdate;
11811
+ if (onBeforeUpdate) for (let i = 0; i < onBeforeUpdate.length; i++) onBeforeUpdate[i]();
11812
+ }
11686
11813
  if (transition && transition.state.isLeaving) {
11687
11814
  this.current = key;
11688
11815
  const pending = this.pending;
@@ -11699,8 +11826,8 @@ var DynamicFragment = class extends VaporFragment {
11699
11826
  }
11700
11827
  const instance = currentInstance;
11701
11828
  const prevSub = setActiveSub();
11702
- const parent = isHydrating$1 ? null : this.anchor.parentNode;
11703
- if (this.current !== void 0) {
11829
+ const parent = !isHydrating$1 && shouldInsert ? this.anchor.parentNode : null;
11830
+ if (wasMounted) {
11704
11831
  const scope = this.scope;
11705
11832
  if (scope) {
11706
11833
  let retainScope = false;
@@ -11716,8 +11843,8 @@ var DynamicFragment = class extends VaporFragment {
11716
11843
  const pending = this.pending;
11717
11844
  if (pending) {
11718
11845
  this.pending = void 0;
11719
- this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope);
11720
- } else this.renderBranch(render, transition, parent, key, noScope);
11846
+ this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope, true);
11847
+ } else this.renderBranch(render, transition, parent, key, noScope, true);
11721
11848
  } finally {
11722
11849
  setCurrentInstance(...prevInstance);
11723
11850
  }
@@ -11731,7 +11858,7 @@ var DynamicFragment = class extends VaporFragment {
11731
11858
  }
11732
11859
  let reusingDeferredAnchor = false;
11733
11860
  if (isHydrating$1) {
11734
- const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && this.anchorLabel !== "slot" && !isValidBlock(this.nodes);
11861
+ const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && !this.isSlot && !isValidBlock(this.nodes);
11735
11862
  reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
11736
11863
  if (isRevivingDeferredBranch) {
11737
11864
  let slotEndAnchor = null;
@@ -11739,11 +11866,11 @@ var DynamicFragment = class extends VaporFragment {
11739
11866
  if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
11740
11867
  }
11741
11868
  }
11742
- this.renderBranch(render, transition, parent, key, noScope);
11869
+ this.renderBranch(render, transition, parent, key, noScope, wasMounted || !!parent);
11743
11870
  setActiveSub(prevSub);
11744
- if (isHydrating$1 && this.anchorLabel !== "slot" && !reusingDeferredAnchor) this.hydrate(render == null);
11871
+ if (isHydrating$1 && !this.isSlot && !reusingDeferredAnchor) this.hydrate(render == null);
11745
11872
  }
11746
- renderBranch(render, transition, parent, key, noScope = false) {
11873
+ renderBranch(render, transition, parent, key, noScope = false, notifyUpdated = !!parent) {
11747
11874
  this.current = key;
11748
11875
  if (render) {
11749
11876
  const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx : null;
@@ -11755,7 +11882,7 @@ var DynamicFragment = class extends VaporFragment {
11755
11882
  } else this.scope = void 0;
11756
11883
  const renderBranch = () => {
11757
11884
  try {
11758
- this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK, this.scope);
11885
+ this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK$1, this.scope);
11759
11886
  } finally {
11760
11887
  const key = this.keyed ? this.current : this.$key;
11761
11888
  if (key !== void 0 && (transition || this.inTransition || keepAliveCtx)) setBlockKey(this.nodes, key);
@@ -11772,14 +11899,12 @@ var DynamicFragment = class extends VaporFragment {
11772
11899
  }
11773
11900
  } else {
11774
11901
  this.scope = void 0;
11775
- this.nodes = EMPTY_BLOCK;
11776
- }
11777
- if (parent) {
11778
- const onUpdated = this.onUpdated;
11779
- if (onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
11902
+ this.nodes = EMPTY_BLOCK$1;
11780
11903
  }
11904
+ const onUpdated = this.onUpdated;
11905
+ if (notifyUpdated && onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
11781
11906
  }
11782
- hydrate(isEmpty = false, isSlot = false) {
11907
+ hydrate(isEmpty = false) {
11783
11908
  if (!isHydrating$1) return;
11784
11909
  let advanceAfterRestore = null;
11785
11910
  let exitHydrationBoundary;
@@ -11814,12 +11939,12 @@ var DynamicFragment = class extends VaporFragment {
11814
11939
  return;
11815
11940
  }
11816
11941
  }
11817
- if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
11942
+ if (!this.isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
11818
11943
  const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
11819
11944
  const anchor = nextLogicalSibling(currentHydrationNode);
11820
11945
  const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
11821
11946
  if (parentNode$4) {
11822
- this.nodes = EMPTY_BLOCK;
11947
+ this.nodes = EMPTY_BLOCK$1;
11823
11948
  if (reusableAnchor) reuseAnchor(reusableAnchor);
11824
11949
  else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
11825
11950
  return;
@@ -11828,7 +11953,7 @@ var DynamicFragment = class extends VaporFragment {
11828
11953
  }
11829
11954
  if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
11830
11955
  const anchor = this.nodes;
11831
- this.nodes = EMPTY_BLOCK;
11956
+ this.nodes = EMPTY_BLOCK$1;
11832
11957
  reuseAnchor(anchor);
11833
11958
  return;
11834
11959
  }
@@ -11836,15 +11961,15 @@ var DynamicFragment = class extends VaporFragment {
11836
11961
  const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
11837
11962
  const nextNode = nextLogicalSibling(currentHydrationNode);
11838
11963
  if (parentNode$5) {
11839
- this.nodes = EMPTY_BLOCK;
11964
+ this.nodes = EMPTY_BLOCK$1;
11840
11965
  cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
11841
11966
  return;
11842
11967
  }
11843
11968
  }
11844
11969
  const currentSlotEndAnchor = getCurrentSlotEndAnchor();
11845
- const forwardedSlot = isSlot ? this.forwarded : false;
11846
- const slotAnchor = isSlot ? currentSlotEndAnchor : null;
11847
- const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
11970
+ const forwardedSlot = this.isSlot ? this.forwarded : false;
11971
+ const slotAnchor = this.isSlot ? currentSlotEndAnchor : null;
11972
+ const closeOwner = getDynamicCloseOwner(!!this.isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
11848
11973
  if (closeOwner === 1) {
11849
11974
  const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
11850
11975
  if (isComment(anchor, "]")) {
@@ -11870,7 +11995,7 @@ var DynamicFragment = class extends VaporFragment {
11870
11995
  parentNode$3 = currentSlotEndAnchor.parentNode;
11871
11996
  nextNode = currentSlotEndAnchor;
11872
11997
  } else {
11873
- const node = findBlockNode(this.nodes);
11998
+ const node = findBlockBoundary(this.nodes);
11874
11999
  parentNode$3 = node.parentNode;
11875
12000
  nextNode = node.nextNode;
11876
12001
  }
@@ -11914,58 +12039,14 @@ function getRedirectedBoundary(boundary) {
11914
12039
  function trackSlotBoundaryDirtying(fragment) {
11915
12040
  const boundary = currentSlotBoundary;
11916
12041
  if (!boundary) return;
11917
- (fragment.onUpdated || (fragment.onUpdated = [])).push(() => boundary.markDirty());
11918
- }
11919
- function walkSlotFallbackBlock(block, node, fragment) {
11920
- if (block instanceof Node) return node(block);
11921
- if (isVaporComponent(block)) return walkSlotFallbackBlock(block.block, node, fragment);
11922
- if (isArray(block)) {
11923
- for (const child of block) if (walkSlotFallbackBlock(child, node, fragment)) return true;
11924
- return false;
11925
- }
11926
- return fragment(block, (block) => walkSlotFallbackBlock(block, node, fragment));
11927
- }
11928
- function resolveSlotFallbackCarrierOwner(block) {
11929
- let owner = null;
11930
- walkSlotFallbackBlock(block, () => false, (block) => {
11931
- owner = block;
11932
- return true;
12042
+ let prevValid = isValidBlock(fragment);
12043
+ (fragment.onBeforeUpdate || (fragment.onBeforeUpdate = [])).push(() => {
12044
+ prevValid = isValidBlock(fragment);
11933
12045
  });
11934
- return owner;
11935
- }
11936
- function findFirstSlotFallbackCarrierNode(block) {
11937
- let node = null;
11938
- walkSlotFallbackBlock(block, (value) => {
11939
- node = value;
11940
- return true;
11941
- }, (block, walk) => {
11942
- if (walk(block.nodes)) return true;
11943
- if (block.anchor) {
11944
- node = block.anchor;
11945
- return true;
11946
- }
11947
- return false;
11948
- });
11949
- return node;
11950
- }
11951
- function collectBlockNodes(block, nodes = [], includeComments = false) {
11952
- walkSlotFallbackBlock(block, (block) => {
11953
- if (includeComments || !(block instanceof Comment)) nodes.push(block);
11954
- return false;
11955
- }, (block) => {
11956
- collectBlockNodes(block.nodes, nodes, true);
11957
- if (block.anchor) nodes.push(block.anchor);
11958
- return false;
11959
- });
11960
- return nodes;
11961
- }
11962
- function mutateSlotFallbackCarrier(block, apply) {
11963
- walkSlotFallbackBlock(block, (block) => {
11964
- if (!(block instanceof Comment)) apply(block);
11965
- return false;
11966
- }, (block) => {
11967
- apply(block);
11968
- return false;
12046
+ (fragment.onUpdated || (fragment.onUpdated = [])).push(() => {
12047
+ const valid = isValidBlock(fragment);
12048
+ if (valid !== prevValid) boundary.markDirty();
12049
+ prevValid = valid;
11969
12050
  });
11970
12051
  }
11971
12052
  function hasSlotFallback(boundary) {
@@ -11975,161 +12056,145 @@ function hasSlotFallback(boundary) {
11975
12056
  }
11976
12057
  return false;
11977
12058
  }
11978
- function renderSlotFallback(boundary, scope, ...args) {
11979
- const [block, hasFallback] = renderSlotFallbackBlock(boundary || null, scope, args);
11980
- return hasFallback ? block : void 0;
11981
- }
11982
- function renderSlotFallbackBlock(boundary, scope, args) {
11983
- if (!boundary) return [[], false];
12059
+ function renderSlotFallback(boundary, scope) {
12060
+ if (!boundary) return;
11984
12061
  const localFallback = boundary.getFallback();
11985
- if (!localFallback) return renderSlotFallbackBlock(boundary.parent, scope, args);
11986
- const renderFallback = () => withOwnedSlotBoundary(getRedirectedBoundary(boundary), () => localFallback(...args));
11987
- const local = boundary.run(() => (scope ? scope.run(renderFallback) : renderFallback()) || [], scope);
11988
- if (isValidBlock(local)) return [local, true];
11989
- const [inherited] = renderSlotFallbackBlock(boundary.parent, scope, args);
11990
- return [resolveSlotFallbackCarrierOwner(local) ? [inherited, local] : inherited, true];
11991
- }
11992
- function getSlotEffectiveOutput(outlet) {
11993
- return outlet.activeFallback || outlet.getContent();
11994
- }
11995
- function isSlotFallbackContentValid(outlet) {
11996
- return outlet.isContentValid ? outlet.isContentValid() : isValidBlock(outlet.getContent());
11997
- }
11998
- function markSlotFallbackDirty(outlet) {
11999
- if (outlet.isDisposed && outlet.isDisposed()) return;
12000
- if (outlet.isRenderingFallback) {
12001
- if (isHydrating$1) outlet.pendingRecheck = true;
12062
+ if (!localFallback) return renderSlotFallback(boundary.parent, scope);
12063
+ const renderFallback = () => withOwnedSlotBoundary(getRedirectedBoundary(boundary), () => localFallback());
12064
+ const local = boundary.run(() => scope.run(renderFallback) || [], scope);
12065
+ if (isValidBlock(local)) return local;
12066
+ const inherited = renderSlotFallback(boundary.parent, scope);
12067
+ return inherited === void 0 ? local : inherited;
12068
+ }
12069
+ function detachBlock(block, parent) {
12070
+ if (block instanceof Node) {
12071
+ if (block.parentNode === parent) removeNode(block, parent);
12072
+ } else if (isVaporComponent(block)) {
12073
+ if (block.block) detachBlock(block.block, parent);
12074
+ } else if (isArray(block)) for (let i = 0; i < block.length; i++) detachBlock(block[i], parent);
12075
+ else {
12076
+ detachBlock(block.nodes, parent);
12077
+ if (!(block instanceof SlotFragment) && block.anchor && block.anchor.parentNode === parent) removeNode(block.anchor, parent);
12078
+ }
12079
+ }
12080
+ function markSlotFallbackDirty(state) {
12081
+ if (state.isDisposed()) return;
12082
+ if (state.isRenderingFallback) {
12083
+ state.pendingRecheck = true;
12002
12084
  return;
12003
12085
  }
12004
- if (outlet.isBusy && outlet.isBusy()) {
12005
- outlet.pendingRecheck = true;
12086
+ if (state.isBusy()) {
12087
+ state.pendingRecheck = true;
12006
12088
  return;
12007
12089
  }
12008
- recheckSlotFallback(outlet, true);
12090
+ recheckSlotFallback(state, true);
12009
12091
  }
12010
- function clearSlotFallback(outlet) {
12011
- if (outlet.activeFallback) {
12012
- const parentNode = outlet.getParentNode();
12013
- if (parentNode) remove(outlet.activeFallback, parentNode);
12014
- outlet.activeFallback = null;
12092
+ function clearSlotFallback(state) {
12093
+ const fallback = state.activeFallback;
12094
+ if (fallback) {
12095
+ const parentNode = state.getParentNode();
12096
+ if (parentNode) remove(fallback, parentNode);
12097
+ state.activeFallback = null;
12015
12098
  }
12016
- if (outlet.fallbackScope) {
12017
- outlet.fallbackScope.stop();
12018
- outlet.fallbackScope = void 0;
12099
+ if (state.fallbackScope) {
12100
+ state.fallbackScope.stop();
12101
+ state.fallbackScope = void 0;
12019
12102
  }
12020
12103
  }
12021
- function renderSlotFallbackForOutlet(outlet) {
12022
- const scope = new EffectScope();
12104
+ function renderSlotFallbackState(state) {
12105
+ const scope = new EffectScope(true);
12023
12106
  let renderedFallback;
12024
- outlet.isRenderingFallback = true;
12107
+ state.isRenderingFallback = true;
12025
12108
  try {
12026
- renderedFallback = renderSlotFallback(outlet.boundary, scope) || void 0;
12109
+ renderedFallback = renderSlotFallback(state.boundary, scope);
12027
12110
  } catch (err) {
12028
12111
  scope.stop();
12029
12112
  throw err;
12030
12113
  } finally {
12031
- outlet.isRenderingFallback = false;
12114
+ state.isRenderingFallback = false;
12032
12115
  }
12033
12116
  if (!renderedFallback) {
12034
12117
  scope.stop();
12035
- return { found: false };
12118
+ return;
12036
12119
  }
12037
12120
  return {
12038
- found: true,
12039
12121
  block: renderedFallback,
12040
12122
  scope
12041
12123
  };
12042
12124
  }
12043
- function syncSlotFallbackOrder(outlet, block) {
12044
- if (!isFragment(block) || !isArray(block.nodes) || block.nodes.length < 2) return;
12045
- const carrierNodes = collectBlockNodes(outlet.getContent(), [], true);
12046
- const fallbackNodes = collectBlockNodes(block, [], true);
12047
- const lastNode = fallbackNodes[fallbackNodes.length - 1];
12048
- if (!carrierNodes.length || !lastNode) return;
12049
- const parentNode = carrierNodes[0].parentNode;
12050
- if (!parentNode || lastNode.parentNode !== parentNode) return;
12051
- let inOrder = true;
12052
- let nextNode = lastNode.nextSibling;
12053
- for (const carrierNode of carrierNodes) {
12054
- if (carrierNode.parentNode !== parentNode) return;
12055
- if (carrierNode !== nextNode) {
12056
- inOrder = false;
12057
- break;
12058
- }
12059
- nextNode = carrierNode.nextSibling;
12060
- }
12061
- if (inOrder) return;
12062
- let anchor = lastNode.nextSibling;
12063
- for (let i = carrierNodes.length - 1; i >= 0; i--) {
12064
- const carrierNode = carrierNodes[i];
12065
- parentNode.insertBefore(carrierNode, anchor);
12066
- anchor = carrierNode;
12067
- }
12068
- }
12069
- function ensureSlotFallbackOrderHook(outlet, block) {
12070
- if (!isFragment(block)) return;
12071
- const fragment = block;
12072
- if (fragment.hasSlotFallbackOrderHook) return;
12073
- (fragment.onUpdated || (fragment.onUpdated = [])).push(() => syncSlotFallbackOrder(outlet, fragment));
12074
- fragment.hasSlotFallbackOrderHook = true;
12075
- }
12076
- function insertActiveSlotFallback(outlet) {
12077
- if (isHydrating$1 || !outlet.activeFallback) return;
12078
- const parentNode = outlet.getParentNode();
12125
+ function insertActiveSlotFallback(state) {
12126
+ const fallback = state.activeFallback;
12127
+ if (isHydrating$1 || !fallback || !isValidBlock(fallback)) return;
12128
+ const parentNode = state.getParentNode();
12079
12129
  if (!parentNode) return;
12080
- const carrierAnchor = findFirstSlotFallbackCarrierNode(outlet.getContent());
12081
- insert(outlet.activeFallback, parentNode, carrierAnchor && carrierAnchor.parentNode === parentNode ? carrierAnchor : outlet.getAnchor());
12130
+ insert(fallback, parentNode, state.getAnchor());
12082
12131
  }
12083
- function commitSlotFallback(outlet, block, scope) {
12084
- outlet.activeFallback = block;
12085
- outlet.fallbackScope = scope;
12086
- ensureSlotFallbackOrderHook(outlet, block);
12132
+ function commitSlotFallback(state, block, scope, detachContent) {
12133
+ const parentNode = state.getParentNode();
12134
+ if (detachContent && !isHydrating$1 && parentNode) detachBlock(state.getContent(), parentNode);
12135
+ state.activeFallback = block;
12136
+ state.fallbackScope = scope;
12087
12137
  if (isTransitionEnabled) {
12088
- const transitionOutlet = outlet;
12089
- if (transitionOutlet.$transition) {
12138
+ const transitionState = state;
12139
+ if (transitionState.$transition) {
12090
12140
  setBlockKey(block, "_fb");
12091
- transitionOutlet.$transition = applyTransitionHooks(block, transitionOutlet.$transition);
12141
+ transitionState.$transition = applyTransitionHooks(block, transitionState.$transition);
12092
12142
  }
12093
12143
  }
12094
- insertActiveSlotFallback(outlet);
12144
+ insertActiveSlotFallback(state);
12095
12145
  }
12096
- function syncActiveSlotFallback(outlet) {
12097
- if (!outlet.activeFallback) return;
12098
- const activeFallback = outlet.activeFallback;
12099
- queuePostFlushCb(() => {
12100
- syncSlotFallbackOrder(outlet, activeFallback);
12101
- });
12146
+ function renderAndCommitSlotFallback(state, hadFallback) {
12147
+ const result = renderSlotFallbackState(state);
12148
+ clearSlotFallback(state);
12149
+ if (result) {
12150
+ commitSlotFallback(state, result.block, result.scope, !hadFallback);
12151
+ if (state.pendingRecheck) {
12152
+ state.pendingRecheck = false;
12153
+ recheckSlotFallback(state, true);
12154
+ }
12155
+ }
12102
12156
  }
12103
- function disposeSlotFallback(outlet) {
12104
- clearSlotFallback(outlet);
12105
- outlet.pendingRecheck = false;
12106
- outlet.lastEffectiveValid = void 0;
12157
+ function disposeSlotFallback(state) {
12158
+ clearSlotFallback(state);
12159
+ state.pendingRecheck = false;
12160
+ state.lastNodesValid = void 0;
12107
12161
  }
12108
- function recheckSlotFallback(outlet, force = false) {
12109
- if (outlet.isRenderingFallback) {
12110
- outlet.pendingRecheck = true;
12162
+ function recheckSlotFallback(state, force = false) {
12163
+ if (state.isRenderingFallback) {
12164
+ state.pendingRecheck = true;
12111
12165
  return;
12112
12166
  }
12113
- const prevValid = outlet.lastEffectiveValid === void 0 ? outlet.activeFallback ? isValidBlock(outlet.activeFallback) : isSlotFallbackContentValid(outlet) : outlet.lastEffectiveValid;
12114
- if (isSlotFallbackContentValid(outlet)) clearSlotFallback(outlet);
12115
- else {
12116
- if (force) clearSlotFallback(outlet);
12117
- if (outlet.activeFallback) insertActiveSlotFallback(outlet);
12118
- else {
12119
- const result = renderSlotFallbackForOutlet(outlet);
12120
- if (result.found) {
12121
- commitSlotFallback(outlet, result.block, result.scope);
12122
- if (outlet.pendingRecheck && outlet.rerunRecheckAfterFallbackRender !== false) {
12123
- outlet.pendingRecheck = false;
12124
- recheckSlotFallback(outlet, true);
12125
- }
12126
- } else clearSlotFallback(outlet);
12127
- }
12167
+ const fallback = state.activeFallback;
12168
+ const fallbackValid = fallback ? isValidBlock(fallback) : false;
12169
+ const contentValid = state.isContentValid();
12170
+ const prevNodesValid = state.lastNodesValid === void 0 ? fallback ? fallbackValid : contentValid : state.lastNodesValid;
12171
+ if (!force && contentValid && !fallback && prevNodesValid) {
12172
+ state.syncNodes();
12173
+ state.lastNodesValid = true;
12174
+ return;
12128
12175
  }
12129
- const nextValid = outlet.activeFallback ? isValidBlock(outlet.activeFallback) : isSlotFallbackContentValid(outlet);
12130
- if (outlet.syncEffectiveOutput) outlet.syncEffectiveOutput();
12131
- outlet.lastEffectiveValid = nextValid;
12132
- if (prevValid !== nextValid) outlet.notifyFallbackValidityChange();
12176
+ if (contentValid) {
12177
+ const content = state.getContent();
12178
+ const hadFallback = !!fallback;
12179
+ clearSlotFallback(state);
12180
+ if (!isHydrating$1 && hadFallback) {
12181
+ const parentNode = state.getParentNode();
12182
+ if (parentNode) insert(content, parentNode, state.getAnchor());
12183
+ }
12184
+ } else if (fallback) {
12185
+ if (prevNodesValid) {
12186
+ if (!fallbackValid && !hasSlotFallback(state.boundary.parent)) {
12187
+ const parentNode = state.getParentNode();
12188
+ if (parentNode) detachBlock(fallback, parentNode);
12189
+ } else if (force) renderAndCommitSlotFallback(state, true);
12190
+ } else if (fallbackValid) insertActiveSlotFallback(state);
12191
+ else if (force) renderAndCommitSlotFallback(state, true);
12192
+ } else renderAndCommitSlotFallback(state, false);
12193
+ const nextFallback = state.activeFallback;
12194
+ const nextNodesValid = nextFallback ? isValidBlock(nextFallback) : state.isContentValid();
12195
+ state.syncNodes();
12196
+ state.lastNodesValid = nextNodesValid;
12197
+ if (prevNodesValid !== nextNodesValid) state.notifyFallbackValidityChange();
12133
12198
  }
12134
12199
  let currentHydratingSlotBoundaryState = null;
12135
12200
  function setCurrentHydratingSlotBoundaryState(state) {
@@ -12184,16 +12249,18 @@ function isReusableDynamicFragmentAnchor(node, anchorLabel) {
12184
12249
  return isComment(node, anchorLabel) || isComment(node, "") && (anchorLabel === "dynamic-component" || anchorLabel === "async component" || anchorLabel === "keyed");
12185
12250
  }
12186
12251
  var SlotFragment = class extends DynamicFragment {
12187
- constructor() {
12252
+ constructor(notifyParent = false) {
12188
12253
  super("slot", false, false, false);
12254
+ this.isSlot = true;
12189
12255
  this.disposed = false;
12190
12256
  this.forwarded = false;
12191
12257
  this.parentSlotBoundary = getCurrentSlotBoundary();
12192
12258
  this.activeFallback = null;
12193
12259
  this.pendingRecheck = false;
12194
12260
  this.isRenderingFallback = false;
12195
- this.rerunRecheckAfterFallbackRender = false;
12261
+ this.content = EMPTY_BLOCK$1;
12196
12262
  this.isUpdatingSlot = false;
12263
+ this.notifyParent = notifyParent;
12197
12264
  if (!isHydrating$1) this.insert = (parent, anchor) => this.insertSlot(parent, anchor);
12198
12265
  this.remove = (parent) => this.removeSlot(parent);
12199
12266
  }
@@ -12218,55 +12285,46 @@ var SlotFragment = class extends DynamicFragment {
12218
12285
  get slotFallbackBoundary() {
12219
12286
  return this.ensureSlotFallbackBoundary();
12220
12287
  }
12221
- getEffectiveOutput() {
12222
- return getSlotEffectiveOutput(this);
12223
- }
12224
12288
  insertSlot(parent, anchor) {
12225
12289
  this.disposed = false;
12226
- if (this.fallbackBlock) {
12227
- insert(this.fallbackBlock, parent, anchor);
12228
- mutateSlotFallbackCarrier(this.nodes, (block) => insert(block, parent, anchor));
12229
- return;
12230
- }
12231
12290
  insert(this.nodes, parent, anchor);
12232
12291
  }
12233
12292
  removeSlot(parent) {
12234
12293
  this.disposed = true;
12235
- if (this.fallbackBlock) mutateSlotFallbackCarrier(this.nodes, (block) => remove(block, parent));
12236
- else remove(this.nodes, parent);
12294
+ const nodes = this.nodes;
12295
+ remove(nodes, parent);
12296
+ if (this.activeFallback === nodes) this.activeFallback = null;
12237
12297
  disposeSlotFallback(this);
12238
12298
  }
12299
+ updateContent(render, key) {
12300
+ this.nodes = this.content;
12301
+ this.update(render, key, false, !this.activeFallback);
12302
+ this.content = this.nodes;
12303
+ }
12239
12304
  updateSlot(render, fallback, key = render || fallback) {
12240
12305
  const prevLocalFallback = this.localFallback;
12241
12306
  this.localFallback = fallback;
12242
- const fallbackChanged = prevLocalFallback !== fallback;
12243
- const fastSlotKey = key === void 0 ? render : key;
12244
- if (!isHydrating$1 && !fallback && !this.parentSlotBoundary && !this._slotFallbackBoundary) {
12245
- this.update(render, fastSlotKey);
12246
- return;
12247
- }
12248
12307
  const boundary = this.slotFallbackBoundary;
12249
- const slotRender = render ? () => withOwnedSlotBoundary(boundary, render) : () => [];
12250
- const slotKey = key === void 0 ? slotRender : key;
12308
+ const slotRender = render ? () => withOwnedSlotBoundary(boundary, render) : () => EMPTY_BLOCK$1;
12251
12309
  this.isUpdatingSlot = true;
12252
12310
  this.pendingRecheck = false;
12253
12311
  try {
12254
- const shouldForce = fallbackChanged;
12312
+ const shouldForce = prevLocalFallback !== fallback;
12255
12313
  if (isHydrating$1) withHydratingSlotBoundary(() => {
12256
12314
  const prev = isHydratingSlotFallbackActive();
12257
12315
  try {
12258
12316
  if (hasSlotFallback(boundary)) setCurrentHydratingSlotFallbackActive(true);
12259
- this.update(slotRender, slotKey);
12260
- const contentValid = isValidBlock(this.nodes);
12317
+ this.updateContent(slotRender, key);
12318
+ const contentValid = isValidBlock(this.content);
12261
12319
  recheckSlotFallback(this, shouldForce);
12262
12320
  if (!hasSlotFallback(boundary) || contentValid) setCurrentHydratingSlotFallbackActive(prev);
12263
- this.hydrate(!isValidBlock(this.getEffectiveOutput()), true);
12321
+ this.hydrate(!isValidBlock(this.nodes));
12264
12322
  } finally {
12265
12323
  setCurrentHydratingSlotFallbackActive(prev);
12266
12324
  }
12267
12325
  });
12268
12326
  else {
12269
- this.update(slotRender, slotKey);
12327
+ this.updateContent(slotRender, key);
12270
12328
  recheckSlotFallback(this, shouldForce);
12271
12329
  }
12272
12330
  } finally {
@@ -12275,7 +12333,7 @@ var SlotFragment = class extends DynamicFragment {
12275
12333
  }
12276
12334
  }
12277
12335
  getContent() {
12278
- return this.nodes;
12336
+ return this.content;
12279
12337
  }
12280
12338
  getParentNode() {
12281
12339
  return this.anchor ? this.anchor.parentNode : null;
@@ -12289,16 +12347,28 @@ var SlotFragment = class extends DynamicFragment {
12289
12347
  isDisposed() {
12290
12348
  return this.disposed;
12291
12349
  }
12350
+ isContentValid() {
12351
+ return isValidBlock(this.content);
12352
+ }
12353
+ syncNodes() {
12354
+ this.nodes = this.activeFallback || this.content;
12355
+ }
12292
12356
  notifyFallbackValidityChange() {
12293
- if (this.parentSlotBoundary) this.parentSlotBoundary.markDirty();
12357
+ if (this.notifyParent && this.parentSlotBoundary) this.parentSlotBoundary.markDirty();
12294
12358
  }
12295
12359
  };
12296
12360
  function isFragment(val) {
12297
12361
  return val instanceof VaporFragment;
12298
12362
  }
12363
+ function isInteropFragment(val) {
12364
+ return val instanceof VaporFragment && val.vnode !== void 0;
12365
+ }
12299
12366
  function isDynamicFragment(val) {
12300
12367
  return val instanceof DynamicFragment;
12301
12368
  }
12369
+ function isSlotFragment(val) {
12370
+ return val instanceof DynamicFragment && !!val.isSlot;
12371
+ }
12302
12372
  //#endregion
12303
12373
  //#region packages/runtime-vapor/src/teleport.ts
12304
12374
  let isTeleportEnabled = false;
@@ -12323,11 +12393,9 @@ function isValidBlock(block) {
12323
12393
  else if (isVaporComponent(block)) return isValidBlock(block.block);
12324
12394
  else if (isArray(block)) return block.length > 0 && block.some(isValidBlock);
12325
12395
  else {
12326
- const isBlockValid = block.isBlockValid;
12327
- if (isBlockValid) return isBlockValid.call(block);
12396
+ if (isInteropEnabled && block.isBlockValid) return block.isBlockValid();
12328
12397
  if (block.validityPending) return true;
12329
- const getEffectiveOutput = block.getEffectiveOutput;
12330
- return isValidBlock(getEffectiveOutput ? getEffectiveOutput.call(block) : block.nodes);
12398
+ return isValidBlock(block.nodes);
12331
12399
  }
12332
12400
  }
12333
12401
  function insert(block, parent, anchor = null, parentSuspense) {
@@ -12413,7 +12481,7 @@ function normalizeBlock(block) {
12413
12481
  }
12414
12482
  return nodes;
12415
12483
  }
12416
- function findBlockNode(block) {
12484
+ function findBlockBoundary(block) {
12417
12485
  const lastChild = findLastChild(block);
12418
12486
  let { parentNode, nextSibling: nextNode } = lastChild;
12419
12487
  if (nextNode && isComment(nextNode, "]") && isFragmentBlock(block) && !isComment(lastChild, "]")) nextNode = nextNode.nextSibling;
@@ -12440,73 +12508,42 @@ function isFragmentBlock(block) {
12440
12508
  //#endregion
12441
12509
  //#region packages/runtime-vapor/src/hmr.ts
12442
12510
  function hmrRerender(instance) {
12443
- const normalized = normalizeBlock(instance.block);
12444
- const parent = normalized[0].parentNode;
12445
- const anchor = normalized[normalized.length - 1].nextSibling;
12446
- instance.scope.reset();
12511
+ const { parentNode, nextNode: anchor } = findBlockBoundary(instance.block);
12512
+ const parent = parentNode;
12513
+ if (instance.renderEffects) {
12514
+ instance.renderEffects.forEach((e) => e.stop());
12515
+ instance.renderEffects.length = 0;
12516
+ }
12447
12517
  remove(instance.block, parent);
12448
12518
  const prev = setCurrentInstance(instance);
12449
12519
  pushWarningContext(instance);
12450
- devRender(instance);
12451
- popWarningContext();
12452
- setCurrentInstance(...prev);
12520
+ try {
12521
+ devRender(instance);
12522
+ } finally {
12523
+ popWarningContext();
12524
+ setCurrentInstance(...prev);
12525
+ }
12453
12526
  insert(instance.block, parent, anchor);
12454
12527
  }
12455
12528
  function hmrReload(instance, newComp) {
12456
- if (isKeepAliveEnabled && instance.parent && isKeepAlive(instance.parent)) {
12457
- instance.parent.hmrRerender();
12529
+ const parentInstance = instance.parent;
12530
+ if (parentInstance) {
12531
+ parentInstance.hmrRerender();
12458
12532
  return;
12459
12533
  }
12460
- const normalized = normalizeBlock(instance.block);
12461
- const parent = normalized[0].parentNode;
12462
- const anchor = normalized[normalized.length - 1].nextSibling;
12534
+ const { parentNode, nextNode: anchor } = findBlockBoundary(instance.block);
12535
+ const parent = parentNode;
12463
12536
  unmountComponent(instance, parent);
12464
- const parentInstance = instance.parent;
12465
12537
  const prev = setCurrentInstance(parentInstance);
12466
- const newInstance = createComponent(newComp, instance.rawProps, instance.rawSlots, instance.isSingleRoot, void 0, instance.appContext);
12467
- setCurrentInstance(...prev);
12468
- mountComponent(newInstance, parent, anchor);
12469
- updateParentBlockOnHmrReload(parentInstance, instance, newInstance);
12470
- updateParentTeleportOnHmrReload(instance, newInstance);
12471
- }
12472
- /**
12473
- * dev only
12474
- * update parentInstance.block to ensure that the correct parent and
12475
- * anchor are found during parentInstance HMR rerender/reload, as
12476
- * `normalizeBlock` relies on the current instance.block
12477
- */
12478
- function updateParentBlockOnHmrReload(parentInstance, instance, newInstance) {
12479
- if (parentInstance) parentInstance.block = replaceBlockInstance(parentInstance.block, instance, newInstance);
12480
- }
12481
- /**
12482
- * dev only
12483
- * during root component HMR reload, since the old component will be unmounted
12484
- * and a new one will be mounted, we need to update the teleport's nodes
12485
- * to ensure that the correct parent and anchor are found during parentInstance
12486
- * HMR rerender/reload, as `normalizeBlock` relies on the current instance.block
12487
- */
12488
- function updateParentTeleportOnHmrReload(instance, newInstance) {
12489
- const teleport = instance.parentTeleport;
12490
- if (teleport) {
12491
- newInstance.parentTeleport = teleport;
12492
- teleport.nodes = replaceBlockInstance(teleport.nodes, instance, newInstance);
12493
- }
12494
- }
12495
- function replaceBlockInstance(block, instance, newInstance) {
12496
- if (block === instance) return newInstance;
12497
- if (isArray(block)) {
12498
- for (let i = 0; i < block.length; i++) block[i] = replaceBlockInstance(block[i], instance, newInstance);
12499
- return block;
12500
- }
12501
- if (isVaporComponent(block)) {
12502
- block.block = replaceBlockInstance(block.block, instance, newInstance);
12503
- return block;
12504
- }
12505
- if (isFragment(block)) {
12506
- block.nodes = replaceBlockInstance(block.nodes, instance, newInstance);
12507
- return block;
12538
+ let newInstance;
12539
+ try {
12540
+ newInstance = createComponent(newComp, instance.rawProps, instance.rawSlots, instance.isSingleRoot, void 0, instance.appContext);
12541
+ } finally {
12542
+ setCurrentInstance(...prev);
12508
12543
  }
12509
- return block;
12544
+ mountComponent(newInstance, parent, anchor);
12545
+ const app = instance.appContext.app;
12546
+ if (app && app._instance === instance) app._instance = newInstance;
12510
12547
  }
12511
12548
  //#endregion
12512
12549
  //#region packages/runtime-vapor/src/suspense.ts
@@ -12524,10 +12561,7 @@ function setParentSuspense(suspense) {
12524
12561
  }
12525
12562
  //#endregion
12526
12563
  //#region packages/runtime-vapor/src/component.ts
12527
- function normalizeRawSlots(rawSlots) {
12528
- return rawSlots && isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
12529
- }
12530
- function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false) {
12564
+ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false, ce) {
12531
12565
  const wasInOnceSlot = inOnceSlot;
12532
12566
  if (wasInOnceSlot) once = true;
12533
12567
  if (isInteropEnabled && isCollectingVdomSlotVNodes) {
@@ -12585,7 +12619,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
12585
12619
  } else frag.hydrate();
12586
12620
  return frag;
12587
12621
  }
12588
- const instance = new VaporComponentInstance(component, rawProps, rawSlots, appContext, once);
12622
+ const instance = new VaporComponentInstance(component, rawProps, rawSlots, appContext, once, ce);
12589
12623
  if (isKeepAliveEnabled && currentKeepAliveCtx && !isAsyncWrapper(instance)) {
12590
12624
  currentKeepAliveCtx.processShapeFlag(instance);
12591
12625
  setCurrentKeepAliveCtx(null);
@@ -12623,7 +12657,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
12623
12657
  if (isSuspenseEnabled && isHydrating$1 && hydrationClose && instance.suspense && instance.asyncDep && !instance.asyncResolved && instance.restoreAsyncContext) {
12624
12658
  deferHydrationBoundary = true;
12625
12659
  instance.deferredHydrationBoundary = () => {
12626
- if (instance.block && hydrationClose && findBlockNode(instance.block).nextNode === hydrationClose.nextSibling) setCurrentHydrationNode(hydrationClose);
12660
+ if (instance.block && hydrationClose && findBlockBoundary(instance.block).nextNode === hydrationClose.nextSibling) setCurrentHydrationNode(hydrationClose);
12627
12661
  finalizeHydrationBoundary();
12628
12662
  };
12629
12663
  exitHydrationCursor(hydrationCursor);
@@ -12705,7 +12739,7 @@ const emptyContext = {
12705
12739
  provides: /* @__PURE__ */ Object.create(null)
12706
12740
  };
12707
12741
  var VaporComponentInstance = class {
12708
- constructor(comp, rawProps, rawSlots, appContext, once) {
12742
+ constructor(comp, rawProps, rawSlots, appContext, once, ce) {
12709
12743
  this.accessedAttrs = false;
12710
12744
  this.vapor = true;
12711
12745
  this.uid = nextUid();
@@ -12751,9 +12785,9 @@ var VaporComponentInstance = class {
12751
12785
  } else this.props = this.attrs = EMPTY_OBJ;
12752
12786
  const normalizedRawSlots = normalizeRawSlots(rawSlots);
12753
12787
  this.rawSlots = normalizedRawSlots || EMPTY_OBJ;
12754
- this.slots = normalizedRawSlots ? normalizedRawSlots.$ ? new Proxy(normalizedRawSlots, dynamicSlotsProxyHandlers) : normalizedRawSlots : EMPTY_OBJ;
12788
+ this.slots = normalizedRawSlots ? new Proxy(normalizedRawSlots, dynamicSlotsProxyHandlers) : EMPTY_OBJ;
12755
12789
  this.scopeId = getCurrentScopeId();
12756
- if (comp.ce) comp.ce(this);
12790
+ if (ce) ce(this);
12757
12791
  if (this.props === this.attrs) this.accessedAttrs = true;
12758
12792
  else {
12759
12793
  const attrs = this.attrs;
@@ -12887,7 +12921,7 @@ function mountComponent(instance, parent, anchor) {
12887
12921
  if (!isHydrating$1) {
12888
12922
  insert(instance.block, parent, anchor);
12889
12923
  setComponentScopeId(instance);
12890
- }
12924
+ } else trackComponentScopeId(instance);
12891
12925
  if (instance.m) queuePostFlushCb(instance.m);
12892
12926
  if (isKeepAliveEnabled && instance.shapeFlag & 256 && instance.a) queuePostFlushCb(instance.a);
12893
12927
  instance.isMounted = true;
@@ -12953,27 +12987,65 @@ function handleSetupResult(setupResult, component, instance) {
12953
12987
  else if (setupResult === EMPTY_OBJ && component.render) instance.block = callRender(component.render, instance, setupResult);
12954
12988
  else instance.block = setupResult;
12955
12989
  if (instance.hasFallthrough && component.inheritAttrs !== false && Object.keys(instance.attrs).length) {
12956
- const root = getRootElement(instance.block, (frag) => registerDynamicFragmentFallthroughAttrs(frag, instance.attrs), false);
12957
- if (root) renderEffect(() => {
12958
- const attrs = isFunction(component) && !(isTransitionEnabled ? isVaporTransition(component) : false) ? getFunctionalFallthrough(instance.attrs) : instance.attrs;
12990
+ const getFallthroughAttrs = isFunction(component) && !(isTransitionEnabled ? isVaporTransition(component) : false) ? () => getFunctionalFallthrough(instance.attrs) : () => instance.attrs;
12991
+ applyFallthroughAttrs(instance.block, instance, getFallthroughAttrs);
12992
+ }
12993
+ popWarningContext();
12994
+ }
12995
+ function applyFallthroughAttrs(block, instance, getFallthroughAttrs, scope) {
12996
+ let hasSlotFragment = false;
12997
+ let dynamicFragments;
12998
+ const root = getRootElement(block, (frag) => {
12999
+ if (frag.isSlot) hasSlotFragment = true;
13000
+ else (dynamicFragments || (dynamicFragments = [])).push(frag);
13001
+ }, false);
13002
+ const dynamicRoot = root ? void 0 : getSingleDynamicRootChain(block);
13003
+ const fragmentsToRegister = root ? dynamicFragments : dynamicRoot && dynamicRoot.fragments;
13004
+ if (fragmentsToRegister) {
13005
+ for (const frag of fragmentsToRegister) if (!frag.isSlot) registerDynamicFragmentFallthroughAttrs(frag, instance, getFallthroughAttrs);
13006
+ }
13007
+ if (root && !hasSlotFragment) {
13008
+ const applyEffect = () => renderEffect(() => {
13009
+ const attrs = getFallthroughAttrs();
12959
13010
  if (attrs) applyFallthroughProps(root, attrs);
12960
13011
  });
12961
- else if (!instance.accessedAttrs && isArray(instance.block) && instance.block.length || isTeleportEnabled && isTeleportFragment(instance.block)) warnExtraneousAttributes(instance.attrs);
13012
+ scope ? scope.run(applyEffect) : applyEffect();
13013
+ } else if (hasSlotFragment || dynamicRoot && dynamicRoot.hasNonSingleRoot || isTeleportEnabled && containsTeleportFragment(block) || !instance.accessedAttrs && isArray(block) && block.length) warnExtraneousAttributes(instance.attrs);
13014
+ }
13015
+ function getSingleDynamicRootChain(block) {
13016
+ if (block instanceof DynamicFragment) {
13017
+ const { nodes } = block;
13018
+ const nested = getSingleDynamicRootChain(nodes);
13019
+ return {
13020
+ fragments: nested ? [block, ...nested.fragments] : [block],
13021
+ hasNonSingleRoot: nested ? nested.hasNonSingleRoot : isArray(nodes) && nodes.some((child) => !(child instanceof Comment))
13022
+ };
13023
+ }
13024
+ if (isFragment(block) && !(isTeleportEnabled && isTeleportFragment(block))) return getSingleDynamicRootChain(block.nodes);
13025
+ if (isArray(block)) {
13026
+ let singleRoot;
13027
+ let hasComment = false;
13028
+ for (const child of block) {
13029
+ if (child instanceof Comment) {
13030
+ hasComment = true;
13031
+ continue;
13032
+ }
13033
+ const childRoot = getSingleDynamicRootChain(child);
13034
+ if (!childRoot || singleRoot) return;
13035
+ singleRoot = childRoot;
13036
+ }
13037
+ return hasComment ? singleRoot : void 0;
12962
13038
  }
12963
- popWarningContext();
12964
13039
  }
12965
- function getCurrentScopeId() {
12966
- const scopeOwner = getScopeOwner();
12967
- return scopeOwner ? scopeOwner.type.__scopeId : void 0;
13040
+ function containsTeleportFragment(block) {
13041
+ if (isTeleportFragment(block)) return true;
13042
+ if (isArray(block)) return block.some((child) => !(child instanceof Comment) && containsTeleportFragment(child));
13043
+ return isFragment(block) && containsTeleportFragment(block.nodes);
12968
13044
  }
12969
- function registerDynamicFragmentFallthroughAttrs(frag, attrs) {
13045
+ function registerDynamicFragmentFallthroughAttrs(frag, instance, getFallthroughAttrs) {
13046
+ if (frag.hasFallthroughAttrs) return;
12970
13047
  frag.hasFallthroughAttrs = true;
12971
- (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => {
12972
- if (nodes instanceof Element) frag.scope.run(() => {
12973
- renderEffect(() => applyFallthroughProps(nodes, attrs));
12974
- });
12975
- else if (frag.anchorLabel === "slot" || isArray(nodes) && nodes.length) warnExtraneousAttributes(attrs);
12976
- });
13048
+ (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => applyFallthroughAttrs(nodes, instance, getFallthroughAttrs, frag.scope));
12977
13049
  }
12978
13050
  //#endregion
12979
13051
  //#region packages/runtime-vapor/src/apiCreateApp.ts
@@ -13082,17 +13154,20 @@ function defineVaporAsyncComponent(source) {
13082
13154
  frag.update(() => createInnerComp(resolvedComp, instance));
13083
13155
  return frag;
13084
13156
  }
13157
+ frag.validityPending = true;
13085
13158
  const onError = (err) => {
13086
13159
  setPendingRequest(null);
13087
13160
  handleError(err, instance, 13, !errorComponent);
13088
13161
  };
13089
13162
  if (suspensible && instance.suspense) return load().then(() => {
13090
13163
  resolvedComp = getResolvedComp();
13164
+ frag.validityPending = false;
13091
13165
  if (resolvedComp) frag.update(() => createInnerComp(resolvedComp, instance));
13092
13166
  return frag;
13093
13167
  }).catch((err) => {
13094
13168
  onError(err);
13095
- if (errorComponent) frag.update(() => createInnerComp(errorComponent, instance, { error: () => err }, {}));
13169
+ frag.validityPending = false;
13170
+ if (errorComponent) frag.update(() => createErrorComp(errorComponent, instance, err));
13096
13171
  return frag;
13097
13172
  });
13098
13173
  const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
@@ -13106,8 +13181,11 @@ function defineVaporAsyncComponent(source) {
13106
13181
  resolvedComp = getResolvedComp();
13107
13182
  let render;
13108
13183
  if (loaded.value && resolvedComp) render = () => createInnerComp(resolvedComp, instance);
13109
- else if (error.value && errorComponent) render = () => createComponent(errorComponent, { error: () => error.value });
13110
- else if (loadingComponent && !delayed.value) render = () => createComponent(loadingComponent);
13184
+ else if (error.value && errorComponent) {
13185
+ const err = error.value;
13186
+ render = () => createErrorComp(errorComponent, instance, err);
13187
+ } else if (loadingComponent && !delayed.value) render = () => createInnerComp(loadingComponent, instance);
13188
+ frag.validityPending = !render && !error.value;
13111
13189
  frag.update(render);
13112
13190
  if (isKeepAliveEnabled && frag.keepAliveCtx) frag.keepAliveCtx.cacheBlock();
13113
13191
  });
@@ -13115,6 +13193,9 @@ function defineVaporAsyncComponent(source) {
13115
13193
  }
13116
13194
  });
13117
13195
  }
13196
+ function createErrorComp(comp, parent, error) {
13197
+ return createInnerComp(comp, parent, { error: () => error }, {});
13198
+ }
13118
13199
  function createInnerComp(comp, parent, rawProps = parent.rawProps, rawSlots = parent.rawSlots) {
13119
13200
  const prevInstance = setCurrentInstance(parent);
13120
13201
  try {
@@ -13336,7 +13417,7 @@ function applyResolvedTransitionHooks(block, hooks) {
13336
13417
  if (block.length === 1) block = block[0];
13337
13418
  else if (block.length === 0) return { hooks };
13338
13419
  }
13339
- if (hooks.applyGroup && (block instanceof ForFragment || block instanceof SlotFragment || isVaporComponent(block) && block.block instanceof SlotFragment)) {
13420
+ if (hooks.applyGroup && (block instanceof ForFragment || isSlotFragment(block) || isVaporComponent(block) && isSlotFragment(block.block))) {
13340
13421
  hooks.applyGroup(block, hooks.props, hooks.state, hooks.instance);
13341
13422
  return { hooks };
13342
13423
  }
@@ -13546,7 +13627,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
13546
13627
  cache.forEach((cached) => {
13547
13628
  unsetShapeFlag(cached);
13548
13629
  if (cached !== current) {
13549
- const parentNode = findBlockNode(cached).parentNode;
13630
+ const parentNode = findBlockBoundary(cached).parentNode;
13550
13631
  if (parentNode) remove(cached, parentNode);
13551
13632
  }
13552
13633
  });
@@ -13638,7 +13719,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
13638
13719
  const cached = cache.get(key);
13639
13720
  if (cached && (!current || cached !== current)) {
13640
13721
  unsetShapeFlag(cached);
13641
- const parentNode = findBlockNode(cached).parentNode;
13722
+ const parentNode = findBlockBoundary(cached).parentNode;
13642
13723
  if (parentNode) remove(cached, parentNode);
13643
13724
  } else if (current) unsetShapeFlag(current);
13644
13725
  cache.delete(key);
@@ -13770,9 +13851,6 @@ function getInnerBlock(block) {
13770
13851
  else if (isFragment(block)) return getInnerBlock(block.nodes);
13771
13852
  return [void 0, false];
13772
13853
  }
13773
- function isInteropFragment(block) {
13774
- return !!(isFragment(block) && block.vnode);
13775
- }
13776
13854
  function getInstanceFromCache(cached) {
13777
13855
  if (isVaporComponent(cached)) return cached;
13778
13856
  if (isInteropEnabled) return cached.vnode.component;
@@ -13798,6 +13876,8 @@ function deactivate$1(instance, container) {
13798
13876
  }
13799
13877
  //#endregion
13800
13878
  //#region packages/runtime-vapor/src/vdomInterop.ts
13879
+ const EMPTY_BLOCK = EMPTY_ARR;
13880
+ const EMPTY_VNODES = EMPTY_ARR;
13801
13881
  function filterReservedProps(props) {
13802
13882
  const filtered = {};
13803
13883
  for (const key in props) if (!isReservedProp(key)) filtered[key] = props[key];
@@ -13805,7 +13885,7 @@ function filterReservedProps(props) {
13805
13885
  }
13806
13886
  const vaporInteropImpl = {
13807
13887
  mount(vnode, container, anchor, parentComponent, parentSuspense, onBeforeMount, onVnodeBeforeMount) {
13808
- let selfAnchor = vnode.anchor = /* @__PURE__ */ createTextNode();
13888
+ const selfAnchor = vnode.anchor = /* @__PURE__ */ createTextNode();
13809
13889
  if (isHydrating$1) queuePostFlushCb(() => container.insertBefore(selfAnchor, anchor));
13810
13890
  else {
13811
13891
  vnode.el = selfAnchor;
@@ -13879,14 +13959,14 @@ const vaporInteropImpl = {
13879
13959
  const anchor = vnode.anchor;
13880
13960
  unmountComponent(instance, container);
13881
13961
  if (!doRemove) {
13882
- const blockContainer = shouldUseCurrentParent(instance.block) ? anchor && anchor.parentNode : void 0;
13962
+ const blockContainer = needsHostParentForRemove(instance.block) ? anchor && anchor.parentNode : void 0;
13883
13963
  remove(instance.block, blockContainer);
13884
13964
  }
13885
13965
  }
13886
13966
  } else if (vnode.vb) {
13887
13967
  const anchor = vnode.anchor;
13888
13968
  if (vnode.el && vnode.el !== anchor && isComment(vnode.el, "[")) slotStartAnchor = vnode.el;
13889
- const blockContainer = container || (shouldUseCurrentParent(vnode.vb) ? anchor && anchor.parentNode : void 0);
13969
+ const blockContainer = container || (needsHostParentForRemove(vnode.vb) ? anchor && anchor.parentNode : void 0);
13890
13970
  remove(vnode.vb, blockContainer);
13891
13971
  stopVaporSlotScope(vnode);
13892
13972
  }
@@ -14031,26 +14111,35 @@ const vaporSlotPropsProxyHandler = {
14031
14111
  }
14032
14112
  };
14033
14113
  const vaporSlotWrappersCache = /* @__PURE__ */ new WeakMap();
14034
- const vaporSlotsProxyHandler = { get(target, key) {
14035
- const slot = target[key];
14036
- if (isFunction(slot)) {
14037
- slot.__vapor = true;
14038
- let wrappers = vaporSlotWrappersCache.get(target);
14039
- if (!wrappers) vaporSlotWrappersCache.set(target, wrappers = /* @__PURE__ */ new Map());
14040
- const cached = wrappers.get(key);
14041
- if (cached && cached.slot === slot) return cached.wrapped;
14042
- const wrapped = (props) => {
14043
- return normalizeVaporSlotVNodes(slot, props) || [renderSlot({ [key]: slot }, key, props)];
14044
- };
14045
- wrapped.__vs = slot;
14046
- wrappers.set(key, {
14047
- slot,
14048
- wrapped
14049
- });
14050
- return wrapped;
14114
+ const vaporSlotsProxyHandler = {
14115
+ get(target, key) {
14116
+ const slot = isString(key) && !isInternalSlotKey(key) ? getSlot(target, key) : target[key];
14117
+ if (isFunction(slot)) {
14118
+ slot.__vapor = true;
14119
+ let wrappers = vaporSlotWrappersCache.get(target);
14120
+ if (!wrappers) vaporSlotWrappersCache.set(target, wrappers = /* @__PURE__ */ new Map());
14121
+ const cached = wrappers.get(key);
14122
+ if (cached && cached.slot === slot) return cached.wrapped;
14123
+ const wrapped = (props) => {
14124
+ return normalizeVaporSlotVNodes(slot, props) || [renderSlot({ [key]: slot }, key, props)];
14125
+ };
14126
+ wrapped.__vs = slot;
14127
+ wrappers.set(key, {
14128
+ slot,
14129
+ wrapped
14130
+ });
14131
+ return wrapped;
14132
+ }
14133
+ return slot;
14134
+ },
14135
+ ownKeys(target) {
14136
+ return Array.from(dynamicSlotsProxyHandlers.ownKeys(target)).filter((key) => isString(key) && !isInternalSlotKey(key));
14137
+ },
14138
+ getOwnPropertyDescriptor(target, key) {
14139
+ if (!isString(key) || isInternalSlotKey(key)) return;
14140
+ return dynamicSlotsProxyHandlers.getOwnPropertyDescriptor(target, key);
14051
14141
  }
14052
- return slot;
14053
- } };
14142
+ };
14054
14143
  const collectedVdomSlotVNodes = /* @__PURE__ */ new WeakMap();
14055
14144
  function normalizeVaporSlotVNodes(slot, props) {
14056
14145
  if (props && hasVNodeSlotProps(props)) return;
@@ -14132,38 +14221,43 @@ function removeAttachedNodes(block, parent) {
14132
14221
  if (block.parentNode === parent) remove(block, parent);
14133
14222
  } else if (isArray(block)) for (let i = 0; i < block.length; i++) removeAttachedNodes(block[i], parent);
14134
14223
  }
14135
- function appendVnodeUpdatedHook(vnode, hook) {
14224
+ function appendVnodeHook(vnode, key, hook) {
14136
14225
  const props = vnode.props || (vnode.props = {});
14137
- const existing = props.onVnodeUpdated;
14138
- props.onVnodeUpdated = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
14226
+ const existing = props[key];
14227
+ props[key] = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
14139
14228
  }
14140
- function appendVnodeBeforeUpdateHook(vnode, hook) {
14141
- const props = vnode.props || (vnode.props = {});
14142
- const existing = props.onVnodeBeforeUpdate;
14143
- props.onVnodeBeforeUpdate = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
14144
- }
14145
- function trackFragmentVNodeUpdates(frag, vnode) {
14229
+ function trackFragmentVNodeUpdates(frag, vnode, syncNodes) {
14146
14230
  const beforeUpdate = () => {
14147
- if (frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
14231
+ if (frag.onBeforeUpdate) frag.onBeforeUpdate.forEach((bu) => bu());
14148
14232
  };
14149
14233
  const updated = () => {
14234
+ syncNodes();
14235
+ if (frag.onUpdated) frag.onUpdated.forEach((u) => u());
14236
+ };
14237
+ appendVnodeHook(vnode, "onVnodeBeforeUpdate", beforeUpdate);
14238
+ appendVnodeHook(vnode, "onVnodeUpdated", updated);
14239
+ }
14240
+ function createVNodeFragment(vnode) {
14241
+ const frag = createInteropFragment(EMPTY_BLOCK, vnode);
14242
+ frag.$key = vnode.key;
14243
+ let validityPending = !isHydrating$1;
14244
+ const syncNodes = () => {
14150
14245
  frag.nodes = resolveVNodeNodes(vnode);
14151
- frag.validityPending = false;
14152
- if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
14246
+ validityPending = false;
14247
+ };
14248
+ frag.isBlockValid = () => validityPending ? true : isValidBlock(frag.nodes);
14249
+ trackFragmentVNodeUpdates(frag, vnode, syncNodes);
14250
+ return {
14251
+ frag,
14252
+ syncNodes
14153
14253
  };
14154
- appendVnodeBeforeUpdateHook(vnode, beforeUpdate);
14155
- appendVnodeUpdatedHook(vnode, updated);
14156
14254
  }
14157
14255
  /**
14158
14256
  * Mount VNode in vapor
14159
14257
  */
14160
14258
  function mountVNode(internals, vnode, parentComponent) {
14161
14259
  const suspense = parentSuspense || parentComponent && parentComponent.suspense;
14162
- const frag = new VaporFragment([]);
14163
- frag.validityPending = !isHydrating$1;
14164
- frag.vnode = vnode;
14165
- frag.$key = vnode.key;
14166
- trackFragmentVNodeUpdates(frag, vnode);
14260
+ const { frag, syncNodes } = createVNodeFragment(vnode);
14167
14261
  let isMounted = false;
14168
14262
  const unmount = (parentNode, transition) => {
14169
14263
  if (transition) setTransitionHooks(vnode, transition);
@@ -14176,8 +14270,7 @@ function mountVNode(internals, vnode, parentComponent) {
14176
14270
  hydrateVNode(vnode, parentComponent);
14177
14271
  onScopeDispose(unmount, true);
14178
14272
  isMounted = true;
14179
- frag.nodes = resolveVNodeNodes(vnode);
14180
- frag.validityPending = false;
14273
+ syncNodes();
14181
14274
  };
14182
14275
  frag.insert = (parentNode, anchor, transition) => {
14183
14276
  if (isHydrating$1) return;
@@ -14196,8 +14289,7 @@ function mountVNode(internals, vnode, parentComponent) {
14196
14289
  } else internals.m(vnode, parentNode, anchor, 2, parentComponent);
14197
14290
  simpleSetCurrentInstance(prev);
14198
14291
  }
14199
- frag.nodes = resolveVNodeNodes(vnode);
14200
- frag.validityPending = false;
14292
+ syncNodes();
14201
14293
  if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
14202
14294
  };
14203
14295
  frag.remove = unmount;
@@ -14210,11 +14302,8 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14210
14302
  const suspense = parentSuspense || parentComponent && parentComponent.suspense;
14211
14303
  const useBridge = shouldUseRendererBridge(component);
14212
14304
  const comp = useBridge ? ensureRendererBridge(component) : component;
14213
- const frag = new VaporFragment([]);
14214
- frag.validityPending = !isHydrating$1;
14215
- const vnode = frag.vnode = createVNode(comp, rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)));
14216
- frag.$key = vnode.key;
14217
- trackFragmentVNodeUpdates(frag, vnode);
14305
+ const vnode = createVNode(comp, rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)));
14306
+ const { frag, syncNodes } = createVNodeFragment(vnode);
14218
14307
  if (!isCollectingVdomSlotVNodes && isKeepAliveEnabled && currentKeepAliveCtx) {
14219
14308
  currentKeepAliveCtx.processShapeFlag(frag);
14220
14309
  if (component.__asyncLoader) {
@@ -14228,7 +14317,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14228
14317
  setCurrentKeepAliveCtx(null);
14229
14318
  }
14230
14319
  const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, once);
14231
- if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.slots));
14320
+ if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.rawSlots));
14232
14321
  vnode.vi = (instance) => {
14233
14322
  instance.props = /* @__PURE__ */ shallowReactive(wrapper.props);
14234
14323
  const attrs = createInternalObject();
@@ -14251,7 +14340,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14251
14340
  };
14252
14341
  }
14253
14342
  });
14254
- instance.slots = wrapper.slots === EMPTY_OBJ ? EMPTY_OBJ : new Proxy(wrapper.slots, vaporSlotsProxyHandler);
14343
+ instance.slots = wrapper.rawSlots === EMPTY_OBJ ? EMPTY_OBJ : new Proxy(wrapper.rawSlots, vaporSlotsProxyHandler);
14255
14344
  };
14256
14345
  let rawRef = null;
14257
14346
  let isMounted = false;
@@ -14282,8 +14371,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14282
14371
  if (!isHydrating$1) return;
14283
14372
  hydrateVNode(vnode, parentComponent);
14284
14373
  isMounted = true;
14285
- frag.nodes = resolveVNodeNodes(vnode);
14286
- frag.validityPending = false;
14374
+ syncNodes();
14287
14375
  };
14288
14376
  vnode.scopeId = getCurrentScopeId() || null;
14289
14377
  vnode.slotScopeIds = currentSlotScopeIds;
@@ -14301,8 +14389,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14301
14389
  } else internals.m(vnode, parentNode, anchor, 2, parentComponent);
14302
14390
  simpleSetCurrentInstance(prev);
14303
14391
  }
14304
- frag.nodes = resolveVNodeNodes(vnode);
14305
- frag.validityPending = false;
14392
+ syncNodes();
14306
14393
  if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
14307
14394
  };
14308
14395
  frag.remove = unmount;
@@ -14342,12 +14429,6 @@ function ensureRendererBridge(component) {
14342
14429
  if (!bridge) rendererBridgeCache.set(component, bridge = (props, { slots }) => createVNode(component, props, slots));
14343
14430
  return bridge;
14344
14431
  }
14345
- function trackSlotVNodeUpdates(frag, vnode) {
14346
- trackSlotVNodeUpdatesWithRefresh(vnode, () => {
14347
- frag.nodes = resolveVNodeNodes(vnode);
14348
- if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
14349
- });
14350
- }
14351
14432
  function hasValidVNodeContent(vnode) {
14352
14433
  return !!ensureValidVNode(vnode.type === Fragment && isArray(vnode.children) ? vnode.children : [vnode]);
14353
14434
  }
@@ -14355,13 +14436,12 @@ function isSlotOutletOnlyVNode(vnode) {
14355
14436
  if (vnode.type === VaporSlot) return true;
14356
14437
  return vnode.type === Fragment && isArray(vnode.children) && vnode.children.every((child) => isVNode(child) && isSlotOutletOnlyVNode(child));
14357
14438
  }
14358
- function hydrateForwardedEmptySlotFragment(vnode, parentComponent) {
14439
+ function hydrateForwardedEmptySlotFragment(vnode, parentComponent, contentValid) {
14359
14440
  if (vnode.type !== Fragment || !isArray(vnode.children)) return false;
14360
14441
  const children = vnode.children;
14361
14442
  const inheritedEmptySlotEndAnchor = isComment(currentHydrationNode, "]") && isComment(currentHydrationNode.previousSibling, "[") ? currentHydrationNode : null;
14362
14443
  const slotEndAnchor = getCurrentSlotEndAnchor() || inheritedEmptySlotEndAnchor;
14363
14444
  const slotStartAnchor = slotEndAnchor && slotEndAnchor.previousSibling;
14364
- const contentValid = hasValidVNodeContent(vnode);
14365
14445
  if (!contentValid && currentHydrationNode === slotEndAnchor && slotStartAnchor && isComment(slotStartAnchor, "[")) {
14366
14446
  vnode.el = slotStartAnchor;
14367
14447
  vnode.anchor = slotEndAnchor;
@@ -14385,10 +14465,11 @@ function hydrateForwardedEmptySlotFragment(vnode, parentComponent) {
14385
14465
  if (currentHydrationNode === fragmentEndAnchor) advanceHydrationNode(fragmentEndAnchor);
14386
14466
  return true;
14387
14467
  }
14388
- function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
14468
+ function trackSlotVNodeUpdatesWithRefresh(vnode, refresh, beforeUpdate) {
14389
14469
  const onUpdated = () => refresh();
14390
14470
  const track = (node) => {
14391
- appendVnodeUpdatedHook(node, onUpdated);
14471
+ if (beforeUpdate) appendVnodeHook(node, "onVnodeBeforeUpdate", beforeUpdate);
14472
+ appendVnodeHook(node, "onVnodeUpdated", onUpdated);
14392
14473
  if (node.type === Fragment && isArray(node.children)) node.children.forEach((child) => {
14393
14474
  if (isVNode(child)) track(child);
14394
14475
  });
@@ -14398,73 +14479,81 @@ function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
14398
14479
  /**
14399
14480
  * Mount vdom slot in vapor
14400
14481
  */
14401
- function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once) {
14482
+ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once, slotRoot) {
14402
14483
  const suspense = parentSuspense || parentComponent.suspense;
14403
- const frag = new VaporFragment([]);
14404
- trackSlotBoundaryDirtying(frag);
14405
- frag.validityPending = !isHydrating$1;
14484
+ const frag = createInteropFragment();
14485
+ let validityPending = !isHydrating$1;
14406
14486
  const instance = currentInstance;
14407
14487
  let isMounted = false;
14408
14488
  const contentState = {
14409
- nodes: [],
14489
+ nodes: EMPTY_BLOCK,
14410
14490
  valid: false,
14411
14491
  rendered: null
14412
14492
  };
14413
- let currentParentNode;
14414
- let currentAnchor;
14493
+ let currentParentNode = null;
14494
+ let currentAnchor = null;
14415
14495
  let disposed = false;
14416
14496
  const scope = effectScope();
14417
14497
  const inheritedBoundary = frag.inheritedSlotBoundary;
14418
14498
  let isContentUpdateRecheck = false;
14419
14499
  let localFallback;
14420
- let outlet;
14500
+ let fallbackState;
14501
+ frag.isBlockValid = () => {
14502
+ if (validityPending) return true;
14503
+ return fallbackState.activeFallback ? isValidBlock(fallbackState.activeFallback) : contentState.valid;
14504
+ };
14421
14505
  const boundary = {
14422
14506
  get parent() {
14423
14507
  return inheritedBoundary;
14424
14508
  },
14425
14509
  getFallback: () => localFallback,
14426
- run: (fn) => runWithFragmentRenderCtx(frag, fn),
14427
- markDirty: () => markSlotFallbackDirty(outlet)
14510
+ run: (fn) => runWithFragmentCtx(frag, fn),
14511
+ markDirty: () => markSlotFallbackDirty(fallbackState)
14428
14512
  };
14429
- outlet = {
14513
+ fallbackState = {
14430
14514
  boundary,
14431
14515
  activeFallback: null,
14432
14516
  pendingRecheck: false,
14433
14517
  isRenderingFallback: false,
14434
14518
  getContent: () => contentState.nodes,
14435
- getParentNode: () => getSlotFallbackParentNode(currentParentNode, contentState.nodes),
14436
- getAnchor: () => currentAnchor || null,
14519
+ getParentNode: () => currentParentNode,
14520
+ getAnchor: () => currentAnchor,
14521
+ isBusy: () => false,
14437
14522
  isDisposed: () => disposed,
14438
14523
  isContentValid: () => contentState.valid,
14439
- syncEffectiveOutput: () => {
14440
- frag.nodes = getSlotEffectiveOutput(outlet);
14524
+ syncNodes: () => {
14525
+ frag.nodes = fallbackState.activeFallback || contentState.nodes;
14441
14526
  },
14442
14527
  notifyFallbackValidityChange: () => {
14443
- if (!isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
14528
+ if (slotRoot && !isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
14444
14529
  }
14445
14530
  };
14531
+ if (slotRoot) trackSlotBoundaryDirtying(frag);
14446
14532
  localFallback = fallback ? once ? () => withOnceSlot(() => fallback(internals, parentComponent)) : () => fallback(internals, parentComponent) : void 0;
14447
- const setRenderedContent = (rendered) => {
14533
+ const setRenderedContent = (rendered, knownValid) => {
14448
14534
  contentState.rendered = rendered;
14449
14535
  if (isVNode(rendered)) {
14450
14536
  contentState.nodes = resolveVNodeNodes(rendered);
14451
- contentState.valid = hasValidVNodeContent(rendered);
14537
+ contentState.valid = knownValid === void 0 ? hasValidVNodeContent(rendered) : knownValid;
14452
14538
  } else if (rendered) {
14453
14539
  contentState.nodes = rendered;
14454
- contentState.valid = isValidBlock(rendered);
14540
+ contentState.valid = knownValid === void 0 ? isValidBlock(rendered) : knownValid;
14455
14541
  } else {
14456
- contentState.nodes = [];
14542
+ contentState.nodes = EMPTY_BLOCK;
14457
14543
  contentState.valid = false;
14458
14544
  }
14459
- frag.validityPending = false;
14545
+ validityPending = false;
14460
14546
  };
14461
14547
  const notifyUpdated = () => {
14462
- if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
14548
+ if (isMounted && frag.onUpdated) frag.onUpdated.forEach((u) => u());
14549
+ };
14550
+ const notifyBeforeUpdate = () => {
14551
+ if (isMounted && frag.onBeforeUpdate) frag.onBeforeUpdate.forEach((bu) => bu());
14463
14552
  };
14464
14553
  const recheckAfterContentUpdate = (forceFallbackRecheck = false) => {
14465
14554
  isContentUpdateRecheck = true;
14466
14555
  try {
14467
- recheckSlotFallback(outlet, forceFallbackRecheck);
14556
+ recheckSlotFallback(fallbackState, forceFallbackRecheck);
14468
14557
  } finally {
14469
14558
  isContentUpdateRecheck = false;
14470
14559
  }
@@ -14475,7 +14564,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14475
14564
  };
14476
14565
  frag.insert = (parentNode, anchor) => {
14477
14566
  if (isHydrating$1) return;
14478
- currentParentNode = parentNode || void 0;
14567
+ currentParentNode = parentNode;
14479
14568
  currentAnchor = anchor;
14480
14569
  if (!isMounted) {
14481
14570
  scope.run(render);
@@ -14483,25 +14572,25 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14483
14572
  } else {
14484
14573
  if (isVNode(contentState.rendered)) internals.m(contentState.rendered, parentNode, anchor, 2, parentComponent);
14485
14574
  else if (contentState.rendered) insert(contentState.rendered, parentNode, anchor);
14486
- insertActiveSlotFallback(outlet);
14575
+ insertActiveSlotFallback(fallbackState);
14487
14576
  }
14488
14577
  notifyUpdated();
14489
14578
  };
14490
14579
  frag.remove = (parentNode) => {
14491
- currentParentNode = parentNode || currentParentNode || void 0;
14492
- currentAnchor = currentAnchor || null;
14580
+ if (parentNode) currentParentNode = parentNode;
14493
14581
  scope.stop();
14494
14582
  disposed = true;
14495
14583
  if (isVNode(contentState.rendered)) internals.um(contentState.rendered, parentComponent, null, !!parentNode);
14496
14584
  else if (contentState.rendered) remove(contentState.rendered, parentNode);
14497
- disposeSlotFallback(outlet);
14585
+ disposeSlotFallback(fallbackState);
14498
14586
  };
14499
14587
  const render = () => {
14500
14588
  const prev = currentInstance;
14501
14589
  simpleSetCurrentInstance(instance);
14502
14590
  try {
14503
14591
  const renderSlotContent = () => {
14504
- runWithFragmentRenderCtx(frag, () => withOwnedSlotBoundary(boundary, () => {
14592
+ notifyBeforeUpdate();
14593
+ runWithFragmentCtx(frag, () => withOwnedSlotBoundary(boundary, () => {
14505
14594
  let slotContent;
14506
14595
  let slotContentValid = false;
14507
14596
  if (slotsRef.value) {
@@ -14519,13 +14608,20 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14519
14608
  if (isVNode(hydratedContent)) {
14520
14609
  frag.vnode = hydratedContent;
14521
14610
  frag.$key = getVNodeKey(hydratedContent);
14522
- trackSlotVNodeUpdates(frag, hydratedContent);
14523
- if (!hydrateForwardedEmptySlotFragment(hydratedContent, parentComponent)) hydrateVNode(hydratedContent, parentComponent);
14524
- setRenderedContent(hydratedContent);
14611
+ const refreshSlotVNode = () => {
14612
+ frag.nodes = resolveVNodeNodes(hydratedContent);
14613
+ if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
14614
+ };
14615
+ trackSlotVNodeUpdatesWithRefresh(hydratedContent, refreshSlotVNode, slotRoot ? notifyBeforeUpdate : void 0);
14616
+ if (!hydrateForwardedEmptySlotFragment(hydratedContent, parentComponent, slotContentValid)) hydrateVNode(hydratedContent, parentComponent);
14617
+ const hydratedEnd = hydratedContent.anchor;
14618
+ currentParentNode = hydratedEnd.parentNode;
14619
+ currentAnchor = hydratedEnd.nextSibling;
14620
+ setRenderedContent(hydratedContent, slotContentValid);
14525
14621
  } else if (hydratedContent) {
14526
14622
  frag.vnode = null;
14527
14623
  frag.$key = void 0;
14528
- setRenderedContent(hydratedContent);
14624
+ setRenderedContent(hydratedContent, slotContentValid);
14529
14625
  } else {
14530
14626
  frag.vnode = null;
14531
14627
  frag.$key = void 0;
@@ -14537,17 +14633,20 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14537
14633
  if (isVNode(slotContent)) {
14538
14634
  frag.vnode = slotContent;
14539
14635
  frag.$key = getVNodeKey(slotContent);
14540
- trackSlotVNodeUpdatesWithRefresh(slotContent, () => {
14636
+ const refreshSlotVNode = () => {
14541
14637
  const prevValid = contentState.valid;
14542
14638
  const prevOutput = frag.nodes;
14543
14639
  setRenderedContent(slotContent);
14544
14640
  recheckAfterContentUpdate();
14545
14641
  if (contentState.valid !== prevValid || !isSameResolvedOutput(prevOutput, frag.nodes)) notifyUpdated();
14546
- });
14642
+ };
14643
+ trackSlotVNodeUpdatesWithRefresh(slotContent, refreshSlotVNode, slotRoot ? notifyBeforeUpdate : void 0);
14547
14644
  const prevRendered = contentState.rendered;
14548
- if (prevRendered && !isVNode(prevRendered)) remove(prevRendered, currentParentNode);
14549
- internals.p(isVNode(prevRendered) ? prevRendered : null, slotContent, currentParentNode, currentAnchor, parentComponent, suspense, void 0, slotContent.slotScopeIds);
14550
- setRenderedContent(slotContent);
14645
+ const prevIsVNode = isVNode(prevRendered);
14646
+ const prevVNode = prevIsVNode && (!fallbackState.activeFallback || contentState.valid) ? prevRendered : null;
14647
+ if (prevRendered && !prevIsVNode) remove(prevRendered, currentParentNode);
14648
+ internals.p(prevVNode, slotContent, currentParentNode, currentAnchor, parentComponent, suspense, void 0, slotContent.slotScopeIds);
14649
+ setRenderedContent(slotContent, slotContentValid);
14551
14650
  finishContentUpdate();
14552
14651
  return;
14553
14652
  }
@@ -14558,7 +14657,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14558
14657
  if (isVNode(prevRendered)) internals.um(prevRendered, parentComponent, null, true);
14559
14658
  else if (prevRendered) remove(prevRendered, currentParentNode);
14560
14659
  insert(slotContent, currentParentNode, currentAnchor);
14561
- setRenderedContent(slotContent);
14660
+ setRenderedContent(slotContent, slotContentValid);
14562
14661
  finishContentUpdate();
14563
14662
  return;
14564
14663
  }
@@ -14578,23 +14677,25 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14578
14677
  frag.hydrate = () => {
14579
14678
  if (!isHydrating$1) return;
14580
14679
  scope.run(render);
14581
- currentParentNode = currentHydrationNode.parentNode;
14582
- currentAnchor = currentHydrationNode;
14680
+ if (!currentParentNode) {
14681
+ currentAnchor = getCurrentSlotEndAnchor() || currentHydrationNode;
14682
+ currentParentNode = currentAnchor.parentNode;
14683
+ }
14583
14684
  isMounted = true;
14584
14685
  };
14585
14686
  return frag;
14586
14687
  }
14587
- function shouldUseCurrentParent(block) {
14588
- if (isVaporComponent(block)) return isKeepAlive(block) || shouldUseCurrentParent(block.block);
14589
- if (isArray(block)) return block.some(shouldUseCurrentParent);
14590
- if (isFragment(block)) return shouldUseCurrentParent(block.nodes);
14688
+ function needsHostParentForRemove(block) {
14689
+ if (isVaporComponent(block)) return isKeepAlive(block) || needsHostParentForRemove(block.block);
14690
+ if (isArray(block)) return block.some(needsHostParentForRemove);
14691
+ if (isFragment(block)) return needsHostParentForRemove(block.nodes);
14591
14692
  return false;
14592
14693
  }
14593
14694
  const vaporInteropPlugin = (app) => {
14594
14695
  enableSuspense();
14595
14696
  setInteropEnabled();
14596
14697
  const internals = ensureRenderer().internals;
14597
- app._context.vapor = extend(vaporInteropImpl, {
14698
+ app._context.vapor = extend({}, vaporInteropImpl, {
14598
14699
  vdomMount: createVDOMComponent.bind(null, internals),
14599
14700
  vdomUnmount: internals.umt,
14600
14701
  vdomSlot: renderVDOMSlot.bind(null, internals),
@@ -14617,30 +14718,17 @@ function createFallback(fallback, parentComponent, isVNodeFallback) {
14617
14718
  const internals = ensureRenderer().internals;
14618
14719
  return () => {
14619
14720
  if (isVNodeFallback()) {
14620
- const frag = createVNodeChildrenFragment(internals, () => fallback().map(normalizeVNode), parentComponent);
14721
+ const frag = createVNodeChildrenFragment(internals, () => {
14722
+ const children = fallback();
14723
+ return children == null ? EMPTY_VNODES : normalizeInteropSlotValue(children);
14724
+ }, parentComponent);
14621
14725
  if (isHydrating$1 && frag.hydrate) frag.hydrate();
14622
14726
  return frag;
14623
14727
  }
14624
14728
  return fallback();
14625
14729
  };
14626
14730
  }
14627
- const renderEmptyVNodes = () => [];
14628
- function runWithFragmentRenderCtx(fragment, fn) {
14629
- const prevSlotOwner = setCurrentSlotOwner(fragment.slotOwner);
14630
- let prevKeepAliveCtx = null;
14631
- if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(fragment.keepAliveCtx || null);
14632
- try {
14633
- return withOwnedSlotBoundary(fragment.inheritedSlotBoundary, fn);
14634
- } finally {
14635
- if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
14636
- setCurrentSlotOwner(prevSlotOwner);
14637
- }
14638
- }
14639
- function getSlotFallbackParentNode(currentParentNode, content) {
14640
- if (currentParentNode) return currentParentNode;
14641
- const carrierAnchor = findFirstSlotFallbackCarrierNode(content);
14642
- return carrierAnchor ? carrierAnchor.parentNode : null;
14643
- }
14731
+ const renderEmptyVNodes = () => EMPTY_VNODES;
14644
14732
  function resolveInteropVaporSlotState(vnode) {
14645
14733
  const slot = vnode.vs;
14646
14734
  let state = slot.state;
@@ -14688,12 +14776,14 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14688
14776
  simpleSetCurrentInstance(parentComponent);
14689
14777
  if (isSuspenseEnabled && parentSuspense) prevSuspense = setParentSuspense(parentSuspense);
14690
14778
  try {
14691
- if (!vnode.vs || !vnode.vs.slot) return [];
14779
+ if (!vnode.vs || !vnode.vs.slot) return EMPTY_BLOCK;
14692
14780
  const slotState = resolveInteropVaporSlotState(vnode);
14693
- const frag = new VaporFragment([]);
14694
- frag.validityPending = !isHydrating$1;
14781
+ const scopeIds = getInteropVaporSlotScopeIds(vnode, parentComponent);
14782
+ const frag = createInteropFragment();
14783
+ let validityPending = !isHydrating$1;
14784
+ frag.isBlockValid = () => validityPending ? true : isValidBlock(frag.nodes);
14695
14785
  const inheritedBoundary = frag.inheritedSlotBoundary;
14696
- let contentNodes = [];
14786
+ let contentNodes = EMPTY_BLOCK;
14697
14787
  let isResolvingContent = false;
14698
14788
  let localFallback;
14699
14789
  let outletFallback;
@@ -14701,13 +14791,13 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14701
14791
  let currentAnchor = null;
14702
14792
  let slotScope;
14703
14793
  let disposed = false;
14704
- let outlet;
14794
+ let fallbackState;
14705
14795
  let ownedSlotFragment;
14706
14796
  let ownedSlotFragmentDirtyQueued = false;
14707
14797
  const markInteropFallbackDirty = () => {
14708
14798
  const target = ownedSlotFragment;
14709
14799
  if (!target) {
14710
- markSlotFallbackDirty(outlet);
14800
+ markSlotFallbackDirty(fallbackState);
14711
14801
  return;
14712
14802
  }
14713
14803
  if (ownedSlotFragmentDirtyQueued) return;
@@ -14715,7 +14805,6 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14715
14805
  queuePostFlushCb(() => {
14716
14806
  ownedSlotFragmentDirtyQueued = false;
14717
14807
  markSlotFallbackDirty(target);
14718
- syncActiveSlotFallback(target);
14719
14808
  });
14720
14809
  };
14721
14810
  const outletFallbackBoundary = {
@@ -14723,7 +14812,7 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14723
14812
  return inheritedBoundary;
14724
14813
  },
14725
14814
  getFallback: () => slotState.outletFallback.value ? outletFallback : void 0,
14726
- run: (fn) => runWithFragmentRenderCtx(frag, fn),
14815
+ run: (fn) => runWithFragmentCtx(frag, fn),
14727
14816
  markDirty: markInteropFallbackDirty
14728
14817
  };
14729
14818
  const localFallbackBoundary = {
@@ -14731,37 +14820,38 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14731
14820
  return outletFallbackBoundary;
14732
14821
  },
14733
14822
  getFallback: () => slotState.localFallback.value ? localFallback : void 0,
14734
- run: (fn) => runWithFragmentRenderCtx(frag, fn),
14823
+ run: (fn) => runWithFragmentCtx(frag, fn),
14735
14824
  markDirty: markInteropFallbackDirty
14736
14825
  };
14737
- outlet = {
14826
+ fallbackState = {
14738
14827
  boundary: localFallbackBoundary,
14739
14828
  activeFallback: null,
14740
14829
  pendingRecheck: false,
14741
14830
  isRenderingFallback: false,
14742
14831
  getContent: () => contentNodes,
14743
- getParentNode: () => getSlotFallbackParentNode(currentParentNode, contentNodes),
14832
+ getParentNode: () => currentParentNode,
14744
14833
  getAnchor: () => currentAnchor,
14745
14834
  isBusy: () => isResolvingContent,
14746
14835
  isDisposed: () => disposed,
14747
- syncEffectiveOutput: () => {
14748
- frag.nodes = getSlotEffectiveOutput(outlet);
14749
- frag.validityPending = false;
14836
+ isContentValid: () => isValidBlock(contentNodes),
14837
+ syncNodes: () => {
14838
+ frag.nodes = fallbackState.activeFallback || contentNodes;
14839
+ validityPending = false;
14750
14840
  },
14751
14841
  notifyFallbackValidityChange: () => {
14752
14842
  if (inheritedBoundary) inheritedBoundary.markDirty();
14753
14843
  }
14754
14844
  };
14755
14845
  const takePendingRecheck = () => {
14756
- const shouldRecheck = outlet.pendingRecheck;
14757
- outlet.pendingRecheck = false;
14846
+ const shouldRecheck = fallbackState.pendingRecheck;
14847
+ fallbackState.pendingRecheck = false;
14758
14848
  return shouldRecheck;
14759
14849
  };
14760
14850
  const dispose = (parentNode) => {
14761
14851
  if (disposed) return;
14762
- currentParentNode = parentNode || currentParentNode;
14852
+ if (parentNode) currentParentNode = parentNode;
14763
14853
  disposed = true;
14764
- disposeSlotFallback(outlet);
14854
+ disposeSlotFallback(fallbackState);
14765
14855
  slotScope = void 0;
14766
14856
  currentParentNode = null;
14767
14857
  currentAnchor = null;
@@ -14769,22 +14859,23 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14769
14859
  try {
14770
14860
  localFallback = createFallback(() => (slotState.localFallback.value || renderEmptyVNodes)(), parentComponent, () => !!slotState.localFallback.value && !!slotState.localFallback.value.__vdom);
14771
14861
  outletFallback = createFallback(() => (slotState.outletFallback.value || renderEmptyVNodes)(), parentComponent, () => !!slotState.outletFallback.value && !!slotState.outletFallback.value.__vdom);
14772
- const preferSlotFragmentOwnership = !!slotState.localFallback.value || !!slotState.outletFallback.value;
14773
- outlet.pendingRecheck = false;
14862
+ const hasInteropFallback = !!slotState.localFallback.value || !!slotState.outletFallback.value;
14863
+ fallbackState.pendingRecheck = false;
14774
14864
  const finalizeResolvedContent = (resolvedContent) => {
14775
- if (preferSlotFragmentOwnership && resolvedContent instanceof SlotFragment) return resolvedContent;
14776
- contentNodes = resolvedContent || [];
14777
- recheckSlotFallback(outlet, takePendingRecheck());
14865
+ if (resolvedContent && scopeIds) setScopeId(resolvedContent, scopeIds);
14866
+ if (hasInteropFallback && resolvedContent instanceof SlotFragment) return resolvedContent;
14867
+ contentNodes = resolvedContent || EMPTY_BLOCK;
14868
+ recheckSlotFallback(fallbackState, takePendingRecheck());
14778
14869
  return resolvedContent;
14779
14870
  };
14780
14871
  let resolvedContent;
14781
14872
  isResolvingContent = true;
14782
14873
  try {
14783
- if (isHydrating$1) resolvedContent = withHydratingSlotBoundary(() => finalizeResolvedContent(runWithFragmentRenderCtx(frag, () => {
14874
+ if (isHydrating$1) resolvedContent = withHydratingSlotBoundary(() => finalizeResolvedContent(runWithFragmentCtx(frag, () => {
14784
14875
  const renderSlot = () => withOwnedSlotBoundary(localFallbackBoundary, () => invokeVaporSlot(vnode));
14785
14876
  return hasSlotFallback(localFallbackBoundary) ? withHydratingSlotFallbackActive(renderSlot) : renderSlot();
14786
14877
  })));
14787
- else resolvedContent = finalizeResolvedContent(runWithFragmentRenderCtx(frag, () => withOwnedSlotBoundary(localFallbackBoundary, () => invokeVaporSlot(vnode))));
14878
+ else resolvedContent = finalizeResolvedContent(runWithFragmentCtx(frag, () => withOwnedSlotBoundary(localFallbackBoundary, () => invokeVaporSlot(vnode))));
14788
14879
  } finally {
14789
14880
  isResolvingContent = false;
14790
14881
  }
@@ -14795,30 +14886,30 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
14795
14886
  onScopeDispose(() => dispose(), true);
14796
14887
  });
14797
14888
  }
14798
- if (preferSlotFragmentOwnership && resolvedContent instanceof SlotFragment) {
14889
+ if (hasInteropFallback && resolvedContent instanceof SlotFragment) {
14799
14890
  ownedSlotFragment = resolvedContent;
14800
14891
  trackInteropFallbackChanges(vnode.vs.scope, slotState, () => markInteropFallbackDirty());
14801
14892
  dispose();
14802
14893
  return resolvedContent;
14803
14894
  }
14804
- outlet.pendingRecheck = false;
14895
+ fallbackState.pendingRecheck = false;
14805
14896
  frag.insert = (parentNode, anchor) => {
14806
14897
  currentParentNode = parentNode;
14807
14898
  currentAnchor = anchor;
14808
- if (outlet.activeFallback) {
14809
- insertActiveSlotFallback(outlet);
14810
- mutateSlotFallbackCarrier(contentNodes, (block) => insert(block, parentNode, anchor));
14811
- } else insert(frag.nodes, parentNode, anchor);
14899
+ if (fallbackState.activeFallback) insertActiveSlotFallback(fallbackState);
14900
+ else insert(frag.nodes, parentNode, anchor);
14812
14901
  };
14813
14902
  frag.remove = (parentNode) => {
14814
- if (outlet.activeFallback) mutateSlotFallbackCarrier(contentNodes, (block) => remove(block, parentNode));
14815
- else remove(frag.nodes, parentNode);
14903
+ if (!fallbackState.activeFallback) remove(frag.nodes, parentNode);
14816
14904
  dispose(parentNode);
14817
14905
  };
14818
14906
  trackInteropFallbackChanges(vnode.vs.scope, slotState, () => {
14819
- recheckSlotFallback(outlet, true);
14820
- syncActiveSlotFallback(outlet);
14907
+ recheckSlotFallback(fallbackState, true);
14821
14908
  });
14909
+ if (isHydrating$1 && currentHydrationNode) {
14910
+ currentAnchor = currentHydrationNode;
14911
+ currentParentNode = currentAnchor.parentNode;
14912
+ }
14822
14913
  return frag;
14823
14914
  } catch (e) {
14824
14915
  dispose();
@@ -14894,24 +14985,24 @@ function ensureVNodeHookState(instance, vnode) {
14894
14985
  }
14895
14986
  function createVNodeChildrenFragment(internals, render, parentComponent) {
14896
14987
  const suspense = parentSuspense || parentComponent && parentComponent.suspense;
14897
- const frag = new VaporFragment([]);
14988
+ const frag = createInteropFragment();
14898
14989
  let contentValid = false;
14899
- frag.validityPending = !isHydrating$1;
14900
- frag.isBlockValid = () => frag.validityPending ? true : contentValid;
14990
+ let validityPending = !isHydrating$1;
14991
+ frag.isBlockValid = () => validityPending ? true : contentValid;
14901
14992
  let currentVNode = null;
14902
- let currentChildren = [];
14993
+ let currentChildren = EMPTY_VNODES;
14903
14994
  let currentParentNode = null;
14904
14995
  let currentAnchor = null;
14905
14996
  let isMounted = false;
14906
14997
  let isRenderEffectStarted = false;
14907
14998
  const scope = effectScope();
14908
14999
  const syncResolvedNodes = (children = currentChildren) => {
14909
- const prevValid = frag.validityPending ? true : contentValid;
15000
+ const prevValid = validityPending ? true : contentValid;
14910
15001
  contentValid = !!ensureValidVNode(children);
14911
- if (children.length === 0) frag.nodes = [];
15002
+ if (children.length === 0) frag.nodes = EMPTY_BLOCK;
14912
15003
  else if (children.length === 1) frag.nodes = resolveVNodeNodes(children[0]);
14913
15004
  else frag.nodes = children.map(resolveVNodeNodes);
14914
- frag.validityPending = false;
15005
+ validityPending = false;
14915
15006
  return prevValid !== contentValid;
14916
15007
  };
14917
15008
  const notifyUpdated = (validityChanged = false) => {
@@ -14923,7 +15014,7 @@ function createVNodeChildrenFragment(internals, render, parentComponent) {
14923
15014
  simpleSetCurrentInstance(parentComponent);
14924
15015
  try {
14925
15016
  renderEffect(() => {
14926
- runWithFragmentRenderCtx(frag, () => {
15017
+ runWithFragmentCtx(frag, () => {
14927
15018
  const nextChildren = render();
14928
15019
  if (isHydrating$1) {
14929
15020
  nextChildren.forEach((vnode) => hydrateVNode(vnode, parentComponent));
@@ -14935,8 +15026,9 @@ function createVNodeChildrenFragment(internals, render, parentComponent) {
14935
15026
  } else if (!isMounted) {
14936
15027
  currentChildren = nextChildren;
14937
15028
  currentVNode = createVNode(Fragment, null, nextChildren);
14938
- contentValid = !!ensureValidVNode(nextChildren);
14939
- frag.validityPending = false;
15029
+ const wasPending = validityPending;
15030
+ const validityChanged = syncResolvedNodes(nextChildren);
15031
+ if (!wasPending) notifyUpdated(validityChanged);
14940
15032
  return;
14941
15033
  } else if (!currentVNode) {
14942
15034
  currentChildren = nextChildren;
@@ -15022,7 +15114,23 @@ function normalizeInteropSlots(rawSlots) {
15022
15114
  });
15023
15115
  return normalized;
15024
15116
  }
15117
+ const interopSlotCache = /* @__PURE__ */ new WeakMap();
15025
15118
  function normalizeInteropSlot(rawSlot, ctx) {
15119
+ let cache = interopSlotCache.get(rawSlot);
15120
+ if (!cache) interopSlotCache.set(rawSlot, cache = {});
15121
+ if (ctx) {
15122
+ let ctxCache = cache.ctx;
15123
+ if (!ctxCache) cache.ctx = ctxCache = /* @__PURE__ */ new WeakMap();
15124
+ const cached = ctxCache.get(ctx);
15125
+ if (cached) return cached;
15126
+ const normalized = createNormalizedInteropSlot(rawSlot, ctx);
15127
+ ctxCache.set(ctx, normalized);
15128
+ return normalized;
15129
+ }
15130
+ if (cache.noCtx) return cache.noCtx;
15131
+ return cache.noCtx = createNormalizedInteropSlot(rawSlot, ctx);
15132
+ }
15133
+ function createNormalizedInteropSlot(rawSlot, ctx) {
15026
15134
  const normalized = withCtx((...args) => normalizeInteropSlotValue(rawSlot(...args)), ctx);
15027
15135
  normalized._c = false;
15028
15136
  return normalized;
@@ -15036,7 +15144,7 @@ function normalizeInteropDefaultSlot(value) {
15036
15144
  function normalizeInteropSlotValue(value) {
15037
15145
  return isArray(value) ? value.map((child) => normalizeVNode(child)) : [normalizeVNode(value)];
15038
15146
  }
15039
- const isInternalSlotKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
15147
+ const isInternalSlotKey = (key) => key === "_" || key === "_ctx" || key === "$stable" || key === "$";
15040
15148
  const interopSlotsSourceHandlers = {
15041
15149
  get(target, key) {
15042
15150
  const slots = target.value;
@@ -15048,7 +15156,7 @@ const interopSlotsSourceHandlers = {
15048
15156
  },
15049
15157
  ownKeys(target) {
15050
15158
  const slots = target.value;
15051
- return slots ? Object.keys(slots).filter((key) => !isInternalSlotKey(key)) : [];
15159
+ return slots ? Object.keys(slots).filter((key) => !isInternalSlotKey(key)) : EMPTY_ARR;
15052
15160
  },
15053
15161
  getOwnPropertyDescriptor(target, key) {
15054
15162
  const slots = target.value;
@@ -15088,11 +15196,27 @@ function setInteropVnodeScopeId(instance, vnode, parentComponent) {
15088
15196
  }
15089
15197
  if (interopScopeIdRootMap.get(instance) === root) return;
15090
15198
  interopScopeIdRootMap.set(instance, root);
15199
+ const scopeIds = getInteropVnodeScopeIds(vnode, parentComponent);
15200
+ if (!scopeIds) return;
15201
+ for (let i = 0; i < scopeIds.length; i++) root.setAttribute(scopeIds[i], "");
15202
+ }
15203
+ function getInteropVnodeScopeIds(vnode, parentComponent) {
15091
15204
  const scopeIds = [];
15092
15205
  if (vnode.scopeId) scopeIds.push(vnode.scopeId);
15093
15206
  if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
15094
15207
  scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
15095
- for (let i = 0; i < scopeIds.length; i++) root.setAttribute(scopeIds[i], "");
15208
+ return scopeIds.length ? scopeIds : void 0;
15209
+ }
15210
+ function getInteropVaporSlotScopeIds(vnode, parentComponent) {
15211
+ const scopeIds = [];
15212
+ if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
15213
+ scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
15214
+ return scopeIds.length ? scopeIds : void 0;
15215
+ }
15216
+ function createInteropFragment(nodes = EMPTY_BLOCK, vnode = null) {
15217
+ const frag = new VaporFragment(nodes);
15218
+ frag.vnode = vnode;
15219
+ return frag;
15096
15220
  }
15097
15221
  //#endregion
15098
15222
  //#region packages/runtime-vapor/src/components/Teleport.ts
@@ -15211,8 +15335,6 @@ var TeleportFragment = class extends VaporFragment {
15211
15335
  }
15212
15336
  bindChildren(block) {
15213
15337
  if (this.parentComponent && this.parentComponent.ut) this.registerUpdateCssVars(block);
15214
- if (isVaporComponent(block)) block.parentTeleport = this;
15215
- else if (isArray(block)) block.forEach((node) => isVaporComponent(node) && (node.parentTeleport = this));
15216
15338
  }
15217
15339
  handleChildrenUpdate(children) {
15218
15340
  if (isHydrating$1 || !this.parent || !this.mountContainer) {
@@ -15220,7 +15342,10 @@ var TeleportFragment = class extends VaporFragment {
15220
15342
  return;
15221
15343
  }
15222
15344
  remove(this.nodes, this.mountContainer);
15223
- insert(this.nodes = children, this.mountContainer, this.mountAnchor);
15345
+ this.nodes = children;
15346
+ const onBeforeInsert = this.onBeforeInsert;
15347
+ if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(this.nodes));
15348
+ insert(children, this.mountContainer, this.mountAnchor);
15224
15349
  this.bindChildren(this.nodes);
15225
15350
  updateCssVars(this);
15226
15351
  }
@@ -15228,6 +15353,8 @@ var TeleportFragment = class extends VaporFragment {
15228
15353
  if (isTransitionEnabled && this.$transition && !this.isMounted) applyTransitionHooks(this.nodes, this.$transition);
15229
15354
  if (this.isMounted) move(this.nodes, this.mountContainer = parent, this.mountAnchor = anchor, 2);
15230
15355
  else {
15356
+ const onBeforeInsert = this.onBeforeInsert;
15357
+ if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(this.nodes));
15231
15358
  insert(this.nodes, this.mountContainer = parent, this.mountAnchor = anchor);
15232
15359
  this.isMounted = true;
15233
15360
  }
@@ -15368,7 +15495,7 @@ const defineVaporSSRCustomElement = ((options, extraOptions) => {
15368
15495
  });
15369
15496
  var VaporElement = class extends VueElementBase {
15370
15497
  constructor(def, props = {}, createAppFn = createVaporApp) {
15371
- super(def, props, createAppFn);
15498
+ super(def, /* @__PURE__ */ shallowReactive(props), createAppFn);
15372
15499
  }
15373
15500
  _needsHydration() {
15374
15501
  const hydrate = vaporCustomElementHydrates.get(this.constructor);
@@ -15387,13 +15514,9 @@ var VaporElement = class extends VueElementBase {
15387
15514
  this._app.mount(this._root);
15388
15515
  if (!this.shadowRoot) this._renderSlots();
15389
15516
  }
15390
- _update() {
15391
- if (!this._app) return;
15392
- const renderEffects = this._instance.renderEffects;
15393
- if (renderEffects) renderEffects.forEach((e) => e.run());
15394
- }
15517
+ _update() {}
15395
15518
  _unmount() {
15396
- this._app.unmount();
15519
+ if (this._app) this._app.unmount();
15397
15520
  if (this._instance && this._instance.ce) this._instance.ce = void 0;
15398
15521
  this._app = this._instance = null;
15399
15522
  }
@@ -15425,12 +15548,12 @@ var VaporElement = class extends VueElementBase {
15425
15548
  else this._updateFragmentNodes(nodes, replacements);
15426
15549
  }
15427
15550
  _createComponent() {
15428
- this._def.ce = (instance) => {
15551
+ const ce = (instance) => {
15429
15552
  this._app._ceComponent = this._instance = instance;
15430
15553
  if (!this.shadowRoot) this._instance.u = [this._renderSlots.bind(this)];
15431
15554
  this._processInstance();
15432
15555
  };
15433
- createComponent(this._def, this._props, void 0, void 0, void 0, this._app._context);
15556
+ createComponent(this._def, this._props, void 0, void 0, void 0, this._app._context, false, ce);
15434
15557
  }
15435
15558
  };
15436
15559
  //#endregion
@@ -15490,10 +15613,10 @@ function createIf(condition, b1, b2, flags = 1) {
15490
15613
  }
15491
15614
  frag = ok ? b1() : b2 ? b2() : [/* @__PURE__ */ createComment("if")];
15492
15615
  } else {
15493
- const index = flags >> 7;
15616
+ const index = flags >> 8;
15494
15617
  const keyed = index > 0;
15495
15618
  const keyBase = keyed ? (index - 1) * 2 : 0;
15496
- frag = new DynamicFragment("if", keyed, false);
15619
+ frag = new DynamicFragment("if", keyed, false, !!(flags & 128));
15497
15620
  renderEffect(() => {
15498
15621
  const ok = condition();
15499
15622
  if (isHydrating$1) {
@@ -15565,10 +15688,10 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15565
15688
  let parentAnchor;
15566
15689
  let pendingHydrationAnchor = false;
15567
15690
  if (!isHydrating$1) parentAnchor = /* @__PURE__ */ createComment("for");
15568
- const frag = new ForFragment(oldBlocks);
15691
+ const frag = new ForFragment(oldBlocks, !!(flags & 32));
15569
15692
  const instance = currentInstance;
15570
- const canUseFastRemove = !!(flags & 1);
15571
15693
  const isComponent = !!(flags & 2);
15694
+ const canUseFastRemove = !!(flags & 1) && !isComponent;
15572
15695
  const isSingleNode = !!(flags & 8);
15573
15696
  const isFragment = !!(flags & 16);
15574
15697
  const slotOwner = currentSlotOwner;
@@ -15590,8 +15713,9 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15590
15713
  for (let i = 0; i < newLength; i++) newKeys[i] = getKey(...getItem(source, i));
15591
15714
  }
15592
15715
  const prevSub = setActiveSub();
15593
- if (isMounted && frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
15594
- if (!isMounted) {
15716
+ const wasMounted = isMounted;
15717
+ if (wasMounted && frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
15718
+ if (!wasMounted) {
15595
15719
  isMounted = true;
15596
15720
  if (isHydrating$1) hydrateList(source, newLength);
15597
15721
  else for (let i = 0; i < newLength; i++) mount(source, i);
@@ -15608,7 +15732,10 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15608
15732
  }
15609
15733
  } else if (!getKey) {
15610
15734
  const commonLength = Math.min(newLength, oldLength);
15611
- for (let i = 0; i < commonLength; i++) update(newBlocks[i] = oldBlocks[i], getItem(source, i)[0]);
15735
+ for (let i = 0; i < commonLength; i++) {
15736
+ const item = getItem(source, i);
15737
+ update(newBlocks[i] = oldBlocks[i], ...item);
15738
+ }
15612
15739
  for (let i = oldLength; i < newLength; i++) mount(source, i);
15613
15740
  for (let i = newLength; i < oldLength; i++) unmount(oldBlocks[i]);
15614
15741
  } else {
@@ -15646,7 +15773,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15646
15773
  const currentKey = newKeys[i];
15647
15774
  const oldBlock = oldBlocks[i];
15648
15775
  const oldKey = oldBlock.key;
15649
- if (oldKey === currentKey) update(newBlocks[i] = oldBlock, currentItem[0]);
15776
+ if (oldKey === currentKey) update(newBlocks[i] = oldBlock, ...currentItem);
15650
15777
  else {
15651
15778
  queuedBlocks[queuedBlocksLength++] = [
15652
15779
  i,
@@ -15747,7 +15874,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15747
15874
  }
15748
15875
  frag.nodes = [oldBlocks = newBlocks];
15749
15876
  if (parentAnchor) frag.nodes.push(parentAnchor);
15750
- if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
15877
+ if (wasMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
15751
15878
  setActiveSub(prevSub);
15752
15879
  };
15753
15880
  const needKey = renderItem.length > 1;
@@ -15775,7 +15902,11 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15775
15902
  if (frag.$transition.applyGroup) setBlockKey(block.nodes, block.key);
15776
15903
  applyTransitionHooks(block.nodes, frag.$transition);
15777
15904
  }
15778
- if (parent) insertForBlock(block, anchor);
15905
+ if (parent) {
15906
+ const onBeforeInsert = frag.onBeforeInsert;
15907
+ if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(block.nodes));
15908
+ insertForBlock(block, anchor);
15909
+ }
15779
15910
  return block;
15780
15911
  };
15781
15912
  function hydrateList(source, newLength) {
@@ -15957,11 +16088,14 @@ function normalizeSource(source) {
15957
16088
  isReadonlySource = /* @__PURE__ */ isReadonly(source);
15958
16089
  }
15959
16090
  } else if (isString(source)) values = source.split("");
15960
- else if (typeof source === "number") {
15961
- if (!Number.isInteger(source)) warn(`The v-for range expect an integer value but got ${source}.`);
16091
+ else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
16092
+ warn(`The v-for range expects a positive integer value but got ${source}.`);
16093
+ values = [];
16094
+ } else {
15962
16095
  values = new Array(source);
15963
16096
  for (let i = 0; i < source; i++) values[i] = i + 1;
15964
- } else if (isObject(source)) if (source[Symbol.iterator]) values = Array.from(source);
16097
+ }
16098
+ else if (isObject(source)) if (source[Symbol.iterator]) values = Array.from(source);
15965
16099
  else {
15966
16100
  keys = Object.keys(source);
15967
16101
  values = new Array(keys.length);
@@ -15998,8 +16132,7 @@ function normalizeAnchor(node) {
15998
16132
  return;
15999
16133
  } else if (isVaporComponent(node)) return normalizeAnchor(node.block);
16000
16134
  else {
16001
- const getEffectiveOutput = node.getEffectiveOutput;
16002
- const nodes = getEffectiveOutput ? getEffectiveOutput.call(node) : node.nodes;
16135
+ const nodes = node.nodes;
16003
16136
  return isValidBlock(nodes) ? normalizeAnchor(nodes) : node.anchor || normalizeAnchor(nodes);
16004
16137
  }
16005
16138
  }
@@ -16008,8 +16141,8 @@ function getRestElement(val, keys) {
16008
16141
  for (const key in val) if (!keys.includes(key)) res[key] = val[key];
16009
16142
  return res;
16010
16143
  }
16011
- function getDefaultValue(val, defaultVal) {
16012
- return val === void 0 ? defaultVal : val;
16144
+ function getDefaultValue(val, getDefaultVal) {
16145
+ return val === void 0 ? getDefaultVal() : val;
16013
16146
  }
16014
16147
  function isForBlock(block) {
16015
16148
  return block instanceof ForBlock;
@@ -16200,12 +16333,15 @@ function setVarsOnBlock(block, vars) {
16200
16333
  }
16201
16334
  //#endregion
16202
16335
  //#region packages/runtime-vapor/src/apiCreateDynamicComponent.ts
16203
- function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once) {
16336
+ function createDynamicComponent(getter, rawProps, rawSlots, flags = 0) {
16337
+ const isSingleRoot = !!(flags & 1);
16338
+ const once = !!(flags & 2);
16339
+ const slotRoot = !!(flags & 4);
16204
16340
  const _insertionParent = insertionParent;
16205
16341
  const _insertionAnchor = insertionAnchor;
16206
16342
  if (!isHydrating$1) resetInsertionState();
16207
16343
  const hydrationCursor = isHydrating$1 ? captureHydrationCursor() : null;
16208
- const frag = new DynamicFragment("dynamic-component");
16344
+ const frag = new DynamicFragment("dynamic-component", false, true, slotRoot);
16209
16345
  const normalizedRawSlots = normalizeRawSlots(rawSlots);
16210
16346
  const scopeOwner = getScopeOwner();
16211
16347
  const renderFn = () => {
@@ -16374,7 +16510,7 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16374
16510
  for (let i = 0; i < children.length; i++) {
16375
16511
  const child = children[i];
16376
16512
  const el = isValidTransitionBlock(child) && child.$transition ? getTransitionElement(child) : void 0;
16377
- if (el) {
16513
+ if (el && !el[vShowHidden]) {
16378
16514
  prevChildren.push(child);
16379
16515
  child.$transition.disabled = true;
16380
16516
  positionMap.set(child, el.getBoundingClientRect());
@@ -16517,7 +16653,7 @@ function getTransitionBlocks(block, onFragment, onUpdateOwner) {
16517
16653
  let children = [];
16518
16654
  if (block instanceof Element) children.push(block);
16519
16655
  else if (isVaporComponent(block)) {
16520
- const isRootSlot = block.block instanceof SlotFragment;
16656
+ const isRootSlot = block.block && isSlotFragment(block.block);
16521
16657
  if (onUpdateOwner && !isRootSlot) onUpdateOwner(block);
16522
16658
  const blocks = getTransitionBlocks(block.block, onFragment, isRootSlot ? onUpdateOwner : void 0);
16523
16659
  inheritKey(blocks, block.$key);
@@ -16563,4 +16699,4 @@ function getFirstConnectedChild(children) {
16563
16699
  }
16564
16700
  }
16565
16701
  //#endregion
16566
- export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAssetComponent, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onBinding, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, withVaporCtx, withVaporDirectives, withVaporKeys, withVaporModifiers, xlinkNS };
16702
+ export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAssetComponent, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onBinding, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, withVaporDirectives, withVaporKeys, withVaporModifiers, xlinkNS };