@vue/compat 3.6.0-alpha.2 → 3.6.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-alpha.2
2
+ * @vue/compat v3.6.0-alpha.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -10,7 +10,6 @@ var estreeWalker = require('estree-walker');
10
10
  var decode_js = require('entities/lib/decode.js');
11
11
  var sourceMapJs = require('source-map-js');
12
12
 
13
- /*! #__NO_SIDE_EFFECTS__ */
14
13
  // @__NO_SIDE_EFFECTS__
15
14
  function makeMap(str) {
16
15
  const map = /* @__PURE__ */ Object.create(null);
@@ -65,10 +64,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
65
64
  );
66
65
  const cacheStringFunction = (fn) => {
67
66
  const cache = /* @__PURE__ */ Object.create(null);
68
- return (str) => {
67
+ return ((str) => {
69
68
  const hit = cache[str];
70
69
  return hit || (cache[str] = fn(str));
71
- };
70
+ });
72
71
  };
73
72
  const camelizeRE = /-(\w)/g;
74
73
  const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
@@ -249,6 +248,9 @@ function shouldSetAsAttr(tagName, key) {
249
248
  if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
250
249
  return true;
251
250
  }
251
+ if (key === "sandbox" && tagName === "IFRAME") {
252
+ return true;
253
+ }
252
254
  return false;
253
255
  }
254
256
 
@@ -448,6 +450,7 @@ var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
448
450
  const notifyBuffer = [];
449
451
  let batchDepth = 0;
450
452
  let activeSub = void 0;
453
+ let globalVersion = 0;
451
454
  let notifyIndex = 0;
452
455
  let notifyBufferLength = 0;
