@vue/compat 3.5.17 → 3.5.19

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.17
2
+ * @vue/compat v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -63,10 +63,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
63
63
  );
64
64
  const cacheStringFunction = (fn) => {
65
65
  const cache = /* @__PURE__ */ Object.create(null);
66
- return (str) => {
66
+ return ((str) => {
67
67
  const hit = cache[str];
68
68
  return hit || (cache[str] = fn(str));
69
- };
69
+ });
70
70
  };
71
71
  const camelizeRE = /-(\w)/g;
72
72
  const camelize = cacheStringFunction(
@@ -437,6 +437,24 @@ const stringifySymbol = (v, i = "") => {
437
437
  );
438
438
  };
439
439
 
440
+ function normalizeCssVarValue(value) {
441
+ if (value == null) {
442
+ return "initial";
443
+ }
444
+ if (typeof value === "string") {
445
+ return value === "" ? " " : value;
446
+ }
447
+ if (typeof value !== "number" || !Number.isFinite(value)) {
448
+ {
449
+ console.warn(
450
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
451
+ value
452
+ );
453
+ }
454
+ }
455
+ return String(value);
456
+ }
457
+
440
458
  function warn$2(msg, ...args) {
441
459
  console.warn(`[Vue warn] ${msg}`, ...args);
442
460
  }
@@ -1400,7 +1418,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1400
1418
  }
1401
1419
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1402
1420
  if (isOldValueReadonly) {
1403
- return false;
1421
+ {
1422
+ warn$2(
1423
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1424
+ target[key]
1425
+ );
1426
+ }
1427
+ return true;
1404
1428
  } else {
1405
1429
  oldValue.value = value;
1406
1430
  return true;
@@ -2767,7 +2791,9 @@ function rerender(id, newRender) {
2767
2791
  }
2768
2792
  instance.renderCache = [];
2769
2793
  isHmrUpdating = true;
2770
- instance.update();
2794
+ if (!(instance.job.flags & 8)) {
2795
+ instance.update();
2796
+ }
2771
2797
  isHmrUpdating = false;
2772
2798
  });
2773
2799
  }
@@ -4359,7 +4385,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4359
4385
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
4360
4386
  const setupState = owner.setupState;
4361
4387
  const rawSetupState = toRaw(setupState);
4362
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4388
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
4363
4389
  {
4364
4390
  if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4365
4391
  warn$1(
@@ -4372,6 +4398,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4372
4398
  }
4373
4399
  return hasOwn(rawSetupState, key);
4374
4400
  };
4401
+ const canSetRef = (ref2) => {
4402
+ return !knownTemplateRefs.has(ref2);
4403
+ };
4375
4404
  if (oldRef != null && oldRef !== ref) {
4376
4405
  if (isString(oldRef)) {
4377
4406
  refs[oldRef] = null;
@@ -4379,7 +4408,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4379
4408
  setupState[oldRef] = null;
4380
4409
  }
4381
4410
  } else if (isRef(oldRef)) {
4382
- oldRef.value = null;
4411
+ if (canSetRef(oldRef)) {
4412
+ oldRef.value = null;
4413
+ }
4414
+ const oldRawRefAtom = oldRawRef;
4415
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
4383
4416
  }
4384
4417
  }
