@vue/runtime-vapor 3.6.0-beta.12 → 3.6.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vue/runtime-vapor v3.6.0-beta.12
2
+ * @vue/runtime-vapor v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { EffectScope, Fragment, NULL_DYNAMIC_COMPONENT, Static, TransitionPropsValidators, VaporSlot, VueElementBase, activate, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, createAppAPI, createAsyncComponentContext, createCanSetSetupRefChecker, createInternalObject, createVNode, currentInstance, currentInstance as currentInstance$1, deactivate, devtoolsComponentAdded, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, handleError, handleMovedChildren, hasCSSTransform, initFeatureFlags, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMismatchAllowed, isRef, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, matches, mergeProps, nextUid, normalizeContainer, normalizeRef, normalizeVNode, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUpdated, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popWarningContext, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, renderSlot, resetShapeFlag, resolveDynamicComponent, resolvePropValue, resolveTeleportTarget, resolveTransitionProps, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, startMeasure, toClassSet, toStyleMap, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useTransitionState, vModelCheckboxInit, vModelCheckboxUpdate, vModelGetValue, vModelSelectInit, vModelSetSelected, vModelTextInit, vModelTextUpdate, vShowHidden, vShowOriginalDisplay, validateProps, warn, warnExtraneousAttributes, warnPropMismatch, watch, withAsyncContext as withAsyncContext$1, withCtx, xlinkNS } from "@vue/runtime-dom";
6
+ import { EffectScope, Fragment, NULL_DYNAMIC_COMPONENT, Static, TransitionPropsValidators, VaporSlot, VueElementBase, activate, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, createAppAPI, createAsyncComponentContext, createCanSetSetupRefChecker, createInternalObject, createVNode, currentInstance, currentInstance as currentInstance$1, deactivate, devtoolsComponentAdded, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, handleError, handleMovedChildren, hasCSSTransform, initFeatureFlags, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMismatchAllowed, isRef, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, matches, mergeProps, nextUid, normalizeContainer, normalizeRef, normalizeVNode, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUpdated, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popWarningContext, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, renderSlot, resetShapeFlag, resolveComponent, resolveDynamicComponent, resolvePropValue, resolveTeleportTarget, resolveTransitionProps, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, startMeasure, toClassSet, toStyleMap, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useTransitionState, vModelCheckboxInit, vModelCheckboxUpdate, vModelGetValue, vModelSelectInit, vModelSetSelected, vModelTextInit, vModelTextUpdate, vShowHidden, vShowOriginalDisplay, validateProps, warn, warnExtraneousAttributes, warnPropMismatch, watch, withAsyncContext as withAsyncContext$1, withCtx, withKeys, withModifiers, xlinkNS } from "@vue/runtime-dom";
7
7
  import { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, camelize, canSetValueDirectly, extend, getEscapedCssVarName, getGlobalThis, hasOwn, includeBooleanAttr, invokeArrayFns, isArray, isFunction, isObject, isOn, isPlainObject, isPromise, isReservedProp, isString, looseEqual, normalizeClass, normalizeCssVarValue, normalizeStyle, parseStringStyle, remove as remove$1, stringifyStyle, toDisplayString } from "@vue/shared";
8
8
  import { EffectScope as EffectScope$1, ReactiveEffect, computed, effectScope, getCurrentScope, isReactive, isReadonly, isRef as isRef$1, isShallow, markRaw, onEffectCleanup, onScopeDispose as onScopeDispose$1, pauseTracking, proxyRefs, resetTracking, setActiveSub, shallowReadArray, shallowRef as shallowRef$1, toRaw, toReactive, toReadonly, traverse, unref, watch as watch$1 } from "@vue/reactivity";
9
9
  //#region packages/runtime-vapor/src/insertionState.ts
@@ -30,6 +30,7 @@ function resetInsertionState() {
30
30
  }
31
31
  //#endregion
32
32
  //#region packages/runtime-vapor/src/dom/hydration.ts
33
+ const START_TAG_RE = /^<([^\s/>]+)/;
33
34
  let isHydratingEnabled = false;