453
456
  function setActiveSub(sub) {
@@ -470,17 +473,18 @@ function link(dep, sub) {
470
473
  if (prevDep !== void 0 && prevDep.dep === dep) {
471
474
  return;
472
475
  }
473
- let nextDep = void 0;
474
- const recursedCheck = sub.flags & 4 /* RecursedCheck */;
475
- if (recursedCheck) {
476
- nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
477
- if (nextDep !== void 0 && nextDep.dep === dep) {
478
- sub.depsTail = nextDep;
479
- return;
480
- }
476
+ const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
477
+ if (nextDep !== void 0 && nextDep.dep === dep) {
478
+ nextDep.version = globalVersion;
479
+ sub.depsTail = nextDep;
480
+ return;
481
481
  }
482
482
  const prevSub = dep.subsTail;
483
+ if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
484
+ return;
485
+ }
483
486
  const newLink = sub.depsTail = dep.subsTail = {
487
+ version: globalVersion,
484
488
  dep,
485
489
  sub,
486
490
  prevDep,
@@ -586,6 +590,7 @@ function propagate(link2) {
586
590
  } while (true);
587
591
  }
588
592
  function startTracking(sub) {
593
+ ++globalVersion;
589
594
  sub.depsTail = void 0;
590
595
  sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
591
596
  return setActiveSub(sub);
@@ -681,18 +686,12 @@ function shallowPropagate(link2) {
681
686
  } while (link2 !== void 0);
682
687
  }
683
688
  function isValidLink(checkLink, sub) {
684
- const depsTail = sub.depsTail;
685
- if (depsTail !== void 0) {
686
- let link2 = sub.deps;
687
- do {
688
- if (link2 === checkLink) {
689
- return true;
690
- }
691
- if (link2 === depsTail) {
692
- break;
693
- }
694
- link2 = link2.nextDep;
695
- } while (link2 !== void 0);
689
+ let link2 = sub.depsTail;
690
+ while (link2 !== void 0) {
691
+ if (link2 === checkLink) {
692
+ return true;
693
+ }
694
+ link2 = link2.prevDep;
696
695
  }
697
696
  return false;
698
697
  }
@@ -860,7 +859,7 @@ const arrayInstrumentations = {
860
859
  join(separator) {
861
860
  return reactiveReadArray(this).join(separator);
862
861
  },
863
- // keys() iterator only reads `length`, no optimisation required
862
+ // keys() iterator only reads `length`, no optimization required
864
863
  lastIndexOf(...args) {
865
864
  return searchProxy(this, "lastIndexOf", args);
866
865
  },
@@ -912,7 +911,7 @@ function iterator(self, method, wrapValue) {
912
911
  iter._next = iter.next;
913
912
  iter.next = () => {
914
913
  const result = iter._next();
915
- if (result.value) {
914
+ if (!result.done) {
916
915
  result.value = wrapValue(result.value);
917
916
  }
918
917
  return result;
@@ -1043,7 +1042,8 @@ class BaseReactiveHandler {
1043
1042
  return res;
1044
1043
  }
1045
1044
  if (isRef(res)) {
1046
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1045
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1046
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1047
1047
  }
1048
1048
  if (isObject(res)) {
1049
1049
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1065,7 +1065,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1065
1065
  }
1066
1066
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1067
1067
  if (isOldValueReadonly) {
1068
- return false;
1068
+ return true;
1069
1069
  } else {
1070
1070
  oldValue.value = value;
1071
1071
  return true;
@@ -1191,7 +1191,7 @@ function createInstrumentations(readonly, shallow) {
1191
1191
  get size() {
1192
1192
  const target = this["__v_raw"];
1193
1193
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1194
- return Reflect.get(target, "size", target);
1194
+ return target.size;
1195
1195
  },
1196
1196
  has(key) {
1197
1197
  const target = this["__v_raw"];
@@ -2111,11 +2111,11 @@ function traverse(value, depth = Infinity, seen) {
2111
2111
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2112
2112
  return value;
2113
2113
  }
2114
- seen = seen || /* @__PURE__ */ new Set();
2115
- if (seen.has(value)) {
2114
+ seen = seen || /* @__PURE__ */ new Map();
2115
+ if ((seen.get(value) || 0) >= depth) {
2116
2116
  return value;
2117
2117
  }
2118
- seen.add(value);
2118
+ seen.set(value, depth);
2119
2119
  depth--;
2120
2120
  if (isRef(value)) {
2121
2121
  traverse(value.value, depth, seen);
@@ -2837,9 +2837,6 @@ const TeleportImpl = {
2837
2837
  insert(mainAnchor, container, anchor);
2838
2838
  const mount = (container2, anchor2) => {
2839
2839
  if (shapeFlag & 16) {
2840
- if (parentComponent && parentComponent.isCE) {
2841
- parentComponent.ce._teleportTarget = container2;
2842
- }
2843
2840
  mountChildren(
2844
2841
  children,
2845
2842
  container2,
@@ -2861,6 +2858,9 @@ const TeleportImpl = {
2861
2858
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
2862
2859
  namespace = "mathml";
2863
2860
  }
2861
+ if (parentComponent && parentComponent.isCE) {
2862
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
2863
+ }
2864
2864
  if (!disabled) {
2865
2865
  mount(target, targetAnchor);
2866
2866
  updateCssVars(n2, false);
@@ -3049,26 +3049,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3049
3049
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3050
3050
  o: { nextSibling, parentNode, querySelector, insert, createText }
3051
3051
  }, hydrateChildren) {
3052
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3053
+ vnode2.anchor = hydrateChildren(
3054
+ nextSibling(node2),
3055
+ vnode2,
3056
+ parentNode(node2),
3057
+ parentComponent,
3058
+ parentSuspense,
3059
+ slotScopeIds,
3060
+ optimized
3061
+ );
3062
+ vnode2.targetStart = targetStart;
3063
+ vnode2.targetAnchor = targetAnchor;
3064
+ }
3052
3065
  const target = vnode.target = resolveTarget(
3053
3066
  vnode.props,
3054
3067
  querySelector
3055
3068
  );
3069
+ const disabled = isTeleportDisabled(vnode.props);
3056
3070
  if (target) {
3057
- const disabled = isTeleportDisabled(vnode.props);
3058
3071
  const targetNode = target._lpa || target.firstChild;
3059
3072
  if (vnode.shapeFlag & 16) {
3060
3073
  if (disabled) {
3061
- vnode.anchor = hydrateChildren(
3062
- nextSibling(node),
3074
+ hydrateDisabledTeleport(
3075
+ node,
3063
3076
  vnode,
3064
- parentNode(node),
3065
- parentComponent,
3066
- parentSuspense,
3067
- slotScopeIds,
3068
- optimized
3077
+ targetNode,
3078
+ targetNode && nextSibling(targetNode)
3069
3079
  );
3070
- vnode.targetStart = targetNode;
3071
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3072
3080
  } else {
3073
3081
  vnode.anchor = nextSibling(node);
3074
3082
  let targetAnchor = targetNode;
@@ -3099,6 +3107,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3099
3107
  }
3100
3108
  }
3101
3109
  updateCssVars(vnode, disabled);
3110
+ } else if (disabled) {
3111
+ if (vnode.shapeFlag & 16) {
3112
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3113
+ }
3102
3114
  }
3103
3115
  return vnode.anchor && nextSibling(vnode.anchor);
3104
3116
  }
@@ -3139,7 +3151,7 @@ function useTransitionState() {
3139
3151
  isMounted: false,
3140
3152
  isLeaving: false,
3141
3153
  isUnmounting: false,
3142
- leavingVNodes: /* @__PURE__ */ new Map()
3154
+ leavingNodes: /* @__PURE__ */ new Map()
3143
3155
  };
3144
3156
  onMounted(() => {
3145
3157
  state.isMounted = true;
@@ -3171,7 +3183,7 @@ const BaseTransitionPropsValidators = {
3171
3183
  onAppearCancelled: TransitionHookValidator
3172
3184
  };
3173
3185
  const recursiveGetSubtree = (instance) => {
3174
- const subTree = instance.subTree;
3186
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3175
3187
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3176
3188
  };
3177
3189
  const BaseTransitionImpl = {
@@ -3207,7 +3219,7 @@ const BaseTransitionImpl = {
3207
3219
  setTransitionHooks(innerChild, enterHooks);
3208
3220
  }
3209
3221
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3210
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3222
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3211
3223
  let leavingHooks = resolveTransitionHooks(
3212
3224
  oldInnerChild,
3213
3225
  rawProps,
@@ -3272,15 +3284,53 @@ function findNonCommentChild(children) {
3272
3284
  }
3273
3285
  const BaseTransition = BaseTransitionImpl;
3274
3286
  function getLeavingNodesForType(state, vnode) {
3275
- const { leavingVNodes } = state;
3276
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
3287
+ const { leavingNodes } = state;
3288
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
3277
3289
  if (!leavingVNodesCache) {
3278
3290
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3279
- leavingVNodes.set(vnode.type, leavingVNodesCache);
3291
+ leavingNodes.set(vnode.type, leavingVNodesCache);
3280
3292
  }
3281
3293
  return leavingVNodesCache;
3282
3294
  }
3283
3295
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3296
+ const key = String(vnode.key);
3297
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3298
+ const context = {
3299
+ setLeavingNodeCache: () => {
3300
+ leavingVNodesCache[key] = vnode;
3301
+ },
3302
+ unsetLeavingNodeCache: () => {
3303
+ if (leavingVNodesCache[key] === vnode) {
3304
+ delete leavingVNodesCache[key];
3305
+ }
3306
+ },
3307
+ earlyRemove: () => {
3308
+ const leavingVNode = leavingVNodesCache[key];
3309
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3310
+ leavingVNode.el[leaveCbKey]();
3311
+ }
3312
+ },
3313
+ cloneHooks: (vnode2) => {
3314
+ const hooks = resolveTransitionHooks(
3315
+ vnode2,
3316
+ props,
3317
+ state,
3318
+ instance,
3319
+ postClone
3320
+ );
3321
+ if (postClone) postClone(hooks);
3322
+ return hooks;
3323
+ }
3324
+ };
3325
+ return baseResolveTransitionHooks(context, props, state, instance);
3326
+ }
3327
+ function baseResolveTransitionHooks(context, props, state, instance) {
3328
+ const {
3329
+ setLeavingNodeCache,
3330
+ unsetLeavingNodeCache,
3331
+ earlyRemove,
3332
+ cloneHooks
3333
+ } = context;
3284
3334
  const {
3285
3335
  appear,
3286
3336
  mode,
@@ -3298,8 +3348,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3298
3348
  onAfterAppear,
3299
3349
  onAppearCancelled
3300
3350
  } = props;
3301
- const key = String(vnode.key);
3302
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3303
3351
  const callHook = (hook, args) => {
3304
3352
  hook && callWithAsyncErrorHandling(
3305
3353
  hook,
@@ -3335,10 +3383,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3335
3383
  /* cancelled */
3336
3384
  );
3337
3385
  }
3338
- const leavingVNode = leavingVNodesCache[key];
3339
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3340
- leavingVNode.el[leaveCbKey]();
3341
- }
3386
+ earlyRemove();
3342
3387
  callHook(hook, [el]);
3343
3388
  },
3344
3389
  enter(el) {
@@ -3375,7 +3420,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3375
3420
  }
3376
3421
  },
3377
3422
  leave(el, remove) {
3378
- const key2 = String(vnode.key);
3379
3423
  if (el[enterCbKey$1]) {
3380
3424
  el[enterCbKey$1](
3381
3425
  true
@@ -3397,27 +3441,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3397
3441
  callHook(onAfterLeave, [el]);
3398
3442
  }
3399
3443
  el[leaveCbKey] = void 0;
3400
- if (leavingVNodesCache[key2] === vnode) {
3401
- delete leavingVNodesCache[key2];
3402
- }
3444
+ unsetLeavingNodeCache(el);
3403
3445
  };
3404
- leavingVNodesCache[key2] = vnode;
3446
+ setLeavingNodeCache(el);
3405
3447
  if (onLeave) {
3406
3448
  callAsyncHook(onLeave, [el, done]);
3407
3449
  } else {
3408
3450
  done();
3409
3451
  }
3410
3452
  },
3411
- clone(vnode2) {
3412
- const hooks2 = resolveTransitionHooks(
3413
- vnode2,
3414
- props,
3415
- state,
3416
- instance,
3417
- postClone
3418
- );
3419
- if (postClone) postClone(hooks2);
3420
- return hooks2;
3453
+ clone(node) {
3454
+ return cloneHooks(node);
3421
3455
  }
3422
3456
  };
3423
3457
  return hooks;
@@ -3451,8 +3485,15 @@ function getInnerChild$1(vnode) {
3451
3485
  }
3452
3486
  function setTransitionHooks(vnode, hooks) {
3453
3487
  if (vnode.shapeFlag & 6 && vnode.component) {
3454
- vnode.transition = hooks;
3455
- setTransitionHooks(vnode.component.subTree, hooks);
3488
+ if (vnode.type.__vapor) {
3489
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
3490
+ vnode.component,
3491
+ hooks
3492
+ );
3493
+ } else {
3494
+ vnode.transition = hooks;
3495
+ setTransitionHooks(vnode.component.subTree, hooks);
3496
+ }
3456
3497
  } else if (vnode.shapeFlag & 128) {
3457
3498
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3458
3499
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3483,7 +3524,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3483
3524
  return ret;
3484
3525
  }
3485
3526
 
3486
- /*! #__NO_SIDE_EFFECTS__ */
3487
3527
  // @__NO_SIDE_EFFECTS__
3488
3528
  function defineComponent(options, extraOptions) {
3489
3529
  return isFunction(options) ? (
@@ -3521,6 +3561,7 @@ function useTemplateRef(key) {
3521
3561
  return ret;
3522
3562
  }
3523
3563
 
3564
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3524
3565
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3525
3566
  if (isArray(rawRef)) {
3526
3567
  rawRef.forEach(
@@ -3546,18 +3587,20 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3546
3587
  const oldRef = oldRawRef && oldRawRef.r;
3547
3588
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3548
3589
  const setupState = owner.setupState;
3549
- const rawSetupState = toRaw(setupState);
3550
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3551
- return hasOwn(rawSetupState, key);
3552
- };
3590
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3553
3591
  if (oldRef != null && oldRef !== ref) {
3592
+ invalidatePendingSetRef(oldRawRef);
3554
3593
  if (isString(oldRef)) {
3555
3594
  refs[oldRef] = null;
3556
3595
  if (canSetSetupRef(oldRef)) {
3557
3596
  setupState[oldRef] = null;
3558
3597
  }
3559
3598
  } else if (isRef(oldRef)) {
3560
- oldRef.value = null;
3599
+ {
3600
+ oldRef.value = null;
3601
+ }
3602
+ const oldRawRefAtom = oldRawRef;
3603
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3561
3604
  }
3562
3605
  }
3563
3606
  if (isFunction(ref)) {
@@ -3568,7 +3611,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3568
3611
  if (_isString || _isRef) {
3569
3612
  const doSet = () => {
3570
3613
  if (rawRef.f) {
3571
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3614
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value ;
3572
3615
  if (isUnmount) {
3573
3616
  isArray(existing) && remove(existing, refValue);
3574
3617
  } else {
@@ -3579,8 +3622,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3579
3622
  setupState[ref] = refs[ref];
3580
3623
  }
3581
3624
  } else {
3582
- ref.value = [refValue];
3583
- if (rawRef.k) refs[rawRef.k] = ref.value;
3625
+ const newVal = [refValue];
3626
+ {
3627
+ ref.value = newVal;
3628
+ }
3629
+ if (rawRef.k) refs[rawRef.k] = newVal;
3584
3630
  }
3585
3631
  } else if (!existing.includes(refValue)) {
3586
3632
  existing.push(refValue);
@@ -3592,18 +3638,39 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3592
3638
  setupState[ref] = value;
3593
3639
  }
3594
3640
  } else if (_isRef) {
3595
- ref.value = value;
3641
+ {
3642
+ ref.value = value;
3643
+ }
3596
3644
  if (rawRef.k) refs[rawRef.k] = value;
3597
3645
  } else ;
3598
3646
  };
3599
3647
  if (value) {
3600
- queuePostRenderEffect(doSet, -1, parentSuspense);
3648
+ const job = () => {
3649
+ doSet();
3650
+ pendingSetRefMap.delete(rawRef);
3651
+ };
3652
+ pendingSetRefMap.set(rawRef, job);
3653
+ queuePostRenderEffect(job, -1, parentSuspense);
3601
3654
  } else {
3655
+ invalidatePendingSetRef(rawRef);
3602
3656
  doSet();
3603
3657
  }
3604
3658
  }
3605
3659
  }
3606
3660
  }
3661
+ function createCanSetSetupRefChecker(setupState) {
3662
+ const rawSetupState = toRaw(setupState);
3663
+ return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
3664
+ return hasOwn(rawSetupState, key);
3665
+ };
3666
+ }
3667
+ function invalidatePendingSetRef(rawRef) {
3668
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
3669
+ if (pendingSetRef) {
3670
+ pendingSetRef.flags |= 4;
3671
+ pendingSetRefMap.delete(rawRef);
3672
+ }
3673
+ }
3607
3674
 
3608
3675
  let hasLoggedMismatchError = false;
3609
3676
  const logMismatchError = () => {
@@ -3684,7 +3751,7 @@ function createHydrationFunctions(rendererInternals) {
3684
3751
  }
3685
3752
  break;
3686
3753
  case Comment:
3687
- if (isTemplateNode(node)) {
3754
+ if (isTemplateNode$1(node)) {
3688
3755
  nextNode = nextSibling(node);
3689
3756
  replaceNode(
3690
3757
  vnode.el = node.content.firstChild,
@@ -3732,9 +3799,15 @@ function createHydrationFunctions(rendererInternals) {
3732
3799
  );
3733
3800
  }
3734
3801
  break;
3802
+ case VaporSlot:
3803
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
3804
+ vnode,
3805
+ node
3806
+ );
3807
+ break;
3735
3808
  default:
3736
3809
  if (shapeFlag & 1) {
3737
- if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
3810
+ if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) {
3738
3811
  nextNode = onMismatch();
3739
3812
  } else {
3740
3813
  nextNode = hydrateElement(
@@ -3747,9 +3820,6 @@ function createHydrationFunctions(rendererInternals) {
3747
3820
  );
3748
3821
  }
3749
3822
  } else if (shapeFlag & 6) {
3750
- if (vnode.type.__vapor) {
3751
- throw new Error("Vapor component hydration is not supported yet.");
3752
- }
3753
3823
  vnode.slotScopeIds = slotScopeIds;
3754
3824
  const container = parentNode(node);
3755
3825
  if (isFragmentStart) {
@@ -3759,15 +3829,25 @@ function createHydrationFunctions(rendererInternals) {
3759
3829
  } else {
3760
3830
  nextNode = nextSibling(node);
3761
3831
  }
3762
- mountComponent(
3763
- vnode,
3764
- container,
3765
- null,
3766
- parentComponent,
3767
- parentSuspense,
3768
- getContainerType(container),
3769
- optimized
3770
- );
3832
+ if (vnode.type.__vapor) {
3833
+ getVaporInterface(parentComponent, vnode).hydrate(
3834
+ vnode,
3835
+ node,
3836
+ container,
3837
+ null,
3838
+ parentComponent
3839
+ );
3840
+ } else {
3841
+ mountComponent(
3842
+ vnode,
3843
+ container,
3844
+ null,
3845
+ parentComponent,
3846
+ parentSuspense,
3847
+ getContainerType(container),
3848
+ optimized
3849
+ );
3850
+ }
3771
3851
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3772
3852
  let subTree;
3773
3853
  if (isFragmentStart) {
@@ -3822,7 +3902,7 @@ function createHydrationFunctions(rendererInternals) {
3822
3902
  invokeDirectiveHook(vnode, null, parentComponent, "created");
3823
3903
  }
3824
3904
  let needCallTransitionHooks = false;
3825
- if (isTemplateNode(el)) {
3905
+ if (isTemplateNode$1(el)) {
3826
3906
  needCallTransitionHooks = needTransition(
3827
3907
  null,
3828
3908
  // no need check parentSuspense in hydration
@@ -3849,7 +3929,7 @@ function createHydrationFunctions(rendererInternals) {
3849
3929
  optimized
3850
3930
  );
3851
3931
  while (next) {
3852
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
3932
+ if (!isMismatchAllowed(el, 1)) {
3853
3933
  logMismatchError();
3854
3934
  }
3855
3935
  const cur = next;
@@ -3861,8 +3941,10 @@ function createHydrationFunctions(rendererInternals) {
3861
3941
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
3862
3942
  clientText = clientText.slice(1);
3863
3943
  }
3864
- if (el.textContent !== clientText) {
3865
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
3944
+ const { textContent } = el;
3945
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
3946
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
3947
+ if (!isMismatchAllowed(el, 0)) {
3866
3948
  logMismatchError();
3867
3949
  }
3868
3950
  el.textContent = vnode.children;
@@ -3942,7 +4024,7 @@ function createHydrationFunctions(rendererInternals) {
3942
4024
  } else if (isText && !vnode.children) {
3943
4025
  insert(vnode.el = createText(""), container);
3944
4026
  } else {
3945
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4027
+ if (!isMismatchAllowed(container, 1)) {
3946
4028
  logMismatchError();
3947
4029
  }
3948
4030
  patch(
@@ -3983,7 +4065,7 @@ function createHydrationFunctions(rendererInternals) {
3983
4065
  }
3984
4066
  };
3985
4067
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
3986
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4068
+ if (!isMismatchAllowed(node.parentElement, 1)) {
3987
4069
  logMismatchError();
3988
4070
  }
3989
4071
  vnode.el = null;
@@ -4047,21 +4129,21 @@ function createHydrationFunctions(rendererInternals) {
4047
4129
  parent = parent.parent;
4048
4130
  }
4049
4131
  };
4050
- const isTemplateNode = (node) => {
4051
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
4052
- };
4053
4132
  return [hydrate, hydrateNode];
4054
4133
  }
4134
+ const isTemplateNode$1 = (node) => {
4135
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4136
+ };
4055
4137
  const allowMismatchAttr = "data-allow-mismatch";
4056
4138
  const MismatchTypeString = {
4057
- [0 /* TEXT */]: "text",
4058
- [1 /* CHILDREN */]: "children",
4059
- [2 /* CLASS */]: "class",
4060
- [3 /* STYLE */]: "style",
4061
- [4 /* ATTRIBUTE */]: "attribute"
4139
+ [0]: "text",
4140
+ [1]: "children",
4141
+ [2]: "class",
4142
+ [3]: "style",
4143
+ [4]: "attribute"
4062
4144
  };
4063
4145
  function isMismatchAllowed(el, allowedType) {
4064
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
4146
+ if (allowedType === 0 || allowedType === 1) {
4065
4147
  while (el && !el.hasAttribute(allowMismatchAttr)) {
4066
4148
  el = el.parentElement;
4067
4149
  }
@@ -4073,7 +4155,7 @@ function isMismatchAllowed(el, allowedType) {
4073
4155
  return true;
4074
4156
  } else {
4075
4157
  const list = allowedAttr.split(",");
4076
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
4158
+ if (allowedType === 0 && list.includes("children")) {
4077
4159
  return true;
4078
4160
  }
4079
4161
  return list.includes(MismatchTypeString[allowedType]);
@@ -4130,7 +4212,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4130
4212
  hasHydrated = true;
4131
4213
  teardown();
4132
4214
  hydrate();
4133
- e.target.dispatchEvent(new e.constructor(e.type, e));
4215
+ if (!(`$evt${e.type}` in e.target)) {
4216
+ e.target.dispatchEvent(new e.constructor(e.type, e));
4217
+ }
4134
4218
  }
4135
4219
  };
4136
4220
  const teardown = () => {
@@ -4172,89 +4256,46 @@ function forEachElement(node, cb) {
4172
4256
  }
4173
4257
 
4174
4258
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4175
- /*! #__NO_SIDE_EFFECTS__ */
4176
4259
  // @__NO_SIDE_EFFECTS__
4177
4260
  function defineAsyncComponent(source) {
4178
- if (isFunction(source)) {
4179
- source = { loader: source };
4180
- }
4181
4261
  const {
4182
- loader,
4183
- loadingComponent,
4184
- errorComponent,
4185
- delay = 200,
4186
- hydrate: hydrateStrategy,
4187
- timeout,
4188
- // undefined = never times out
4189
- suspensible = true,
4190
- onError: userOnError
4191
- } = source;
4192
- let pendingRequest = null;
4193
- let resolvedComp;
4194
- let retries = 0;
4195
- const retry = () => {
4196
- retries++;
4197
- pendingRequest = null;
4198
- return load();
4199
- };
4200
- const load = () => {
4201
- let thisRequest;
4202
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4203
- err = err instanceof Error ? err : new Error(String(err));
4204
- if (userOnError) {
4205
- return new Promise((resolve, reject) => {
4206
- const userRetry = () => resolve(retry());
4207
- const userFail = () => reject(err);
4208
- userOnError(err, userRetry, userFail, retries + 1);
4209
- });
4210
- } else {
4211
- throw err;
4212
- }
4213
- }).then((comp) => {
4214
- if (thisRequest !== pendingRequest && pendingRequest) {
4215
- return pendingRequest;
4216
- }
4217
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4218
- comp = comp.default;
4219
- }
4220
- resolvedComp = comp;
4221
- return comp;
4222
- }));
4223
- };
4262
+ load,
4263
+ getResolvedComp,
4264
+ setPendingRequest,
4265
+ source: {
4266
+ loadingComponent,
4267
+ errorComponent,
4268
+ delay,
4269
+ hydrate: hydrateStrategy,
4270
+ timeout,
4271
+ suspensible = true
4272
+ }
4273
+ } = createAsyncComponentContext(source);
4224
4274
  return defineComponent({
4225
4275
  name: "AsyncComponentWrapper",
4226
4276
  __asyncLoader: load,
4227
4277
  __asyncHydrate(el, instance, hydrate) {
4228
- const doHydrate = hydrateStrategy ? () => {
4229
- const performHydrate = () => {
4230
- hydrate();
4231
- };
4232
- const teardown = hydrateStrategy(
4233
- performHydrate,
4234
- (cb) => forEachElement(el, cb)
4235
- );
4236
- if (teardown) {
4237
- (instance.bum || (instance.bum = [])).push(teardown);
4238
- }
4239
- (instance.u || (instance.u = [])).push(() => true);
4240
- } : hydrate;
4241
- if (resolvedComp) {
4242
- doHydrate();
4243
- } else {
4244
- load().then(() => !instance.isUnmounted && doHydrate());
4245
- }
4278
+ performAsyncHydrate(
4279
+ el,
4280
+ instance,
4281
+ hydrate,
4282
+ getResolvedComp,
4283
+ load,
4284
+ hydrateStrategy
4285
+ );
4246
4286
  },
4247
4287
  get __asyncResolved() {
4248
- return resolvedComp;
4288
+ return getResolvedComp();
4249
4289
  },
4250
4290
  setup() {
4251
4291
  const instance = currentInstance;
4252
4292
  markAsyncBoundary(instance);
4293
+ let resolvedComp = getResolvedComp();
4253
4294
  if (resolvedComp) {
4254
4295
  return () => createInnerComp(resolvedComp, instance);
4255
4296
  }
4256
4297
  const onError = (err) => {
4257
- pendingRequest = null;
4298
+ setPendingRequest(null);
4258
4299
  handleError(
4259
4300
  err,
4260
4301
  instance,
@@ -4272,25 +4313,11 @@ function defineAsyncComponent(source) {
4272
4313
  }) : null;
4273
4314
  });
4274
4315
  }
4275
- const loaded = ref(false);
4276
- const error = ref();
4277
- const delayed = ref(!!delay);
4278
- if (delay) {
4279
- setTimeout(() => {
4280
- delayed.value = false;
4281
- }, delay);
4282
- }
4283
- if (timeout != null) {
4284
- setTimeout(() => {
4285
- if (!loaded.value && !error.value) {
4286
- const err = new Error(
4287
- `Async component timed out after ${timeout}ms.`
4288
- );
4289
- onError(err);
4290
- error.value = err;
4291
- }
4292
- }, timeout);
4293
- }
4316
+ const { loaded, error, delayed } = useAsyncComponentState(
4317
+ delay,
4318
+ timeout,
4319
+ onError
4320
+ );
4294
4321
  load().then(() => {
4295
4322
  loaded.value = true;
4296
4323
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -4301,6 +4328,7 @@ function defineAsyncComponent(source) {
4301
4328
  error.value = err;
4302
4329
  });
4303
4330
  return () => {
4331
+ resolvedComp = getResolvedComp();
4304
4332
  if (loaded.value && resolvedComp) {
4305
4333
  return createInnerComp(resolvedComp, instance);
4306
4334
  } else if (error.value && errorComponent) {
@@ -4308,7 +4336,10 @@ function defineAsyncComponent(source) {
4308
4336
  error: error.value
4309
4337
  });
4310
4338
  } else if (loadingComponent && !delayed.value) {
4311
- return createVNode(loadingComponent);
4339
+ return createInnerComp(
4340
+ loadingComponent,
4341
+ instance
4342
+ );
4312
4343
  }
4313
4344
  };
4314
4345
  }
@@ -4322,6 +4353,94 @@ function createInnerComp(comp, parent) {
4322
4353
  delete parent.vnode.ce;
4323
4354
  return vnode;
4324
4355
  }
4356
+ function createAsyncComponentContext(source) {
4357
+ if (isFunction(source)) {
4358
+ source = { loader: source };
4359
+ }
4360
+ const { loader, onError: userOnError } = source;
4361
+ let pendingRequest = null;
4362
+ let resolvedComp;
4363
+ let retries = 0;
4364
+ const retry = () => {
4365
+ retries++;
4366
+ pendingRequest = null;
4367
+ return load();
4368
+ };
4369
+ const load = () => {
4370
+ let thisRequest;
4371
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4372
+ err = err instanceof Error ? err : new Error(String(err));
4373
+ if (userOnError) {
4374
+ return new Promise((resolve, reject) => {
4375
+ const userRetry = () => resolve(retry());
4376
+ const userFail = () => reject(err);
4377
+ userOnError(err, userRetry, userFail, retries + 1);
4378
+ });
4379
+ } else {
4380
+ throw err;
4381
+ }
4382
+ }).then((comp) => {
4383
+ if (thisRequest !== pendingRequest && pendingRequest) {
4384
+ return pendingRequest;
4385
+ }
4386
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4387
+ comp = comp.default;
4388
+ }
4389
+ resolvedComp = comp;
4390
+ return comp;
4391
+ }));
4392
+ };
4393
+ return {
4394
+ load,
4395
+ source,
4396
+ getResolvedComp: () => resolvedComp,
4397
+ setPendingRequest: (request) => pendingRequest = request
4398
+ };
4399
+ }
4400
+ const useAsyncComponentState = (delay, timeout, onError) => {
4401
+ const loaded = ref(false);
4402
+ const error = ref();
4403
+ const delayed = ref(!!delay);
4404
+ if (delay) {
4405
+ setTimeout(() => {
4406
+ delayed.value = false;
4407
+ }, delay);
4408
+ }
4409
+ if (timeout != null) {
4410
+ setTimeout(() => {
4411
+ if (!loaded.value && !error.value) {
4412
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
4413
+ onError(err);
4414
+ error.value = err;
4415
+ }
4416
+ }, timeout);
4417
+ }
4418
+ return { loaded, error, delayed };
4419
+ };
4420
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4421
+ let patched = false;
4422
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
4423
+ const performHydrate = () => {
4424
+ if (patched) {
4425
+ return;
4426
+ }
4427
+ hydrate();
4428
+ };
4429
+ const doHydrate = hydrateStrategy ? () => {
4430
+ const teardown = hydrateStrategy(
4431
+ performHydrate,
4432
+ (cb) => forEachElement(el, cb)
4433
+ );
4434
+ if (teardown) {
4435
+ (instance.bum || (instance.bum = [])).push(teardown);
4436
+ }
4437
+ } : performHydrate;
4438
+ if (getResolvedComp()) {
4439
+ doHydrate();
4440
+ } else {
4441
+ load().then(() => !instance.isUnmounted && doHydrate());
4442
+ }
4443
+ }
4325
4444
 
4326
4445
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
4327
4446
  const KeepAliveImpl = {
@@ -4348,77 +4467,37 @@ const KeepAliveImpl = {
4348
4467
  const keys = /* @__PURE__ */ new Set();
4349
4468
  let current = null;
4350
4469
  const parentSuspense = keepAliveInstance.suspense;
4470
+ const { renderer } = sharedContext;
4351
4471
  const {
4352
- renderer: {
4353
- p: patch,
4354
- m: move,
4355
- um: _unmount,
4356
- o: { createElement }
4357
- }
4358
- } = sharedContext;
4472
+ um: _unmount,
4473
+ o: { createElement }
4474
+ } = renderer;
4359
4475
  const storageContainer = createElement("div");
4476
+ sharedContext.getStorageContainer = () => storageContainer;
4477
+ sharedContext.getCachedComponent = (vnode) => {
4478
+ const key = vnode.key == null ? vnode.type : vnode.key;
4479
+ return cache.get(key);
4480
+ };
4360
4481
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4361
- const instance = vnode.component;
4362
- move(
4482
+ activate(
4363
4483
  vnode,
4364
4484
  container,
4365
4485
  anchor,
4366
- 0,
4486
+ renderer,
4367
4487
  keepAliveInstance,
4368
- parentSuspense
4369
- );
4370
- patch(
4371
- instance.vnode,
4372
- vnode,
4373
- container,
4374
- anchor,
4375
- instance,
4376
4488
  parentSuspense,
4377
4489
  namespace,
4378
- vnode.slotScopeIds,
4379
4490
  optimized
4380
4491
  );
4381
- queuePostRenderEffect(
4382
- () => {
4383
- instance.isDeactivated = false;
4384
- if (instance.a) {
4385
- invokeArrayFns(instance.a);
4386
- }
4387
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4388
- if (vnodeHook) {
4389
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4390
- }
4391
- },
4392
- void 0,
4393
- parentSuspense
4394
- );
4395
4492
  };
4396
4493
  sharedContext.deactivate = (vnode) => {
4397
- const instance = vnode.component;
4398
- invalidateMount(instance.m);
4399
- invalidateMount(instance.a);
4400
- move(
4494
+ deactivate(
4401
4495
  vnode,
4402
4496
  storageContainer,
4403
- null,
4404
- 1,
4497
+ renderer,
4405
4498
  keepAliveInstance,
4406
4499
  parentSuspense
4407
4500
  );
4408
- queuePostRenderEffect(
4409
- () => {
4410
- if (instance.da) {
4411
- invokeArrayFns(instance.da);
4412
- }
4413
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4414
- if (vnodeHook) {
4415
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4416
- }
4417
- instance.isDeactivated = true;
4418
- },
4419
- void 0,
4420
- parentSuspense
4421
- );
4422
4501
  };
4423
4502
  function unmount(vnode) {
4424
4503
  resetShapeFlag(vnode);
@@ -4566,7 +4645,7 @@ function onActivated(hook, target) {
4566
4645
  function onDeactivated(hook, target) {
4567
4646
  registerKeepAliveHook(hook, "da", target);
4568
4647
  }
4569
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
4648
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
4570
4649
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4571
4650
  let current = target;
4572
4651
  while (current) {
@@ -4580,8 +4659,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
4580
4659
  injectHook(type, wrappedHook, target);
4581
4660
  if (target) {
4582
4661
  let current = target.parent;
4583
- while (current && current.parent && current.parent.vnode) {
4584
- if (isKeepAlive(current.parent.vnode)) {
4662
+ while (current && current.parent) {
4663
+ let parent = current.parent;
4664
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
4585
4665
  injectToKeepAliveRoot(wrappedHook, type, target, current);
4586
4666
  }
4587
4667
  current = current.parent;
@@ -4607,6 +4687,62 @@ function resetShapeFlag(vnode) {
4607
4687
  function getInnerChild(vnode) {
4608
4688
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
4609
4689
  }
4690
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
4691
+ const instance = vnode.component;
4692
+ move(
4693
+ vnode,
4694
+ container,
4695
+ anchor,
4696
+ 0,
4697
+ parentComponent,
4698
+ parentSuspense
4699
+ );
4700
+ patch(
4701
+ instance.vnode,
4702
+ vnode,
4703
+ container,
4704
+ anchor,
4705
+ instance,
4706
+ parentSuspense,
4707
+ namespace,
4708
+ vnode.slotScopeIds,
4709
+ optimized
4710
+ );
4711
+ queuePostRenderEffect(
4712
+ () => {
4713
+ instance.isDeactivated = false;
4714
+ if (instance.a) {
4715
+ invokeArrayFns(instance.a);
4716
+ }
4717
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4718
+ if (vnodeHook) {
4719
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4720
+ }
4721
+ },
4722
+ void 0,
4723
+ parentSuspense
4724
+ );
4725
+ }
4726
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
4727
+ const instance = vnode.component;
4728
+ invalidateMount(instance.m);
4729
+ invalidateMount(instance.a);
4730
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
4731
+ queuePostRenderEffect(
4732
+ () => {
4733
+ if (instance.da) {
4734
+ invokeArrayFns(instance.da);
4735
+ }
4736
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4737
+ if (vnodeHook) {
4738
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4739
+ }
4740
+ instance.isDeactivated = true;
4741
+ },
4742
+ void 0,
4743
+ parentSuspense
4744
+ );
4745
+ }
4610
4746
 
4611
4747
  function injectHook(type, hook, target = currentInstance, prepend = false) {
4612
4748
  if (target) {
@@ -5065,12 +5201,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5065
5201
  return ret;
5066
5202
  }
5067
5203
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5204
+ const hasProps = Object.keys(props).length > 0;
5068
5205
  if (name !== "default") props.name = name;
5069
5206
  return openBlock(), createBlock(
5070
5207
  Fragment,
5071
5208
  null,
5072
5209
  [createVNode("slot", props, fallback && fallback())],
5073
- 64
5210
+ hasProps ? -2 : 64
5074
5211
  );
5075
5212
  }
5076
5213
  if (slot && slot._c) {
@@ -5078,6 +5215,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5078
5215
  }
5079
5216
  openBlock();
5080
5217
  const validSlotContent = slot && ensureValidVNode(slot(props));
5218
+ ensureVaporSlotFallback(validSlotContent, fallback);
5081
5219
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5082
5220
  // key attached in the `createSlots` helper, respect that
5083
5221
  validSlotContent && validSlotContent.key;
@@ -5107,6 +5245,14 @@ function ensureValidVNode(vnodes) {
5107
5245
  return true;
5108
5246
  }) ? vnodes : null;
5109
5247
  }
5248
+ function ensureVaporSlotFallback(vnodes, fallback) {
5249
+ let vaporSlot;
5250
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5251
+ if (!vaporSlot.fallback && fallback) {
5252
+ vaporSlot.fallback = fallback;
5253
+ }
5254
+ }
5255
+ }
5110
5256
 
5111
5257
  function toHandlers(obj, preserveCaseIfNecessary) {
5112
5258
  const ret = {};
@@ -5164,7 +5310,7 @@ function legacyRenderSlot(instance, name, fallback, props, bindObject) {
5164
5310
  }
5165
5311
  return renderSlot(instance.slots, name, props, fallback && (() => fallback));
5166
5312
  }
5167
- function legacyresolveScopedSlots(fns, raw, hasDynamicKeys) {
5313
+ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
5168
5314
  return createSlots(
5169
5315
  raw || { $stable: !hasDynamicKeys },
5170
5316
  mapKeyToName(fns)
@@ -5325,7 +5471,7 @@ function installCompatInstanceProperties(map) {
5325
5471
  _b: () => legacyBindObjectProps,
5326
5472
  _v: () => createTextVNode,
5327
5473
  _e: () => createCommentVNode,
5328
- _u: () => legacyresolveScopedSlots,
5474
+ _u: () => legacyResolveScopedSlots,
5329
5475
  _g: () => legacyBindObjectListeners,
5330
5476
  _d: () => legacyBindDynamicKeys,
5331
5477
  _p: () => legacyPrependModifier
@@ -5463,10 +5609,10 @@ const PublicInstanceProxyHandlers = {
5463
5609
  return true;
5464
5610
  },
5465
5611
  has({
5466
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5612
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5467
5613
  }, key) {
5468
- let normalizedProps;
5469
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
5614
+ let normalizedProps, cssModules;
5615
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5470
5616
  },
5471
5617
  defineProperty(target, key, descriptor) {
5472
5618
  if (descriptor.get != null) {
@@ -5527,7 +5673,7 @@ function useSlots() {
5527
5673
  function useAttrs() {
5528
5674
  return getContext().attrs;
5529
5675
  }
5530
- function getContext() {
5676
+ function getContext(calledFunctionName) {
5531
5677
  const i = getCurrentGenericInstance();
5532
5678
  if (i.vapor) {
5533
5679
  return i;
@@ -5719,7 +5865,8 @@ function applyOptions(instance) {
5719
5865
  expose.forEach((key) => {
5720
5866
  Object.defineProperty(exposed, key, {
5721
5867
  get: () => publicThis[key],
5722
- set: (val) => publicThis[key] = val
5868
+ set: (val) => publicThis[key] = val,
5869
+ enumerable: true
5723
5870
  });
5724
5871
  });
5725
5872
  } else if (!instance.exposed) {
@@ -6007,7 +6154,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6007
6154
  return vm;
6008
6155
  }
6009
6156
  }
6010
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.2"}`;
6157
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.3"}`;
6011
6158
  Vue.config = singletonApp.config;
6012
6159
  Vue.use = (plugin, ...options) => {
6013
6160
  if (plugin && isFunction(plugin.install)) {
@@ -6021,22 +6168,22 @@ function createCompatVue$1(createApp, createSingletonApp) {
6021
6168
  singletonApp.mixin(m);
6022
6169
  return Vue;
6023
6170
  };
6024
- Vue.component = (name, comp) => {
6171
+ Vue.component = ((name, comp) => {
6025
6172
  if (comp) {
6026
6173
  singletonApp.component(name, comp);
6027
6174
  return Vue;
6028
6175
  } else {
6029
6176
  return singletonApp.component(name);
6030
6177
  }
6031
- };
6032
- Vue.directive = (name, dir) => {
6178
+ });
6179
+ Vue.directive = ((name, dir) => {
6033
6180
  if (dir) {
6034
6181
  singletonApp.directive(name, dir);
6035
6182
  return Vue;
6036
6183
  } else {
6037
6184
  return singletonApp.directive(name);
6038
6185
  }
6039
- };
6186
+ });
6040
6187
  Vue.options = { _base: Vue };
6041
6188
  let cid = 1;
6042
6189
  Vue.cid = cid;
@@ -6099,14 +6246,14 @@ function createCompatVue$1(createApp, createSingletonApp) {
6099
6246
  assertCompatEnabled("GLOBAL_OBSERVABLE", null);
6100
6247
  return reactive(target);
6101
6248
  };
6102
- Vue.filter = (name, filter) => {
6249
+ Vue.filter = ((name, filter) => {
6103
6250
  if (filter) {
6104
6251
  singletonApp.filter(name, filter);
6105
6252
  return Vue;
6106
6253
  } else {
6107
6254
  return singletonApp.filter(name);
6108
6255
  }
6109
- };
6256
+ });
6110
6257
  const util = {
6111
6258
  warn: NOOP,
6112
6259
  extend,
@@ -6852,7 +6999,7 @@ function validatePropName(key) {
6852
6999
  return false;
6853
7000
  }
6854
7001
 
6855
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7002
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6856
7003
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6857
7004
  const normalizeSlot = (key, rawSlot, ctx) => {
6858
7005
  if (rawSlot._n) {
@@ -6892,8 +7039,6 @@ const assignSlots = (slots, children, optimized) => {
6892
7039
  const initSlots = (instance, children, optimized) => {
6893
7040
  const slots = instance.slots = createInternalObject();
6894
7041
  if (instance.vnode.shapeFlag & 32) {
6895
- const cacheIndexes = children.__;
6896
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6897
7042
  const type = children._;
6898
7043
  if (type) {
6899
7044
  assignSlots(slots, children, optimized);
@@ -7133,15 +7278,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7133
7278
  optimized
7134
7279
  );
7135
7280
  } else {
7136
- patchElement(
7137
- n1,
7138
- n2,
7139
- parentComponent,
7140
- parentSuspense,
7141
- namespace,
7142
- slotScopeIds,
7143
- optimized
7144
- );
7281
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7282
+ try {
7283
+ if (customElement) {
7284
+ customElement._beginPatch();
7285
+ }
7286
+ patchElement(
7287
+ n1,
7288
+ n2,
7289
+ parentComponent,
7290
+ parentSuspense,
7291
+ namespace,
7292
+ slotScopeIds,
7293
+ optimized
7294
+ );
7295
+ } finally {
7296
+ if (customElement) {
7297
+ customElement._endPatch();
7298
+ }
7299
+ }
7145
7300
  }
7146
7301
  };
7147
7302
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7188,16 +7343,20 @@ function baseCreateRenderer(options, createHydrationFns) {
7188
7343
  if (dirs) {
7189
7344
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7190
7345
  }
7191
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
7192
- if (needCallTransitionHooks) {
7193
- transition.beforeEnter(el);
7346
+ if (transition) {
7347
+ performTransitionEnter(
7348
+ el,
7349
+ transition,
7350
+ () => hostInsert(el, container, anchor),
7351
+ parentSuspense
7352
+ );
7353
+ } else {
7354
+ hostInsert(el, container, anchor);
7194
7355
  }
7195
- hostInsert(el, container, anchor);
7196
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7356
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7197
7357
  queuePostRenderEffect(
7198
7358
  () => {
7199
7359
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7200
- needCallTransitionHooks && transition.enter(el);
7201
7360
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7202
7361
  },
7203
7362
  void 0,
@@ -7214,18 +7373,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7214
7373
  hostSetScopeId(el, slotScopeIds[i]);
7215
7374
  }
7216
7375
  }
7217
- let subTree = parentComponent && parentComponent.subTree;
7218
- if (subTree) {
7219
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7220
- const parentVNode = parentComponent.vnode;
7221
- setScopeId(
7222
- el,
7223
- parentVNode,
7224
- parentVNode.scopeId,
7225
- parentVNode.slotScopeIds,
7226
- parentComponent.parent
7227
- );
7228
- }
7376
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
7377
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
7378
+ hostSetScopeId(el, inheritedScopeIds[i]);
7229
7379
  }
7230
7380
  };
7231
7381
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -7458,12 +7608,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7458
7608
  n2.slotScopeIds = slotScopeIds;
7459
7609
  if (n2.type.__vapor) {
7460
7610
  if (n1 == null) {
7461
- getVaporInterface(parentComponent, n2).mount(
7462
- n2,
7463
- container,
7464
- anchor,
7465
- parentComponent
7466
- );
7611
+ if (n2.shapeFlag & 512) {
7612
+ getVaporInterface(parentComponent, n2).activate(
7613
+ n2,
7614
+ container,
7615
+ anchor,
7616
+ parentComponent
7617
+ );
7618
+ } else {
7619
+ getVaporInterface(parentComponent, n2).mount(
7620
+ n2,
7621
+ container,
7622
+ anchor,
7623
+ parentComponent
7624
+ );
7625
+ }
7467
7626
  } else {
7468
7627
  getVaporInterface(parentComponent, n2).update(
7469
7628
  n1,
@@ -7513,6 +7672,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7513
7672
  if (!initialVNode.el) {
7514
7673
  const placeholder = instance.subTree = createVNode(Comment);
7515
7674
  processCommentNode(null, placeholder, container, anchor);
7675
+ initialVNode.placeholder = placeholder.el;
7516
7676
  }
7517
7677
  } else {
7518
7678
  setupRenderEffect(
@@ -8011,7 +8171,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8011
8171
  for (i = toBePatched - 1; i >= 0; i--) {
8012
8172
  const nextIndex = s2 + i;
8013
8173
  const nextChild = c2[nextIndex];
8014
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
8174
+ const anchorVNode = c2[nextIndex + 1];
8175
+ const anchor = nextIndex + 1 < l2 ? (
8176
+ // #13559, fallback to el placeholder for unresolved async component
8177
+ anchorVNode.el || anchorVNode.placeholder
8178
+ ) : parentAnchor;
8015
8179
  if (newIndexToOldIndexMap[i] === 0) {
8016
8180
  patch(
8017
8181
  null,
@@ -8091,12 +8255,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8091
8255
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8092
8256
  if (needTransition2) {
8093
8257
  if (moveType === 0) {
8094
- transition.beforeEnter(el);
8095
- hostInsert(el, container, anchor);
8096
- queuePostRenderEffect(
8097
- () => transition.enter(el),
8098
- void 0,
8099
- parentSuspense
8258
+ performTransitionEnter(
8259
+ el,
8260
+ transition,
8261
+ () => hostInsert(el, container, anchor),
8262
+ parentSuspense,
8263
+ true
8100
8264
  );
8101
8265
  } else {
8102
8266
  const { leave, delayLeave, afterLeave } = transition;
@@ -8108,6 +8272,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8108
8272
  }
8109
8273
  };
8110
8274
  const performLeave = () => {
8275
+ if (el._isLeaving) {
8276
+ el[leaveCbKey](
8277
+ true
8278
+ /* cancelled */
8279
+ );
8280
+ }
8111
8281
  leave(el, () => {
8112
8282
  remove2();
8113
8283
  afterLeave && afterLeave();
@@ -8147,7 +8317,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8147
8317
  parentComponent.renderCache[cacheIndex] = void 0;
8148
8318
  }
8149
8319
  if (shapeFlag & 256) {
8150
- parentComponent.ctx.deactivate(vnode);
8320
+ if (vnode.type.__vapor) {
8321
+ getVaporInterface(parentComponent, vnode).deactivate(
8322
+ vnode,
8323
+ parentComponent.ctx.getStorageContainer()
8324
+ );
8325
+ } else {
8326
+ parentComponent.ctx.deactivate(vnode);
8327
+ }
8151
8328
  return;
8152
8329
  }
8153
8330
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8227,22 +8404,15 @@ function baseCreateRenderer(options, createHydrationFns) {
8227
8404
  removeStaticNode(vnode);
8228
8405
  return;
8229
8406
  }
8230
- const performRemove = () => {
8231
- hostRemove(el);
8232
- if (transition && !transition.persisted && transition.afterLeave) {
8233
- transition.afterLeave();
8234
- }
8235
- };
8236
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8237
- const { leave, delayLeave } = transition;
8238
- const performLeave = () => leave(el, performRemove);
8239
- if (delayLeave) {
8240
- delayLeave(vnode.el, performRemove, performLeave);
8241
- } else {
8242
- performLeave();
8243
- }
8407
+ if (transition) {
8408
+ performTransitionLeave(
8409
+ el,
8410
+ transition,
8411
+ () => hostRemove(el),
8412
+ !!(vnode.shapeFlag & 1)
8413
+ );
8244
8414
  } else {
8245
- performRemove();
8415
+ hostRemove(el);
8246
8416
  }
8247
8417
  };
8248
8418
  const removeFragment = (cur, end) => {
@@ -8255,27 +8425,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8255
8425
  hostRemove(end);
8256
8426
  };
8257
8427
  const unmountComponent = (instance, parentSuspense, doRemove) => {
8258
- const {
8259
- bum,
8260
- scope,
8261
- effect,
8262
- subTree,
8263
- um,
8264
- m,
8265
- a,
8266
- parent,
8267
- slots: { __: slotCacheKeys }
8268
- } = instance;
8428
+ const { bum, scope, effect, subTree, um, m, a } = instance;
8269
8429
  invalidateMount(m);
8270
8430
  invalidateMount(a);
8271
8431
  if (bum) {
8272
8432
  invokeArrayFns(bum);
8273
8433
  }
8274
- if (parent && isArray(slotCacheKeys)) {
8275
- slotCacheKeys.forEach((v) => {
8276
- parent.renderCache[v] = void 0;
8277
- });
8278
- }
8279
8434
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
8280
8435
  instance.emit("hook:beforeDestroy");
8281
8436
  }
@@ -8299,12 +8454,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8299
8454
  void 0,
8300
8455
  parentSuspense
8301
8456
  );
8302
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8303
- parentSuspense.deps--;
8304
- if (parentSuspense.deps === 0) {
8305
- parentSuspense.resolve();
8306
- }
8307
- }
8308
8457
  };
8309
8458
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
8310
8459
  for (let i = start; i < children.length; i++) {
@@ -8314,7 +8463,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8314
8463
  const getNextHostNode = (vnode) => {
8315
8464
  if (vnode.shapeFlag & 6) {
8316
8465
  if (vnode.type.__vapor) {
8317
- return hostNextSibling(vnode.component.block);
8466
+ return hostNextSibling(vnode.anchor);
8318
8467
  }
8319
8468
  return getNextHostNode(vnode.component.subTree);
8320
8469
  }
@@ -8385,6 +8534,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8385
8534
  return {
8386
8535
  render,
8387
8536
  hydrate,
8537
+ hydrateNode,
8388
8538
  internals,
8389
8539
  createApp: createAppAPI(
8390
8540
  mountApp,
@@ -8426,7 +8576,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8426
8576
  if (!shallow && c2.patchFlag !== -2)
8427
8577
  traverseStaticChildren(c1, c2);
8428
8578
  }
8429
- if (c2.type === Text) {
8579
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8580
+ c2.patchFlag !== -1) {
8430
8581
  c2.el = c1.el;
8431
8582
  }
8432
8583
  if (c2.type === Comment && !c2.el) {
@@ -8436,7 +8587,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8436
8587
  }
8437
8588
  }
8438
8589
  function locateNonHydratedAsyncRoot(instance) {
8439
- const subComponent = instance.vapor ? null : instance.subTree.component;
8590
+ const subComponent = instance.subTree && instance.subTree.component;
8440
8591
  if (subComponent) {
8441
8592
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8442
8593
  return subComponent;
@@ -8451,11 +8602,62 @@ function invalidateMount(hooks) {
8451
8602
  hooks[i].flags |= 4;
8452
8603
  }
8453
8604
  }
8605
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8606
+ if (force || needTransition(parentSuspense, transition)) {
8607
+ transition.beforeEnter(el);
8608
+ insert();
8609
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
8610
+ } else {
8611
+ insert();
8612
+ }
8613
+ }
8614
+ function performTransitionLeave(el, transition, remove, isElement = true) {
8615
+ const performRemove = () => {
8616
+ remove();
8617
+ if (transition && !transition.persisted && transition.afterLeave) {
8618
+ transition.afterLeave();
8619
+ }
8620
+ };
8621
+ if (isElement && transition && !transition.persisted) {
8622
+ const { leave, delayLeave } = transition;
8623
+ const performLeave = () => leave(el, performRemove);
8624
+ if (delayLeave) {
8625
+ delayLeave(el, performRemove, performLeave);
8626
+ } else {
8627
+ performLeave();
8628
+ }
8629
+ } else {
8630
+ performRemove();
8631
+ }
8632
+ }
8454
8633
  function getVaporInterface(instance, vnode) {
8455
8634
  const ctx = instance ? instance.appContext : vnode.appContext;
8456
8635
  const res = ctx && ctx.vapor;
8457
8636
  return res;
8458
8637
  }
8638
+ function getInheritedScopeIds(vnode, parentComponent) {
8639
+ const inheritedScopeIds = [];
8640
+ let currentParent = parentComponent;
8641
+ let currentVNode = vnode;
8642
+ while (currentParent) {
8643
+ let subTree = currentParent.subTree;
8644
+ if (!subTree) break;
8645
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
8646
+ const parentVNode = currentParent.vnode;
8647
+ if (parentVNode.scopeId) {
8648
+ inheritedScopeIds.push(parentVNode.scopeId);
8649
+ }
8650
+ if (parentVNode.slotScopeIds) {
8651
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
8652
+ }
8653
+ currentVNode = parentVNode;
8654
+ currentParent = currentParent.parent;
8655
+ } else {
8656
+ break;
8657
+ }
8658
+ }
8659
+ return inheritedScopeIds;
8660
+ }
8459
8661
 
8460
8662
  const ssrContextKey = Symbol.for("v-scx");
8461
8663
  const useSSRContext = () => {
@@ -8730,8 +8932,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
8730
8932
  function defaultPropGetter(props, key) {
8731
8933
  return props[key];
8732
8934
  }
8935
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8733
8936
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8734
- const cache = appContext.emitsCache;
8937
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8735
8938
  const cached = cache.get(comp);
8736
8939
  if (cached !== void 0) {
8737
8940
  return cached;
@@ -9117,7 +9320,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9117
9320
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9118
9321
  if (pendingBranch) {
9119
9322
  suspense.pendingBranch = newBranch;
9120
- if (isSameVNodeType(newBranch, pendingBranch)) {
9323
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9121
9324
  patch(
9122
9325
  pendingBranch,
9123
9326
  newBranch,
@@ -9188,7 +9391,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9188
9391
  );
9189
9392
  setActiveBranch(suspense, newFallback);
9190
9393
  }
9191
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9394
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9192
9395
  patch(
9193
9396
  activeBranch,
9194
9397
  newBranch,
@@ -9219,7 +9422,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9219
9422
  }
9220
9423
  }
9221
9424
  } else {
9222
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9425
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9223
9426
  patch(
9224
9427
  activeBranch,
9225
9428
  newBranch,
@@ -9310,7 +9513,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9310
9513
  pendingId,
9311
9514
  effects,
9312
9515
  parentComponent: parentComponent2,
9313
- container: container2
9516
+ container: container2,
9517
+ isInFallback
9314
9518
  } = suspense;
9315
9519
  let delayEnter = false;
9316
9520
  if (suspense.isHydrating) {
@@ -9328,6 +9532,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9328
9532
  parentComponent2
9329
9533
  );
9330
9534
  queuePostFlushCb(effects);
9535
+ if (isInFallback && vnode2.ssFallback) {
9536
+ vnode2.ssFallback.el = null;
9537
+ }
9331
9538
  }
9332
9539
  };
9333
9540
  }
@@ -9336,6 +9543,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9336
9543
  anchor = next(activeBranch);
9337
9544
  }
9338
9545
  unmount(activeBranch, parentComponent2, suspense, true);
9546
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9547
+ vnode2.ssFallback.el = null;
9548
+ }
9339
9549
  }
9340
9550
  if (!delayEnter) {
9341
9551
  move(
@@ -9457,6 +9667,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9457
9667
  optimized2
9458
9668
  );
9459
9669
  if (placeholder) {
9670
+ vnode2.placeholder = null;
9460
9671
  remove(placeholder);
9461
9672
  }
9462
9673
  updateHOCHostEl(instance, vnode2.el);
@@ -9698,15 +9909,11 @@ function isSameVNodeType(n1, n2) {
9698
9909
  function transformVNodeArgs(transformer) {
9699
9910
  }
9700
9911
  const normalizeKey = ({ key }) => key != null ? key : null;
9701
- const normalizeRef = ({
9702
- ref,
9703
- ref_key,
9704
- ref_for
9705
- }) => {
9912
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
9706
9913
  if (typeof ref === "number") {
9707
9914
  ref = "" + ref;
9708
9915
  }
9709
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
9916
+ return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
9710
9917
  };
9711
9918
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
9712
9919
  const vnode = {
@@ -9864,6 +10071,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9864
10071
  suspense: vnode.suspense,
9865
10072
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
9866
10073
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
10074
+ placeholder: vnode.placeholder,
9867
10075
  el: vnode.el,
9868
10076
  anchor: vnode.anchor,
9869
10077
  ctx: vnode.ctx,
@@ -10293,23 +10501,28 @@ const computed = (getterOrOptions, debugOptions) => {
10293
10501
  };
10294
10502
 
10295
10503
  function h(type, propsOrChildren, children) {
10296
- const l = arguments.length;
10297
- if (l === 2) {
10298
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10299
- if (isVNode(propsOrChildren)) {
10300
- return createVNode(type, null, [propsOrChildren]);
10504
+ try {
10505
+ setBlockTracking(-1);
10506
+ const l = arguments.length;
10507
+ if (l === 2) {
10508
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10509
+ if (isVNode(propsOrChildren)) {
10510
+ return createVNode(type, null, [propsOrChildren]);
10511
+ }
10512
+ return createVNode(type, propsOrChildren);
10513
+ } else {
10514
+ return createVNode(type, null, propsOrChildren);
10301
10515
  }
10302
- return createVNode(type, propsOrChildren);
10303
10516
  } else {
10304
- return createVNode(type, null, propsOrChildren);
10305
- }
10306
- } else {
10307
- if (l > 3) {
10308
- children = Array.prototype.slice.call(arguments, 2);
10309
- } else if (l === 3 && isVNode(children)) {
10310
- children = [children];
10517
+ if (l > 3) {
10518
+ children = Array.prototype.slice.call(arguments, 2);
10519
+ } else if (l === 3 && isVNode(children)) {
10520
+ children = [children];
10521
+ }
10522
+ return createVNode(type, propsOrChildren, children);
10311
10523
  }
10312
- return createVNode(type, propsOrChildren, children);
10524
+ } finally {
10525
+ setBlockTracking(1);
10313
10526
  }
10314
10527
  }
10315
10528
 
@@ -10345,7 +10558,7 @@ function isMemoSame(cached, memo) {
10345
10558
  return true;
10346
10559
  }
10347
10560
 
10348
- const version = "3.6.0-alpha.2";
10561
+ const version = "3.6.0-alpha.3";
10349
10562
  const warn$1 = NOOP;
10350
10563
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10351
10564
  const devtools = void 0;
@@ -10614,11 +10827,11 @@ function resolveTransitionProps(rawProps) {
10614
10827
  addTransitionClass(el, legacyLeaveFromClass);
10615
10828
  }
10616
10829
  if (!el._enterCancelled) {
10617
- forceReflow();
10830
+ forceReflow(el);
10618
10831
  addTransitionClass(el, leaveActiveClass);
10619
10832
  } else {
10620
10833
  addTransitionClass(el, leaveActiveClass);
10621
- forceReflow();
10834
+ forceReflow(el);
10622
10835
  }
10623
10836
  nextFrame(() => {
10624
10837
  if (!el._isLeaving) {
@@ -10744,7 +10957,7 @@ function getTransitionInfo(el, expectedType) {
10744
10957
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
10745
10958
  propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
10746
10959
  }
10747
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
10960
+ const hasTransform = type === TRANSITION$1 && /\b(?:transform|all)(?:,|$)/.test(
10748
10961
  getStyleProperties(`${TRANSITION$1}Property`).toString()
10749
10962
  );
10750
10963
  return {
@@ -10764,8 +10977,9 @@ function toMs(s) {
10764
10977
  if (s === "auto") return 0;
10765
10978
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
10766
10979
  }
10767
- function forceReflow() {
10768
- return document.body.offsetHeight;
10980
+ function forceReflow(el) {
10981
+ const targetDocument = el ? el.ownerDocument : document;
10982
+ return targetDocument.body.offsetHeight;
10769
10983
  }
10770
10984
 
10771
10985
  function patchClass(el, value, isSVG) {
@@ -10785,6 +10999,8 @@ function patchClass(el, value, isSVG) {
10785
10999
  const vShowOriginalDisplay = Symbol("_vod");
10786
11000
  const vShowHidden = Symbol("_vsh");
10787
11001
  const vShow = {
11002
+ // used for prop mismatch check during hydration
11003
+ name: "show",
10788
11004
  beforeMount(el, { value }, { transition }) {
10789
11005
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
10790
11006
  if (transition && value) {
@@ -10835,7 +11051,7 @@ function useCssVars(getter) {
10835
11051
  return;
10836
11052
  }
10837
11053
 
10838
- const displayRE = /(^|;)\s*display\s*:/;
11054
+ const displayRE = /(?:^|;)\s*display\s*:/;
10839
11055
  function patchStyle(el, prev, next) {
10840
11056
  const style = el.style;
10841
11057
  const isCssString = isString(next);
@@ -11155,11 +11371,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
11155
11371
  }
11156
11372
 
11157
11373
  const REMOVAL = {};
11158
- /*! #__NO_SIDE_EFFECTS__ */
11159
11374
  // @__NO_SIDE_EFFECTS__
11160
11375
  function defineCustomElement(options, extraOptions, _createApp) {
11161
- const Comp = defineComponent(options, extraOptions);
11162
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
11376
+ let Comp = defineComponent(options, extraOptions);
11377
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11163
11378
  class VueCustomElement extends VueElement {
11164
11379
  constructor(initialProps) {
11165
11380
  super(Comp, initialProps, _createApp);
@@ -11168,10 +11383,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
11168
11383
  VueCustomElement.def = Comp;
11169
11384
  return VueCustomElement;
11170
11385
  }
11171
- /*! #__NO_SIDE_EFFECTS__ */
11172
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11386
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11173
11387
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11174
- };
11388
+ });
11175
11389
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11176
11390
  };
11177
11391
  class VueElement extends BaseClass {
@@ -11195,6 +11409,8 @@ class VueElement extends BaseClass {
11195
11409
  this._nonce = this._def.nonce;
11196
11410
  this._connected = false;
11197
11411
  this._resolved = false;
11412
+ this._patching = false;
11413
+ this._dirty = false;
11198
11414
  this._numberProps = null;
11199
11415
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11200
11416
  this._ob = null;
@@ -11202,7 +11418,11 @@ class VueElement extends BaseClass {
11202
11418
  this._root = this.shadowRoot;
11203
11419
  } else {
11204
11420
  if (_def.shadowRoot !== false) {
11205
- this.attachShadow({ mode: "open" });
11421
+ this.attachShadow(
11422
+ extend({}, _def.shadowRootOptions, {
11423
+ mode: "open"
11424
+ })
11425
+ );
11206
11426
  this._root = this.shadowRoot;
11207
11427
  } else {
11208
11428
  this._root = this;
@@ -11262,9 +11482,18 @@ class VueElement extends BaseClass {
11262
11482
  this._app && this._app.unmount();
11263
11483
  if (this._instance) this._instance.ce = void 0;
11264
11484
  this._app = this._instance = null;
11485
+ if (this._teleportTargets) {
11486
+ this._teleportTargets.clear();
11487
+ this._teleportTargets = void 0;
11488
+ }
11265
11489
  }
11266
11490
  });
11267
11491
  }
11492
+ _processMutations(mutations) {
11493
+ for (const m of mutations) {
11494
+ this._setAttr(m.attributeName);
11495
+ }
11496
+ }
11268
11497
  /**
11269
11498
  * resolve inner component definition (handle possible async component)
11270
11499
  */
@@ -11275,11 +11504,7 @@ class VueElement extends BaseClass {
11275
11504
  for (let i = 0; i < this.attributes.length; i++) {
11276
11505
  this._setAttr(this.attributes[i].name);
11277
11506
  }
11278
- this._ob = new MutationObserver((mutations) => {
11279
- for (const m of mutations) {
11280
- this._setAttr(m.attributeName);
11281
- }
11282
- });
11507
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11283
11508
  this._ob.observe(this, { attributes: true });
11284
11509
  const resolve = (def, isAsync = false) => {
11285
11510
  this._resolved = true;
@@ -11347,7 +11572,7 @@ class VueElement extends BaseClass {
11347
11572
  return this._getProp(key);
11348
11573
  },
11349
11574
  set(val) {
11350
- this._setProp(key, val, true, true);
11575
+ this._setProp(key, val, true, !this._patching);
11351
11576
  }
11352
11577
  });
11353
11578
  }
@@ -11373,6 +11598,7 @@ class VueElement extends BaseClass {
11373
11598
  */
11374
11599
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
11375
11600
  if (val !== this._props[key]) {
11601
+ this._dirty = true;
11376
11602
  if (val === REMOVAL) {
11377
11603
  delete this._props[key];
11378
11604
  } else {
@@ -11386,7 +11612,10 @@ class VueElement extends BaseClass {
11386
11612
  }
11387
11613
  if (shouldReflect) {
11388
11614
  const ob = this._ob;
11389
- ob && ob.disconnect();
11615
+ if (ob) {
11616
+ this._processMutations(ob.takeRecords());
11617
+ ob.disconnect();
11618
+ }
11390
11619
  if (val === true) {
11391
11620
  this.setAttribute(hyphenate(key), "");
11392
11621
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11465,7 +11694,7 @@ class VueElement extends BaseClass {
11465
11694
  * Only called when shadowRoot is false
11466
11695
  */
11467
11696
  _renderSlots() {
11468
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11697
+ const outlets = this._getSlots();
11469
11698
  const scopeId = this._instance.type.__scopeId;
11470
11699
  for (let i = 0; i < outlets.length; i++) {
11471
11700
  const o = outlets[i];
@@ -11491,12 +11720,45 @@ class VueElement extends BaseClass {
11491
11720
  parent.removeChild(o);
11492
11721
  }
11493
11722
  }
11723
+ /**
11724
+ * @internal
11725
+ */
11726
+ _getSlots() {
11727
+ const roots = [this];
11728
+ if (this._teleportTargets) {
11729
+ roots.push(...this._teleportTargets);
11730
+ }
11731
+ const slots = /* @__PURE__ */ new Set();
11732
+ for (const root of roots) {
11733
+ const found = root.querySelectorAll("slot");
11734
+ for (let i = 0; i < found.length; i++) {
11735
+ slots.add(found[i]);
11736
+ }
11737
+ }
11738
+ return Array.from(slots);
11739
+ }
11494
11740
  /**
11495
11741
  * @internal
11496
11742
  */
11497
11743
  _injectChildStyle(comp) {
11498
11744
  this._applyStyles(comp.styles, comp);
11499
11745
  }
11746
+ /**
11747
+ * @internal
11748
+ */
11749
+ _beginPatch() {
11750
+ this._patching = true;
11751
+ this._dirty = false;
11752
+ }
11753
+ /**
11754
+ * @internal
11755
+ */
11756
+ _endPatch() {
11757
+ this._patching = false;
11758
+ if (this._dirty && this._instance) {
11759
+ this._update();
11760
+ }
11761
+ }
11500
11762
  /**
11501
11763
  * @internal
11502
11764
  */
@@ -11569,26 +11831,13 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11569
11831
  prevChildren = [];
11570
11832
  return;
11571
11833
  }
11572
- prevChildren.forEach(callPendingCbs);
11834
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
11573
11835
  prevChildren.forEach(recordPosition);
11574
11836
  const movedChildren = prevChildren.filter(applyTranslation);
11575
- forceReflow();
11837
+ forceReflow(instance.vnode.el);
11576
11838
  movedChildren.forEach((c) => {
11577
11839
  const el = c.el;
11578
- const style = el.style;
11579
- addTransitionClass(el, moveClass);
11580
- style.transform = style.webkitTransform = style.transitionDuration = "";
11581
- const cb = el[moveCbKey] = (e) => {
11582
- if (e && e.target !== el) {
11583
- return;
11584
- }
11585
- if (!e || /transform$/.test(e.propertyName)) {
11586
- el.removeEventListener("transitionend", cb);
11587
- el[moveCbKey] = null;
11588
- removeTransitionClass(el, moveClass);
11589
- }
11590
- };
11591
- el.addEventListener("transitionend", cb);
11840
+ handleMovedChildren(el, moveClass);
11592
11841
  });
11593
11842
  prevChildren = [];
11594
11843
  });
@@ -11617,10 +11866,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11617
11866
  instance
11618
11867
  )
11619
11868
  );
11620
- positionMap.set(
11621
- child,
11622
- child.el.getBoundingClientRect()
11623
- );
11869
+ positionMap.set(child, {
11870
+ left: child.el.offsetLeft,
11871
+ top: child.el.offsetTop
11872
+ });
11624
11873
  }
11625
11874
  }
11626
11875
  }
@@ -11639,8 +11888,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11639
11888
  }
11640
11889
  });
11641
11890
  const TransitionGroup = TransitionGroupImpl;
11642
- function callPendingCbs(c) {
11643
- const el = c.el;
11891
+ function callPendingCbs(el) {
11644
11892
  if (el[moveCbKey]) {
11645
11893
  el[moveCbKey]();
11646
11894
  }
@@ -11649,19 +11897,30 @@ function callPendingCbs(c) {
11649
11897
  }
11650
11898
  }
11651
11899
  function recordPosition(c) {
11652
- newPositionMap.set(c, c.el.getBoundingClientRect());
11900
+ newPositionMap.set(c, {
11901
+ left: c.el.offsetLeft,
11902
+ top: c.el.offsetTop
11903
+ });
11653
11904
  }
11654
11905
  function applyTranslation(c) {
11655
- const oldPos = positionMap.get(c);
11656
- const newPos = newPositionMap.get(c);
11906
+ if (baseApplyTranslation(
11907
+ positionMap.get(c),
11908
+ newPositionMap.get(c),
11909
+ c.el
11910
+ )) {
11911
+ return c;
11912
+ }
11913
+ }
11914
+ function baseApplyTranslation(oldPos, newPos, el) {
11657
11915
  const dx = oldPos.left - newPos.left;
11658
11916
  const dy = oldPos.top - newPos.top;
11659
11917
  if (dx || dy) {
11660
- const s = c.el.style;
11918
+ const s = el.style;
11661
11919
  s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
11662
11920
  s.transitionDuration = "0s";
11663
- return c;
11921
+ return true;
11664
11922
  }
11923
+ return false;
11665
11924
  }
11666
11925
  function hasCSSTransform(el, root, moveClass) {
11667
11926
  const clone = el.cloneNode();
@@ -11679,6 +11938,22 @@ function hasCSSTransform(el, root, moveClass) {
11679
11938
  container.removeChild(clone);
11680
11939
  return hasTransform;
11681
11940
  }
11941
+ const handleMovedChildren = (el, moveClass) => {
11942
+ const style = el.style;
11943
+ addTransitionClass(el, moveClass);
11944
+ style.transform = style.webkitTransform = style.transitionDuration = "";
11945
+ const cb = el[moveCbKey] = (e) => {
11946
+ if (e && e.target !== el) {
11947
+ return;
11948
+ }
11949
+ if (!e || e.propertyName.endsWith("transform")) {
11950
+ el.removeEventListener("transitionend", cb);
11951
+ el[moveCbKey] = null;
11952
+ removeTransitionClass(el, moveClass);
11953
+ }
11954
+ };
11955
+ el.addEventListener("transitionend", cb);
11956
+ };
11682
11957
 
11683
11958
  const getModelAssigner = (vnode) => {
11684
11959
  const fn = vnode.props["onUpdate:modelValue"] || vnode.props["onModelCompat:input"];
@@ -11714,21 +11989,21 @@ const vModelText = {
11714
11989
  vModelTextUpdate(el, oldValue, value, trim, number, lazy);
11715
11990
  }
11716
11991
  };
11992
+ function castValue(value, trim, number) {
11993
+ if (trim) value = value.trim();
11994
+ if (number) value = looseToNumber(value);
11995
+ return value;
11996
+ }
11717
11997
  const vModelTextInit = (el, trim, number, lazy, set) => {
11718
11998
  addEventListener(el, lazy ? "change" : "input", (e) => {
11719
11999
  if (e.target.composing) return;
11720
- let domValue = el.value;
11721
- if (trim) {
11722
- domValue = domValue.trim();
11723
- }
11724
- if (number || el.type === "number") {
11725
- domValue = looseToNumber(domValue);
11726
- }
11727
- (0, el[assignKey])(domValue);
12000
+ (0, el[assignKey])(
12001
+ castValue(el.value, trim, number || el.type === "number")
12002
+ );
11728
12003
  });
11729
- if (trim) {
12004
+ if (trim || number) {
11730
12005
  addEventListener(el, "change", () => {
11731
- el.value = el.value.trim();
12006
+ el.value = castValue(el.value, trim, number || el.type === "number");
11732
12007
  });
11733
12008
  }
11734
12009
  if (!lazy) {
@@ -12008,13 +12283,13 @@ const modifierGuards = {
12008
12283
  const withModifiers = (fn, modifiers) => {
12009
12284
  const cache = fn._withMods || (fn._withMods = {});
12010
12285
  const cacheKey = modifiers.join(".");
12011
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12286
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12012
12287
  for (let i = 0; i < modifiers.length; i++) {
12013
12288
  const guard = modifierGuards[modifiers[i]];
12014
12289
  if (guard && guard(event, modifiers)) return;
12015
12290
  }
12016
12291
  return fn(event, ...args);
12017
- });
12292
+ }));
12018
12293
  };
12019
12294
  const keyNames = {
12020
12295
  esc: "escape",
@@ -12038,7 +12313,7 @@ const withKeys = (fn, modifiers) => {
12038
12313
  }
12039
12314
  const cache = fn._withKeys || (fn._withKeys = {});
12040
12315
  const cacheKey = modifiers.join(".");
12041
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
12316
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12042
12317
  if (!("key" in event)) {
12043
12318
  return;
12044
12319
  }
@@ -12068,7 +12343,7 @@ const withKeys = (fn, modifiers) => {
12068
12343
  }
12069
12344
  }
12070
12345
  }
12071
- });
12346
+ }));
12072
12347
  };
12073
12348
 
12074
12349
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12082,13 +12357,13 @@ function ensureHydrationRenderer() {
12082
12357
  enabledHydration = true;
12083
12358
  return renderer;
12084
12359
  }
12085
- const render = (...args) => {
12360
+ const render = ((...args) => {
12086
12361
  ensureRenderer().render(...args);
12087
- };
12088
- const hydrate = (...args) => {
12362
+ });
12363
+ const hydrate = ((...args) => {
12089
12364
  ensureHydrationRenderer().hydrate(...args);
12090
- };
12091
- const createApp = (...args) => {
12365
+ });
12366
+ const createApp = ((...args) => {
12092
12367
  const app = ensureRenderer().createApp(...args);
12093
12368
  const { mount } = app;
12094
12369
  app.mount = (containerOrSelector) => {
@@ -12109,8 +12384,8 @@ const createApp = (...args) => {
12109
12384
  return proxy;
12110
12385
  };
12111
12386
  return app;
12112
- };
12113
- const createSSRApp = (...args) => {
12387
+ });
12388
+ const createSSRApp = ((...args) => {
12114
12389
  const app = ensureHydrationRenderer().createApp(...args);
12115
12390
  const { mount } = app;
12116
12391
  app.mount = (containerOrSelector) => {
@@ -12120,7 +12395,7 @@ const createSSRApp = (...args) => {
12120
12395
  }
12121
12396
  };
12122
12397
  return app;
12123
- };
12398
+ });
12124
12399
  function resolveRootNamespace(container) {
12125
12400
  if (container instanceof SVGElement) {
12126
12401
  return "svg";
@@ -13596,16 +13871,34 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
13596
13871
  (id) => markScopeIdentifier(node, id, knownIds)
13597
13872
  );
13598
13873
  }
13874
+ } else if (node.type === "SwitchStatement") {
13875
+ if (node.scopeIds) {
13876
+ node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
13877
+ } else {
13878
+ walkSwitchStatement(
13879
+ node,
13880
+ false,
13881
+ (id) => markScopeIdentifier(node, id, knownIds)
13882
+ );
13883
+ }
13599
13884
  } else if (node.type === "CatchClause" && node.param) {
13600
- for (const id of extractIdentifiers(node.param)) {
13601
- markScopeIdentifier(node, id, knownIds);
13885
+ if (node.scopeIds) {
13886
+ node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
13887
+ } else {
13888
+ for (const id of extractIdentifiers(node.param)) {
13889
+ markScopeIdentifier(node, id, knownIds);
13890
+ }
13602
13891
  }
13603
13892
  } else if (isForStatement(node)) {
13604
- walkForStatement(
13605
- node,
13606
- false,
13607
- (id) => markScopeIdentifier(node, id, knownIds)
13608
- );
13893
+ if (node.scopeIds) {
13894
+ node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
13895
+ } else {
13896
+ walkForStatement(
13897
+ node,
13898
+ false,
13899
+ (id) => markScopeIdentifier(node, id, knownIds)
13900
+ );
13901
+ }
13609
13902
  }
13610
13903
  },
13611
13904
  leave(node, parent) {
@@ -13628,14 +13921,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
13628
13921
  if (id.name === "arguments") {
13629
13922
  return false;
13630
13923
  }
13631
- if (isReferenced(id, parent)) {
13924
+ if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {
13632
13925
  return true;
13633
13926
  }
13634
13927
  switch (parent.type) {
13635
13928
  case "AssignmentExpression":
13636
13929
  case "AssignmentPattern":
13637
13930
  return true;
13638
- case "ObjectPattern":
13931
+ case "ObjectProperty":
13932
+ return parent.key !== id && isInDestructureAssignment(parent, parentStack);
13639
13933
  case "ArrayPattern":
13640
13934
  return isInDestructureAssignment(parent, parentStack);
13641
13935
  }
@@ -13675,7 +13969,8 @@ function walkFunctionParams(node, onIdent) {
13675
13969
  }
13676
13970
  }
13677
13971
  function walkBlockDeclarations(block, onIdent) {
13678
- for (const stmt of block.body) {
13972
+ const body = block.type === "SwitchCase" ? block.consequent : block.body;
13973
+ for (const stmt of body) {
13679
13974
  if (stmt.type === "VariableDeclaration") {
13680
13975
  if (stmt.declare) continue;
13681
13976
  for (const decl of stmt.declarations) {
@@ -13688,6 +13983,8 @@ function walkBlockDeclarations(block, onIdent) {
13688
13983
  onIdent(stmt.id);
13689
13984
  } else if (isForStatement(stmt)) {
13690
13985
  walkForStatement(stmt, true, onIdent);
13986
+ } else if (stmt.type === "SwitchStatement") {
13987
+ walkSwitchStatement(stmt, true, onIdent);
13691
13988
  }
13692
13989
  }
13693
13990
  }
@@ -13704,6 +14001,20 @@ function walkForStatement(stmt, isVar, onIdent) {
13704
14001
  }
13705
14002
  }
13706
14003
  }
14004
+ function walkSwitchStatement(stmt, isVar, onIdent) {
14005
+ for (const cs of stmt.cases) {
14006
+ for (const stmt2 of cs.consequent) {
14007
+ if (stmt2.type === "VariableDeclaration" && (stmt2.kind === "var" ? isVar : !isVar)) {
14008
+ for (const decl of stmt2.declarations) {
14009
+ for (const id of extractIdentifiers(decl.id)) {
14010
+ onIdent(id);
14011
+ }
14012
+ }
14013
+ }
14014
+ }
14015
+ walkBlockDeclarations(cs, onIdent);
14016
+ }
14017
+ }
13707
14018
  function extractIdentifiers(param, nodes = []) {
13708
14019
  switch (param.type) {
13709
14020
  case "Identifier":
@@ -13804,7 +14115,7 @@ function isReferenced(node, parent, grandparent) {
13804
14115
  if (parent.key === node) {
13805
14116
  return !!parent.computed;
13806
14117
  }
13807
- return true;
14118
+ return !grandparent || grandparent.type !== "ObjectPattern";
13808
14119
  // no: class { NODE = value; }
13809
14120
  // yes: class { [NODE] = value; }
13810
14121
  // yes: class { key = NODE; }
@@ -13854,6 +14165,9 @@ function isReferenced(node, parent, grandparent) {
13854
14165
  // yes: export { NODE as foo };
13855
14166
  // no: export { NODE as foo } from "foo";
13856
14167
  case "ExportSpecifier":
14168
+ if (grandparent == null ? void 0 : grandparent.source) {
14169
+ return false;
14170
+ }
13857
14171
  return parent.local === node;
13858
14172
  // no: import NODE from "foo";
13859
14173
  // no: import * as NODE from "foo";
@@ -13934,8 +14248,9 @@ function isCoreComponent(tag) {
13934
14248
  return BASE_TRANSITION;
13935
14249
  }
13936
14250
  }
13937
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
14251
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
13938
14252
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
14253
+ const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
13939
14254
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
13940
14255
  const isMemberExpressionNode = (exp, context) => {
13941
14256
  try {
@@ -14027,6 +14342,9 @@ function hasDynamicKeyVBind(node) {
14027
14342
  function isText$1(node) {
14028
14343
  return node.type === 5 || node.type === 2;
14029
14344
  }
14345
+ function isVPre(p) {
14346
+ return p.type === 7 && p.name === "pre";
14347
+ }
14030
14348
  function isVSlot(p) {
14031
14349
  return p.type === 7 && p.name === "slot";
14032
14350
  }
@@ -14325,7 +14643,7 @@ const tokenizer = new Tokenizer(stack, {
14325
14643
  ondirarg(start, end) {
14326
14644
  if (start === end) return;
14327
14645
  const arg = getSlice(start, end);
14328
- if (inVPre) {
14646
+ if (inVPre && !isVPre(currentProp)) {
14329
14647
  currentProp.name += arg;
14330
14648
  setLocEnd(currentProp.nameLoc, end);
14331
14649
  } else {
@@ -14340,7 +14658,7 @@ const tokenizer = new Tokenizer(stack, {
14340
14658
  },
14341
14659
  ondirmodifier(start, end) {
14342
14660
  const mod = getSlice(start, end);
14343
- if (inVPre) {
14661
+ if (inVPre && !isVPre(currentProp)) {
14344
14662
  currentProp.name += "." + mod;
14345
14663
  setLocEnd(currentProp.nameLoc, end);
14346
14664
  } else if (currentProp.name === "slot") {
@@ -14950,6 +15268,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14950
15268
  } else if (child.type === 12) {
14951
15269
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
14952
15270
  if (constantType >= 2) {
15271
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
15272
+ child.codegenNode.arguments.push(
15273
+ -1 + (``)
15274
+ );
15275
+ }
14953
15276
  toCache.push(child);
14954
15277
  continue;
14955
15278
  }
@@ -14978,7 +15301,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14978
15301
  }
14979
15302
  }
14980
15303
  let cachedAsArray = false;
14981
- const slotCacheKeys = [];
14982
15304
  if (toCache.length === children.length && node.type === 1) {
14983
15305
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14984
15306
  node.codegenNode.children = getCacheExpression(
@@ -14988,7 +15310,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14988
15310
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14989
15311
  const slot = getSlotNode(node.codegenNode, "default");
14990
15312
  if (slot) {
14991
- slotCacheKeys.push(context.cached.length);
14992
15313
  slot.returns = getCacheExpression(
14993
15314
  createArrayExpression(slot.returns)
14994
15315
  );
@@ -14998,7 +15319,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14998
15319
  const slotName = findDir(node, "slot", true);
14999
15320
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
15000
15321
  if (slot) {
15001
- slotCacheKeys.push(context.cached.length);
15002
15322
  slot.returns = getCacheExpression(
15003
15323
  createArrayExpression(slot.returns)
15004
15324
  );
@@ -15008,23 +15328,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
15008
15328
  }
15009
15329
  if (!cachedAsArray) {
15010
15330
  for (const child of toCache) {
15011
- slotCacheKeys.push(context.cached.length);
15012
15331
  child.codegenNode = context.cache(child.codegenNode);
15013
15332
  }
15014
15333
  }
15015
- if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
15016
- node.codegenNode.children.properties.push(
15017
- createObjectProperty(
15018
- `__`,
15019
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
15020
- )
15021
- );
15022
- }
15023
15334
  function getCacheExpression(value) {
15024
15335
  const exp = context.cache(value);
15025
- if (inFor && context.hmr) {
15026
- exp.needArraySpread = true;
15027
- }
15336
+ exp.needArraySpread = true;
15028
15337
  return exp;
15029
15338
  }
15030
15339
  function getSlotNode(node2, name) {
@@ -16444,14 +16753,17 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
16444
16753
  knownIds
16445
16754
  );
16446
16755
  const children = [];
16756
+ const isTSNode = TS_NODE_TYPES.includes(ast.type);
16447
16757
  ids.sort((a, b) => a.start - b.start);
16448
16758
  ids.forEach((id, i) => {
16449
16759
  const start = id.start - 1;
16450
16760
  const end = id.end - 1;
16451
16761
  const last = ids[i - 1];
16452
- const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
16453
- if (leadingText.length || id.prefix) {
16454
- children.push(leadingText + (id.prefix || ``));
16762
+ if (!(isTSNode && i === 0)) {
16763
+ const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
16764
+ if (leadingText.length || id.prefix) {
16765
+ children.push(leadingText + (id.prefix || ``));
16766
+ }
16455
16767
  }
16456
16768
  const source = rawExp.slice(start, end);
16457
16769
  children.push(
@@ -16466,7 +16778,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
16466
16778
  id.isConstant ? 3 : 0
16467
16779
  )
16468
16780
  );
16469
- if (i === ids.length - 1 && end < rawExp.length) {
16781
+ if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
16470
16782
  children.push(rawExp.slice(end));
16471
16783
  }
16472
16784
  });
@@ -16504,7 +16816,7 @@ function isConst(type) {
16504
16816
  }
16505
16817
 
16506
16818
  const transformIf = createStructuralDirectiveTransform(
16507
- /^(if|else|else-if)$/,
16819
+ /^(?:if|else|else-if)$/,
16508
16820
  (node, dir, context) => {
16509
16821
  return processIf(node, dir, context, (ifNode, branch, isRoot) => {
16510
16822
  const siblings = context.parent.children;
@@ -16571,7 +16883,7 @@ function processIf(node, dir, context, processCodegen) {
16571
16883
  continue;
16572
16884
  }
16573
16885
  if (sibling && sibling.type === 9) {
16574
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
16886
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
16575
16887
  context.onError(
16576
16888
  createCompilerError(30, node.loc)
16577
16889
  );
@@ -16713,90 +17025,6 @@ function getParentCondition(node) {
16713
17025
  }
16714
17026
  }
16715
17027
 
16716
- const transformBind = (dir, _node, context) => {
16717
- const { modifiers, loc } = dir;
16718
- const arg = dir.arg;
16719
- let { exp } = dir;
16720
- if (exp && exp.type === 4 && !exp.content.trim()) {
16721
- {
16722
- context.onError(
16723
- createCompilerError(34, loc)
16724
- );
16725
- return {
16726
- props: [
16727
- createObjectProperty(arg, createSimpleExpression("", true, loc))
16728
- ]
16729
- };
16730
- }
16731
- }
16732
- if (!exp) {
16733
- if (arg.type !== 4 || !arg.isStatic) {
16734
- context.onError(
16735
- createCompilerError(
16736
- 52,
16737
- arg.loc
16738
- )
16739
- );
16740
- return {
16741
- props: [
16742
- createObjectProperty(arg, createSimpleExpression("", true, loc))
16743
- ]
16744
- };
16745
- }
16746
- transformBindShorthand(dir, context);
16747
- exp = dir.exp;
16748
- }
16749
- if (arg.type !== 4) {
16750
- arg.children.unshift(`(`);
16751
- arg.children.push(`) || ""`);
16752
- } else if (!arg.isStatic) {
16753
- arg.content = `${arg.content} || ""`;
16754
- }
16755
- if (modifiers.some((mod) => mod.content === "camel")) {
16756
- if (arg.type === 4) {
16757
- if (arg.isStatic) {
16758
- arg.content = camelize(arg.content);
16759
- } else {
16760
- arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
16761
- }
16762
- } else {
16763
- arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
16764
- arg.children.push(`)`);
16765
- }
16766
- }
16767
- if (!context.inSSR) {
16768
- if (modifiers.some((mod) => mod.content === "prop")) {
16769
- injectPrefix(arg, ".");
16770
- }
16771
- if (modifiers.some((mod) => mod.content === "attr")) {
16772
- injectPrefix(arg, "^");
16773
- }
16774
- }
16775
- return {
16776
- props: [createObjectProperty(arg, exp)]
16777
- };
16778
- };
16779
- const transformBindShorthand = (dir, context) => {
16780
- const arg = dir.arg;
16781
- const propName = camelize(arg.content);
16782
- dir.exp = createSimpleExpression(propName, false, arg.loc);
16783
- {
16784
- dir.exp = processExpression(dir.exp, context);
16785
- }
16786
- };
16787
- const injectPrefix = (arg, prefix) => {
16788
- if (arg.type === 4) {
16789
- if (arg.isStatic) {
16790
- arg.content = prefix + arg.content;
16791
- } else {
16792
- arg.content = `\`${prefix}\${${arg.content}}\``;
16793
- }
16794
- } else {
16795
- arg.children.unshift(`'${prefix}' + (`);
16796
- arg.children.push(`)`);
16797
- }
16798
- };
16799
-
16800
17028
  const transformFor = createStructuralDirectiveTransform(
16801
17029
  "for",
16802
17030
  (node, dir, context) => {
@@ -16809,9 +17037,6 @@ const transformFor = createStructuralDirectiveTransform(
16809
17037
  const memo = findDir(node, "memo");
16810
17038
  const keyProp = findProp(node, `key`, false, true);
16811
17039
  const isDirKey = keyProp && keyProp.type === 7;
16812
- if (isDirKey && !keyProp.exp) {
16813
- transformBindShorthand(keyProp, context);
16814
- }
16815
17040
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16816
17041
  if (memo && keyExp && isDirKey) {
16817
17042
  {
@@ -17092,7 +17317,9 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
17092
17317
  const dynamicSlots = [];
17093
17318
  let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
17094
17319
  if (!context.ssr && context.prefixIdentifiers) {
17095
- hasDynamicSlots = hasScopeRef(node, context.identifiers);
17320
+ hasDynamicSlots = node.props.some(
17321
+ (prop) => isVSlot(prop) && (hasScopeRef(prop.arg, context.identifiers) || hasScopeRef(prop.exp, context.identifiers))
17322
+ ) || children.some((child) => hasScopeRef(child, context.identifiers));
17096
17323
  }
17097
17324
  const onComponentSlot = findDir(node, "slot", true);
17098
17325
  if (onComponentSlot) {
@@ -17155,7 +17382,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
17155
17382
  );
17156
17383
  } else if (vElse = findDir(
17157
17384
  slotElement,
17158
- /^else(-if)?$/,
17385
+ /^else(?:-if)?$/,
17159
17386
  true
17160
17387
  /* allowEmpty */
17161
17388
  )) {
@@ -17167,7 +17394,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
17167
17394
  break;
17168
17395
  }
17169
17396
  }
17170
- if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
17397
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {
17171
17398
  let conditional = dynamicSlots[dynamicSlots.length - 1];
17172
17399
  while (conditional.alternate.type === 19) {
17173
17400
  conditional = conditional.alternate;
@@ -18092,6 +18319,65 @@ const transformOn$1 = (dir, node, context, augmentor) => {
18092
18319
  return ret;
18093
18320
  };
18094
18321
 
18322
+ const transformBind = (dir, _node, context) => {
18323
+ const { modifiers, loc } = dir;
18324
+ const arg = dir.arg;
18325
+ let { exp } = dir;
18326
+ if (exp && exp.type === 4 && !exp.content.trim()) {
18327
+ {
18328
+ context.onError(
18329
+ createCompilerError(34, loc)
18330
+ );
18331
+ return {
18332
+ props: [
18333
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
18334
+ ]
18335
+ };
18336
+ }
18337
+ }
18338
+ if (arg.type !== 4) {
18339
+ arg.children.unshift(`(`);
18340
+ arg.children.push(`) || ""`);
18341
+ } else if (!arg.isStatic) {
18342
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
18343
+ }
18344
+ if (modifiers.some((mod) => mod.content === "camel")) {
18345
+ if (arg.type === 4) {
18346
+ if (arg.isStatic) {
18347
+ arg.content = camelize(arg.content);
18348
+ } else {
18349
+ arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
18350
+ }
18351
+ } else {
18352
+ arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
18353
+ arg.children.push(`)`);
18354
+ }
18355
+ }
18356
+ if (!context.inSSR) {
18357
+ if (modifiers.some((mod) => mod.content === "prop")) {
18358
+ injectPrefix(arg, ".");
18359
+ }
18360
+ if (modifiers.some((mod) => mod.content === "attr")) {
18361
+ injectPrefix(arg, "^");
18362
+ }
18363
+ }
18364
+ return {
18365
+ props: [createObjectProperty(arg, exp)]
18366
+ };
18367
+ };
18368
+ const injectPrefix = (arg, prefix) => {
18369
+ if (arg.type === 4) {
18370
+ if (arg.isStatic) {
18371
+ arg.content = prefix + arg.content;
18372
+ } else {
18373
+ arg.content = `\`${prefix}\${${arg.content}}\``;
18374
+ }
18375
+ } else {
18376
+ arg.children.unshift(`'${prefix}' + (`);
18377
+ arg.children.push(`)`);
18378
+ }
18379
+ };
18380
+
18095
18381
  const transformText = (node, context) => {
18096
18382
  if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
18097
18383
  return () => {
@@ -18420,7 +18706,7 @@ const seen = /* @__PURE__ */ new WeakSet();
18420
18706
  const transformMemo = (node, context) => {
18421
18707
  if (node.type === 1) {
18422
18708
  const dir = findDir(node, "memo");
18423
- if (!dir || seen.has(node)) {
18709
+ if (!dir || seen.has(node) || context.inSSR) {
18424
18710
  return;
18425
18711
  }
18426
18712
  seen.add(node);
@@ -18442,9 +18728,36 @@ const transformMemo = (node, context) => {
18442
18728
  }
18443
18729
  };
18444
18730
 
18731
+ const transformVBindShorthand = (node, context) => {
18732
+ if (node.type === 1) {
18733
+ for (const prop of node.props) {
18734
+ if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
18735
+ false) && prop.arg) {
18736
+ const arg = prop.arg;
18737
+ if (arg.type !== 4 || !arg.isStatic) {
18738
+ context.onError(
18739
+ createCompilerError(
18740
+ 52,
18741
+ arg.loc
18742
+ )
18743
+ );
18744
+ prop.exp = createSimpleExpression("", true, arg.loc);
18745
+ } else {
18746
+ const propName = camelize(arg.content);
18747
+ if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
18748
+ propName[0] === "-") {
18749
+ prop.exp = createSimpleExpression(propName, false, arg.loc);
18750
+ }
18751
+ }
18752
+ }
18753
+ }
18754
+ }
18755
+ };
18756
+
18445
18757
  function getBaseTransformPreset(prefixIdentifiers) {
18446
18758
  return [
18447
18759
  [
18760
+ transformVBindShorthand,
18448
18761
  transformOnce,
18449
18762
  transformIf,
18450
18763
  transformMemo,
@@ -18932,7 +19245,7 @@ const getCachedNode = (node) => {
18932
19245
  return node.codegenNode;
18933
19246
  }
18934
19247
  };
18935
- const dataAriaRE = /^(data|aria)-/;
19248
+ const dataAriaRE = /^(?:data|aria)-/;
18936
19249
  const isStringifiableAttr = (name, ns) => {
18937
19250
  return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : ns === 2 ? isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
18938
19251
  };
@@ -18943,6 +19256,9 @@ function analyzeNode(node) {
18943
19256
  if (node.type === 1 && isNonStringifiable(node.tag)) {
18944
19257
  return false;
18945
19258
  }
19259
+ if (node.type === 1 && findDir(node, "once", true)) {
19260
+ return false;
19261
+ }
18946
19262
  if (node.type === 12) {
18947
19263
  return [1, 0];
18948
19264
  }