4385
4418
  if (isFunction(ref)) {
@@ -4390,7 +4423,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4390
4423
  if (_isString || _isRef) {
4391
4424
  const doSet = () => {
4392
4425
  if (rawRef.f) {
4393
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
4426
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
4394
4427
  if (isUnmount) {
4395
4428
  isArray(existing) && remove(existing, refValue);
4396
4429
  } else {
@@ -4401,8 +4434,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4401
4434
  setupState[ref] = refs[ref];
4402
4435
  }
4403
4436
  } else {
4404
- ref.value = [refValue];
4405
- if (rawRef.k) refs[rawRef.k] = ref.value;
4437
+ const newVal = [refValue];
4438
+ if (canSetRef(ref)) {
4439
+ ref.value = newVal;
4440
+ }
4441
+ if (rawRef.k) refs[rawRef.k] = newVal;
4406
4442
  }
4407
4443
  } else if (!existing.includes(refValue)) {
4408
4444
  existing.push(refValue);
@@ -4414,7 +4450,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4414
4450
  setupState[ref] = value;
4415
4451
  }
4416
4452
  } else if (_isRef) {
4417
- ref.value = value;
4453
+ if (canSetRef(ref)) {
4454
+ ref.value = value;
4455
+ }
4418
4456
  if (rawRef.k) refs[rawRef.k] = value;
4419
4457
  } else {
4420
4458
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -5035,10 +5073,8 @@ function resolveCssVars(instance, vnode, expectedMap) {
5035
5073
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5036
5074
  const cssVars = instance.getCssVars();
5037
5075
  for (const key in cssVars) {
5038
- expectedMap.set(
5039
- `--${getEscapedCssVarName(key)}`,
5040
- String(cssVars[key])
5041
- );
5076
+ const value = normalizeCssVarValue(cssVars[key]);
5077
+ expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
5042
5078
  }
5043
5079
  }
5044
5080
  if (vnode === root && instance.parent) {
@@ -5227,16 +5263,19 @@ function defineAsyncComponent(source) {
5227
5263
  __asyncLoader: load,
5228
5264
  __asyncHydrate(el, instance, hydrate) {
5229
5265
  let patched = false;
5230
- const doHydrate = hydrateStrategy ? () => {
5231
- const performHydrate = () => {
5232
- if (patched) {
5266
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
5267
+ const performHydrate = () => {
5268
+ if (patched) {
5269
+ {
5233
5270
  warn$1(
5234
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
5271
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
5235
5272
  );
5236
- return;
5237
5273
  }
5238
- hydrate();
5239
- };
5274
+ return;
5275
+ }
5276
+ hydrate();
5277
+ };
5278
+ const doHydrate = hydrateStrategy ? () => {
5240
5279
  const teardown = hydrateStrategy(
5241
5280
  performHydrate,
5242
5281
  (cb) => forEachElement(el, cb)
@@ -5244,8 +5283,7 @@ function defineAsyncComponent(source) {
5244
5283
  if (teardown) {
5245
5284
  (instance.bum || (instance.bum = [])).push(teardown);
5246
5285
  }
5247
- (instance.u || (instance.u = [])).push(() => patched = true);
5248
- } : hydrate;
5286
+ } : performHydrate;
5249
5287
  if (resolvedComp) {
5250
5288
  doHydrate();
5251
5289
  } else {
@@ -6509,10 +6547,10 @@ const PublicInstanceProxyHandlers = {
6509
6547
  return true;
6510
6548
  },
6511
6549
  has({
6512
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
6550
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
6513
6551
  }, key) {
6514
- let normalizedProps;
6515
- 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);
6552
+ let normalizedProps, cssModules;
6553
+ 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]);
6516
6554
  },
6517
6555
  defineProperty(target, key, descriptor) {
6518
6556
  if (descriptor.get != null) {
@@ -6664,15 +6702,15 @@ function withDefaults(props, defaults) {
6664
6702
  return null;
6665
6703
  }
6666
6704
  function useSlots() {
6667
- return getContext().slots;
6705
+ return getContext("useSlots").slots;
6668
6706
  }
6669
6707
  function useAttrs() {
6670
- return getContext().attrs;
6708
+ return getContext("useAttrs").attrs;
6671
6709
  }
6672
- function getContext() {
6710
+ function getContext(calledFunctionName) {
6673
6711
  const i = getCurrentInstance();
6674
6712
  if (!i) {
6675
- warn$1(`useContext() called without active instance.`);
6713
+ warn$1(`${calledFunctionName}() called without active instance.`);
6676
6714
  }
6677
6715
  return i.setupContext || (i.setupContext = createSetupContext(i));
6678
6716
  }
@@ -6931,7 +6969,8 @@ function applyOptions(instance) {
6931
6969
  expose.forEach((key) => {
6932
6970
  Object.defineProperty(exposed, key, {
6933
6971
  get: () => publicThis[key],
6934
- set: (val) => publicThis[key] = val
6972
+ set: (val) => publicThis[key] = val,
6973
+ enumerable: true
6935
6974
  });
6936
6975
  });
6937
6976
  } else if (!instance.exposed) {
@@ -7256,7 +7295,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7256
7295
  return vm;
7257
7296
  }
7258
7297
  }
7259
- Vue.version = `2.6.14-compat:${"3.5.17"}`;
7298
+ Vue.version = `2.6.14-compat:${"3.5.19"}`;
7260
7299
  Vue.config = singletonApp.config;
7261
7300
  Vue.use = (plugin, ...options) => {
7262
7301
  if (plugin && isFunction(plugin.install)) {
@@ -7270,22 +7309,22 @@ function createCompatVue$1(createApp, createSingletonApp) {
7270
7309
  singletonApp.mixin(m);
7271
7310
  return Vue;
7272
7311
  };
7273
- Vue.component = (name, comp) => {
7312
+ Vue.component = ((name, comp) => {
7274
7313
  if (comp) {
7275
7314
  singletonApp.component(name, comp);
7276
7315
  return Vue;
7277
7316
  } else {
7278
7317
  return singletonApp.component(name);
7279
7318
  }
7280
- };
7281
- Vue.directive = (name, dir) => {
7319
+ });
7320
+ Vue.directive = ((name, dir) => {
7282
7321
  if (dir) {
7283
7322
  singletonApp.directive(name, dir);
7284
7323
  return Vue;
7285
7324
  } else {
7286
7325
  return singletonApp.directive(name);
7287
7326
  }
7288
- };
7327
+ });
7289
7328
  Vue.options = { _base: Vue };
7290
7329
  let cid = 1;
7291
7330
  Vue.cid = cid;
@@ -7348,14 +7387,14 @@ function createCompatVue$1(createApp, createSingletonApp) {
7348
7387
  assertCompatEnabled("GLOBAL_OBSERVABLE", null);
7349
7388
  return reactive(target);
7350
7389
  };
7351
- Vue.filter = (name, filter) => {
7390
+ Vue.filter = ((name, filter) => {
7352
7391
  if (filter) {
7353
7392
  singletonApp.filter(name, filter);
7354
7393
  return Vue;
7355
7394
  } else {
7356
7395
  return singletonApp.filter(name);
7357
7396
  }
7358
- };
7397
+ });
7359
7398
  const util = {
7360
7399
  warn: warn$1 ,
7361
7400
  extend,
@@ -7848,7 +7887,7 @@ function provide(key, value) {
7848
7887
  }
7849
7888
  }
7850
7889
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
7851
- const instance = currentInstance || currentRenderingInstance;
7890
+ const instance = getCurrentInstance();
7852
7891
  if (instance || currentApp) {
7853
7892
  let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7854
7893
  if (provides && key in provides) {
@@ -7863,7 +7902,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
7863
7902
  }
7864
7903
  }
7865
7904
  function hasInjectionContext() {
7866
- return !!(currentInstance || currentRenderingInstance || currentApp);
7905
+ return !!(getCurrentInstance() || currentApp);
7867
7906
  }
7868
7907
 
7869
7908
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -8349,7 +8388,7 @@ function isBoolean(...args) {
8349
8388
  return args.some((elem) => elem.toLowerCase() === "boolean");
8350
8389
  }
8351
8390
 
8352
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
8391
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
8353
8392
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
8354
8393
  const normalizeSlot = (key, rawSlot, ctx) => {
8355
8394
  if (rawSlot._n) {
@@ -8403,8 +8442,6 @@ const assignSlots = (slots, children, optimized) => {
8403
8442
  const initSlots = (instance, children, optimized) => {
8404
8443
  const slots = instance.slots = createInternalObject();
8405
8444
  if (instance.vnode.shapeFlag & 32) {
8406
- const cacheIndexes = children.__;
8407
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
8408
8445
  const type = children._;
8409
8446
  if (type) {
8410
8447
  assignSlots(slots, children, optimized);
@@ -8465,12 +8502,10 @@ function endMeasure(instance, type) {
8465
8502
  if (instance.appContext.config.performance && isSupported()) {
8466
8503
  const startTag = `vue-${type}-${instance.uid}`;
8467
8504
  const endTag = startTag + `:end`;
8505
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
8468
8506
  perf.mark(endTag);
8469
- perf.measure(
8470
- `<${formatComponentName(instance, instance.type)}> ${type}`,
8471
- startTag,
8472
- endTag
8473
- );
8507
+ perf.measure(measureName, startTag, endTag);
8508
+ perf.clearMeasures(measureName);
8474
8509
  perf.clearMarks(startTag);
8475
8510
  perf.clearMarks(endTag);
8476
8511
  }
@@ -9092,6 +9127,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9092
9127
  if (!initialVNode.el) {
9093
9128
  const placeholder = instance.subTree = createVNode(Comment);
9094
9129
  processCommentNode(null, placeholder, container, anchor);
9130
+ initialVNode.placeholder = placeholder.el;
9095
9131
  }
9096
9132
  } else {
9097
9133
  setupRenderEffect(
@@ -9617,7 +9653,11 @@ function baseCreateRenderer(options, createHydrationFns) {
9617
9653
  for (i = toBePatched - 1; i >= 0; i--) {
9618
9654
  const nextIndex = s2 + i;
9619
9655
  const nextChild = c2[nextIndex];
9620
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
9656
+ const anchorVNode = c2[nextIndex + 1];
9657
+ const anchor = nextIndex + 1 < l2 ? (
9658
+ // #13559, fallback to el placeholder for unresolved async component
9659
+ anchorVNode.el || anchorVNode.placeholder
9660
+ ) : parentAnchor;
9621
9661
  if (newIndexToOldIndexMap[i] === 0) {
9622
9662
  patch(
9623
9663
  null,
@@ -9682,6 +9722,12 @@ function baseCreateRenderer(options, createHydrationFns) {
9682
9722
  }
9683
9723
  };
9684
9724
  const performLeave = () => {
9725
+ if (el._isLeaving) {
9726
+ el[leaveCbKey](
9727
+ true
9728
+ /* cancelled */
9729
+ );
9730
+ }
9685
9731
  leave(el, () => {
9686
9732
  remove2();
9687
9733
  afterLeave && afterLeave();
@@ -9827,27 +9873,12 @@ function baseCreateRenderer(options, createHydrationFns) {
9827
9873
  if (instance.type.__hmrId) {
9828
9874
  unregisterHMR(instance);
9829
9875
  }
9830
- const {
9831
- bum,
9832
- scope,
9833
- job,
9834
- subTree,
9835
- um,
9836
- m,
9837
- a,
9838
- parent,
9839
- slots: { __: slotCacheKeys }
9840
- } = instance;
9876
+ const { bum, scope, job, subTree, um, m, a } = instance;
9841
9877
  invalidateMount(m);
9842
9878
  invalidateMount(a);
9843
9879
  if (bum) {
9844
9880
  invokeArrayFns(bum);
9845
9881
  }
9846
- if (parent && isArray(slotCacheKeys)) {
9847
- slotCacheKeys.forEach((v) => {
9848
- parent.renderCache[v] = void 0;
9849
- });
9850
- }
9851
9882
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
9852
9883
  instance.emit("hook:beforeDestroy");
9853
9884
  }
@@ -9868,12 +9899,6 @@ function baseCreateRenderer(options, createHydrationFns) {
9868
9899
  queuePostRenderEffect(() => {
9869
9900
  instance.isUnmounted = true;
9870
9901
  }, parentSuspense);
9871
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
9872
- parentSuspense.deps--;
9873
- if (parentSuspense.deps === 0) {
9874
- parentSuspense.resolve();
9875
- }
9876
- }
9877
9902
  {
9878
9903
  devtoolsComponentRemoved(instance);
9879
9904
  }
@@ -9974,7 +9999,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9974
9999
  if (!shallow && c2.patchFlag !== -2)
9975
10000
  traverseStaticChildren(c1, c2);
9976
10001
  }
9977
- if (c2.type === Text) {
10002
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
10003
+ c2.patchFlag !== -1) {
9978
10004
  c2.el = c1.el;
9979
10005
  }
9980
10006
  if (c2.type === Comment && !c2.el) {
@@ -11612,6 +11638,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
11612
11638
  suspense: vnode.suspense,
11613
11639
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
11614
11640
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
11641
+ placeholder: vnode.placeholder,
11615
11642
  el: vnode.el,
11616
11643
  anchor: vnode.anchor,
11617
11644
  ctx: vnode.ctx,
@@ -12418,7 +12445,7 @@ function isMemoSame(cached, memo) {
12418
12445
  return true;
12419
12446
  }
12420
12447
 
12421
- const version = "3.5.17";
12448
+ const version = "3.5.19";
12422
12449
  const warn = warn$1 ;
12423
12450
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12424
12451
  const devtools = devtools$1 ;
@@ -13295,10 +13322,10 @@ function defineCustomElement(options, extraOptions, _createApp) {
13295
13322
  VueCustomElement.def = Comp;
13296
13323
  return VueCustomElement;
13297
13324
  }
13298
- /*! #__NO_SIDE_EFFECTS__ */
13299
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13325
+
13326
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13300
13327
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13301
- };
13328
+ });
13302
13329
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
13303
13330
  };
13304
13331
  class VueElement extends BaseClass {
@@ -14168,13 +14195,13 @@ const modifierGuards = {
14168
14195
  const withModifiers = (fn, modifiers) => {
14169
14196
  const cache = fn._withMods || (fn._withMods = {});
14170
14197
  const cacheKey = modifiers.join(".");
14171
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
14198
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
14172
14199
  for (let i = 0; i < modifiers.length; i++) {
14173
14200
  const guard = modifierGuards[modifiers[i]];
14174
14201
  if (guard && guard(event, modifiers)) return;
14175
14202
  }
14176
14203
  return fn(event, ...args);
14177
- });
14204
+ }));
14178
14205
  };
14179
14206
  const keyNames = {
14180
14207
  esc: "escape",
@@ -14204,7 +14231,7 @@ const withKeys = (fn, modifiers) => {
14204
14231
  }
14205
14232
  const cache = fn._withKeys || (fn._withKeys = {});
14206
14233
  const cacheKey = modifiers.join(".");
14207
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
14234
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
14208
14235
  if (!("key" in event)) {
14209
14236
  return;
14210
14237
  }
@@ -14234,7 +14261,7 @@ const withKeys = (fn, modifiers) => {
14234
14261
  }
14235
14262
  }
14236
14263
  }
14237
- });
14264
+ }));
14238
14265
  };
14239
14266
 
14240
14267
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -14248,13 +14275,13 @@ function ensureHydrationRenderer() {
14248
14275
  enabledHydration = true;
14249
14276
  return renderer;
14250
14277
  }
14251
- const render = (...args) => {
14278
+ const render = ((...args) => {
14252
14279
  ensureRenderer().render(...args);
14253
- };
14254
- const hydrate = (...args) => {
14280
+ });
14281
+ const hydrate = ((...args) => {
14255
14282
  ensureHydrationRenderer().hydrate(...args);
14256
- };
14257
- const createApp = (...args) => {
14283
+ });
14284
+ const createApp = ((...args) => {
14258
14285
  const app = ensureRenderer().createApp(...args);
14259
14286
  {
14260
14287
  injectNativeTagCheck(app);
@@ -14291,8 +14318,8 @@ const createApp = (...args) => {
14291
14318
  return proxy;
14292
14319
  };
14293
14320
  return app;
14294
- };
14295
- const createSSRApp = (...args) => {
14321
+ });
14322
+ const createSSRApp = ((...args) => {
14296
14323
  const app = ensureHydrationRenderer().createApp(...args);
14297
14324
  {
14298
14325
  injectNativeTagCheck(app);
@@ -14306,7 +14333,7 @@ const createSSRApp = (...args) => {
14306
14333
  }
14307
14334
  };
14308
14335
  return app;
14309
- };
14336
+ });
14310
14337
  function resolveRootNamespace(container) {
14311
14338
  if (container instanceof SVGElement) {
14312
14339
  return "svg";
@@ -15909,14 +15936,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
15909
15936
  if (id.name === "arguments") {
15910
15937
  return false;
15911
15938
  }
15912
- if (isReferenced(id, parent)) {
15939
+ if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {
15913
15940
  return true;
15914
15941
  }
15915
15942
  switch (parent.type) {
15916
15943
  case "AssignmentExpression":
15917
15944
  case "AssignmentPattern":
15918
15945
  return true;
15919
- case "ObjectPattern":
15946
+ case "ObjectProperty":
15947
+ return parent.key !== id && isInDestructureAssignment(parent, parentStack);
15920
15948
  case "ArrayPattern":
15921
15949
  return isInDestructureAssignment(parent, parentStack);
15922
15950
  }
@@ -16085,7 +16113,7 @@ function isReferenced(node, parent, grandparent) {
16085
16113
  if (parent.key === node) {
16086
16114
  return !!parent.computed;
16087
16115
  }
16088
- return true;
16116
+ return !grandparent || grandparent.type !== "ObjectPattern";
16089
16117
  // no: class { NODE = value; }
16090
16118
  // yes: class { [NODE] = value; }
16091
16119
  // yes: class { key = NODE; }
@@ -16135,6 +16163,9 @@ function isReferenced(node, parent, grandparent) {
16135
16163
  // yes: export { NODE as foo };
16136
16164
  // no: export { NODE as foo } from "foo";
16137
16165
  case "ExportSpecifier":
16166
+ if (grandparent == null ? void 0 : grandparent.source) {
16167
+ return false;
16168
+ }
16138
16169
  return parent.local === node;
16139
16170
  // no: import NODE from "foo";
16140
16171
  // no: import * as NODE from "foo";
@@ -16215,7 +16246,7 @@ function isCoreComponent(tag) {
16215
16246
  return BASE_TRANSITION;
16216
16247
  }
16217
16248
  }
16218
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
16249
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
16219
16250
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
16220
16251
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
16221
16252
  const isMemberExpressionNode = (exp, context) => {
@@ -16313,6 +16344,9 @@ function hasDynamicKeyVBind(node) {
16313
16344
  function isText$1(node) {
16314
16345
  return node.type === 5 || node.type === 2;
16315
16346
  }
16347
+ function isVPre(p) {
16348
+ return p.type === 7 && p.name === "pre";
16349
+ }
16316
16350
  function isVSlot(p) {
16317
16351
  return p.type === 7 && p.name === "slot";
16318
16352
  }
@@ -16611,7 +16645,7 @@ const tokenizer = new Tokenizer(stack, {
16611
16645
  ondirarg(start, end) {
16612
16646
  if (start === end) return;
16613
16647
  const arg = getSlice(start, end);
16614
- if (inVPre) {
16648
+ if (inVPre && !isVPre(currentProp)) {
16615
16649
  currentProp.name += arg;
16616
16650
  setLocEnd(currentProp.nameLoc, end);
16617
16651
  } else {
@@ -16626,7 +16660,7 @@ const tokenizer = new Tokenizer(stack, {
16626
16660
  },
16627
16661
  ondirmodifier(start, end) {
16628
16662
  const mod = getSlice(start, end);
16629
- if (inVPre) {
16663
+ if (inVPre && !isVPre(currentProp)) {
16630
16664
  currentProp.name += "." + mod;
16631
16665
  setLocEnd(currentProp.nameLoc, end);
16632
16666
  } else if (currentProp.name === "slot") {
@@ -17273,6 +17307,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
17273
17307
  } else if (child.type === 12) {
17274
17308
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
17275
17309
  if (constantType >= 2) {
17310
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
17311
+ child.codegenNode.arguments.push(
17312
+ -1 + (` /* ${PatchFlagNames[-1]} */` )
17313
+ );
17314
+ }
17276
17315
  toCache.push(child);
17277
17316
  continue;
17278
17317
  }
@@ -17301,7 +17340,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
17301
17340
  }
17302
17341
  }
17303
17342
  let cachedAsArray = false;
17304
- const slotCacheKeys = [];
17305
17343
  if (toCache.length === children.length && node.type === 1) {
17306
17344
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
17307
17345
  node.codegenNode.children = getCacheExpression(
@@ -17311,7 +17349,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
17311
17349
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
17312
17350
  const slot = getSlotNode(node.codegenNode, "default");
17313
17351
  if (slot) {
17314
- slotCacheKeys.push(context.cached.length);
17315
17352
  slot.returns = getCacheExpression(
17316
17353
  createArrayExpression(slot.returns)
17317
17354
  );
@@ -17321,7 +17358,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
17321
17358
  const slotName = findDir(node, "slot", true);
17322
17359
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
17323
17360
  if (slot) {
17324
- slotCacheKeys.push(context.cached.length);
17325
17361
  slot.returns = getCacheExpression(
17326
17362
  createArrayExpression(slot.returns)
17327
17363
  );
@@ -17331,23 +17367,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
17331
17367
  }
17332
17368
  if (!cachedAsArray) {
17333
17369
  for (const child of toCache) {
17334
- slotCacheKeys.push(context.cached.length);
17335
17370
  child.codegenNode = context.cache(child.codegenNode);
17336
17371
  }
17337
17372
  }
17338
- 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) {
17339
- node.codegenNode.children.properties.push(
17340
- createObjectProperty(
17341
- `__`,
17342
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
17343
- )
17344
- );
17345
- }
17346
17373
  function getCacheExpression(value) {
17347
17374
  const exp = context.cache(value);
17348
- if (inFor && context.hmr) {
17349
- exp.needArraySpread = true;
17350
- }
17375
+ exp.needArraySpread = true;
17351
17376
  return exp;
17352
17377
  }
17353
17378
  function getSlotNode(node2, name) {
@@ -18927,7 +18952,7 @@ function processIf(node, dir, context, processCodegen) {
18927
18952
  continue;
18928
18953
  }
18929
18954
  if (sibling && sibling.type === 9) {
18930
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
18955
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
18931
18956
  context.onError(
18932
18957
  createCompilerError(30, node.loc)
18933
18958
  );
@@ -19113,7 +19138,7 @@ const transformBind = (dir, _node, context) => {
19113
19138
  arg.children.unshift(`(`);
19114
19139
  arg.children.push(`) || ""`);
19115
19140
  } else if (!arg.isStatic) {
19116
- arg.content = `${arg.content} || ""`;
19141
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
19117
19142
  }
19118
19143
  if (modifiers.some((mod) => mod.content === "camel")) {
19119
19144
  if (arg.type === 4) {
@@ -20821,7 +20846,7 @@ const seen = /* @__PURE__ */ new WeakSet();
20821
20846
  const transformMemo = (node, context) => {
20822
20847
  if (node.type === 1) {
20823
20848
  const dir = findDir(node, "memo");
20824
- if (!dir || seen.has(node)) {
20849
+ if (!dir || seen.has(node) || context.inSSR) {
20825
20850
  return;
20826
20851
  }
20827
20852
  seen.add(node);