34
35
  function setIsHydratingEnabled(value) {
35
36
  isHydratingEnabled = value;
@@ -152,18 +153,18 @@ function exitHydrationCursor(cursor) {
152
153
  * Locate the first non-fragment-comment node and locate the next node
153
154
  * while handling potential fragments.
154
155
  */
155
- function adoptTemplateImpl(node, template) {
156
+ function adoptTemplateImpl(node, template, adoptChildren = false, ns) {
156
157
  if (!(template[0] === "<" && template[1] === "!")) {
157
158
  if (template.trim() === "" && isComment(node, "]") && isComment(node.previousSibling, "[")) node.before(node = /* @__PURE__ */ createTextNode());
158
159
  node = resolveHydrationTarget(node);
159
160
  }
160
161
  const type = node.nodeType;
161
- if (type === 8 && !template.startsWith("<!") || type === 1 && !template.startsWith(`<` + node.tagName.toLowerCase())) node = handleMismatch(node, template);
162
+ if (type === 8 && !template.startsWith("<!") || type === 1 && !template.startsWith(`<` + node.tagName.toLowerCase())) node = handleMismatch(node, template, adoptChildren, ns);
162
163
  advanceHydrationNode(node);
163
164
  return node;
164
165
  }
165
- function locateNextNode(node) {
166
- return isComment(node, "[") ? /* @__PURE__ */ _next(locateEndAnchor(node)) : isComment(node, "teleport start") ? /* @__PURE__ */ _next(locateEndAnchor(node, "teleport start", "teleport end")) : /* @__PURE__ */ _next(node);
166
+ function nextLogicalSibling(node) {
167
+ return isComment(node, "[") ? locateEndAnchor(node).nextSibling : isComment(node, "teleport start") ? locateEndAnchor(node, "teleport start", "teleport end").nextSibling : node.nextSibling;
167
168
  }
168
169
  function locateHydrationNodeImpl(consumeFragmentStart = false) {
169
170
  let node;
@@ -192,18 +193,15 @@ function locateHydrationBoundaryClose(node, closeHint = null) {
192
193
  let close = closeHint;
193
194
  if (!close || !isComment(close, "]")) if (isComment(node, "]")) close = node;
194
195
  else {
195
- let candidate = locateNextNode(node);
196
- while (candidate && !isComment(candidate, "]")) candidate = locateNextNode(candidate);
196
+ let candidate = nextLogicalSibling(node);
197
+ while (candidate && !isComment(candidate, "]")) candidate = nextLogicalSibling(candidate);
197
198
  close = candidate;
198
199
  }
199
200
  if (!close) return node;
200
201
  return close;
201
202
  }
202
- function handleMismatch(node, template) {
203
- if (!isMismatchAllowed(node.parentElement, 1)) {
204
- (process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node, "[[") ? `(start of block node)` : ``, `\n- expected on client:`, template);
205
- logMismatchError();
206
- }
203
+ function handleMismatch(node, template, adoptChildren, ns) {
204
+ warnHydrationNodeMismatch(node, template);
207
205
  if (isComment(node, "[")) removeFragmentNodes(node);
208
206
  const shouldPreserveAnchor = isHydrationAnchor(node);
209
207
  const container = /* @__PURE__ */ parentNode(node);
@@ -211,17 +209,46 @@ function handleMismatch(node, template) {
211
209
  if (!shouldPreserveAnchor) remove(node, container);
212
210
  if (template[0] !== "<") return container.insertBefore(/* @__PURE__ */ createTextNode(template), next);
213
211
  const t = /* @__PURE__ */ createElement("template");
214
- t.innerHTML = template;
215
- const newNode = (/* @__PURE__ */ _child(t.content)).cloneNode(true);
216
- if (node.nodeType === 1) {
217
- newNode.innerHTML = node.innerHTML;
218
- Array.from(node.attributes).forEach((attr) => {
219
- newNode.setAttribute(attr.name, attr.value);
220
- });
212
+ let newNode;
213
+ if (ns) {
214
+ const tag = ns === 1 ? "svg" : "math";
215
+ t.innerHTML = `<${tag}>${template}</${tag}>`;
216
+ newNode = (/* @__PURE__ */ _child(/* @__PURE__ */ _child(t.content))).cloneNode(true);
217
+ } else {
218
+ t.innerHTML = template;
219
+ newNode = (/* @__PURE__ */ _child(t.content)).cloneNode(true);
220
+ }
221
+ if (adoptChildren && node.nodeType === 1 && !newNode.firstChild) {
222
+ let child = node.firstChild;
223
+ while (child) {
224
+ const nextChild = child.nextSibling;
225
+ newNode.appendChild(child);
226
+ child = nextChild;
227
+ }
221
228
  }
222
229
  container.insertBefore(newNode, next);
223
230
  return newNode;
224
231
  }
232
+ function validateHydrationTarget(node, template) {
233
+ let expectedType;
234
+ if (template[0] !== "<") expectedType = 3;
235
+ else if (template[1] === "!") expectedType = 8;
236
+ else expectedType = 1;
237
+ if (node.nodeType !== expectedType) {
238
+ warnHydrationNodeMismatch(node, template);
239
+ return;
240
+ }
241
+ if (expectedType !== 1) return;
242
+ const match = START_TAG_RE.exec(template);
243
+ const expectedTag = match && match[1];
244
+ if (expectedTag && node.tagName.toLowerCase() !== expectedTag.toLowerCase()) warnHydrationNodeMismatch(node, template);
245
+ }
246
+ function warnHydrationNodeMismatch(node, expected) {
247
+ if (!isMismatchAllowed(node.parentElement, 1)) {
248
+ (process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node, "[[") ? `(start of block node)` : ``, `\n- expected on client:`, expected);
249
+ logMismatchError();
250
+ }
251
+ }
225
252
  let hasLoggedMismatchError = false;
226
253
  const logMismatchError = () => {
227
254
  if (hasLoggedMismatchError) return;
@@ -263,7 +290,7 @@ function cleanupHydrationTail(node, container) {
263
290
  }
264
291
  let current = node;
265
292
  while (current && current.parentNode === container) {
266
- const next = locateNextNode(current);
293
+ const next = nextLogicalSibling(current);
267
294
  removeHydrationNode(current);
268
295
  current = next;
269
296
  }
@@ -294,7 +321,7 @@ function finalizeHydrationBoundary(close) {
294
321
  let hasRemovableNode = false;
295
322
  while (cur && cur !== close) {
296
323
  if (!isHydrationAnchor(cur)) hasRemovableNode = true;
297
- cur = locateNextNode(cur);
324
+ cur = nextLogicalSibling(cur);
298
325
  }
299
326
  if (!cur) return;
300
327
  if (!hasRemovableNode) {
@@ -303,7 +330,7 @@ function finalizeHydrationBoundary(close) {
303
330
  }
304
331
  warnHydrationChildrenMismatch(close.parentElement);
305
332
  while (node && node !== close) {
306
- const next = locateNextNode(node);
333
+ const next = nextLogicalSibling(node);
307
334
  if (!isHydrationAnchor(node)) removeHydrationNode(node, close);
308
335
  node = next;
309
336
  }
@@ -386,7 +413,7 @@ function locateChildByLogicalIndex(parent, logicalIndex) {
386
413
  child.$idx = logicalIndex;
387
414
  return parent.$llc = child;
388
415
  }
389
- child = isComment(child, "[") ? locateEndAnchor(child).nextSibling : child.nextSibling;
416
+ child = nextLogicalSibling(child);
390
417
  fromIndex++;
391
418
  }
392
419
  return null;
@@ -440,6 +467,66 @@ function propGetter(rawProps, key) {
440
467
  return rawProps[key] && resolveSource(rawProps[key]);
441
468
  }
442
469
  //#endregion
470
+ //#region packages/runtime-vapor/src/renderEffect.ts
471
+ var RenderEffect = class extends ReactiveEffect {
472
+ constructor(render, noLifecycle = false) {
473
+ super(noLifecycle ? render : void 0);
474
+ this.render = render;
475
+ const instance = currentInstance;
476
+ if (!!(process.env.NODE_ENV !== "production") && !this.subs && !isVaporComponent(instance)) warn("renderEffect called without active EffectScope or Vapor instance.");
477
+ const job = () => {
478
+ if (this.dirty) this.run();
479
+ };
480
+ if (instance) {
481
+ if (!!(process.env.NODE_ENV !== "production") && !noLifecycle) {
482
+ this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
483
+ this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
484
+ }
485
+ if (instance.type.ce) (instance.renderEffects || (instance.renderEffects = [])).push(this);
486
+ job.i = instance;
487
+ }
488
+ this.job = job;
489
+ this.i = instance;
490
+ this.flags |= 128;
491
+ this.job.flags |= 2;
492
+ }
493
+ fn() {
494
+ const instance = this.i;
495
+ const scope = this.subs ? this.subs.sub : void 0;
496
+ const hasUpdateHooks = instance && (instance.bu || instance.u);
497
+ if (!!(process.env.NODE_ENV !== "production") && instance) startMeasure(instance, `renderEffect`);
498
+ const prev = setCurrentInstance(instance, scope);
499
+ try {
500
+ if (hasUpdateHooks && instance.isMounted && !instance.isUpdating) {
501
+ instance.isUpdating = true;
502
+ try {
503
+ instance.bu && invokeArrayFns(instance.bu);
504
+ this.render();
505
+ } catch (err) {
506
+ instance.isUpdating = false;
507
+ throw err;
508
+ }
509
+ let updateJob = this.updateJob;
510
+ if (!updateJob) updateJob = this.updateJob = () => {
511
+ instance.isUpdating = false;
512
+ instance.u && invokeArrayFns(instance.u);
513
+ };
514
+ queuePostFlushCb(updateJob);
515
+ } else this.render();
516
+ } finally {
517
+ setCurrentInstance(...prev);
518
+ if (!!(process.env.NODE_ENV !== "production") && instance) endMeasure(instance, `renderEffect`);
519
+ }
520
+ }
521
+ notify() {
522
+ if (!(this.flags & 256)) queueJob(this.job, this.i ? this.i.uid : void 0);
523
+ }
524
+ };
525
+ function renderEffect(fn, noLifecycle = false) {
526
+ if (inOnceSlot) return fn();
527
+ new RenderEffect(fn, noLifecycle).run();
528
+ }
529
+ //#endregion
443
530
  //#region packages/runtime-vapor/src/componentProps.ts
444
531
  function resolveSource(source) {
445
532
  return isFunction(source) ? resolveFunctionSource(source) : source;
@@ -461,6 +548,30 @@ function resolveFunctionSource(source) {
461
548
  }
462
549
  return source();
463
550
  }
551
+ function snapshotRawProps(rawProps) {
552
+ const snapshot = Object.create(null);
553
+ for (const key in rawProps) if (key !== "$") snapshot[key] = resolveSource(rawProps[key]);
554
+ const dynamicSources = rawProps.$;
555
+ if (dynamicSources) {
556
+ const snapshotSources = [];
557
+ for (let i = 0; i < dynamicSources.length; i++) {
558
+ const source = dynamicSources[i];
559
+ const value = Object.create(null);
560
+ if (isFunction(source)) {
561
+ const resolved = resolveFunctionSource(source);
562
+ for (const key in resolved) value[key] = resolved[key];
563
+ snapshotSources[i] = () => value;
564
+ } else {
565
+ for (const key in source) value[key] = resolveSource(source[key]);
566
+ snapshotSources[i] = value;
567
+ }
568
+ }
569
+ const symbols = Object.getOwnPropertySymbols(dynamicSources);
570
+ for (let i = 0; i < symbols.length; i++) snapshotSources[symbols[i]] = dynamicSources[symbols[i]];
571
+ snapshot.$ = snapshotSources;
572
+ }
573
+ return snapshot;
574
+ }
464
575
  function stabilizeDynamicSourceValue(oldValue, value) {
465
576
  if (!isPlainObject(oldValue) || !isPlainObject(value)) return value;
466
577
  const oldKeys = Object.keys(oldValue);
@@ -472,7 +583,7 @@ function stabilizeDynamicSourceValue(oldValue, value) {
472
583
  }
473
584
  return oldValue;
474
585
  }
475
- function getPropsProxyHandlers(comp, once) {
586
+ function getPropsProxyHandlers(comp) {
476
587
  if (comp.__propsHandlers) return comp.__propsHandlers;
477
588
  const propsOptions = normalizePropsOptions(comp)[0];
478
589
  const emitsOptions = normalizeEmitsOptions(comp);
@@ -490,7 +601,7 @@ function getPropsProxyHandlers(comp, once) {
490
601
  source = dynamicSources[i];
491
602
  isDynamic = isFunction(source);
492
603
  source = isDynamic ? resolveFunctionSource(source) : source;
493
- for (rawKey in source) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, isDynamic ? source[rawKey] : resolveFunctionSource(source[rawKey]), instance, resolveDefault);
604
+ for (rawKey in source) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, isDynamic ? source[rawKey] : resolveSource(source[rawKey]), instance, resolveDefault);
494
605
  }
495
606
  }
496
607
  for (const rawKey in rawProps) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, resolveSource(rawProps[rawKey]), instance, resolveDefault);
@@ -498,8 +609,8 @@ function getPropsProxyHandlers(comp, once) {
498
609
  };
499
610
  const withOnceCache = (getter) => {
500
611
  return ((instance, key) => {
501
- const cache = instance.oncePropsCache || (instance.oncePropsCache = {});
502
- if (!(key in cache)) {
612
+ const cache = instance.oncePropsCache || (instance.oncePropsCache = Object.create(null));
613
+ if (!hasOwn(cache, key)) {
503
614
  pauseTracking();
504
615
  try {
505
616
  cache[key] = getter(instance, key);
@@ -511,15 +622,16 @@ function getPropsProxyHandlers(comp, once) {
511
622
  });
512
623
  };
513
624
  const getOnceProp = withOnceCache(getProp);
625
+ const getMaybeOnceProp = (instance, key) => (instance.isOnce ? getOnceProp : getProp)(instance, key);
514
626
  const propsHandlers = propsOptions ? {
515
- get: (target, key) => (once ? getOnceProp : getProp)(target, key),
627
+ get: getMaybeOnceProp,
516
628
  has: (_, key) => isProp(key),
517
629
  ownKeys: () => Object.keys(propsOptions),
518
630
  getOwnPropertyDescriptor(target, key) {
519
631
  if (isProp(key)) return {
520
632
  configurable: true,
521
633
  enumerable: true,
522
- get: () => (once ? getOnceProp : getProp)(target, key)
634
+ get: () => getMaybeOnceProp(target, key)
523
635
  };
524
636
  }
525
637
  } : null;
@@ -535,15 +647,36 @@ function getPropsProxyHandlers(comp, once) {
535
647
  else return false;
536
648
  };
537
649
  const getOnceAttr = withOnceCache((instance, key) => getAttr(instance.rawProps, key));
650
+ const onceAttrKeys = Symbol();
651
+ const getAttrKeys = (target) => getKeysFromRawProps(target.rawProps).filter(isAttr);
652
+ const getOnceAttrKeys = (target) => {
653
+ const cache = target.oncePropsCache || (target.oncePropsCache = Object.create(null));
654
+ if (!hasOwn(cache, onceAttrKeys)) {
655
+ pauseTracking();
656
+ try {
657
+ const keys = getAttrKeys(target);
658
+ cache[onceAttrKeys] = keys;
659
+ for (let i = 0; i < keys.length; i++) {
660
+ const key = keys[i];
661
+ if (!hasOwn(cache, key)) cache[key] = getAttr(target.rawProps, key);
662
+ }
663
+ } finally {
664
+ resetTracking();
665
+ }
666
+ }
667
+ return cache[onceAttrKeys];
668
+ };
669
+ const getMaybeOnceAttrKeys = (target) => target.isOnce ? getOnceAttrKeys(target) : getAttrKeys(target);
670
+ const getMaybeOnceAttr = (instance, key) => instance.isOnce ? getOnceAttrKeys(instance).includes(key) ? getOnceAttr(instance, key) : void 0 : getAttr(instance.rawProps, key);
538
671
  const attrsHandlers = {
539
- get: (target, key) => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key),
540
- has: (target, key) => hasAttr(target.rawProps, key),
541
- ownKeys: (target) => getKeysFromRawProps(target.rawProps).filter(isAttr),
672
+ get: getMaybeOnceAttr,
673
+ has: (target, key) => target.isOnce ? getOnceAttrKeys(target).includes(key) : hasAttr(target.rawProps, key),
674
+ ownKeys: getMaybeOnceAttrKeys,
542
675
  getOwnPropertyDescriptor(target, key) {
543
- if (isString(key) && hasAttr(target.rawProps, key)) return {
676
+ if (isString(key) && (target.isOnce ? getOnceAttrKeys(target).includes(key) : hasAttr(target.rawProps, key))) return {
544
677
  configurable: true,
545
678
  enumerable: true,
546
- get: () => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key)
679
+ get: () => getMaybeOnceAttr(target, key)
547
680
  };
548
681
  }
549
682
  };
@@ -565,7 +698,7 @@ function getAttrFromRawProps(rawProps, key) {
565
698
  isDynamic = isFunction(source);
566
699
  source = isDynamic ? resolveFunctionSource(source) : source;
567
700
  if (source && hasOwn(source, key)) {
568
- const value = isDynamic ? source[key] : resolveFunctionSource(source[key]);
701
+ const value = isDynamic ? source[key] : resolveSource(source[key]);
569
702
  if (merged) merged.push(value);
570
703
  else return value;
571
704
  }
@@ -647,7 +780,7 @@ function resolveDynamicProps(props) {
647
780
  const isDynamic = isFunction(source);
648
781
  const resolved = isDynamic ? resolveFunctionSource(source) : source;
649
782
  for (const key in resolved) {
650
- const value = isDynamic ? resolved[key] : resolveFunctionSource(source[key]);
783
+ const value = isDynamic ? resolved[key] : resolveSource(source[key]);
651
784
  if (key === "class" || key === "style") {
652
785
  const existing = mergedRawProps[key];
653
786
  if (isArray(existing)) existing.push(value);
@@ -687,18 +820,23 @@ function on(el, event, handler, options = {}) {
687
820
  if (isArray(handler)) handler.forEach((fn) => on(el, event, fn, options));
688
821
  else {
689
822
  if (!handler) return;
690
- addEventListener(el, event, handler, options);
691
- if (options.effect) onEffectCleanup(() => {
692
- el.removeEventListener(event, handler, options);
693
- });
823
+ addEventListener(el, event, createInvoker(handler), options);
824
+ }
825
+ }
826
+ function onBinding(el, event, handler, options = {}) {
827
+ if (isArray(handler)) handler.forEach((fn) => onBinding(el, event, fn, options));
828
+ else {
829
+ if (!handler) return;
830
+ onEffectCleanup(addEventListener(el, event, createInvoker(handler), options));
694
831
  }
695
832
  }
696
833
  function delegate(el, event, handler) {
697
834
  const key = `$evt${event}`;
698
835
  const existing = el[key];
699
- if (existing) if (isArray(existing)) existing.push(handler);
700
- else el[key] = [existing, handler];
701
- else el[key] = handler;
836
+ const invoker = createInvoker(handler);
837
+ if (existing) if (isArray(existing)) existing.push(invoker);
838
+ else el[key] = [existing, invoker];
839
+ else el[key] = invoker;
702
840
  }
703
841
  /**
704
842
  * Event delegation borrowed from solid
@@ -737,7 +875,13 @@ const delegatedEventHandler = (e) => {
737
875
  }
738
876
  };
739
877
  function setDynamicEvents(el, events) {
740
- for (const name in events) on(el, name, events[name], { effect: true });
878
+ for (const name in events) onBinding(el, name, events[name]);
879
+ }
880
+ function withVaporModifiers(fn, modifiers) {
881
+ return createInvoker(typeof fn === "function" ? withModifiers(fn, modifiers) : fn);
882
+ }
883
+ function withVaporKeys(fn, modifiers) {
884
+ return createInvoker(typeof fn === "function" ? withKeys(fn, modifiers) : fn);
741
885
  }
742
886
  function createInvoker(handler) {
743
887
  const i = currentInstance;
@@ -745,13 +889,16 @@ function createInvoker(handler) {
745
889
  }
746
890
  //#endregion
747
891
  //#region packages/runtime-vapor/src/dom/prop.ts
748
- const hasFallthroughKey = (key) => currentInstance.hasFallthrough && key in currentInstance.attrs;
892
+ const shouldSkipFallthroughKey = (el, key) => {
893
+ const instance = currentInstance;
894
+ return !isApplyingFallthroughProps && el.$root && instance.hasFallthrough && instance.type.inheritAttrs !== false && key in instance.attrs;
895
+ };
749
896
  function setProp(el, key, value) {
750
897
  if (key in el) setDOMProp(el, key, value);
751
898
  else setAttr(el, key, value);
752
899
  }
753
900
  function setAttr(el, key, value, isSVG = false) {
754
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) return;
901
+ if (shouldSkipFallthroughKey(el, key)) return;
755
902
  if (key === "true-value") el._trueValue = value;
756
903
  else if (key === "false-value") el._falseValue = value;
757
904
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating$1 && !attributeHasMismatch(el, key, value)) {
@@ -767,7 +914,7 @@ function setAttr(el, key, value, isSVG = false) {
767
914
  }
768
915
  }
769
916
  function setDOMProp(el, key, value, forceHydrate = false, attrName) {
770
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) return;
917
+ if (shouldSkipFallthroughKey(el, key)) return;
771
918
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating$1 && !attributeHasMismatch(el, key, value) && !shouldForceHydrate(el, key) && !forceHydrate) return;
772
919
  const prev = el[key];
773
920
  if (value === prev) return;
@@ -885,7 +1032,7 @@ function setStyleIncremental(el, value) {
885
1032
  patchStyle(el, el[cacheKey], el[cacheKey] = normalizedValue);
886
1033
  }
887
1034
  function setValue(el, value, forceHydrate = false) {
888
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey("value")) return;
1035
+ if (shouldSkipFallthroughKey(el, "value")) return;
889
1036
  el._value = value;
890
1037
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating$1 && !attributeHasMismatch(el, "value", getClientText(el, value)) && !shouldForceHydrate(el, "value") && !forceHydrate) return;
891
1038
  const oldValue = el.tagName === "OPTION" ? el.getAttribute("value") : el.value;
@@ -990,8 +1137,10 @@ function setDynamicProp(el, key, value, isSVG = false) {
990
1137
  let forceHydrate = false;
991
1138
  if (key === "class") setClass(el, value, isSVG);
992
1139
  else if (key === "style") setStyle(el, value);
993
- else if (isOn(key)) on(el, key[2].toLowerCase() + key.slice(3), value, { effect: true });
994
- else if ((forceHydrate = key[0] === ".") ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, value, isSVG)) if (key === "innerHTML") setHtml(el, value);
1140
+ else if (isOn(key)) {
1141
+ if (shouldSkipFallthroughKey(el, key)) return;
1142
+ onBinding(el, key[2].toLowerCase() + key.slice(3), value);
1143
+ } else if ((forceHydrate = key[0] === ".") ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, value, isSVG)) if (key === "innerHTML") setHtml(el, value);
995
1144
  else if (key === "textContent") setElementText(el, value);
996
1145
  else if (key === "value" && canSetValueDirectly(el.tagName)) setValue(el, value, forceHydrate);
997
1146
  else setDOMProp(el, key, value, forceHydrate);
@@ -1024,9 +1173,10 @@ function classHasMismatch(el, expected, isIncremental) {
1024
1173
  if (expected) hasMismatch = Array.from(expectedClassSet).some((cls) => !actualClassSet.has(cls));
1025
1174
  } else hasMismatch = !isSetEqual(actualClassSet, expectedClassSet);
1026
1175
  if (hasMismatch) {
1027
- warnPropMismatch(el, "class", 2, actual, expected);
1028
- logMismatchError();
1029
- return true;
1176
+ if (warnPropMismatch(el, "class", 2, actual, expected)) {
1177
+ logMismatchError();
1178
+ return true;
1179
+ }
1030
1180
  }
1031
1181
  return false;
1032
1182
  }
@@ -1042,9 +1192,10 @@ function styleHasMismatch(el, value, normalizedValue, isIncremental, instance =
1042
1192
  if (expected) hasMismatch = Array.from(expectedStyleMap.entries()).some(([key, val]) => actualStyleMap.get(key) !== val);
1043
1193
  } else hasMismatch = !isMapEqual(actualStyleMap, expectedStyleMap);
1044
1194
  if (hasMismatch) {
1045
- warnPropMismatch(el, "style", 3, actual, expected);
1046
- logMismatchError();
1047
- return true;
1195
+ if (warnPropMismatch(el, "style", 3, actual, expected)) {
1196
+ logMismatchError();
1197
+ return true;
1198
+ }
1048
1199
  }
1049
1200
  return false;
1050
1201
  }
@@ -1067,9 +1218,10 @@ function attributeHasMismatch(el, key, value) {
1067
1218
  if (isValidHtmlOrSvgAttribute(el, key)) {
1068
1219
  const { actual, expected } = getAttributeMismatch(el, key, value);
1069
1220
  if (actual !== expected) {
1070
- warnPropMismatch(el, key, 4, actual, expected);
1071
- logMismatchError();
1072
- return true;
1221
+ if (warnPropMismatch(el, key, 4, actual, expected)) {
1222
+ logMismatchError();
1223
+ return true;
1224
+ }
1073
1225
  }
1074
1226
  }
1075
1227
  return false;
@@ -1112,6 +1264,15 @@ function setComponentScopeId(instance) {
1112
1264
  * When true, renderEffect should skip creating reactive effect.
1113
1265
  */
1114
1266
  let inOnceSlot = false;
1267
+ function withOnceSlot(fn, value = true) {
1268
+ const prev = inOnceSlot;
1269
+ try {
1270
+ inOnceSlot = value;
1271
+ return fn();
1272
+ } finally {
1273
+ inOnceSlot = prev;
1274
+ }
1275
+ }
1115
1276
  /**
1116
1277
  * Current slot scopeIds for vdom interop
1117
1278
  */
@@ -1209,7 +1370,7 @@ function withVaporCtx(fn) {
1209
1370
  }
1210
1371
  };
1211
1372
  }
1212
- function createSlot(name, rawProps, fallback, noSlotted, once) {
1373
+ function createSlot(name = "default", rawProps, fallback, flags = 0) {
1213
1374
  if (isInteropEnabled && isCollectingVdomSlotVNodes) return;
1214
1375
  const _insertionParent = insertionParent;
1215
1376
  const _insertionAnchor = insertionAnchor;
@@ -1217,13 +1378,18 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
1217
1378
  let hydrationCursor = null;
1218
1379
  const instance = getScopeOwner();
1219
1380
  const rawSlots = instance.rawSlots;
1220
- const slotProps = rawProps ? new Proxy(rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
1221
- const scopeId = !noSlotted && instance.type.__scopeId;
1381
+ const scopeId = !(flags & 1) && instance.type.__scopeId;
1222
1382
  const slotScopeIds = scopeId ? [`${scopeId}-s`] : null;
1383
+ const once = !!(flags & 2);
1384
+ const slotProps = rawProps ? new Proxy(once ? snapshotRawProps(rawProps) : rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
1385
+ if (once && fallback) {
1386
+ const originalFallback = fallback;
1387
+ fallback = (...args) => withOnceSlot(() => originalFallback(...args));
1388
+ }
1223
1389
  let fragment;
1224
1390
  if (isRef(rawSlots._) && isInteropEnabled) {
1225
1391
  if (isHydrating$1) hydrationCursor = enterHydrationCursor();
1226
- fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback);
1392
+ fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once);
1227
1393
  } else {
1228
1394
  if (isHydrating$1) hydrationCursor = captureHydrationCursor();
1229
1395
  const slotFragment = fragment = new SlotFragment();
@@ -1233,9 +1399,11 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
1233
1399
  const slotName = isFunction(name) ? name() : name;
1234
1400
  if (instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce) {
1235
1401
  const el = /* @__PURE__ */ createElement("slot");
1236
- renderEffect(() => {
1402
+ const setSlotProps = () => {
1237
1403
  setDynamicProps(el, [slotProps, slotName !== "default" ? { name: slotName } : {}]);
1238
- });
1404
+ };
1405
+ if (once) setSlotProps();
1406
+ else renderEffect(setSlotProps);
1239
1407
  if (fallback) withOwnedSlotBoundary(slotFragment.parentSlotBoundary, () => {
1240
1408
  const fallbackBlock = fallback();
1241
1409
  slotFragment.customElementFallback = fallbackBlock;
@@ -1255,12 +1423,9 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
1255
1423
  cachedSlot = slot;
1256
1424
  cachedBoundSlot = () => {
1257
1425
  const prevSlotScopeIds = setCurrentSlotScopeIds(slotScopeIds);
1258
- const prev = inOnceSlot;
1259
1426
  try {
1260
- if (once) inOnceSlot = true;
1261
- return slot(slotProps);
1427
+ return once ? withOnceSlot(() => slot(slotProps)) : slot(slotProps);
1262
1428
  } finally {
1263
- inOnceSlot = prev;
1264
1429
  setCurrentSlotScopeIds(prevSlotScopeIds);
1265
1430
  }
1266
1431
  };
@@ -1280,67 +1445,6 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
1280
1445
  return fragment;
1281
1446
  }
1282
1447
  //#endregion
1283
- //#region packages/runtime-vapor/src/renderEffect.ts
1284
- var RenderEffect = class extends ReactiveEffect {
1285
- constructor(render) {
1286
- super();
1287
- this.render = render;
1288
- const instance = currentInstance;
1289
- if (!!(process.env.NODE_ENV !== "production") && !this.subs && !isVaporComponent(instance)) warn("renderEffect called without active EffectScope or Vapor instance.");
1290
- const job = () => {
1291
- if (this.dirty) this.run();
1292
- };
1293
- this.updateJob = () => {
1294
- instance.isUpdating = false;
1295
- instance.u && invokeArrayFns(instance.u);
1296
- };
1297
- if (instance) {
1298
- if (!!(process.env.NODE_ENV !== "production")) {
1299
- this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
1300
- this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
1301
- }
1302
- if (instance.type.ce) (instance.renderEffects || (instance.renderEffects = [])).push(this);
1303
- job.i = instance;
1304
- }
1305
- this.job = job;
1306
- this.i = instance;
1307
- this.flags |= 128;
1308
- this.job.flags |= 2;
1309
- }
1310
- fn() {
1311
- const instance = this.i;
1312
- const scope = this.subs ? this.subs.sub : void 0;
1313
- const hasUpdateHooks = instance && (instance.bu || instance.u);
1314
- if (!!(process.env.NODE_ENV !== "production") && instance) startMeasure(instance, `renderEffect`);
1315
- const prev = setCurrentInstance(instance, scope);
1316
- try {
1317
- if (hasUpdateHooks && instance.isMounted && !instance.isUpdating) {
1318
- instance.isUpdating = true;
1319
- try {
1320
- instance.bu && invokeArrayFns(instance.bu);
1321
- this.render();
1322
- } catch (err) {
1323
- instance.isUpdating = false;
1324
- throw err;
1325
- }
1326
- queuePostFlushCb(this.updateJob);
1327
- } else this.render();
1328
- } finally {
1329
- setCurrentInstance(...prev);
1330
- if (!!(process.env.NODE_ENV !== "production") && instance) endMeasure(instance, `renderEffect`);
1331
- }
1332
- }
1333
- notify() {
1334
- if (!(this.flags & 256)) queueJob(this.job, this.i ? this.i.uid : void 0);
1335
- }
1336
- };
1337
- function renderEffect(fn, noLifecycle = false) {
1338
- if (inOnceSlot) return fn();
1339
- const effect = new RenderEffect(fn);
1340
- if (noLifecycle) effect.fn = fn;
1341
- effect.run();
1342
- }
1343
- //#endregion
1344
1448
  //#region packages/runtime-vapor/src/keepAlive.ts
1345
1449
  let isKeepAliveEnabled = false;
1346
1450
  let currentKeepAliveCtx = null;
@@ -1400,9 +1504,9 @@ function isVaporTransition(component) {
1400
1504
  }
1401
1505
  //#endregion
1402
1506
  //#region packages/runtime-vapor/src/fragment.ts
1507
+ const EMPTY_BLOCK = EMPTY_ARR;
1403
1508
  var VaporFragment = class {
1404
1509
  constructor(nodes) {
1405
- this.vnode = null;
1406
1510
  this.renderInstance = currentInstance;
1407
1511
  this.slotOwner = currentSlotOwner;
1408
1512
  this.inheritedSlotBoundary = currentSlotBoundary;
@@ -1411,9 +1515,15 @@ var VaporFragment = class {
1411
1515
  }
1412
1516
  runWithRenderCtx(fn, scope) {
1413
1517
  const prevInstance = setCurrentInstance(this.renderInstance, scope);
1518
+ const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx || null : null;
1519
+ if (currentSlotOwner === this.slotOwner && currentSlotBoundary === this.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) try {
1520
+ return fn();
1521
+ } finally {
1522
+ setCurrentInstance(...prevInstance);
1523
+ }
1414
1524
  const prevSlotOwner = setCurrentSlotOwner(this.slotOwner);
1415
1525
  let prevKeepAliveCtx = null;
1416
- if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(this.keepAliveCtx || null);
1526
+ if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
1417
1527
  const prevBoundary = setCurrentSlotBoundary(this.inheritedSlotBoundary);
1418
1528
  try {
1419
1529
  return fn();
@@ -1445,10 +1555,12 @@ var ForBlock = class extends VaporFragment {
1445
1555
  }
1446
1556
  };
1447
1557
  function getDynamicCloseOwner(isSlot, forwardedSlot, anchorLabel, nodes, currentSlotEndAnchor) {
1448
- const valid = isValidBlock(nodes);
1449
- if (isSlot) return !forwardedSlot || valid ? 1 : 3;
1558
+ if (isSlot) {
1559
+ if (!forwardedSlot) return 1;
1560
+ return isValidBlock(nodes) ? 1 : 3;
1561
+ }
1450
1562
  if (anchorLabel === "if" && isArray(nodes) && nodes.length > 1) return 1;
1451
- if (anchorLabel === "if" && !valid && currentSlotEndAnchor && isHydratingSlotFallbackActive()) return 2;
1563
+ if (anchorLabel === "if" && currentSlotEndAnchor && isHydratingSlotFallbackActive() && !isValidBlock(nodes)) return 2;
1452
1564
  return 0;
1453
1565
  }
1454
1566
  function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
@@ -1458,110 +1570,9 @@ function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
1458
1570
  });
1459
1571
  }
1460
1572
  var DynamicFragment = class extends VaporFragment {
1461
- constructor(anchorLabel, keyed = false, locate = true) {
1462
- super([]);
1463
- this.hydrate = (isEmpty = false, isSlot = false) => {
1464
- if (!isHydrating$1) return;
1465
- let advanceAfterRestore = null;
1466
- let exitHydrationBoundary;
1467
- const reuseAnchor = (anchor) => {
1468
- this.anchor = markHydrationAnchor(anchor);
1469
- if (currentHydrationNode === this.anchor) advanceHydrationNode(this.anchor);
1470
- else {
1471
- exitHydrationBoundary = enterHydrationBoundary(this.anchor);
1472
- advanceAfterRestore = this.anchor;
1473
- }
1474
- };
1475
- const createRuntimeAnchor = () => this.anchor = markHydrationAnchor(!!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ createComment(this.anchorLabel) : /* @__PURE__ */ createTextNode());
1476
- const cleanupAndInsertRuntimeAnchor = (parentNode, nextNode, cleanupStart, cleanupUntil) => {
1477
- if (cleanupUntil) exitHydrationBoundary = enterHydrationBoundary(cleanupUntil);
1478
- else {
1479
- cleanupHydrationTail(cleanupStart);
1480
- setCurrentHydrationNode(null);
1481
- }
1482
- queueAnchorInsert(parentNode, nextNode, createRuntimeAnchor);
1483
- };
1484
- try {
1485
- if (isEmpty) {
1486
- if (isComment(currentHydrationNode, "")) {
1487
- reuseAnchor(currentHydrationNode);
1488
- return;
1489
- }
1490
- if (this.anchorLabel && currentHydrationNode && isComment(currentHydrationNode, "teleport anchor")) {
1491
- const parentNode$2 = /* @__PURE__ */ parentNode(currentHydrationNode);
1492
- const anchor = markHydrationAnchor(currentHydrationNode);
1493
- if (parentNode$2) {
1494
- queueAnchorInsert(parentNode$2, anchor, createRuntimeAnchor);
1495
- return;
1496
- }
1497
- }
1498
- if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
1499
- const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
1500
- const anchor = locateNextNode(currentHydrationNode);
1501
- const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
1502
- if (parentNode$4) {
1503
- this.nodes = [];
1504
- if (reusableAnchor) reuseAnchor(reusableAnchor);
1505
- else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
1506
- return;
1507
- }
1508
- }
1509
- }
1510
- if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
1511
- const anchor = this.nodes;
1512
- this.nodes = [];
1513
- reuseAnchor(anchor);
1514
- return;
1515
- }
1516
- if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && !/* @__PURE__ */ parentNode(this.nodes) && currentHydrationNode) {
1517
- const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
1518
- const nextNode = locateNextNode(currentHydrationNode);
1519
- if (parentNode$5) {
1520
- this.nodes = [];
1521
- cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
1522
- return;
1523
- }
1524
- }
1525
- const currentSlotEndAnchor = getCurrentSlotEndAnchor();
1526
- const forwardedSlot = this.forwarded;
1527
- const slotAnchor = isSlot ? currentSlotEndAnchor : null;
1528
- const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
1529
- if (closeOwner === 1) {
1530
- const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
1531
- if (isComment(anchor, "]")) {
1532
- reuseAnchor(anchor);
1533
- return;
1534
- } else if (!!(process.env.NODE_ENV !== "production")) throw new Error(`Failed to locate ${this.anchorLabel} fragment anchor. this is likely a Vue internal bug.`);
1535
- } else if (closeOwner === 3 && currentSlotEndAnchor) {
1536
- const anchor = markHydrationAnchor(currentSlotEndAnchor);
1537
- queueAnchorInsert(anchor.parentNode, anchor.nextSibling, createRuntimeAnchor);
1538
- return;
1539
- } else if (closeOwner === 2 && currentSlotEndAnchor) {
1540
- const endAnchor = currentSlotEndAnchor;
1541
- queuePostFlushCb(() => {
1542
- const parentNode$6 = /* @__PURE__ */ parentNode(endAnchor);
1543
- if (!parentNode$6) return;
1544
- parentNode$6.insertBefore(createRuntimeAnchor(), endAnchor);
1545
- });
1546
- return;
1547
- }
1548
- let parentNode$3;
1549
- let nextNode;
1550
- if (this.anchorLabel === "if" && !isValidBlock(this.nodes) && currentSlotEndAnchor && currentHydrationNode === currentSlotEndAnchor) {
1551
- parentNode$3 = currentSlotEndAnchor.parentNode;
1552
- nextNode = currentSlotEndAnchor;
1553
- } else {
1554
- const node = findBlockNode(this.nodes);
1555
- parentNode$3 = node.parentNode;
1556
- nextNode = node.nextNode;
1557
- }
1558
- queueAnchorInsert(parentNode$3, nextNode, createRuntimeAnchor);
1559
- } finally {
1560
- exitHydrationBoundary && exitHydrationBoundary();
1561
- if (advanceAfterRestore && currentHydrationNode === advanceAfterRestore) advanceHydrationNode(advanceAfterRestore);
1562
- }
1563
- };
1564
- this.keyed = keyed;
1573
+ constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary = true) {
1574
+ super(EMPTY_BLOCK);
1575
+ if (keyed) this.keyed = true;
1565
1576
  if (isTransitionEnabled && currentInstance && isVaporTransition(currentInstance.type)) this.inTransition = true;
1566
1577
  if (isHydrating$1) {
1567
1578
  this.anchorLabel = anchorLabel;
@@ -1570,14 +1581,9 @@ var DynamicFragment = class extends VaporFragment {
1570
1581
  this.anchor = !!(process.env.NODE_ENV !== "production") && anchorLabel ? /* @__PURE__ */ createComment(anchorLabel) : /* @__PURE__ */ createTextNode();
1571
1582
  if (!!(process.env.NODE_ENV !== "production")) this.anchorLabel = anchorLabel;
1572
1583
  }
1573
- this.registerSlotBoundaryDirty();
1584
+ if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
1574
1585
  }
1575
- registerSlotBoundaryDirty() {
1576
- const boundary = this.inheritedSlotBoundary;
1577
- if (!boundary) return;
1578
- (this.onUpdated || (this.onUpdated = [])).push(() => boundary.markDirty());
1579
- }
1580
- update(render, key = render) {
1586
+ update(render, key = render, noScope = false) {
1581
1587
  if (key === this.current) {
1582
1588
  if (isHydrating$1 && this.anchorLabel !== "slot") this.hydrate(true);
1583
1589
  return;
@@ -1585,28 +1591,29 @@ var DynamicFragment = class extends VaporFragment {
1585
1591
  const transition = isTransitionEnabled ? this.$transition : void 0;
1586
1592
  if (transition && transition.state.isLeaving) {
1587
1593
  this.current = key;
1588
- this.pending = {
1594
+ const pending = this.pending;
1595
+ if (pending) {
1596
+ pending.render = render;
1597
+ pending.key = key;
1598
+ pending.noScope = noScope;
1599
+ } else this.pending = {
1589
1600
  render,
1590
- key
1601
+ key,
1602
+ noScope
1591
1603
  };
1592
1604
  return;
1593
1605
  }
1594
1606
  const instance = currentInstance;
1595
1607
  const prevSub = setActiveSub();
1596
1608
  const parent = isHydrating$1 ? null : this.anchor.parentNode;
1597
- if (this.scope) {
1598
- if (isKeepAliveEnabled) {
1609
+ if (this.current !== void 0) {
1610
+ const scope = this.scope;
1611
+ if (scope) {
1599
1612
  let retainScope = false;
1600
- const keepAliveCtx = this.keepAliveCtx;
1601
- if (keepAliveCtx) {
1602
- const cacheKey = this.keyed ? withCurrentCacheKey(this.current, () => keepAliveCtx.processShapeFlag(this.nodes)) : keepAliveCtx.processShapeFlag(this.nodes);
1603
- if (cacheKey !== false) {
1604
- keepAliveCtx.cacheScope(cacheKey, this.current, this.scope);
1605
- retainScope = true;
1606
- }
1607
- }
1608
- if (!retainScope) this.scope.stop();
1609
- } else this.scope.stop();
1613
+ const onBeforeRemove = this.onBeforeRemove;
1614
+ if (onBeforeRemove) for (let i = 0; i < onBeforeRemove.length; i++) retainScope = onBeforeRemove[i](scope) || retainScope;
1615
+ if (!retainScope) scope.stop();
1616
+ }
1610
1617
  const mode = transition && transition.mode;
1611
1618
  if (mode && (mode !== "in-out" || mode === "in-out" && render) && (mode !== "out-in" || isValidBlock(this.nodes))) {
1612
1619
  applyTransitionLeaveHooks(this.nodes, transition, () => {
@@ -1615,8 +1622,8 @@ var DynamicFragment = class extends VaporFragment {
1615
1622
  const pending = this.pending;
1616
1623
  if (pending) {
1617
1624
  this.pending = void 0;
1618
- this.renderBranch(pending.render, transition, parent, pending.key);
1619
- } else this.renderBranch(render, transition, parent, key);
1625
+ this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope);
1626
+ } else this.renderBranch(render, transition, parent, key, noScope);
1620
1627
  } finally {
1621
1628
  setCurrentInstance(...prevInstance);
1622
1629
  }
@@ -1628,27 +1635,33 @@ var DynamicFragment = class extends VaporFragment {
1628
1635
  }
1629
1636
  } else parent && remove(this.nodes, parent);
1630
1637
  }
1631
- const isRevivingDeferredBranch = isHydrating$1 && isInDeferredHydrationBoundary() && !!render && this.anchorLabel !== "slot" && !isValidBlock(this.nodes);
1632
- const reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
1633
- if (isRevivingDeferredBranch) {
1634
- let slotEndAnchor = null;
1635
- const anchor = this.anchor || (currentHydrationNode === (slotEndAnchor = getCurrentSlotEndAnchor()) ? slotEndAnchor : null);
1636
- if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
1638
+ let reusingDeferredAnchor = false;
1639
+ if (isHydrating$1) {
1640
+ const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && this.anchorLabel !== "slot" && !isValidBlock(this.nodes);
1641
+ reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
1642
+ if (isRevivingDeferredBranch) {
1643
+ let slotEndAnchor = null;
1644
+ const anchor = this.anchor || (currentHydrationNode === (slotEndAnchor = getCurrentSlotEndAnchor()) ? slotEndAnchor : null);
1645
+ if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
1646
+ }
1637
1647
  }
1638
- this.renderBranch(render, transition, parent, key);
1648
+ this.renderBranch(render, transition, parent, key, noScope);
1639
1649
  setActiveSub(prevSub);
1640
1650
  if (isHydrating$1 && this.anchorLabel !== "slot" && !reusingDeferredAnchor) this.hydrate(render == null);
1641
1651
  }
1642
- renderBranch(render, transition, parent, key) {
1652
+ renderBranch(render, transition, parent, key, noScope = false) {
1643
1653
  this.current = key;
1644
1654
  if (render) {
1645
1655
  const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx : null;
1646
- const scope = keepAliveCtx && keepAliveCtx.getScope(this.current);
1647
- if (scope) this.scope = scope;
1648
- else this.scope = new EffectScope$1();
1656
+ const useScope = !noScope || !!this.hasFallthroughAttrs;
1657
+ if (useScope) {
1658
+ const scope = keepAliveCtx && keepAliveCtx.getScope(this.current);
1659
+ if (scope) this.scope = scope;
1660
+ else this.scope = new EffectScope$1();
1661
+ } else this.scope = void 0;
1649
1662
  const renderBranch = () => {
1650
1663
  try {
1651
- this.nodes = this.runWithRenderCtx(() => this.scope.run(render) || []);
1664
+ this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK, this.scope);
1652
1665
  } finally {
1653
1666
  const key = this.keyed ? this.current : this.$key;
1654
1667
  if (key !== void 0 && (transition || this.inTransition || keepAliveCtx)) setBlockKey(this.nodes, key);
@@ -1659,20 +1672,119 @@ var DynamicFragment = class extends VaporFragment {
1659
1672
  if (keepAliveCtx && this.keyed) withCurrentCacheKey(key, renderBranch);
1660
1673
  else renderBranch();
1661
1674
  if (parent) {
1662
- if (this.attrs) {
1663
- if (this.nodes instanceof Element) this.scope.run(() => {
1664
- renderEffect(() => applyFallthroughProps(this.nodes, this.attrs));
1665
- });
1666
- else if (!!(process.env.NODE_ENV !== "production") && (this.anchorLabel === "slot" || isArray(this.nodes) && this.nodes.length)) warnExtraneousAttributes(this.attrs);
1667
- }
1675
+ const onBeforeInsert = this.onBeforeInsert;
1676
+ if (onBeforeInsert) onBeforeInsert.forEach((hook) => hook(this.nodes));
1668
1677
  insert(this.nodes, parent, this.anchor);
1669
- if (keepAliveCtx && transition && transition.mode === "out-in") keepAliveCtx.cacheBlock();
1670
1678
  }
1671
1679
  } else {
1672
1680
  this.scope = void 0;
1673
- this.nodes = [];
1681
+ this.nodes = EMPTY_BLOCK;
1682
+ }
1683
+ if (parent) {
1684
+ const onUpdated = this.onUpdated;
1685
+ if (onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
1686
+ }
1687
+ }
1688
+ hydrate(isEmpty = false, isSlot = false) {
1689
+ if (!isHydrating$1) return;
1690
+ let advanceAfterRestore = null;
1691
+ let exitHydrationBoundary;
1692
+ const reuseAnchor = (anchor) => {
1693
+ this.anchor = markHydrationAnchor(anchor);
1694
+ if (currentHydrationNode === this.anchor) advanceHydrationNode(this.anchor);
1695
+ else {
1696
+ exitHydrationBoundary = enterHydrationBoundary(this.anchor);
1697
+ advanceAfterRestore = this.anchor;
1698
+ }
1699
+ };
1700
+ const createRuntimeAnchor = () => this.anchor = markHydrationAnchor(!!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ createComment(this.anchorLabel) : /* @__PURE__ */ createTextNode());
1701
+ const cleanupAndInsertRuntimeAnchor = (parentNode, nextNode, cleanupStart, cleanupUntil) => {
1702
+ if (cleanupUntil) exitHydrationBoundary = enterHydrationBoundary(cleanupUntil);
1703
+ else {
1704
+ cleanupHydrationTail(cleanupStart);
1705
+ setCurrentHydrationNode(null);
1706
+ }
1707
+ queueAnchorInsert(parentNode, nextNode, createRuntimeAnchor);
1708
+ };
1709
+ try {
1710
+ if (isEmpty) {
1711
+ if (isComment(currentHydrationNode, "")) {
1712
+ reuseAnchor(currentHydrationNode);
1713
+ return;
1714
+ }
1715
+ if (this.anchorLabel && currentHydrationNode && isComment(currentHydrationNode, "teleport anchor")) {
1716
+ const parentNode$2 = /* @__PURE__ */ parentNode(currentHydrationNode);
1717
+ const anchor = markHydrationAnchor(currentHydrationNode);
1718
+ if (parentNode$2) {
1719
+ queueAnchorInsert(parentNode$2, anchor, createRuntimeAnchor);
1720
+ return;
1721
+ }
1722
+ }
1723
+ if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
1724
+ const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
1725
+ const anchor = nextLogicalSibling(currentHydrationNode);
1726
+ const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
1727
+ if (parentNode$4) {
1728
+ this.nodes = EMPTY_BLOCK;
1729
+ if (reusableAnchor) reuseAnchor(reusableAnchor);
1730
+ else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
1731
+ return;
1732
+ }
1733
+ }
1734
+ }
1735
+ if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
1736
+ const anchor = this.nodes;
1737
+ this.nodes = EMPTY_BLOCK;
1738
+ reuseAnchor(anchor);
1739
+ return;
1740
+ }
1741
+ if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && !/* @__PURE__ */ parentNode(this.nodes) && currentHydrationNode) {
1742
+ const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
1743
+ const nextNode = nextLogicalSibling(currentHydrationNode);
1744
+ if (parentNode$5) {
1745
+ this.nodes = EMPTY_BLOCK;
1746
+ cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
1747
+ return;
1748
+ }
1749
+ }
1750
+ const currentSlotEndAnchor = getCurrentSlotEndAnchor();
1751
+ const forwardedSlot = isSlot ? this.forwarded : false;
1752
+ const slotAnchor = isSlot ? currentSlotEndAnchor : null;
1753
+ const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
1754
+ if (closeOwner === 1) {
1755
+ const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
1756
+ if (isComment(anchor, "]")) {
1757
+ reuseAnchor(anchor);
1758
+ return;
1759
+ } else if (!!(process.env.NODE_ENV !== "production")) throw new Error(`Failed to locate ${this.anchorLabel} fragment anchor. this is likely a Vue internal bug.`);
1760
+ } else if (closeOwner === 3 && currentSlotEndAnchor) {
1761
+ const anchor = markHydrationAnchor(currentSlotEndAnchor);
1762
+ queueAnchorInsert(anchor.parentNode, anchor.nextSibling, createRuntimeAnchor);
1763
+ return;
1764
+ } else if (closeOwner === 2 && currentSlotEndAnchor) {
1765
+ const endAnchor = currentSlotEndAnchor;
1766
+ queuePostFlushCb(() => {
1767
+ const parentNode$6 = /* @__PURE__ */ parentNode(endAnchor);
1768
+ if (!parentNode$6) return;
1769
+ parentNode$6.insertBefore(createRuntimeAnchor(), endAnchor);
1770
+ });
1771
+ return;
1772
+ }
1773
+ let parentNode$3;
1774
+ let nextNode;
1775
+ if (this.anchorLabel === "if" && !isValidBlock(this.nodes) && currentSlotEndAnchor && currentHydrationNode === currentSlotEndAnchor) {
1776
+ parentNode$3 = currentSlotEndAnchor.parentNode;
1777
+ nextNode = currentSlotEndAnchor;
1778
+ } else {
1779
+ const node = findBlockNode(this.nodes);
1780
+ parentNode$3 = node.parentNode;
1781
+ nextNode = node.nextNode;
1782
+ }
1783
+ queueAnchorInsert(parentNode$3, nextNode, createRuntimeAnchor);
1784
+ } finally {
1785
+ exitHydrationBoundary && exitHydrationBoundary();
1786
+ if (advanceAfterRestore && currentHydrationNode === advanceAfterRestore) advanceHydrationNode(advanceAfterRestore);
1674
1787
  }
1675
- if (parent && this.onUpdated) this.onUpdated.forEach((hook) => hook(this.nodes));
1676
1788
  }
1677
1789
  };
1678
1790
  let currentSlotBoundary = null;
@@ -1878,6 +1990,13 @@ function commitSlotFallback(outlet, block, scope) {
1878
1990
  outlet.activeFallback = block;
1879
1991
  outlet.fallbackScope = scope;
1880
1992
  ensureSlotFallbackOrderHook(outlet, block);
1993
+ if (isTransitionEnabled) {
1994
+ const transitionOutlet = outlet;
1995
+ if (transitionOutlet.$transition) {
1996
+ setBlockKey(block, "_fb");
1997
+ transitionOutlet.$transition = applyTransitionHooks(block, transitionOutlet.$transition);
1998
+ }
1999
+ }
1881
2000
  insertActiveSlotFallback(outlet);
1882
2001
  }
1883
2002
  function syncActiveSlotFallback(outlet) {
@@ -1972,7 +2091,7 @@ function isReusableDynamicFragmentAnchor(node, anchorLabel) {
1972
2091
  }
1973
2092
  var SlotFragment = class extends DynamicFragment {
1974
2093
  constructor() {
1975
- super(isHydrating$1 || !!(process.env.NODE_ENV !== "production") ? "slot" : void 0, false, false);
2094
+ super(isHydrating$1 || !!(process.env.NODE_ENV !== "production") ? "slot" : void 0, false, false, false);
1976
2095
  this.disposed = false;
1977
2096
  this.forwarded = false;
1978
2097
  this.parentSlotBoundary = getCurrentSlotBoundary();
@@ -1996,7 +2115,6 @@ var SlotFragment = class extends DynamicFragment {
1996
2115
  markDirty: () => markSlotFallbackDirty(this)
1997
2116
  };
1998
2117
  }
1999
- registerSlotBoundaryDirty() {}
2000
2118
  get fallbackBlock() {
2001
2119
  return this.activeFallback;
2002
2120
  }
@@ -2119,21 +2237,32 @@ function isValidBlock(block) {
2119
2237
  }
2120
2238
  }
2121
2239
  function insert(block, parent, anchor = null, parentSuspense) {
2122
- anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
2123
2240
  if (block instanceof Node) {
2124
- if (!isHydrating$1) if (isTransitionEnabled && block instanceof Element && block.$transition && !block.$transition.disabled) performTransitionEnter(block, block.$transition, () => parent.insertBefore(block, anchor), parentSuspense);
2125
- else parent.insertBefore(block, anchor);
2126
- } else if (isVaporComponent(block)) if (block.isMounted && !block.isDeactivated) insert(block.block, parent, anchor);
2127
- else mountComponent(block, parent, anchor);
2128
- else if (isArray(block)) for (const b of block) insert(b, parent, anchor);
2129
- else {
2130
- if (block.anchor) {
2131
- insert(block.anchor, parent, anchor);
2132
- anchor = block.anchor;
2133
- }
2134
- if (block.insert) block.insert(parent, anchor, block.$transition);
2135
- else insert(block.nodes, parent, anchor, parentSuspense);
2241
+ insertNode(block, parent, anchor, parentSuspense);
2242
+ return;
2243
+ }
2244
+ if (isVaporComponent(block)) {
2245
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
2246
+ if (block.isMounted && !block.isDeactivated) insert(block.block, parent, anchor);
2247
+ else mountComponent(block, parent, anchor);
2248
+ } else if (isArray(block)) {
2249
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
2250
+ for (const b of block) insert(b, parent, anchor);
2251
+ } else insertFragment(block, parent, anchor, parentSuspense);
2252
+ }
2253
+ function insertNode(block, parent, anchor = null, parentSuspense) {
2254
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
2255
+ if (!isHydrating$1) if (isTransitionEnabled && block instanceof Element && block.$transition && !block.$transition.disabled) performTransitionEnter(block, block.$transition, () => parent.insertBefore(block, anchor), parentSuspense);
2256
+ else parent.insertBefore(block, anchor);
2257
+ }
2258
+ function insertFragment(block, parent, anchor = null, parentSuspense) {
2259
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
2260
+ if (block.anchor) {
2261
+ insertNode(block.anchor, parent, anchor, parentSuspense);
2262
+ anchor = block.anchor;
2136
2263
  }
2264
+ if (block.insert) block.insert(parent, anchor, block.$transition);
2265
+ else insert(block.nodes, parent, anchor, parentSuspense);
2137
2266
  }
2138
2267
  function move(block, parent, anchor = null, moveType = 1, parentComponent, parentSuspense) {
2139
2268
  anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
@@ -2160,16 +2289,20 @@ function prepend(parent, ...blocks) {
2160
2289
  while (i--) insert(blocks[i], parent, 0);
2161
2290
  }
2162
2291
  function remove(block, parent) {
2163
- if (block instanceof Node) if (isTransitionEnabled && block.$transition && block instanceof Element) performTransitionLeave(block, block.$transition, () => parent && parent.removeChild(block));
2164
- else parent && parent.removeChild(block);
2292
+ if (block instanceof Node) removeNode(block, parent);
2165
2293
  else if (isVaporComponent(block)) unmountComponent(block, parent);
2166
2294
  else if (isArray(block)) for (let i = 0; i < block.length; i++) remove(block[i], parent);
2167
- else {
2168
- if (block.remove) block.remove(parent, block.$transition);
2169
- else remove(block.nodes, parent);
2170
- if (block.anchor) remove(block.anchor, parent);
2171
- if (block.scope) block.scope.stop();
2172
- }
2295
+ else removeFragment(block, parent);
2296
+ }
2297
+ function removeNode(block, parent) {
2298
+ if (isTransitionEnabled && block.$transition && block instanceof Element) performTransitionLeave(block, block.$transition, () => parent && parent.removeChild(block));
2299
+ else parent && parent.removeChild(block);
2300
+ }
2301
+ function removeFragment(block, parent) {
2302
+ if (block.remove) block.remove(parent, block.$transition);
2303
+ else remove(block.nodes, parent);
2304
+ if (block.anchor) removeNode(block.anchor, parent);
2305
+ if (block.scope) block.scope.stop();
2173
2306
  }
2174
2307
  /**
2175
2308
  * dev / test only
@@ -2298,7 +2431,12 @@ function setParentSuspense(suspense) {
2298
2431
  }
2299
2432
  //#endregion
2300
2433
  //#region packages/runtime-vapor/src/component.ts
2434
+ function normalizeRawSlots(rawSlots) {
2435
+ return rawSlots && isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
2436
+ }
2301
2437
  function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false) {
2438
+ const wasInOnceSlot = inOnceSlot;
2439
+ if (wasInOnceSlot) once = true;
2302
2440
  if (isInteropEnabled && isCollectingVdomSlotVNodes) {
2303
2441
  if (component.__vapor) return;
2304
2442
  const owner = getScopeOwner();
@@ -2339,7 +2477,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
2339
2477
  if (cached) return cached;
2340
2478
  }
2341
2479
  if (isInteropEnabled && appContext.vapor && !component.__vapor) {
2342
- const frag = appContext.vapor.vdomMount(component, currentInstance, rawProps, rawSlots);
2480
+ const frag = appContext.vapor.vdomMount(component, currentInstance, rawProps, normalizeRawSlots(rawSlots), once);
2343
2481
  if (isCollectingVdomSlotVNodes) return frag;
2344
2482
  if (!isHydrating$1) {
2345
2483
  if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
@@ -2347,7 +2485,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
2347
2485
  return frag;
2348
2486
  }
2349
2487
  if (isTeleportEnabled && isVaporTeleport(component)) {
2350
- const frag = component.process(rawProps, rawSlots);
2488
+ const frag = component.process(rawProps, normalizeRawSlots(rawSlots));
2351
2489
  if (_insertionParent) onScopeDispose$1(() => frag.dispose(), true);
2352
2490
  if (!isHydrating$1) {
2353
2491
  if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
@@ -2375,7 +2513,10 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
2375
2513
  instance.propsOptions = normalizePropsOptions(component);
2376
2514
  instance.emitsOptions = normalizeEmitsOptions(component);
2377
2515
  }
2378
- if (isHydrating$1 && isAsyncWrapper(instance) && component.__asyncHydrate && !component.__asyncResolved) component.__asyncHydrate(currentHydrationNode, instance, () => setupComponent(instance, component));
2516
+ if (isHydrating$1 && isAsyncWrapper(instance) && component.__asyncHydrate && !component.__asyncResolved) {
2517
+ const setup = () => setupComponent(instance, component);
2518
+ component.__asyncHydrate(currentHydrationNode, instance, wasInOnceSlot ? () => withOnceSlot(setup, false) : setup);
2519
+ } else if (wasInOnceSlot) withOnceSlot(() => setupComponent(instance, component), false);
2379
2520
  else setupComponent(instance, component);
2380
2521
  } finally {
2381
2522
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -2498,6 +2639,7 @@ var VaporComponentInstance = class {
2498
2639
  }
2499
2640
  this.block = null;
2500
2641
  this.scope = new EffectScope(true);
2642
+ this.isOnce = !!once;
2501
2643
  this.emit = emit.bind(null, this);
2502
2644
  this.expose = expose.bind(null, this);
2503
2645
  this.refs = EMPTY_OBJ;
@@ -2511,15 +2653,16 @@ var VaporComponentInstance = class {
2511
2653
  this.asyncDep = null;
2512
2654
  this.asyncResolved = false;
2513
2655
  this.isMounted = this.isUnmounted = this.isUpdating = this.isDeactivated = false;
2514
- this.rawProps = rawProps || EMPTY_OBJ;
2515
- this.hasFallthrough = hasFallthroughAttrs(comp, rawProps);
2656
+ this.rawProps = this.isOnce && rawProps ? snapshotRawProps(rawProps) : rawProps || EMPTY_OBJ;
2657
+ this.hasFallthrough = hasFallthroughAttrs(comp, this.rawProps);
2516
2658
  if (rawProps || comp.props) {
2517
- const [propsHandlers, attrsHandlers] = getPropsProxyHandlers(comp, once);
2659
+ const [propsHandlers, attrsHandlers] = getPropsProxyHandlers(comp);
2518
2660
  this.attrs = new Proxy(this, attrsHandlers);
2519
2661
  this.props = comp.props ? new Proxy(this, propsHandlers) : isFunction(comp) ? this.attrs : EMPTY_OBJ;
2520
2662
  } else this.props = this.attrs = EMPTY_OBJ;
2521
- this.rawSlots = rawSlots || EMPTY_OBJ;
2522
- this.slots = rawSlots ? rawSlots.$ ? new Proxy(rawSlots, dynamicSlotsProxyHandlers) : rawSlots : EMPTY_OBJ;
2663
+ const normalizedRawSlots = normalizeRawSlots(rawSlots);
2664
+ this.rawSlots = normalizedRawSlots || EMPTY_OBJ;
2665
+ this.slots = normalizedRawSlots ? normalizedRawSlots.$ ? new Proxy(normalizedRawSlots, dynamicSlotsProxyHandlers) : normalizedRawSlots : EMPTY_OBJ;
2523
2666
  this.scopeId = getCurrentScopeId();
2524
2667
  if (comp.ce) comp.ce(this);
2525
2668
  if (!!(process.env.NODE_ENV !== "production")) if (this.props === this.attrs) this.accessedAttrs = true;
@@ -2544,6 +2687,14 @@ function isVaporComponent(value) {
2544
2687
  return value instanceof VaporComponentInstance;
2545
2688
  }
2546
2689
  /**
2690
+ * Resolve an asset component by name before passing it to the fallback helper;
2691
+ * a string passed directly to `createComponentWithFallback` is plain element
2692
+ * fallback, not a component name.
2693
+ */
2694
+ function createAssetComponent(name, rawProps, rawSlots, isSingleRoot, once, maybeSelfReference, appContext) {
2695
+ return createComponentWithFallback(resolveComponent(name, maybeSelfReference), rawProps, rawSlots, isSingleRoot, once, appContext);
2696
+ }
2697
+ /**
2547
2698
  * Used when a component cannot be resolved at compile time
2548
2699
  * and needs rely on runtime resolution - where it might fallback to a plain
2549
2700
  * element if the resolution fails.
@@ -2556,7 +2707,7 @@ function createComponentWithFallback(comp, rawProps, rawSlots, isSingleRoot, onc
2556
2707
  if (isComment(node, "")) advanceHydrationNode(node);
2557
2708
  return node;
2558
2709
  }
2559
- const nextAnchor = locateNextNode(currentHydrationNode);
2710
+ const nextAnchor = nextLogicalSibling(currentHydrationNode);
2560
2711
  if (nextAnchor && isReusableNullComponentAnchor(nextAnchor)) return nextAnchor;
2561
2712
  }
2562
2713
  return !!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ createComment("ndc") : /* @__PURE__ */ createTextNode("");
@@ -2568,12 +2719,17 @@ function isReusableNullComponentAnchor(node) {
2568
2719
  return isComment(node, "") || isComment(node, "dynamic-component") || isComment(node, "async component") || isComment(node, "keyed");
2569
2720
  }
2570
2721
  function createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once) {
2722
+ rawSlots = normalizeRawSlots(rawSlots);
2571
2723
  const _insertionParent = insertionParent;
2572
2724
  const _insertionAnchor = insertionAnchor;
2573
2725
  let hydrationCursor = null;
2574
2726
  if (isHydrating$1) hydrationCursor = enterHydrationCursor();
2575
2727
  else resetInsertionState();
2576
- const el = isHydrating$1 ? adoptTemplate(currentHydrationNode, `<${comp}/>`) : /* @__PURE__ */ createElement(comp);
2728
+ const defaultSlot = rawSlots && getSlot(rawSlots, "default");
2729
+ const hasDynamicSlots = !!rawSlots && !!rawSlots.$;
2730
+ const adoptHydrationChildren = !!defaultSlot;
2731
+ const hydrationTemplate = hasDynamicSlots && !defaultSlot ? `<${comp}><!></${comp}>` : `<${comp}/>`;
2732
+ const el = isHydrating$1 ? adoptTemplate(currentHydrationNode, hydrationTemplate, adoptHydrationChildren) : /* @__PURE__ */ createElement(comp);
2577
2733
  el.$root = isSingleRoot;
2578
2734
  if (!isHydrating$1) {
2579
2735
  const scopeId = getCurrentScopeId();
@@ -2587,7 +2743,7 @@ function createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once) {
2587
2743
  if (rawSlots) {
2588
2744
  let nextNode = null;
2589
2745
  if (isHydrating$1) {
2590
- nextNode = locateNextNode(el);
2746
+ nextNode = nextLogicalSibling(el);
2591
2747
  setCurrentHydrationNode(el.firstChild);
2592
2748
  }
2593
2749
  if (rawSlots.$) {
@@ -2708,7 +2864,7 @@ function handleSetupResult(setupResult, component, instance) {
2708
2864
  else if (setupResult === EMPTY_OBJ && component.render) instance.block = callRender(component.render, instance, setupResult);
2709
2865
  else instance.block = setupResult;
2710
2866
  if (instance.hasFallthrough && component.inheritAttrs !== false && Object.keys(instance.attrs).length) {
2711
- const root = getRootElement(instance.block, (frag) => frag.attrs = instance.attrs, false);
2867
+ const root = getRootElement(instance.block, (frag) => registerDynamicFragmentFallthroughAttrs(frag, instance.attrs), false);
2712
2868
  if (root) renderEffect(() => {
2713
2869
  const attrs = isFunction(component) && !(isTransitionEnabled ? isVaporTransition(component) : false) ? getFunctionalFallthrough(instance.attrs) : instance.attrs;
2714
2870
  if (attrs) applyFallthroughProps(root, attrs);
@@ -2721,6 +2877,15 @@ function getCurrentScopeId() {
2721
2877
  const scopeOwner = getScopeOwner();
2722
2878
  return scopeOwner ? scopeOwner.type.__scopeId : void 0;
2723
2879
  }
2880
+ function registerDynamicFragmentFallthroughAttrs(frag, attrs) {
2881
+ frag.hasFallthroughAttrs = true;
2882
+ (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => {
2883
+ if (nodes instanceof Element) frag.scope.run(() => {
2884
+ renderEffect(() => applyFallthroughProps(nodes, attrs));
2885
+ });
2886
+ else if (!!(process.env.NODE_ENV !== "production") && (frag.anchorLabel === "slot" || isArray(nodes) && nodes.length)) warnExtraneousAttributes(attrs);
2887
+ });
2888
+ }
2724
2889
  //#endregion
2725
2890
  //#region packages/runtime-vapor/src/apiCreateApp.ts
2726
2891
  let _createApp;
@@ -2865,7 +3030,7 @@ function defineVaporAsyncComponent(source) {
2865
3030
  function createInnerComp(comp, parent, rawProps = parent.rawProps, rawSlots = parent.rawSlots) {
2866
3031
  const prevInstance = setCurrentInstance(parent);
2867
3032
  try {
2868
- return createComponent(comp, rawProps, rawSlots, void 0, void 0, parent.appContext);
3033
+ return createComponent(comp, rawProps, rawSlots, void 0, parent.isOnce, parent.appContext);
2869
3034
  } finally {
2870
3035
  setCurrentInstance(...prevInstance);
2871
3036
  }
@@ -2929,10 +3094,11 @@ function setDisplay(target, value) {
2929
3094
  else el.style.display = "none";
2930
3095
  else if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating$1) {
2931
3096
  if (!value && el.style.display !== "none") {
2932
- warnPropMismatch(el, "style", 3, `display: ${el.style.display}`, "display: none");
2933
- logMismatchError();
2934
- el.style.display = "none";
2935
- el[vShowOriginalDisplay] = "";
3097
+ if (warnPropMismatch(el, "style", 3, `display: ${el.style.display}`, "display: none")) {
3098
+ logMismatchError();
3099
+ el.style.display = "none";
3100
+ el[vShowOriginalDisplay] = "";
3101
+ }
2936
3102
  }
2937
3103
  } else el.style.display = value ? el[vShowOriginalDisplay] : "none";
2938
3104
  el[vShowHidden] = !value;
@@ -3082,7 +3248,7 @@ function applyResolvedTransitionHooks(block, hooks) {
3082
3248
  if (block.length === 1) block = block[0];
3083
3249
  else if (block.length === 0) return { hooks };
3084
3250
  }
3085
- if (hooks.applyGroup && block instanceof ForFragment) {
3251
+ if (hooks.applyGroup && (block instanceof ForFragment || block instanceof SlotFragment || isVaporComponent(block) && block.block instanceof SlotFragment)) {
3086
3252
  hooks.applyGroup(block, hooks.props, hooks.state, hooks.instance);
3087
3253
  return { hooks };
3088
3254
  }
@@ -3438,7 +3604,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
3438
3604
  keptAliveScopes.forEach((scope) => scope.stop());
3439
3605
  keptAliveScopes.clear();
3440
3606
  });
3441
- const prevCtx = setCurrentKeepAliveCtx({
3607
+ const keepAliveCtx = {
3442
3608
  processShapeFlag,
3443
3609
  cacheBlock,
3444
3610
  cacheScope(cacheKey, scopeLookupKey, scope) {
@@ -3453,11 +3619,14 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
3453
3619
  getScope(key) {
3454
3620
  return deleteScope(key);
3455
3621
  }
3456
- });
3622
+ };
3623
+ const prevCtx = setCurrentKeepAliveCtx(keepAliveCtx);
3457
3624
  let children = slots.default();
3458
3625
  setCurrentKeepAliveCtx(prevCtx);
3626
+ registerDynamicFragmentHooks(children, keepAliveCtx);
3459
3627
  if (isArray(children)) {
3460
3628
  children = children.filter((child) => !(child instanceof Comment));
3629
+ if (children.length === 1) registerDynamicFragmentHooks(children[0], keepAliveCtx);
3461
3630
  if (children.length > 1) {
3462
3631
  if (!!(process.env.NODE_ENV !== "production")) warn(`KeepAlive should contain exactly one component child.`);
3463
3632
  return children;
@@ -3466,6 +3635,20 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
3466
3635
  return children;
3467
3636
  }
3468
3637
  }));
3638
+ function registerDynamicFragmentHooks(block, keepAliveCtx) {
3639
+ if (!isDynamicFragment(block)) return;
3640
+ (block.onBeforeRemove || (block.onBeforeRemove = [])).push((scope) => {
3641
+ const cacheKey = block.keyed ? withCurrentCacheKey(block.current, () => keepAliveCtx.processShapeFlag(block.nodes)) : keepAliveCtx.processShapeFlag(block.nodes);
3642
+ if (cacheKey !== false) {
3643
+ keepAliveCtx.cacheScope(cacheKey, block.current, scope);
3644
+ return true;
3645
+ }
3646
+ return false;
3647
+ });
3648
+ (block.onUpdated || (block.onUpdated = [])).unshift(() => {
3649
+ if (block.$transition && block.$transition.mode === "out-in") keepAliveCtx.cacheBlock(block);
3650
+ });
3651
+ }
3469
3652
  const shouldCache = (block, props, interop = false) => {
3470
3653
  const isAsync = isAsyncWrapper(interop ? block.vnode : block);
3471
3654
  const type = interop && isInteropEnabled ? block.vnode.type : block.type;
@@ -3555,7 +3738,9 @@ const vaporInteropImpl = {
3555
3738
  const instance = vnode.component = createComponent(vnode.type, { $: dynamicPropSource }, rawSlots, void 0, void 0, parentComponent ? parentComponent.appContext : vnode.appContext, true);
3556
3739
  instance.rawPropsRef = propsRef;
3557
3740
  instance.rawSlotsRef = slotsRef;
3558
- ensureVNodeHookState(instance, vnode);
3741
+ const vnodeHookState = ensureVNodeHookState(instance, vnode);
3742
+ const applyScopeId = (vnode) => setInteropVnodeScopeId(instance, vnode, instance.parent);
3743
+ vnodeHookState.postRootSyncHooks.push(applyScopeId);
3559
3744
  if (parentComponent && isKeepAlive(parentComponent)) {
3560
3745
  enableKeepAlive();
3561
3746
  instance.shapeFlag = vnode.shapeFlag;
@@ -3574,6 +3759,7 @@ const vaporInteropImpl = {
3574
3759
  vnode.dirs = null;
3575
3760
  }
3576
3761
  mountComponent(instance, container, selfAnchor);
3762
+ if (!isHydrating$1) applyScopeId(vnodeHookState.vnode);
3577
3763
  simpleSetCurrentInstance(prev);
3578
3764
  return instance;
3579
3765
  },
@@ -3594,6 +3780,7 @@ const vaporInteropImpl = {
3594
3780
  instance.rawSlotsRef.value = normalizeInteropSlots(n2.children);
3595
3781
  queuePostFlushCb(() => {
3596
3782
  syncVNodeEl(n2, instance);
3783
+ setInteropVnodeScopeId(instance, n2, instance.parent);
3597
3784
  if (!instance.isUpdating) vnodeHookState.skipVnodeHooks = false;
3598
3785
  });
3599
3786
  }
@@ -3865,13 +4052,22 @@ function appendVnodeUpdatedHook(vnode, hook) {
3865
4052
  const existing = props.onVnodeUpdated;
3866
4053
  props.onVnodeUpdated = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
3867
4054
  }
4055
+ function appendVnodeBeforeUpdateHook(vnode, hook) {
4056
+ const props = vnode.props || (vnode.props = {});
4057
+ const existing = props.onVnodeBeforeUpdate;
4058
+ props.onVnodeBeforeUpdate = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
4059
+ }
3868
4060
  function trackFragmentVNodeUpdates(frag, vnode) {
3869
- const refresh = () => {
4061
+ const beforeUpdate = () => {
4062
+ if (frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
4063
+ };
4064
+ const updated = () => {
3870
4065
  frag.nodes = resolveVNodeNodes(vnode);
3871
4066
  frag.validityPending = false;
3872
4067
  if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
3873
4068
  };
3874
- appendVnodeUpdatedHook(vnode, refresh);
4069
+ appendVnodeBeforeUpdateHook(vnode, beforeUpdate);
4070
+ appendVnodeUpdatedHook(vnode, updated);
3875
4071
  }
3876
4072
  /**
3877
4073
  * Mount VNode in vapor
@@ -3925,7 +4121,7 @@ function mountVNode(internals, vnode, parentComponent) {
3925
4121
  /**
3926
4122
  * Mount vdom component in vapor
3927
4123
  */
3928
- function createVDOMComponent(internals, component, parentComponent, rawProps, rawSlots) {
4124
+ function createVDOMComponent(internals, component, parentComponent, rawProps, rawSlots, once) {
3929
4125
  const suspense = parentSuspense || parentComponent && parentComponent.suspense;
3930
4126
  const useBridge = shouldUseRendererBridge(component);
3931
4127
  const comp = useBridge ? ensureRendererBridge(component) : component;
@@ -3946,7 +4142,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
3946
4142
  }
3947
4143
  setCurrentKeepAliveCtx(null);
3948
4144
  }
3949
- const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, void 0);
4145
+ const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, once);
3950
4146
  if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.slots));
3951
4147
  vnode.vi = (instance) => {
3952
4148
  instance.props = shallowReactive(wrapper.props);
@@ -4117,7 +4313,7 @@ function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
4117
4313
  /**
4118
4314
  * Mount vdom slot in vapor
4119
4315
  */
4120
- function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback) {
4316
+ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once) {
4121
4317
  const suspense = parentSuspense || parentComponent.suspense;
4122
4318
  const frag = new VaporFragment([]);
4123
4319
  trackSlotBoundaryDirtying(frag);
@@ -4162,7 +4358,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
4162
4358
  if (!isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
4163
4359
  }
4164
4360
  };
4165
- localFallback = fallback ? () => fallback(internals, parentComponent) : void 0;
4361
+ localFallback = fallback ? once ? () => withOnceSlot(() => fallback(internals, parentComponent)) : () => fallback(internals, parentComponent) : void 0;
4166
4362
  const setRenderedContent = (rendered) => {
4167
4363
  contentState.rendered = rendered;
4168
4364
  if (isVNode(rendered)) {
@@ -4219,12 +4415,13 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
4219
4415
  const prev = currentInstance;
4220
4416
  simpleSetCurrentInstance(instance);
4221
4417
  try {
4222
- renderEffect(() => {
4418
+ const renderSlotContent = () => {
4223
4419
  runWithFragmentRenderCtx(frag, () => withOwnedSlotBoundary(boundary, () => {
4224
4420
  let slotContent;
4225
4421
  let slotContentValid = false;
4226
4422
  if (slotsRef.value) {
4227
- slotContent = renderSlot(slotsRef.value, isFunction(name) ? name() : name, props);
4423
+ const renderContent = () => renderSlot(slotsRef.value, isFunction(name) ? name() : name, props);
4424
+ slotContent = once ? withOnceSlot(renderContent) : renderContent();
4228
4425
  if (isVNode(slotContent)) if (slotContent.type === Fragment) {
4229
4426
  const children = slotContent.children;
4230
4427
  ensureVaporSlotFallback(children, localFallback);
@@ -4287,7 +4484,8 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
4287
4484
  setRenderedContent(null);
4288
4485
  finishContentUpdate();
4289
4486
  }));
4290
- });
4487
+ };
4488
+ once ? renderSlotContent() : renderEffect(renderSlotContent);
4291
4489
  } finally {
4292
4490
  simpleSetCurrentInstance(prev);
4293
4491
  }
@@ -4584,7 +4782,8 @@ function ensureVNodeHookState(instance, vnode) {
4584
4782
  if (!state) {
4585
4783
  state = {
4586
4784
  vnode,
4587
- skipVnodeHooks: false
4785
+ skipVnodeHooks: false,
4786
+ postRootSyncHooks: []
4588
4787
  };
4589
4788
  vnodeHookStateMap.set(instance, state);
4590
4789
  (instance.bu || (instance.bu = [])).push(() => {
@@ -4592,7 +4791,11 @@ function ensureVNodeHookState(instance, vnode) {
4592
4791
  const vnodeHook = state.vnode.props && state.vnode.props.onVnodeBeforeUpdate;
4593
4792
  if (vnodeHook) callWithAsyncErrorHandling(vnodeHook, instance.parent, 7, [state.vnode, state.vnode]);
4594
4793
  });
4595
- (instance.u || (instance.u = [])).unshift(() => syncVNodeEl(state.vnode, instance));
4794
+ (instance.u || (instance.u = [])).unshift(() => {
4795
+ syncVNodeEl(state.vnode, instance);
4796
+ const hooks = state.postRootSyncHooks;
4797
+ for (let i = 0; i < hooks.length; i++) hooks[i](state.vnode);
4798
+ });
4596
4799
  instance.u.push(() => {
4597
4800
  if (state.skipVnodeHooks) {
4598
4801
  state.skipVnodeHooks = false;
@@ -4780,6 +4983,32 @@ function createInteropRawSlots(slotsRef) {
4780
4983
  });
4781
4984
  return rawSlots;
4782
4985
  }
4986
+ const interopScopeIdRootMap = /* @__PURE__ */ new WeakMap();
4987
+ const interopScopeIdFragmentMap = /* @__PURE__ */ new WeakMap();
4988
+ function trackInteropScopeIdFragment(instance, frag) {
4989
+ if (interopScopeIdFragmentMap.get(frag) === instance) return;
4990
+ interopScopeIdFragmentMap.set(frag, instance);
4991
+ (frag.onUpdated || (frag.onUpdated = [])).push(() => {
4992
+ const state = vnodeHookStateMap.get(instance);
4993
+ if (!state) return;
4994
+ syncVNodeEl(state.vnode, instance);
4995
+ setInteropVnodeScopeId(instance, state.vnode, instance.parent);
4996
+ });
4997
+ }
4998
+ function setInteropVnodeScopeId(instance, vnode, parentComponent) {
4999
+ const root = getRootElement(instance, (frag) => trackInteropScopeIdFragment(instance, frag));
5000
+ if (!root) {
5001
+ interopScopeIdRootMap.delete(instance);
5002
+ return;
5003
+ }
5004
+ if (interopScopeIdRootMap.get(instance) === root) return;
5005
+ interopScopeIdRootMap.set(instance, root);
5006
+ const scopeIds = [];
5007
+ if (vnode.scopeId) scopeIds.push(vnode.scopeId);
5008
+ if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
5009
+ scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
5010
+ for (let i = 0; i < scopeIds.length; i++) root.setAttribute(scopeIds[i], "");
5011
+ }
4783
5012
  //#endregion
4784
5013
  //#region packages/runtime-vapor/src/components/Teleport.ts
4785
5014
  const VaporTeleportImpl = {
@@ -5125,16 +5354,19 @@ var VaporElement = class extends VueElementBase {
5125
5354
  //#region packages/runtime-vapor/src/dom/template.ts
5126
5355
  let t;
5127
5356
  /* @__NO_SIDE_EFFECTS__ */
5128
- function template(html, root, isStatic, ns) {
5357
+ function template(html, flags = 0, ns) {
5358
+ const root = !!(flags & 1);
5359
+ const isStatic = !!(flags & 2);
5129
5360
  let node;
5130
5361
  return () => {
5131
5362
  if (isHydrating$1) {
5132
5363
  let adopted = null;
5133
5364
  if (isStatic) {
5134
5365
  adopted = resolveHydrationTarget(currentHydrationNode);
5366
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && html !== "") validateHydrationTarget(adopted, html);
5135
5367
  node = adopted.cloneNode(true);
5136
5368
  advanceHydrationNode(adopted);
5137
- } else adopted = adoptTemplate(currentHydrationNode, html);
5369
+ } else adopted = adoptTemplate(currentHydrationNode, html, false, ns);
5138
5370
  if (root) adopted.$root = true;
5139
5371
  return adopted;
5140
5372
  }
@@ -5160,30 +5392,32 @@ function template(html, root, isStatic, ns) {
5160
5392
  }
5161
5393
  //#endregion
5162
5394
  //#region packages/runtime-vapor/src/apiCreateIf.ts
5163
- function createIf(condition, b1, b2, blockShape, once, index) {
5395
+ function createIf(condition, b1, b2, flags = 1) {
5164
5396
  const _insertionParent = insertionParent;
5165
5397
  const _insertionAnchor = insertionAnchor;
5166
5398
  if (!isHydrating$1) resetInsertionState();
5167
5399
  let hydrationCursor = null;
5168
5400
  let branchShape;
5169
5401
  let frag;
5170
- if (once) {
5402
+ if (flags & 16) {
5171
5403
  const ok = condition();
5172
5404
  if (isHydrating$1) {
5173
- branchShape = decodeIfShape(blockShape, ok);
5405
+ branchShape = decodeIfShape(flags, ok);
5174
5406
  hydrationCursor = enterHydrationCursor(branchShape === 2);
5175
5407
  }
5176
5408
  frag = ok ? b1() : b2 ? b2() : [!!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ createComment("if") : /* @__PURE__ */ createTextNode()];
5177
5409
  } else {
5178
- const keyed = index != null;
5410
+ const index = flags >> 7;
5411
+ const keyed = index > 0;
5412
+ const keyBase = keyed ? (index - 1) * 2 : 0;
5179
5413
  frag = isHydrating$1 || !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("if", keyed, false) : new DynamicFragment(void 0, keyed, false);
5180
5414
  renderEffect(() => {
5181
5415
  const ok = condition();
5182
5416
  if (isHydrating$1) {
5183
- branchShape = decodeIfShape(blockShape, ok);
5417
+ branchShape = decodeIfShape(flags, ok);
5184
5418
  hydrationCursor = enterHydrationCursor(branchShape === 2);
5185
5419
  }
5186
- frag.update(ok ? b1 : b2, keyed ? `${index}${ok ? 0 : 1}` : void 0);
5420
+ frag.update(ok ? b1 : b2, keyed ? keyBase + (ok ? 0 : 1) : void 0, isNoScopeBranch(flags, ok));
5187
5421
  });
5188
5422
  }
5189
5423
  if (!isHydrating$1) {
@@ -5200,6 +5434,9 @@ function createIf(condition, b1, b2, blockShape, once, index) {
5200
5434
  function decodeIfShape(shape, ok) {
5201
5435
  return shape >> (ok ? 0 : 2) & 3;
5202
5436
  }
5437
+ function isNoScopeBranch(flags, ok) {
5438
+ return !!(flags & (ok ? 32 : 64));
5439
+ }
5203
5440
  //#endregion
5204
5441
  //#region packages/runtime-vapor/src/apiCreateFragment.ts
5205
5442
  /**
@@ -5240,6 +5477,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5240
5477
  let isMounted = false;
5241
5478
  let oldBlocks = [];
5242
5479
  let newBlocks;
5480
+ let newKeys;
5243
5481
  let parent;
5244
5482
  let parentAnchor;
5245
5483
  let pendingHydrationAnchor = false;
@@ -5248,6 +5486,8 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5248
5486
  const instance = currentInstance$1;
5249
5487
  const canUseFastRemove = !!(flags & 1);
5250
5488
  const isComponent = !!(flags & 2);
5489
+ const isSingleNode = !!(flags & 8);
5490
+ const isFragment = !!(flags & 16);
5251
5491
  const slotOwner = currentSlotOwner;
5252
5492
  if (!!(process.env.NODE_ENV !== "production") && !instance) warn("createFor() can only be used inside setup()");
5253
5493
  if (!isComponent) onScopeDispose$1(() => {
@@ -5261,7 +5501,13 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5261
5501
  const newLength = source.values.length;
5262
5502
  const oldLength = oldBlocks.length;
5263
5503
  newBlocks = new Array(newLength);
5504
+ newKeys = void 0;
5505
+ if (getKey) {
5506
+ newKeys = new Array(newLength);
5507
+ for (let i = 0; i < newLength; i++) newKeys[i] = getKey(...getItem(source, i));
5508
+ }
5264
5509
  const prevSub = setActiveSub();
5510
+ if (isMounted && frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
5265
5511
  if (!isMounted) {
5266
5512
  isMounted = true;
5267
5513
  if (isHydrating$1) hydrateList(source, newLength);
@@ -5286,7 +5532,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5286
5532
  if (!!(process.env.NODE_ENV !== "production")) {
5287
5533
  const keyToIndexMap = /* @__PURE__ */ new Map();
5288
5534
  for (let i = 0; i < newLength; i++) {
5289
- const key = getKey(...getItem(source, i));
5535
+ const key = newKeys[i];
5290
5536
  if (key != null) {
5291
5537
  if (keyToIndexMap.has(key)) warn(`Duplicate keys found during update:`, JSON.stringify(key), `Make sure keys are unique.`);
5292
5538
  keyToIndexMap.set(key, i);
@@ -5302,7 +5548,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5302
5548
  while (endOffset < commonLength) {
5303
5549
  const index = newLength - endOffset - 1;
5304
5550
  const item = getItem(source, index);
5305
- const key = getKey(...item);
5551
+ const key = newKeys[index];
5306
5552
  const existingBlock = oldBlocks[oldLength - endOffset - 1];
5307
5553
  if (existingBlock.key !== key) break;
5308
5554
  update(existingBlock, ...item);
@@ -5314,7 +5560,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5314
5560
  const e3 = newLength - endOffset;
5315
5561
  for (let i = 0; i < e1; i++) {
5316
5562
  const currentItem = getItem(source, i);
5317
- const currentKey = getKey(...currentItem);
5563
+ const currentKey = newKeys[i];
5318
5564
  const oldBlock = oldBlocks[i];
5319
5565
  const oldKey = oldBlock.key;
5320
5566
  if (oldKey === currentKey) update(newBlocks[i] = oldBlock, currentItem[0]);
@@ -5330,7 +5576,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5330
5576
  for (let i = e1; i < e2; i++) oldKeyIndexPairs[oldKeyIndexPairsLength++] = [oldBlocks[i].key, i];
5331
5577
  for (let i = e1; i < e3; i++) {
5332
5578
  const blockItem = getItem(source, i);
5333
- const blockKey = getKey(...blockItem);
5579
+ const blockKey = newKeys[i];
5334
5580
  queuedBlocks[queuedBlocksLength++] = [
5335
5581
  i,
5336
5582
  blockItem,
@@ -5396,7 +5642,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5396
5642
  const { item, key } = action;
5397
5643
  moveLink(mount(source, index, anchorNode, item, key), nextBlock.prev, nextBlock);
5398
5644
  } else if (action.block.next !== nextBlock) {
5399
- insert(action.block, parent, anchorNode);
5645
+ insertForBlock(action.block, anchorNode);
5400
5646
  moveLink(action.block, nextBlock.prev, nextBlock);
5401
5647
  }
5402
5648
  } else if ("source" in action) {
@@ -5407,7 +5653,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5407
5653
  } else if (action.block.next !== void 0) {
5408
5654
  let anchorNode = anchor ? normalizeAnchor(anchor.nodes) : parentAnchor;
5409
5655
  if (!anchorNode.parentNode) anchorNode = parentAnchor;
5410
- insert(action.block, parent, anchorNode);
5656
+ insertForBlock(action.block, anchorNode);
5411
5657
  moveLink(action.block, blocksTail);
5412
5658
  blocksTail = action.block;
5413
5659
  }
@@ -5423,7 +5669,9 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5423
5669
  };
5424
5670
  const needKey = renderItem.length > 1;
5425
5671
  const needIndex = renderItem.length > 2;
5426
- const mount = (source, idx, anchor = parentAnchor, [item, key, index] = getItem(source, idx), key2 = getKey && getKey(item, key, index)) => {
5672
+ const insertForBlock = isSingleNode ? (block, anchor) => insertNode(block.nodes, parent, anchor) : isFragment ? (block, anchor) => insertFragment(block.nodes, parent, anchor) : (block, anchor) => insert(block.nodes, parent, anchor);
5673
+ const removeForBlock = isSingleNode ? (block) => removeNode(block.nodes, parent) : isFragment ? (block) => removeFragment(block.nodes, parent) : (block) => remove(block.nodes, parent);
5674
+ const mount = (source, idx, anchor = parentAnchor, [item, key, index] = getItem(source, idx), key2 = newKeys ? newKeys[idx] : getKey && getKey(item, key, index)) => {
5427
5675
  const itemRef = shallowRef$1(item);
5428
5676
  const keyRef = needKey ? shallowRef$1(key) : void 0;
5429
5677
  const indexRef = needIndex ? shallowRef$1(index) : void 0;
@@ -5440,8 +5688,11 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5440
5688
  }
5441
5689
  }
5442
5690
  const block = newBlocks[idx] = new ForBlock(nodes, scope, itemRef, keyRef, indexRef, key2);
5443
- if (isTransitionEnabled && frag.$transition) applyTransitionHooks(block.nodes, frag.$transition);
5444
- if (parent) insert(block.nodes, parent, anchor);
5691
+ if (isTransitionEnabled && frag.$transition) {
5692
+ if (frag.$transition.applyGroup) setBlockKey(block.nodes, block.key);
5693
+ applyTransitionHooks(block.nodes, frag.$transition);
5694
+ }
5695
+ if (parent) insertForBlock(block, anchor);
5445
5696
  return block;
5446
5697
  };
5447
5698
  function hydrateList(source, newLength) {
@@ -5465,7 +5716,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5465
5716
  if (isComment(currentHydrationNode, "]")) {
5466
5717
  nextNode = markHydrationAnchor(currentHydrationNode);
5467
5718
  setCurrentHydrationNode(nextNode);
5468
- } else nextNode = locateNextNode(currentHydrationNode);
5719
+ } else nextNode = nextLogicalSibling(currentHydrationNode);
5469
5720
  mount(source, i);
5470
5721
  if (nextNode) setCurrentHydrationNode(nextNode);
5471
5722
  }
@@ -5502,7 +5753,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
5502
5753
  };
5503
5754
  const unmount = (block, doRemove = true) => {
5504
5755
  if (!isComponent) block.scope.stop();
5505
- if (doRemove) remove(block.nodes, parent);
5756
+ if (doRemove) removeForBlock(block);
5506
5757
  };
5507
5758
  if (flags & 4) renderList();
5508
5759
  else renderEffect(() => {
@@ -5656,9 +5907,18 @@ function getItem({ keys, values, needsWrap, isReadonlySource }, idx) {
5656
5907
  }
5657
5908
  function normalizeAnchor(node) {
5658
5909
  if (node instanceof Node) return node;
5659
- else if (isArray(node)) return normalizeAnchor(node[0]);
5660
- else if (isVaporComponent(node)) return normalizeAnchor(node.block);
5661
- else return normalizeAnchor(node.nodes);
5910
+ else if (isArray(node)) {
5911
+ for (let i = 0; i < node.length; i++) {
5912
+ const anchor = normalizeAnchor(node[i]);
5913
+ if (anchor) return anchor;
5914
+ }
5915
+ return;
5916
+ } else if (isVaporComponent(node)) return normalizeAnchor(node.block);
5917
+ else {
5918
+ const getEffectiveOutput = node.getEffectiveOutput;
5919
+ const nodes = getEffectiveOutput ? getEffectiveOutput.call(node) : node.nodes;
5920
+ return isValidBlock(nodes) ? normalizeAnchor(nodes) : node.anchor || normalizeAnchor(nodes);
5921
+ }
5662
5922
  }
5663
5923
  function getRestElement(val, keys) {
5664
5924
  const res = {};
@@ -5673,6 +5933,10 @@ function isForBlock(block) {
5673
5933
  }
5674
5934
  //#endregion
5675
5935
  //#region packages/runtime-vapor/src/apiTemplateRef.ts
5936
+ function getTemplateRefUpdateFragment(el) {
5937
+ if (isDynamicFragment(el)) return el;
5938
+ if (isVaporComponent(el) && isAsyncWrapper(el)) return el.block;
5939
+ }
5676
5940
  function ensureCleanup(el) {
5677
5941
  let cleanupRef = refCleanups.get(el);
5678
5942
  if (!cleanupRef) {
@@ -5690,8 +5954,8 @@ function createTemplateRefSetter() {
5690
5954
  const oldRefMap = /* @__PURE__ */ new WeakMap();
5691
5955
  const setRefMap = /* @__PURE__ */ new WeakMap();
5692
5956
  return (el, ref, refFor, refKey) => {
5693
- if (isDynamicFragment(el) || isVaporComponent(el) && isAsyncWrapper(el)) {
5694
- const frag = isDynamicFragment(el) ? el : el.block;
5957
+ const frag = getTemplateRefUpdateFragment(el);
5958
+ if (frag) {
5695
5959
  const doSet = () => {
5696
5960
  if (isVaporComponent(el) && el.isDeactivated) return;
5697
5961
  oldRefMap.set(el, setRef$1(instance, el, ref, oldRefMap.get(el), refFor, refKey));
@@ -5706,6 +5970,19 @@ function createTemplateRefSetter() {
5706
5970
  return oldRef;
5707
5971
  };
5708
5972
  }
5973
+ function setStaticTemplateRef(el, ref, refFor, refKey) {
5974
+ const instance = currentInstance$1;
5975
+ const oldRef = setRef$1(instance, el, ref, void 0, refFor, refKey);
5976
+ const frag = getTemplateRefUpdateFragment(el);
5977
+ if (frag) (frag.onUpdated || (frag.onUpdated = [])).push(() => {
5978
+ if (isVaporComponent(el) && el.isDeactivated) return;
5979
+ setRef$1(instance, el, ref, oldRef, refFor, refKey);
5980
+ });
5981
+ return oldRef;
5982
+ }
5983
+ function setTemplateRefBinding(el, getter, setter = createTemplateRefSetter(), refFor, refKey) {
5984
+ renderEffect(() => setter(el, getter(), refFor, refKey));
5985
+ }
5709
5986
  /**
5710
5987
  * Function for handling a template ref
5711
5988
  */
@@ -5846,6 +6123,7 @@ function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once)
5846
6123
  if (!isHydrating$1) resetInsertionState();
5847
6124
  const hydrationCursor = isHydrating$1 ? captureHydrationCursor() : null;
5848
6125
  const frag = isHydrating$1 || !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("dynamic-component") : new DynamicFragment();
6126
+ const normalizedRawSlots = normalizeRawSlots(rawSlots);
5849
6127
  const scopeOwner = getScopeOwner();
5850
6128
  const renderFn = () => {
5851
6129
  const value = getter();
@@ -5865,7 +6143,7 @@ function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once)
5865
6143
  }
5866
6144
  return frag;
5867
6145
  }
5868
- return createComponentWithFallback(withScopeOwner(scopeOwner, () => resolveDynamicComponent(value)), rawProps, rawSlots, isSingleRoot, once, appContext);
6146
+ return createComponentWithFallback(withScopeOwner(scopeOwner, () => resolveDynamicComponent(value)), rawProps, normalizedRawSlots, isSingleRoot, once, appContext);
5869
6147
  }, value);
5870
6148
  };
5871
6149
  if (once) renderFn();
@@ -5965,6 +6243,7 @@ function withVaporDirectives(node, dirs) {
5965
6243
  //#region packages/runtime-vapor/src/components/TransitionGroup.ts
5966
6244
  const positionMap = /* @__PURE__ */ new WeakMap();
5967
6245
  const newPositionMap = /* @__PURE__ */ new WeakMap();
6246
+ const transitionGroupUpdateOwnerMap = /* @__PURE__ */ new WeakMap();
5968
6247
  let isForHydrationAnchorResolverRegistered = false;
5969
6248
  let currentForHydrationContainer;
5970
6249
  function ensureForHydrationAnchorResolver() {
@@ -5995,16 +6274,18 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
5995
6274
  ensureTransitionHooksRegistered();
5996
6275
  const instance = currentInstance;
5997
6276
  const state = useTransitionState();
5998
- let cssTransitionProps = resolveTransitionProps(props);
6277
+ let cssTransitionProps;
5999
6278
  const propsProxy = new Proxy({}, { get(_, key) {
6000
6279
  return cssTransitionProps[key];
6001
6280
  } });
6002
- renderEffect(() => {
6003
- cssTransitionProps = resolveTransitionProps(props);
6004
- });
6005
- let prevChildren;
6281
+ renderEffect(() => cssTransitionProps = resolveTransitionProps(props), true);
6282
+ let prevChildren = [];
6283
+ let isUpdatePending = false;
6284
+ let isUpdatedPending = false;
6006
6285
  let slottedBlock = [];
6007
- onBeforeUpdate(() => {
6286
+ const beforeUpdate = () => {
6287
+ if (isUpdatePending) return;
6288
+ isUpdatePending = true;
6008
6289
  prevChildren = [];
6009
6290
  const children = getTransitionBlocks(slottedBlock);
6010
6291
  for (let i = 0; i < children.length; i++) {
@@ -6016,8 +6297,11 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
6016
6297
  positionMap.set(child, el.getBoundingClientRect());
6017
6298
  }
6018
6299
  }
6019
- });
6020
- onUpdated(() => {
6300
+ };
6301
+ const flushUpdated = () => {
6302
+ isUpdatedPending = false;
6303
+ if (!isUpdatePending) return;
6304
+ isUpdatePending = false;
6021
6305
  if (!prevChildren.length) return;
6022
6306
  const moveClass = props.moveClass || `${props.name || "v"}-move`;
6023
6307
  const firstChild = getFirstConnectedChild(prevChildren);
@@ -6034,7 +6318,14 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
6034
6318
  forceReflow();
6035
6319
  movedChildren.forEach((c) => handleMovedChildren(getTransitionElement(c), moveClass));
6036
6320
  prevChildren = [];
6037
- });
6321
+ };
6322
+ const updated = () => {
6323
+ if (!isUpdatePending || isUpdatedPending) return;
6324
+ isUpdatedPending = true;
6325
+ queuePostFlushCb(flushUpdated);
6326
+ };
6327
+ onBeforeUpdate(beforeUpdate);
6328
+ onUpdated(updated);
6038
6329
  const frag = new DynamicFragment("transition-group");
6039
6330
  let currentTag;
6040
6331
  let currentSlot;
@@ -6050,7 +6341,7 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
6050
6341
  ensureForHydrationAnchorResolver();
6051
6342
  prevForHydrationContainer = currentForHydrationContainer;
6052
6343
  currentForHydrationContainer = container;
6053
- nextNode = locateNextNode(container);
6344
+ nextNode = nextLogicalSibling(container);
6054
6345
  setCurrentHydrationNode(container.firstChild || container);
6055
6346
  }
6056
6347
  let block = slottedBlock;
@@ -6058,7 +6349,10 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
6058
6349
  try {
6059
6350
  frag.update(() => {
6060
6351
  block = slot && slot() || [];
6061
- transitionBlocks = applyGroupTransitionHooks(block, propsProxy, state, instance);
6352
+ transitionBlocks = applyGroupTransitionHooks(block, propsProxy, state, instance, {
6353
+ beforeUpdate,
6354
+ updated
6355
+ });
6062
6356
  if (container) {
6063
6357
  if (!isHydrating$1) insert(block, container);
6064
6358
  return container;
@@ -6080,9 +6374,9 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
6080
6374
  return frag;
6081
6375
  }
6082
6376
  }));
6083
- function applyGroupTransitionHooks(block, props, state, instance) {
6377
+ function applyGroupTransitionHooks(block, props, state, instance, updateHooks) {
6084
6378
  const fragments = [];
6085
- const children = getTransitionBlocks(block, (frag) => fragments.push(frag));
6379
+ const children = getTransitionBlocks(block, (frag) => fragments.push(frag), (owner) => trackTransitionGroupUpdate(owner, updateHooks));
6086
6380
  for (let i = 0; i < children.length; i++) {
6087
6381
  const child = children[i];
6088
6382
  if (isValidTransitionBlock(child)) {
@@ -6092,11 +6386,45 @@ function applyGroupTransitionHooks(block, props, state, instance) {
6092
6386
  }
6093
6387
  fragments.forEach((frag) => {
6094
6388
  const hooks = resolveTransitionHooks(frag, props, state, instance);
6095
- hooks.applyGroup = applyGroupTransitionHooks;
6389
+ hooks.applyGroup = (block, props, state, instance) => applyGroupTransitionHooks(block, props, state, instance, updateHooks);
6096
6390
  frag.$transition = hooks;
6097
6391
  });
6098
6392
  return children;
6099
6393
  }
6394
+ function trackTransitionGroupUpdate(owner, updateHooks) {
6395
+ const registeredHooks = transitionGroupUpdateOwnerMap.get(owner);
6396
+ if (registeredHooks) {
6397
+ registeredHooks.beforeUpdate = updateHooks.beforeUpdate;
6398
+ registeredHooks.updated = updateHooks.updated;
6399
+ return;
6400
+ }
6401
+ transitionGroupUpdateOwnerMap.set(owner, updateHooks);
6402
+ if (isFragment(owner)) {
6403
+ (owner.onBeforeUpdate || (owner.onBeforeUpdate = [])).push(() => updateHooks.beforeUpdate());
6404
+ (owner.onUpdated || (owner.onUpdated = [])).push(() => updateHooks.updated());
6405
+ } else {
6406
+ let isPending = false;
6407
+ const flushUpdated = () => {
6408
+ isPending = false;
6409
+ updateHooks.updated();
6410
+ };
6411
+ owner.scope.run(() => {
6412
+ watch$1(() => {
6413
+ const prev = setCurrentInstance(owner, owner.scope);
6414
+ try {
6415
+ return resolveDynamicProps(owner.rawProps);
6416
+ } finally {
6417
+ setCurrentInstance(...prev);
6418
+ }
6419
+ }, () => {
6420
+ if (isPending) return;
6421
+ isPending = true;
6422
+ updateHooks.beforeUpdate();
6423
+ queuePostFlushCb(flushUpdated);
6424
+ });
6425
+ });
6426
+ }
6427
+ }
6100
6428
  function inheritKey(children, key) {
6101
6429
  if (key === void 0 || children.length === 0) return;
6102
6430
  for (let i = 0; i < children.length; i++) {
@@ -6104,25 +6432,30 @@ function inheritKey(children, key) {
6104
6432
  child.$key = String(key) + String(child.$key != null ? child.$key : i);
6105
6433
  }
6106
6434
  }
6107
- function getTransitionBlocks(block, onFragment) {
6435
+ function getTransitionBlocks(block, onFragment, onUpdateOwner) {
6108
6436
  let children = [];
6109
6437
  if (block instanceof Element) children.push(block);
6110
6438
  else if (isVaporComponent(block)) {
6111
- const blocks = getTransitionBlocks(block.block, onFragment);
6439
+ const isRootSlot = block.block instanceof SlotFragment;
6440
+ if (onUpdateOwner && !isRootSlot) onUpdateOwner(block);
6441
+ const blocks = getTransitionBlocks(block.block, onFragment, isRootSlot ? onUpdateOwner : void 0);
6112
6442
  inheritKey(blocks, block.$key);
6113
6443
  children.push(...blocks);
6114
6444
  } else if (isArray(block)) for (let i = 0; i < block.length; i++) {
6115
6445
  const b = block[i];
6116
- const blocks = getTransitionBlocks(b, onFragment);
6446
+ const blocks = getTransitionBlocks(b, onFragment, onUpdateOwner);
6117
6447
  if (isForBlock(b)) blocks.forEach((block) => block.$key = b.key);
6118
6448
  children.push(...blocks);
6119
6449
  }
6120
- else if (isFragment(block)) if (isInteropEnabled && block.vnode) children.push(block);
6121
- else {
6450
+ else if (isFragment(block)) {
6122
6451
  if (onFragment) onFragment(block);
6123
- const blocks = getTransitionBlocks(block.nodes, onFragment);
6124
- inheritKey(blocks, block.$key);
6125
- children.push(...blocks);
6452
+ if (onUpdateOwner) onUpdateOwner(block);
6453
+ if (isInteropEnabled && block.vnode) children.push(block);
6454
+ else {
6455
+ const blocks = getTransitionBlocks(block.nodes, onFragment, onUpdateOwner);
6456
+ inheritKey(blocks, block.$key);
6457
+ children.push(...blocks);
6458
+ }
6126
6459
  }
6127
6460
  return children;
6128
6461
  }
@@ -6149,4 +6482,4 @@ function getFirstConnectedChild(children) {
6149
6482
  }
6150
6483
  }
6151
6484
  //#endregion
6152
- export { DynamicFragment, VaporElement, VaporFragment, VaporKeepAlive, VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createInvoker, createKeyedFragment, createPlainElement, createSelector, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockKey, setBlockText, setClass, setClassName, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStyle, setText, setValue, template, txt, useVaporCssVars, vaporInteropPlugin, withAsyncContext, withVaporCtx, withVaporDirectives };
6485
+ export { DynamicFragment, VaporElement, VaporFragment, VaporKeepAlive, VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createAssetComponent, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createInvoker, createKeyedFragment, createPlainElement, createSelector, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, onBinding, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockKey, setBlockText, setClass, setClassName, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setValue, template, txt, useVaporCssVars, vaporInteropPlugin, withAsyncContext, withVaporCtx, withVaporDirectives, withVaporKeys, withVaporModifiers };