@vue/compat 3.3.0-alpha.3 → 3.3.0-alpha.5

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.
@@ -13,22 +13,99 @@ function makeMap(str, expectsLowerCase) {
13
13
  return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
14
14
  }
15
15
 
16
- const PatchFlagNames = {
17
- [1]: `TEXT`,
18
- [2]: `CLASS`,
19
- [4]: `STYLE`,
20
- [8]: `PROPS`,
21
- [16]: `FULL_PROPS`,
22
- [32]: `HYDRATE_EVENTS`,
23
- [64]: `STABLE_FRAGMENT`,
24
- [128]: `KEYED_FRAGMENT`,
25
- [256]: `UNKEYED_FRAGMENT`,
26
- [512]: `NEED_PATCH`,
27
- [1024]: `DYNAMIC_SLOTS`,
28
- [2048]: `DEV_ROOT_FRAGMENT`,
29
- [-1]: `HOISTED`,
30
- [-2]: `BAIL`
16
+ const EMPTY_OBJ = {};
17
+ const EMPTY_ARR = [];
18
+ const NOOP = () => {
19
+ };
20
+ const NO = () => false;
21
+ const onRE = /^on[^a-z]/;
22
+ const isOn = (key) => onRE.test(key);
23
+ const isModelListener = (key) => key.startsWith("onUpdate:");
24
+ const extend = Object.assign;
25
+ const remove = (arr, el) => {
26
+ const i = arr.indexOf(el);
27
+ if (i > -1) {
28
+ arr.splice(i, 1);
29
+ }
30
+ };
31
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
32
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
33
+ const isArray = Array.isArray;
34
+ const isMap = (val) => toTypeString(val) === "[object Map]";
35
+ const isSet = (val) => toTypeString(val) === "[object Set]";
36
+ const isDate = (val) => toTypeString(val) === "[object Date]";
37
+ const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
38
+ const isFunction = (val) => typeof val === "function";
39
+ const isString = (val) => typeof val === "string";
40
+ const isSymbol = (val) => typeof val === "symbol";
41
+ const isObject = (val) => val !== null && typeof val === "object";
42
+ const isPromise = (val) => {
43
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
31
44
  };
45
+ const objectToString = Object.prototype.toString;
46
+ const toTypeString = (value) => objectToString.call(value);
47
+ const toRawType = (value) => {
48
+ return toTypeString(value).slice(8, -1);
49
+ };
50
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
51
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
52
+ const isReservedProp = /* @__PURE__ */ makeMap(
53
+ // the leading comma is intentional so empty string "" is also included
54
+ ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
55
+ );
56
+ const isBuiltInDirective = /* @__PURE__ */ makeMap(
57
+ "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
58
+ );
59
+ const cacheStringFunction = (fn) => {
60
+ const cache = /* @__PURE__ */ Object.create(null);
61
+ return (str) => {
62
+ const hit = cache[str];
63
+ return hit || (cache[str] = fn(str));
64
+ };
65
+ };
66
+ const camelizeRE = /-(\w)/g;
67
+ const camelize = cacheStringFunction((str) => {
68
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
69
+ });
70
+ const hyphenateRE = /\B([A-Z])/g;
71
+ const hyphenate = cacheStringFunction(
72
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
73
+ );
74
+ const capitalize = cacheStringFunction(
75
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
76
+ );
77
+ const toHandlerKey = cacheStringFunction(
78
+ (str) => str ? `on${capitalize(str)}` : ``
79
+ );
80
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
81
+ const invokeArrayFns = (fns, arg) => {
82
+ for (let i = 0; i < fns.length; i++) {
83
+ fns[i](arg);
84
+ }
85
+ };
86
+ const def = (obj, key, value) => {
87
+ Object.defineProperty(obj, key, {
88
+ configurable: true,
89
+ enumerable: false,
90
+ value
91
+ });
92
+ };
93
+ const looseToNumber = (val) => {
94
+ const n = parseFloat(val);
95
+ return isNaN(n) ? val : n;
96
+ };
97
+ const toNumber = (val) => {
98
+ const n = isString(val) ? Number(val) : NaN;
99
+ return isNaN(n) ? val : n;
100
+ };
101
+ let _globalThis;
102
+ const getGlobalThis = () => {
103
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
104
+ };
105
+ const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
106
+ function genPropsAccessExp(name) {
107
+ return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
108
+ }
32
109
 
33
110
  const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
34
111
  const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
@@ -249,100 +326,6 @@ const replacer = (_key, val) => {
249
326
  return val;
250
327
  };
251
328
 
252
- const EMPTY_OBJ = {};
253
- const EMPTY_ARR = [];
254
- const NOOP = () => {
255
- };
256
- const NO = () => false;
257
- const onRE = /^on[^a-z]/;
258
- const isOn = (key) => onRE.test(key);
259
- const isModelListener = (key) => key.startsWith("onUpdate:");
260
- const extend = Object.assign;
261
- const remove = (arr, el) => {
262
- const i = arr.indexOf(el);
263
- if (i > -1) {
264
- arr.splice(i, 1);
265
- }
266
- };
267
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
268
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
269
- const isArray = Array.isArray;
270
- const isMap = (val) => toTypeString(val) === "[object Map]";
271
- const isSet = (val) => toTypeString(val) === "[object Set]";
272
- const isDate = (val) => toTypeString(val) === "[object Date]";
273
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
274
- const isFunction = (val) => typeof val === "function";
275
- const isString = (val) => typeof val === "string";
276
- const isSymbol = (val) => typeof val === "symbol";
277
- const isObject = (val) => val !== null && typeof val === "object";
278
- const isPromise = (val) => {
279
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
280
- };
281
- const objectToString = Object.prototype.toString;
282
- const toTypeString = (value) => objectToString.call(value);
283
- const toRawType = (value) => {
284
- return toTypeString(value).slice(8, -1);
285
- };
286
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
287
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
288
- const isReservedProp = /* @__PURE__ */ makeMap(
289
- // the leading comma is intentional so empty string "" is also included
290
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
291
- );
292
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
293
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
294
- );
295
- const cacheStringFunction = (fn) => {
296
- const cache = /* @__PURE__ */ Object.create(null);
297
- return (str) => {
298
- const hit = cache[str];
299
- return hit || (cache[str] = fn(str));
300
- };
301
- };
302
- const camelizeRE = /-(\w)/g;
303
- const camelize = cacheStringFunction((str) => {
304
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
305
- });
306
- const hyphenateRE = /\B([A-Z])/g;
307
- const hyphenate = cacheStringFunction(
308
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
309
- );
310
- const capitalize = cacheStringFunction(
311
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
312
- );
313
- const toHandlerKey = cacheStringFunction(
314
- (str) => str ? `on${capitalize(str)}` : ``
315
- );
316
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
317
- const invokeArrayFns = (fns, arg) => {
318
- for (let i = 0; i < fns.length; i++) {
319
- fns[i](arg);
320
- }
321
- };
322
- const def = (obj, key, value) => {
323
- Object.defineProperty(obj, key, {
324
- configurable: true,
325
- enumerable: false,
326
- value
327
- });
328
- };
329
- const looseToNumber = (val) => {
330
- const n = parseFloat(val);
331
- return isNaN(n) ? val : n;
332
- };
333
- const toNumber = (val) => {
334
- const n = isString(val) ? Number(val) : NaN;
335
- return isNaN(n) ? val : n;
336
- };
337
- let _globalThis;
338
- const getGlobalThis = () => {
339
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
340
- };
341
- const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
342
- function genPropsAccessExp(name) {
343
- return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
344
- }
345
-
346
329
  let activeEffectScope;
347
330
  class EffectScope {
348
331
  constructor(detached = false) {
@@ -1451,7 +1434,7 @@ function handleError(err, instance, type, throwInDev = true) {
1451
1434
  callWithErrorHandling(
1452
1435
  appErrorHandler,
1453
1436
  null,
1454
- "10",
1437
+ 10,
1455
1438
  [err, exposedInstance, errorInfo]
1456
1439
  );
1457
1440
  return;
@@ -1573,7 +1556,7 @@ function flushJobs(seen) {
1573
1556
  const job = queue[flushIndex];
1574
1557
  if (job && job.active !== false) {
1575
1558
  if (false) ;
1576
- callWithErrorHandling(job, null, "14");
1559
+ callWithErrorHandling(job, null, 14);
1577
1560
  }
1578
1561
  }
1579
1562
  } finally {
@@ -1728,7 +1711,7 @@ function emit$1(instance, event, args) {
1728
1711
  callWithAsyncErrorHandling(
1729
1712
  cbs.map((cb) => cb.bind(instance.proxy)),
1730
1713
  instance,
1731
- "6",
1714
+ 6,
1732
1715
  args
1733
1716
  );
1734
1717
  }
@@ -1783,7 +1766,7 @@ function compatModelEmit(instance, event, args) {
1783
1766
  callWithErrorHandling(
1784
1767
  modelHandler,
1785
1768
  instance,
1786
- "6",
1769
+ 6,
1787
1770
  args
1788
1771
  );
1789
1772
  }
@@ -1816,7 +1799,7 @@ function emit(instance, event, ...rawArgs) {
1816
1799
  callWithAsyncErrorHandling(
1817
1800
  handler,
1818
1801
  instance,
1819
- "6",
1802
+ 6,
1820
1803
  args
1821
1804
  );
1822
1805
  }
@@ -1831,7 +1814,7 @@ function emit(instance, event, ...rawArgs) {
1831
1814
  callWithAsyncErrorHandling(
1832
1815
  onceHandler,
1833
1816
  instance,
1834
- "6",
1817
+ 6,
1835
1818
  args
1836
1819
  );
1837
1820
  }
@@ -2005,7 +1988,7 @@ function renderComponentRoot(instance) {
2005
1988
  }
2006
1989
  } catch (err) {
2007
1990
  blockStack.length = 0;
2008
- handleError(err, instance, "1");
1991
+ handleError(err, instance, 1);
2009
1992
  result = createVNode(Comment);
2010
1993
  }
2011
1994
  let root = result;
@@ -2436,7 +2419,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2436
2419
  if (delayEnter) {
2437
2420
  activeBranch.transition.afterLeave = () => {
2438
2421
  if (pendingId === suspense.pendingId) {
2439
- move(pendingBranch, container2, anchor2, "0");
2422
+ move(pendingBranch, container2, anchor2, 0);
2440
2423
  }
2441
2424
  };
2442
2425
  }
@@ -2446,7 +2429,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2446
2429
  unmount(activeBranch, parentComponent2, suspense, true);
2447
2430
  }
2448
2431
  if (!delayEnter) {
2449
- move(pendingBranch, container2, anchor2, "0");
2432
+ move(pendingBranch, container2, anchor2, 0);
2450
2433
  }
2451
2434
  }
2452
2435
  setActiveBranch(suspense, pendingBranch);
@@ -2524,7 +2507,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2524
2507
  }
2525
2508
  const hydratedEl = instance.vnode.el;
2526
2509
  instance.asyncDep.catch((err) => {
2527
- handleError(err, instance, "0");
2510
+ handleError(err, instance, 0);
2528
2511
  }).then((asyncSetupResult) => {
2529
2512
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
2530
2513
  return;
@@ -2727,12 +2710,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2727
2710
  } else if (isReactive(s)) {
2728
2711
  return traverse(s);
2729
2712
  } else if (isFunction(s)) {
2730
- return callWithErrorHandling(s, instance, "2");
2713
+ return callWithErrorHandling(s, instance, 2);
2731
2714
  } else ;
2732
2715
  });
2733
2716
  } else if (isFunction(source)) {
2734
2717
  if (cb) {
2735
- getter = () => callWithErrorHandling(source, instance, "2");
2718
+ getter = () => callWithErrorHandling(source, instance, 2);
2736
2719
  } else {
2737
2720
  getter = () => {
2738
2721
  if (instance && instance.isUnmounted) {
@@ -2744,7 +2727,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2744
2727
  return callWithAsyncErrorHandling(
2745
2728
  source,
2746
2729
  instance,
2747
- "3",
2730
+ 3,
2748
2731
  [onCleanup]
2749
2732
  );
2750
2733
  };
@@ -2769,7 +2752,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2769
2752
  let cleanup;
2770
2753
  let onCleanup = (fn) => {
2771
2754
  cleanup = effect.onStop = () => {
2772
- callWithErrorHandling(fn, instance, "4");
2755
+ callWithErrorHandling(fn, instance, 4);
2773
2756
  };
2774
2757
  };
2775
2758
  let ssrCleanup;
@@ -2778,7 +2761,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2778
2761
  if (!cb) {
2779
2762
  getter();
2780
2763
  } else if (immediate) {
2781
- callWithAsyncErrorHandling(cb, instance, "3", [
2764
+ callWithAsyncErrorHandling(cb, instance, 3, [
2782
2765
  getter(),
2783
2766
  isMultiSource ? [] : void 0,
2784
2767
  onCleanup
@@ -2804,7 +2787,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
2804
2787
  if (cleanup) {
2805
2788
  cleanup();
2806
2789
  }
2807
- callWithAsyncErrorHandling(cb, instance, "3", [
2790
+ callWithAsyncErrorHandling(cb, instance, 3, [
2808
2791
  newValue,
2809
2792
  // pass undefined as the old value when it's changed for the first time
2810
2793
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -3070,7 +3053,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3070
3053
  hook && callWithAsyncErrorHandling(
3071
3054
  hook,
3072
3055
  instance,
3073
- "9",
3056
+ 9,
3074
3057
  args
3075
3058
  );
3076
3059
  };
@@ -3294,7 +3277,7 @@ function defineAsyncComponent(source) {
3294
3277
  handleError(
3295
3278
  err,
3296
3279
  instance,
3297
- "13",
3280
+ 13,
3298
3281
  !errorComponent
3299
3282
  /* do not throw in dev if user provided error component */
3300
3283
  );
@@ -3396,7 +3379,7 @@ const KeepAliveImpl = {
3396
3379
  const storageContainer = createElement("div");
3397
3380
  sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
3398
3381
  const instance2 = vnode.component;
3399
- move(vnode, container, anchor, "0", parentSuspense);
3382
+ move(vnode, container, anchor, 0, parentSuspense);
3400
3383
  patch(
3401
3384
  instance2.vnode,
3402
3385
  vnode,
@@ -3421,7 +3404,7 @@ const KeepAliveImpl = {
3421
3404
  };
3422
3405
  sharedContext.deactivate = (vnode) => {
3423
3406
  const instance2 = vnode.component;
3424
- move(vnode, storageContainer, null, "1", parentSuspense);
3407
+ move(vnode, storageContainer, null, 1, parentSuspense);
3425
3408
  queuePostRenderEffect(() => {
3426
3409
  if (instance2.da) {
3427
3410
  invokeArrayFns(instance2.da);
@@ -3762,7 +3745,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3762
3745
  }
3763
3746
  if (hook) {
3764
3747
  pauseTracking();
3765
- callWithAsyncErrorHandling(hook, instance, "8", [
3748
+ callWithAsyncErrorHandling(hook, instance, 8, [
3766
3749
  vnode.el,
3767
3750
  binding,
3768
3751
  vnode,
@@ -3779,7 +3762,7 @@ const FILTERS = "filters";
3779
3762
  function resolveComponent(name, maybeSelfReference) {
3780
3763
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
3781
3764
  }
3782
- const NULL_DYNAMIC_COMPONENT = Symbol();
3765
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
3783
3766
  function resolveDynamicComponent(component) {
3784
3767
  if (isString(component)) {
3785
3768
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -5372,7 +5355,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5372
5355
  return vm;
5373
5356
  }
5374
5357
  }
5375
- Vue.version = `2.6.14-compat:${"3.3.0-alpha.3"}`;
5358
+ Vue.version = `2.6.14-compat:${"3.3.0-alpha.5"}`;
5376
5359
  Vue.config = singletonApp.config;
5377
5360
  Vue.use = (p, ...options) => {
5378
5361
  if (p && isFunction(p.install)) {
@@ -5850,7 +5833,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5850
5833
  }
5851
5834
  }
5852
5835
  if (isFunction(ref)) {
5853
- callWithErrorHandling(ref, owner, "12", [value, refs]);
5836
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
5854
5837
  } else {
5855
5838
  const _isString = isString(ref);
5856
5839
  const _isRef = isRef(ref);
@@ -7305,7 +7288,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7305
7288
  );
7306
7289
  } else if (moved) {
7307
7290
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
7308
- move(nextChild, container, anchor, "2");
7291
+ move(nextChild, container, anchor, 2);
7309
7292
  } else {
7310
7293
  j--;
7311
7294
  }
@@ -7339,9 +7322,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7339
7322
  moveStaticNode(vnode, container, anchor);
7340
7323
  return;
7341
7324
  }
7342
- const needTransition = moveType !== "2" && shapeFlag & 1 && transition;
7325
+ const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7343
7326
  if (needTransition) {
7344
- if (moveType === "0") {
7327
+ if (moveType === 0) {
7345
7328
  transition.beforeEnter(el);
7346
7329
  hostInsert(el, container, anchor);
7347
7330
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
@@ -7714,7 +7697,7 @@ const TeleportImpl = {
7714
7697
  container,
7715
7698
  mainAnchor,
7716
7699
  internals,
7717
- "1"
7700
+ 1
7718
7701
  );
7719
7702
  }
7720
7703
  } else {
@@ -7729,7 +7712,7 @@ const TeleportImpl = {
7729
7712
  nextTarget,
7730
7713
  null,
7731
7714
  internals,
7732
- "0"
7715
+ 0
7733
7716
  );
7734
7717
  }
7735
7718
  } else if (wasDisabled) {
@@ -7738,7 +7721,7 @@ const TeleportImpl = {
7738
7721
  target,
7739
7722
  targetAnchor,
7740
7723
  internals,
7741
- "1"
7724
+ 1
7742
7725
  );
7743
7726
  }
7744
7727
  }
@@ -7769,12 +7752,12 @@ const TeleportImpl = {
7769
7752
  move: moveTeleport,
7770
7753
  hydrate: hydrateTeleport
7771
7754
  };
7772
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = "2") {
7773
- if (moveType === "0") {
7755
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
7756
+ if (moveType === 0) {
7774
7757
  insert(vnode.targetAnchor, container, parentAnchor);
7775
7758
  }
7776
7759
  const { el, anchor, shapeFlag, children, props } = vnode;
7777
- const isReorder = moveType === "2";
7760
+ const isReorder = moveType === 2;
7778
7761
  if (isReorder) {
7779
7762
  insert(el, container, parentAnchor);
7780
7763
  }
@@ -7785,7 +7768,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
7785
7768
  children[i],
7786
7769
  container,
7787
7770
  parentAnchor,
7788
- "2"
7771
+ 2
7789
7772
  );
7790
7773
  }
7791
7774
  }
@@ -7906,10 +7889,10 @@ function convertLegacyComponent(comp, instance) {
7906
7889
  return comp;
7907
7890
  }
7908
7891
 
7909
- const Fragment = Symbol(void 0);
7910
- const Text = Symbol(void 0);
7911
- const Comment = Symbol(void 0);
7912
- const Static = Symbol(void 0);
7892
+ const Fragment = Symbol.for("v-fgt");
7893
+ const Text = Symbol.for("v-txt");
7894
+ const Comment = Symbol.for("v-cmt");
7895
+ const Static = Symbol.for("v-stc");
7913
7896
  const blockStack = [];
7914
7897
  let currentBlock = null;
7915
7898
  function openBlock(disableTracking = false) {
@@ -8240,7 +8223,7 @@ function mergeProps(...args) {
8240
8223
  return ret;
8241
8224
  }
8242
8225
  function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8243
- callWithAsyncErrorHandling(hook, instance, "7", [
8226
+ callWithAsyncErrorHandling(hook, instance, 7, [
8244
8227
  vnode,
8245
8228
  prevVNode
8246
8229
  ]);
@@ -8337,13 +8320,29 @@ function createComponentInstance(vnode, parent, suspense) {
8337
8320
  }
8338
8321
  let currentInstance = null;
8339
8322
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
8323
+ let internalSetCurrentInstance;
8324
+ let globalCurrentInstanceSetters;
8325
+ let settersKey = "__VUE_INSTANCE_SETTERS__";
8326
+ {
8327
+ if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
8328
+ globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
8329
+ }
8330
+ globalCurrentInstanceSetters.push((i) => currentInstance = i);
8331
+ internalSetCurrentInstance = (instance) => {
8332
+ if (globalCurrentInstanceSetters.length > 1) {
8333
+ globalCurrentInstanceSetters.forEach((s) => s(instance));
8334
+ } else {
8335
+ globalCurrentInstanceSetters[0](instance);
8336
+ }
8337
+ };
8338
+ }
8340
8339
  const setCurrentInstance = (instance) => {
8341
- currentInstance = instance;
8340
+ internalSetCurrentInstance(instance);
8342
8341
  instance.scope.on();
8343
8342
  };
8344
8343
  const unsetCurrentInstance = () => {
8345
8344
  currentInstance && currentInstance.scope.off();
8346
- currentInstance = null;
8345
+ internalSetCurrentInstance(null);
8347
8346
  };
8348
8347
  function isStatefulComponent(instance) {
8349
8348
  return instance.vnode.shapeFlag & 4;
@@ -8371,7 +8370,7 @@ function setupStatefulComponent(instance, isSSR) {
8371
8370
  const setupResult = callWithErrorHandling(
8372
8371
  setup,
8373
8372
  instance,
8374
- "0",
8373
+ 0,
8375
8374
  [instance.props, setupContext]
8376
8375
  );
8377
8376
  resetTracking();
@@ -8382,7 +8381,7 @@ function setupStatefulComponent(instance, isSSR) {
8382
8381
  return setupResult.then((resolvedResult) => {
8383
8382
  handleSetupResult(instance, resolvedResult, isSSR);
8384
8383
  }).catch((e) => {
8385
- handleError(e, instance, "0");
8384
+ handleError(e, instance, 0);
8386
8385
  });
8387
8386
  } else {
8388
8387
  instance.asyncDep = setupResult;
@@ -8600,7 +8599,7 @@ function h(type, propsOrChildren, children) {
8600
8599
  }
8601
8600
  }
8602
8601
 
8603
- const ssrContextKey = Symbol(``);
8602
+ const ssrContextKey = Symbol.for("v-scx");
8604
8603
  const useSSRContext = () => {
8605
8604
  {
8606
8605
  const ctx = inject(ssrContextKey);
@@ -8639,7 +8638,7 @@ function isMemoSame(cached, memo) {
8639
8638
  return true;
8640
8639
  }
8641
8640
 
8642
- const version = "3.3.0-alpha.3";
8641
+ const version = "3.3.0-alpha.5";
8643
8642
  const _ssrUtils = {
8644
8643
  createComponentInstance,
8645
8644
  setupComponent,
@@ -8960,7 +8959,7 @@ function createInvoker(initialValue, instance) {
8960
8959
  callWithAsyncErrorHandling(
8961
8960
  patchStopImmediatePropagation(e, invoker.value),
8962
8961
  instance,
8963
- "5",
8962
+ 5,
8964
8963
  [e]
8965
8964
  );
8966
8965
  };
@@ -10314,63 +10313,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
10314
10313
  }
10315
10314
  const errorMessages = {
10316
10315
  // parse errors
10317
- ["0"]: "Illegal comment.",
10318
- ["1"]: "CDATA section is allowed only in XML context.",
10319
- ["2"]: "Duplicate attribute.",
10320
- ["3"]: "End tag cannot have attributes.",
10321
- ["4"]: "Illegal '/' in tags.",
10322
- ["5"]: "Unexpected EOF in tag.",
10323
- ["6"]: "Unexpected EOF in CDATA section.",
10324
- ["7"]: "Unexpected EOF in comment.",
10325
- ["8"]: "Unexpected EOF in script.",
10326
- ["9"]: "Unexpected EOF in tag.",
10327
- ["10"]: "Incorrectly closed comment.",
10328
- ["11"]: "Incorrectly opened comment.",
10329
- ["12"]: "Illegal tag name. Use '&lt;' to print '<'.",
10330
- ["13"]: "Attribute value was expected.",
10331
- ["14"]: "End tag name was expected.",
10332
- ["15"]: "Whitespace was expected.",
10333
- ["16"]: "Unexpected '<!--' in comment.",
10334
- ["17"]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
10335
- ["18"]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
10336
- ["19"]: "Attribute name cannot start with '='.",
10337
- ["21"]: "'<?' is allowed only in XML context.",
10338
- ["20"]: `Unexpected null character.`,
10339
- ["22"]: "Illegal '/' in tags.",
10316
+ [0]: "Illegal comment.",
10317
+ [1]: "CDATA section is allowed only in XML context.",
10318
+ [2]: "Duplicate attribute.",
10319
+ [3]: "End tag cannot have attributes.",
10320
+ [4]: "Illegal '/' in tags.",
10321
+ [5]: "Unexpected EOF in tag.",
10322
+ [6]: "Unexpected EOF in CDATA section.",
10323
+ [7]: "Unexpected EOF in comment.",
10324
+ [8]: "Unexpected EOF in script.",
10325
+ [9]: "Unexpected EOF in tag.",
10326
+ [10]: "Incorrectly closed comment.",
10327
+ [11]: "Incorrectly opened comment.",
10328
+ [12]: "Illegal tag name. Use '&lt;' to print '<'.",
10329
+ [13]: "Attribute value was expected.",
10330
+ [14]: "End tag name was expected.",
10331
+ [15]: "Whitespace was expected.",
10332
+ [16]: "Unexpected '<!--' in comment.",
10333
+ [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
10334
+ [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
10335
+ [19]: "Attribute name cannot start with '='.",
10336
+ [21]: "'<?' is allowed only in XML context.",
10337
+ [20]: `Unexpected null character.`,
10338
+ [22]: "Illegal '/' in tags.",
10340
10339
  // Vue-specific parse errors
10341
- ["23"]: "Invalid end tag.",
10342
- ["24"]: "Element is missing end tag.",
10343
- ["25"]: "Interpolation end sign was not found.",
10344
- ["27"]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
10345
- ["26"]: "Legal directive name was expected.",
10340
+ [23]: "Invalid end tag.",
10341
+ [24]: "Element is missing end tag.",
10342
+ [25]: "Interpolation end sign was not found.",
10343
+ [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
10344
+ [26]: "Legal directive name was expected.",
10346
10345
  // transform errors
10347
- ["28"]: `v-if/v-else-if is missing expression.`,
10348
- ["29"]: `v-if/else branches must use unique keys.`,
10349
- ["30"]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
10350
- ["31"]: `v-for is missing expression.`,
10351
- ["32"]: `v-for has invalid expression.`,
10352
- ["33"]: `<template v-for> key should be placed on the <template> tag.`,
10353
- ["34"]: `v-bind is missing expression.`,
10354
- ["35"]: `v-on is missing expression.`,
10355
- ["36"]: `Unexpected custom directive on <slot> outlet.`,
10356
- ["37"]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
10357
- ["38"]: `Duplicate slot names found. `,
10358
- ["39"]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
10359
- ["40"]: `v-slot can only be used on components or <template> tags.`,
10360
- ["41"]: `v-model is missing expression.`,
10361
- ["42"]: `v-model value must be a valid JavaScript member expression.`,
10362
- ["43"]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
10363
- ["44"]: `v-model cannot be used on a prop, because local prop bindings are not writable.
10346
+ [28]: `v-if/v-else-if is missing expression.`,
10347
+ [29]: `v-if/else branches must use unique keys.`,
10348
+ [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
10349
+ [31]: `v-for is missing expression.`,
10350
+ [32]: `v-for has invalid expression.`,
10351
+ [33]: `<template v-for> key should be placed on the <template> tag.`,
10352
+ [34]: `v-bind is missing expression.`,
10353
+ [35]: `v-on is missing expression.`,
10354
+ [36]: `Unexpected custom directive on <slot> outlet.`,
10355
+ [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
10356
+ [38]: `Duplicate slot names found. `,
10357
+ [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
10358
+ [40]: `v-slot can only be used on components or <template> tags.`,
10359
+ [41]: `v-model is missing expression.`,
10360
+ [42]: `v-model value must be a valid JavaScript member expression.`,
10361
+ [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
10362
+ [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
10364
10363
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
10365
- ["45"]: `Error parsing JavaScript expression: `,
10366
- ["46"]: `<KeepAlive> expects exactly one child component.`,
10364
+ [45]: `Error parsing JavaScript expression: `,
10365
+ [46]: `<KeepAlive> expects exactly one child component.`,
10367
10366
  // generic errors
10368
- ["47"]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
10369
- ["48"]: `ES module mode is not supported in this build of compiler.`,
10370
- ["49"]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
10371
- ["50"]: `"scopeId" option is only supported in module mode.`,
10367
+ [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
10368
+ [48]: `ES module mode is not supported in this build of compiler.`,
10369
+ [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
10370
+ [50]: `"scopeId" option is only supported in module mode.`,
10372
10371
  // just to fulfill types
10373
- ["51"]: ``
10372
+ [51]: ``
10374
10373
  };
10375
10374
 
10376
10375
  const FRAGMENT = Symbol(``);
@@ -10468,7 +10467,7 @@ const locStub = {
10468
10467
  };
10469
10468
  function createRoot(children, loc = locStub) {
10470
10469
  return {
10471
- type: "0",
10470
+ type: 0,
10472
10471
  children,
10473
10472
  helpers: /* @__PURE__ */ new Set(),
10474
10473
  components: [],
@@ -10494,7 +10493,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
10494
10493
  }
10495
10494
  }
10496
10495
  return {
10497
- type: "13",
10496
+ type: 13,
10498
10497
  tag,
10499
10498
  props,
10500
10499
  children,
@@ -10509,21 +10508,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
10509
10508
  }
10510
10509
  function createArrayExpression(elements, loc = locStub) {
10511
10510
  return {
10512
- type: "17",
10511
+ type: 17,
10513
10512
  loc,
10514
10513
  elements
10515
10514
  };
10516
10515
  }
10517
10516
  function createObjectExpression(properties, loc = locStub) {
10518
10517
  return {
10519
- type: "15",
10518
+ type: 15,
10520
10519
  loc,
10521
10520
  properties
10522
10521
  };
10523
10522
  }
10524
10523
  function createObjectProperty(key, value) {
10525
10524
  return {
10526
- type: "16",
10525
+ type: 16,
10527
10526
  loc: locStub,
10528
10527
  key: isString(key) ? createSimpleExpression(key, true) : key,
10529
10528
  value
@@ -10531,23 +10530,23 @@ function createObjectProperty(key, value) {
10531
10530
  }
10532
10531
  function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
10533
10532
  return {
10534
- type: "4",
10533
+ type: 4,
10535
10534
  loc,
10536
10535
  content,
10537
10536
  isStatic,
10538
- constType: isStatic ? "3" : constType
10537
+ constType: isStatic ? 3 : constType
10539
10538
  };
10540
10539
  }
10541
10540
  function createCompoundExpression(children, loc = locStub) {
10542
10541
  return {
10543
- type: "8",
10542
+ type: 8,
10544
10543
  loc,
10545
10544
  children
10546
10545
  };
10547
10546
  }
10548
10547
  function createCallExpression(callee, args = [], loc = locStub) {
10549
10548
  return {
10550
- type: "14",
10549
+ type: 14,
10551
10550
  loc,
10552
10551
  callee,
10553
10552
  arguments: args
@@ -10555,7 +10554,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
10555
10554
  }
10556
10555
  function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
10557
10556
  return {
10558
- type: "18",
10557
+ type: 18,
10559
10558
  params,
10560
10559
  returns,
10561
10560
  newline,
@@ -10565,7 +10564,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
10565
10564
  }
10566
10565
  function createConditionalExpression(test, consequent, alternate, newline = true) {
10567
10566
  return {
10568
- type: "19",
10567
+ type: 19,
10569
10568
  test,
10570
10569
  consequent,
10571
10570
  alternate,
@@ -10575,7 +10574,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
10575
10574
  }
10576
10575
  function createCacheExpression(index, value, isVNode = false) {
10577
10576
  return {
10578
- type: "20",
10577
+ type: 20,
10579
10578
  index,
10580
10579
  value,
10581
10580
  isVNode,
@@ -10584,13 +10583,27 @@ function createCacheExpression(index, value, isVNode = false) {
10584
10583
  }
10585
10584
  function createBlockStatement(body) {
10586
10585
  return {
10587
- type: "21",
10586
+ type: 21,
10588
10587
  body,
10589
10588
  loc: locStub
10590
10589
  };
10591
10590
  }
10591
+ function getVNodeHelper(ssr, isComponent) {
10592
+ return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
10593
+ }
10594
+ function getVNodeBlockHelper(ssr, isComponent) {
10595
+ return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
10596
+ }
10597
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
10598
+ if (!node.isBlock) {
10599
+ node.isBlock = true;
10600
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
10601
+ helper(OPEN_BLOCK);
10602
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
10603
+ }
10604
+ }
10592
10605
 
10593
- const isStaticExp = (p) => p.type === "4" && p.isStatic;
10606
+ const isStaticExp = (p) => p.type === 4 && p.isStatic;
10594
10607
  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
10595
10608
  function isCoreComponent(tag) {
10596
10609
  if (isBuiltInType(tag, "Teleport")) {
@@ -10659,7 +10672,7 @@ function advancePositionWithMutation(pos, source, numberOfCharacters = source.le
10659
10672
  function findDir(node, name, allowEmpty = false) {
10660
10673
  for (let i = 0; i < node.props.length; i++) {
10661
10674
  const p = node.props[i];
10662
- if (p.type === "7" && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
10675
+ if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
10663
10676
  return p;
10664
10677
  }
10665
10678
  }
@@ -10667,7 +10680,7 @@ function findDir(node, name, allowEmpty = false) {
10667
10680
  function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
10668
10681
  for (let i = 0; i < node.props.length; i++) {
10669
10682
  const p = node.props[i];
10670
- if (p.type === "6") {
10683
+ if (p.type === 6) {
10671
10684
  if (dynamicOnly)
10672
10685
  continue;
10673
10686
  if (p.name === name && (p.value || allowEmpty)) {
@@ -10683,33 +10696,27 @@ function isStaticArgOf(arg, name) {
10683
10696
  }
10684
10697
  function hasDynamicKeyVBind(node) {
10685
10698
  return node.props.some(
10686
- (p) => p.type === "7" && p.name === "bind" && (!p.arg || // v-bind="obj"
10687
- p.arg.type !== "4" || // v-bind:[_ctx.foo]
10699
+ (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
10700
+ p.arg.type !== 4 || // v-bind:[_ctx.foo]
10688
10701
  !p.arg.isStatic)
10689
10702
  // v-bind:[foo]
10690
10703
  );
10691
10704
  }
10692
10705
  function isText$1(node) {
10693
- return node.type === "5" || node.type === "2";
10706
+ return node.type === 5 || node.type === 2;
10694
10707
  }
10695
10708
  function isVSlot(p) {
10696
- return p.type === "7" && p.name === "slot";
10709
+ return p.type === 7 && p.name === "slot";
10697
10710
  }
10698
10711
  function isTemplateNode(node) {
10699
- return node.type === "1" && node.tagType === "3";
10712
+ return node.type === 1 && node.tagType === 3;
10700
10713
  }
10701
10714
  function isSlotOutlet(node) {
10702
- return node.type === "1" && node.tagType === "2";
10703
- }
10704
- function getVNodeHelper(ssr, isComponent) {
10705
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
10706
- }
10707
- function getVNodeBlockHelper(ssr, isComponent) {
10708
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
10715
+ return node.type === 1 && node.tagType === 2;
10709
10716
  }
10710
10717
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
10711
10718
  function getUnnormalizedProps(props, callPath = []) {
10712
- if (props && !isString(props) && props.type === "14") {
10719
+ if (props && !isString(props) && props.type === 14) {
10713
10720
  const callee = props.callee;
10714
10721
  if (!isString(callee) && propsHelperSet.has(callee)) {
10715
10722
  return getUnnormalizedProps(
@@ -10722,10 +10729,10 @@ function getUnnormalizedProps(props, callPath = []) {
10722
10729
  }
10723
10730
  function injectProp(node, prop, context) {
10724
10731
  let propsWithInjection;
10725
- let props = node.type === "13" ? node.props : node.arguments[2];
10732
+ let props = node.type === 13 ? node.props : node.arguments[2];
10726
10733
  let callPath = [];
10727
10734
  let parentCall;
10728
- if (props && !isString(props) && props.type === "14") {
10735
+ if (props && !isString(props) && props.type === 14) {
10729
10736
  const ret = getUnnormalizedProps(props);
10730
10737
  props = ret[0];
10731
10738
  callPath = ret[1];
@@ -10733,9 +10740,9 @@ function injectProp(node, prop, context) {
10733
10740
  }
10734
10741
  if (props == null || isString(props)) {
10735
10742
  propsWithInjection = createObjectExpression([prop]);
10736
- } else if (props.type === "14") {
10743
+ } else if (props.type === 14) {
10737
10744
  const first = props.arguments[0];
10738
- if (!isString(first) && first.type === "15") {
10745
+ if (!isString(first) && first.type === 15) {
10739
10746
  if (!hasProp(prop, first)) {
10740
10747
  first.properties.unshift(prop);
10741
10748
  }
@@ -10750,7 +10757,7 @@ function injectProp(node, prop, context) {
10750
10757
  }
10751
10758
  }
10752
10759
  !propsWithInjection && (propsWithInjection = props);
10753
- } else if (props.type === "15") {
10760
+ } else if (props.type === 15) {
10754
10761
  if (!hasProp(prop, props)) {
10755
10762
  props.properties.unshift(prop);
10756
10763
  }
@@ -10764,7 +10771,7 @@ function injectProp(node, prop, context) {
10764
10771
  parentCall = callPath[callPath.length - 2];
10765
10772
  }
10766
10773
  }
10767
- if (node.type === "13") {
10774
+ if (node.type === 13) {
10768
10775
  if (parentCall) {
10769
10776
  parentCall.arguments[0] = propsWithInjection;
10770
10777
  } else {
@@ -10780,10 +10787,10 @@ function injectProp(node, prop, context) {
10780
10787
  }
10781
10788
  function hasProp(prop, props) {
10782
10789
  let result = false;
10783
- if (prop.key.type === "4") {
10790
+ if (prop.key.type === 4) {
10784
10791
  const propKeyName = prop.key.content;
10785
10792
  result = props.properties.some(
10786
- (p) => p.key.type === "4" && p.key.content === propKeyName
10793
+ (p) => p.key.type === 4 && p.key.content === propKeyName
10787
10794
  );
10788
10795
  }
10789
10796
  return result;
@@ -10798,55 +10805,47 @@ function hasScopeRef(node, ids) {
10798
10805
  return false;
10799
10806
  }
10800
10807
  switch (node.type) {
10801
- case "1":
10808
+ case 1:
10802
10809
  for (let i = 0; i < node.props.length; i++) {
10803
10810
  const p = node.props[i];
10804
- if (p.type === "7" && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
10811
+ if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
10805
10812
  return true;
10806
10813
  }
10807
10814
  }
10808
10815
  return node.children.some((c) => hasScopeRef(c, ids));
10809
- case "11":
10816
+ case 11:
10810
10817
  if (hasScopeRef(node.source, ids)) {
10811
10818
  return true;
10812
10819
  }
10813
10820
  return node.children.some((c) => hasScopeRef(c, ids));
10814
- case "9":
10821
+ case 9:
10815
10822
  return node.branches.some((b) => hasScopeRef(b, ids));
10816
- case "10":
10823
+ case 10:
10817
10824
  if (hasScopeRef(node.condition, ids)) {
10818
10825
  return true;
10819
10826
  }
10820
10827
  return node.children.some((c) => hasScopeRef(c, ids));
10821
- case "4":
10828
+ case 4:
10822
10829
  return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];
10823
- case "8":
10830
+ case 8:
10824
10831
  return node.children.some((c) => isObject(c) && hasScopeRef(c, ids));
10825
- case "5":
10826
- case "12":
10832
+ case 5:
10833
+ case 12:
10827
10834
  return hasScopeRef(node.content, ids);
10828
- case "2":
10829
- case "3":
10835
+ case 2:
10836
+ case 3:
10830
10837
  return false;
10831
10838
  default:
10832
10839
  return false;
10833
10840
  }
10834
10841
  }
10835
10842
  function getMemoedVNodeCall(node) {
10836
- if (node.type === "14" && node.callee === WITH_MEMO) {
10843
+ if (node.type === 14 && node.callee === WITH_MEMO) {
10837
10844
  return node.arguments[1].returns;
10838
10845
  } else {
10839
10846
  return node;
10840
10847
  }
10841
10848
  }
10842
- function makeBlock(node, { helper, removeHelper, inSSR }) {
10843
- if (!node.isBlock) {
10844
- node.isBlock = true;
10845
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
10846
- helper(OPEN_BLOCK);
10847
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
10848
- }
10849
- }
10850
10849
 
10851
10850
  function getCompatValue(key, context) {
10852
10851
  const config = context.options ? context.options.compatConfig : context.compatConfig;
@@ -10877,8 +10876,8 @@ const decodeMap = {
10877
10876
  };
10878
10877
  const defaultParserOptions = {
10879
10878
  delimiters: [`{{`, `}}`],
10880
- getNamespace: () => "0",
10881
- getTextMode: () => "0",
10879
+ getNamespace: () => 0,
10880
+ getTextMode: () => 0,
10882
10881
  isVoidTag: NO,
10883
10882
  isPreTag: NO,
10884
10883
  isCustomElement: NO,
@@ -10891,7 +10890,7 @@ function baseParse(content, options = {}) {
10891
10890
  const context = createParserContext(content, options);
10892
10891
  const start = getCursor(context);
10893
10892
  return createRoot(
10894
- parseChildren(context, "0", []),
10893
+ parseChildren(context, 0, []),
10895
10894
  getSelection(context, start)
10896
10895
  );
10897
10896
  }
@@ -10915,48 +10914,48 @@ function createParserContext(content, rawOptions) {
10915
10914
  }
10916
10915
  function parseChildren(context, mode, ancestors) {
10917
10916
  const parent = last(ancestors);
10918
- const ns = parent ? parent.ns : "0";
10917
+ const ns = parent ? parent.ns : 0;
10919
10918
  const nodes = [];
10920
10919
  while (!isEnd(context, mode, ancestors)) {
10921
10920
  const s = context.source;
10922
10921
  let node = void 0;
10923
- if (mode === "0" || mode === "1") {
10922
+ if (mode === 0 || mode === 1) {
10924
10923
  if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
10925
10924
  node = parseInterpolation(context, mode);
10926
- } else if (mode === "0" && s[0] === "<") {
10925
+ } else if (mode === 0 && s[0] === "<") {
10927
10926
  if (s.length === 1) {
10928
- emitError(context, "5", 1);
10927
+ emitError(context, 5, 1);
10929
10928
  } else if (s[1] === "!") {
10930
10929
  if (startsWith(s, "<!--")) {
10931
10930
  node = parseComment(context);
10932
10931
  } else if (startsWith(s, "<!DOCTYPE")) {
10933
10932
  node = parseBogusComment(context);
10934
10933
  } else if (startsWith(s, "<![CDATA[")) {
10935
- if (ns !== "0") {
10934
+ if (ns !== 0) {
10936
10935
  node = parseCDATA(context, ancestors);
10937
10936
  } else {
10938
- emitError(context, "1");
10937
+ emitError(context, 1);
10939
10938
  node = parseBogusComment(context);
10940
10939
  }
10941
10940
  } else {
10942
- emitError(context, "11");
10941
+ emitError(context, 11);
10943
10942
  node = parseBogusComment(context);
10944
10943
  }
10945
10944
  } else if (s[1] === "/") {
10946
10945
  if (s.length === 2) {
10947
- emitError(context, "5", 2);
10946
+ emitError(context, 5, 2);
10948
10947
  } else if (s[2] === ">") {
10949
- emitError(context, "14", 2);
10948
+ emitError(context, 14, 2);
10950
10949
  advanceBy(context, 3);
10951
10950
  continue;
10952
10951
  } else if (/[a-z]/i.test(s[2])) {
10953
- emitError(context, "23");
10952
+ emitError(context, 23);
10954
10953
  parseTag(context, TagType.End, parent);
10955
10954
  continue;
10956
10955
  } else {
10957
10956
  emitError(
10958
10957
  context,
10959
- "12",
10958
+ 12,
10960
10959
  2
10961
10960
  );
10962
10961
  node = parseBogusComment(context);
@@ -10967,19 +10966,19 @@ function parseChildren(context, mode, ancestors) {
10967
10966
  "COMPILER_NATIVE_TEMPLATE",
10968
10967
  context
10969
10968
  ) && node && node.tag === "template" && !node.props.some(
10970
- (p) => p.type === "7" && isSpecialTemplateDirective(p.name)
10969
+ (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
10971
10970
  )) {
10972
10971
  node = node.children;
10973
10972
  }
10974
10973
  } else if (s[1] === "?") {
10975
10974
  emitError(
10976
10975
  context,
10977
- "21",
10976
+ 21,
10978
10977
  1
10979
10978
  );
10980
10979
  node = parseBogusComment(context);
10981
10980
  } else {
10982
- emitError(context, "12", 1);
10981
+ emitError(context, 12, 1);
10983
10982
  }
10984
10983
  }
10985
10984
  }
@@ -10995,16 +10994,16 @@ function parseChildren(context, mode, ancestors) {
10995
10994
  }
10996
10995
  }
10997
10996
  let removedWhitespace = false;
10998
- if (mode !== "2" && mode !== "1") {
10997
+ if (mode !== 2 && mode !== 1) {
10999
10998
  const shouldCondense = context.options.whitespace !== "preserve";
11000
10999
  for (let i = 0; i < nodes.length; i++) {
11001
11000
  const node = nodes[i];
11002
- if (node.type === "2") {
11001
+ if (node.type === 2) {
11003
11002
  if (!context.inPre) {
11004
11003
  if (!/[^\t\r\n\f ]/.test(node.content)) {
11005
11004
  const prev = nodes[i - 1];
11006
11005
  const next = nodes[i + 1];
11007
- if (!prev || !next || shouldCondense && (prev.type === "3" && next.type === "3" || prev.type === "3" && next.type === "1" || prev.type === "1" && next.type === "3" || prev.type === "1" && next.type === "1" && /[\r\n]/.test(node.content))) {
11006
+ if (!prev || !next || shouldCondense && (prev.type === 3 && next.type === 3 || prev.type === 3 && next.type === 1 || prev.type === 1 && next.type === 3 || prev.type === 1 && next.type === 1 && /[\r\n]/.test(node.content))) {
11008
11007
  removedWhitespace = true;
11009
11008
  nodes[i] = null;
11010
11009
  } else {
@@ -11016,14 +11015,14 @@ function parseChildren(context, mode, ancestors) {
11016
11015
  } else {
11017
11016
  node.content = node.content.replace(/\r\n/g, "\n");
11018
11017
  }
11019
- } else if (node.type === "3" && !context.options.comments) {
11018
+ } else if (node.type === 3 && !context.options.comments) {
11020
11019
  removedWhitespace = true;
11021
11020
  nodes[i] = null;
11022
11021
  }
11023
11022
  }
11024
11023
  if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
11025
11024
  const first = nodes[0];
11026
- if (first && first.type === "2") {
11025
+ if (first && first.type === 2) {
11027
11026
  first.content = first.content.replace(/^\r?\n/, "");
11028
11027
  }
11029
11028
  }
@@ -11031,9 +11030,9 @@ function parseChildren(context, mode, ancestors) {
11031
11030
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
11032
11031
  }
11033
11032
  function pushNode(nodes, node) {
11034
- if (node.type === "2") {
11033
+ if (node.type === 2) {
11035
11034
  const prev = last(nodes);
11036
- if (prev && prev.type === "2" && prev.loc.end.offset === node.loc.start.offset) {
11035
+ if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) {
11037
11036
  prev.content += node.content;
11038
11037
  prev.loc.end = node.loc.end;
11039
11038
  prev.loc.source += node.loc.source;
@@ -11044,9 +11043,9 @@ function pushNode(nodes, node) {
11044
11043
  }
11045
11044
  function parseCDATA(context, ancestors) {
11046
11045
  advanceBy(context, 9);
11047
- const nodes = parseChildren(context, "3", ancestors);
11046
+ const nodes = parseChildren(context, 3, ancestors);
11048
11047
  if (context.source.length === 0) {
11049
- emitError(context, "6");
11048
+ emitError(context, 6);
11050
11049
  } else {
11051
11050
  advanceBy(context, 3);
11052
11051
  }
@@ -11059,13 +11058,13 @@ function parseComment(context) {
11059
11058
  if (!match) {
11060
11059
  content = context.source.slice(4);
11061
11060
  advanceBy(context, context.source.length);
11062
- emitError(context, "7");
11061
+ emitError(context, 7);
11063
11062
  } else {
11064
11063
  if (match.index <= 3) {
11065
- emitError(context, "0");
11064
+ emitError(context, 0);
11066
11065
  }
11067
11066
  if (match[1]) {
11068
- emitError(context, "10");
11067
+ emitError(context, 10);
11069
11068
  }
11070
11069
  content = context.source.slice(4, match.index);
11071
11070
  const s = context.source.slice(0, match.index);
@@ -11073,14 +11072,14 @@ function parseComment(context) {
11073
11072
  while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
11074
11073
  advanceBy(context, nestedIndex - prevIndex + 1);
11075
11074
  if (nestedIndex + 4 < s.length) {
11076
- emitError(context, "16");
11075
+ emitError(context, 16);
11077
11076
  }
11078
11077
  prevIndex = nestedIndex + 1;
11079
11078
  }
11080
11079
  advanceBy(context, match.index + match[0].length - prevIndex + 1);
11081
11080
  }
11082
11081
  return {
11083
- type: "3",
11082
+ type: 3,
11084
11083
  content,
11085
11084
  loc: getSelection(context, start)
11086
11085
  };
@@ -11098,7 +11097,7 @@ function parseBogusComment(context) {
11098
11097
  advanceBy(context, closeIndex + 1);
11099
11098
  }
11100
11099
  return {
11101
- type: "3",
11100
+ type: 3,
11102
11101
  content,
11103
11102
  loc: getSelection(context, start)
11104
11103
  };
@@ -11125,7 +11124,7 @@ function parseElement(context, ancestors) {
11125
11124
  ancestors.pop();
11126
11125
  {
11127
11126
  const inlineTemplateProp = element.props.find(
11128
- (p) => p.type === "6" && p.name === "inline-template"
11127
+ (p) => p.type === 6 && p.name === "inline-template"
11129
11128
  );
11130
11129
  if (inlineTemplateProp && checkCompatEnabled(
11131
11130
  "COMPILER_INLINE_TEMPLATE",
@@ -11134,7 +11133,7 @@ function parseElement(context, ancestors) {
11134
11133
  )) {
11135
11134
  const loc = getSelection(context, element.loc.end);
11136
11135
  inlineTemplateProp.value = {
11137
- type: "2",
11136
+ type: 2,
11138
11137
  content: loc.source,
11139
11138
  loc
11140
11139
  };
@@ -11144,11 +11143,11 @@ function parseElement(context, ancestors) {
11144
11143
  if (startsWithEndTagOpen(context.source, element.tag)) {
11145
11144
  parseTag(context, TagType.End, parent);
11146
11145
  } else {
11147
- emitError(context, "24", 0, element.loc.start);
11146
+ emitError(context, 24, 0, element.loc.start);
11148
11147
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
11149
11148
  const first = children[0];
11150
11149
  if (first && startsWith(first.loc.source, "<!--")) {
11151
- emitError(context, "8");
11150
+ emitError(context, 8);
11152
11151
  }
11153
11152
  }
11154
11153
  }
@@ -11182,7 +11181,7 @@ function parseTag(context, type, parent) {
11182
11181
  context.inPre = true;
11183
11182
  }
11184
11183
  let props = parseAttributes(context, type);
11185
- if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === "7" && p.name === "pre")) {
11184
+ if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
11186
11185
  context.inVPre = true;
11187
11186
  extend(context, cursor);
11188
11187
  context.source = currentSource;
@@ -11190,33 +11189,33 @@ function parseTag(context, type, parent) {
11190
11189
  }
11191
11190
  let isSelfClosing = false;
11192
11191
  if (context.source.length === 0) {
11193
- emitError(context, "9");
11192
+ emitError(context, 9);
11194
11193
  } else {
11195
11194
  isSelfClosing = startsWith(context.source, "/>");
11196
11195
  if (type === 1 /* End */ && isSelfClosing) {
11197
- emitError(context, "4");
11196
+ emitError(context, 4);
11198
11197
  }
11199
11198
  advanceBy(context, isSelfClosing ? 2 : 1);
11200
11199
  }
11201
11200
  if (type === 1 /* End */) {
11202
11201
  return;
11203
11202
  }
11204
- let tagType = "0";
11203
+ let tagType = 0;
11205
11204
  if (!context.inVPre) {
11206
11205
  if (tag === "slot") {
11207
- tagType = "2";
11206
+ tagType = 2;
11208
11207
  } else if (tag === "template") {
11209
11208
  if (props.some(
11210
- (p) => p.type === "7" && isSpecialTemplateDirective(p.name)
11209
+ (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
11211
11210
  )) {
11212
- tagType = "3";
11211
+ tagType = 3;
11213
11212
  }
11214
11213
  } else if (isComponent(tag, props, context)) {
11215
- tagType = "1";
11214
+ tagType = 1;
11216
11215
  }
11217
11216
  }
11218
11217
  return {
11219
- type: "1",
11218
+ type: 1,
11220
11219
  ns,
11221
11220
  tag,
11222
11221
  tagType,
@@ -11238,7 +11237,7 @@ function isComponent(tag, props, context) {
11238
11237
  }
11239
11238
  for (let i = 0; i < props.length; i++) {
11240
11239
  const p = props[i];
11241
- if (p.type === "6") {
11240
+ if (p.type === 6) {
11242
11241
  if (p.name === "is" && p.value) {
11243
11242
  if (p.value.content.startsWith("vue:")) {
11244
11243
  return true;
@@ -11271,23 +11270,23 @@ function parseAttributes(context, type) {
11271
11270
  const attributeNames = /* @__PURE__ */ new Set();
11272
11271
  while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
11273
11272
  if (startsWith(context.source, "/")) {
11274
- emitError(context, "22");
11273
+ emitError(context, 22);
11275
11274
  advanceBy(context, 1);
11276
11275
  advanceSpaces(context);
11277
11276
  continue;
11278
11277
  }
11279
11278
  if (type === 1 /* End */) {
11280
- emitError(context, "3");
11279
+ emitError(context, 3);
11281
11280
  }
11282
11281
  const attr = parseAttribute(context, attributeNames);
11283
- if (attr.type === "6" && attr.value && attr.name === "class") {
11282
+ if (attr.type === 6 && attr.value && attr.name === "class") {
11284
11283
  attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
11285
11284
  }
11286
11285
  if (type === 0 /* Start */) {
11287
11286
  props.push(attr);
11288
11287
  }
11289
11288
  if (/^[^\t\r\n\f />]/.test(context.source)) {
11290
- emitError(context, "15");
11289
+ emitError(context, 15);
11291
11290
  }
11292
11291
  advanceSpaces(context);
11293
11292
  }
@@ -11298,11 +11297,11 @@ function parseAttribute(context, nameSet) {
11298
11297
  const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
11299
11298
  const name = match[0];
11300
11299
  if (nameSet.has(name)) {
11301
- emitError(context, "2");
11300
+ emitError(context, 2);
11302
11301
  }
11303
11302
  nameSet.add(name);
11304
11303
  if (name[0] === "=") {
11305
- emitError(context, "19");
11304
+ emitError(context, 19);
11306
11305
  }
11307
11306
  {
11308
11307
  const pattern = /["'<]/g;
@@ -11310,7 +11309,7 @@ function parseAttribute(context, nameSet) {
11310
11309
  while (m = pattern.exec(name)) {
11311
11310
  emitError(
11312
11311
  context,
11313
- "17",
11312
+ 17,
11314
11313
  m.index
11315
11314
  );
11316
11315
  }
@@ -11323,7 +11322,7 @@ function parseAttribute(context, nameSet) {
11323
11322
  advanceSpaces(context);
11324
11323
  value = parseAttributeValue(context);
11325
11324
  if (!value) {
11326
- emitError(context, "13");
11325
+ emitError(context, 13);
11327
11326
  }
11328
11327
  }
11329
11328
  const loc = getSelection(context, start);
@@ -11353,7 +11352,7 @@ function parseAttribute(context, nameSet) {
11353
11352
  if (!content.endsWith("]")) {
11354
11353
  emitError(
11355
11354
  context,
11356
- "27"
11355
+ 27
11357
11356
  );
11358
11357
  content = content.slice(1);
11359
11358
  } else {
@@ -11363,10 +11362,10 @@ function parseAttribute(context, nameSet) {
11363
11362
  content += match2[3] || "";
11364
11363
  }
11365
11364
  arg = {
11366
- type: "4",
11365
+ type: 4,
11367
11366
  content,
11368
11367
  isStatic,
11369
- constType: isStatic ? "3" : 0,
11368
+ constType: isStatic ? 3 : 0,
11370
11369
  loc: loc2
11371
11370
  };
11372
11371
  }
@@ -11392,10 +11391,10 @@ function parseAttribute(context, nameSet) {
11392
11391
  }
11393
11392
  }
11394
11393
  return {
11395
- type: "7",
11394
+ type: 7,
11396
11395
  name: dirName,
11397
11396
  exp: value && {
11398
- type: "4",
11397
+ type: 4,
11399
11398
  content: value.content,
11400
11399
  isStatic: false,
11401
11400
  // Treat as non-constant by default. This can be potentially set to
@@ -11409,13 +11408,13 @@ function parseAttribute(context, nameSet) {
11409
11408
  };
11410
11409
  }
11411
11410
  if (!context.inVPre && startsWith(name, "v-")) {
11412
- emitError(context, "26");
11411
+ emitError(context, 26);
11413
11412
  }
11414
11413
  return {
11415
- type: "6",
11414
+ type: 6,
11416
11415
  name,
11417
11416
  value: value && {
11418
- type: "2",
11417
+ type: 2,
11419
11418
  content: value.content,
11420
11419
  loc: value.loc
11421
11420
  },
@@ -11434,10 +11433,10 @@ function parseAttributeValue(context) {
11434
11433
  content = parseTextData(
11435
11434
  context,
11436
11435
  context.source.length,
11437
- "4"
11436
+ 4
11438
11437
  );
11439
11438
  } else {
11440
- content = parseTextData(context, endIndex, "4");
11439
+ content = parseTextData(context, endIndex, 4);
11441
11440
  advanceBy(context, 1);
11442
11441
  }
11443
11442
  } else {
@@ -11450,11 +11449,11 @@ function parseAttributeValue(context) {
11450
11449
  while (m = unexpectedChars.exec(match[0])) {
11451
11450
  emitError(
11452
11451
  context,
11453
- "18",
11452
+ 18,
11454
11453
  m.index
11455
11454
  );
11456
11455
  }
11457
- content = parseTextData(context, match[0].length, "4");
11456
+ content = parseTextData(context, match[0].length, 4);
11458
11457
  }
11459
11458
  return { content, isQuoted, loc: getSelection(context, start) };
11460
11459
  }
@@ -11462,7 +11461,7 @@ function parseInterpolation(context, mode) {
11462
11461
  const [open, close] = context.options.delimiters;
11463
11462
  const closeIndex = context.source.indexOf(close, open.length);
11464
11463
  if (closeIndex === -1) {
11465
- emitError(context, "25");
11464
+ emitError(context, 25);
11466
11465
  return void 0;
11467
11466
  }
11468
11467
  const start = getCursor(context);
@@ -11481,9 +11480,9 @@ function parseInterpolation(context, mode) {
11481
11480
  advancePositionWithMutation(innerEnd, rawContent, endOffset);
11482
11481
  advanceBy(context, close.length);
11483
11482
  return {
11484
- type: "5",
11483
+ type: 5,
11485
11484
  content: {
11486
- type: "4",
11485
+ type: 4,
11487
11486
  isStatic: false,
11488
11487
  // Set `isConstant` to false by default and will decide in transformExpression
11489
11488
  constType: 0,
@@ -11494,7 +11493,7 @@ function parseInterpolation(context, mode) {
11494
11493
  };
11495
11494
  }
11496
11495
  function parseText(context, mode) {
11497
- const endTokens = mode === "3" ? ["]]>"] : ["<", context.options.delimiters[0]];
11496
+ const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
11498
11497
  let endIndex = context.source.length;
11499
11498
  for (let i = 0; i < endTokens.length; i++) {
11500
11499
  const index = context.source.indexOf(endTokens[i], 1);
@@ -11505,7 +11504,7 @@ function parseText(context, mode) {
11505
11504
  const start = getCursor(context);
11506
11505
  const content = parseTextData(context, endIndex, mode);
11507
11506
  return {
11508
- type: "2",
11507
+ type: 2,
11509
11508
  content,
11510
11509
  loc: getSelection(context, start)
11511
11510
  };
@@ -11513,12 +11512,12 @@ function parseText(context, mode) {
11513
11512
  function parseTextData(context, length, mode) {
11514
11513
  const rawText = context.source.slice(0, length);
11515
11514
  advanceBy(context, length);
11516
- if (mode === "2" || mode === "3" || !rawText.includes("&")) {
11515
+ if (mode === 2 || mode === 3 || !rawText.includes("&")) {
11517
11516
  return rawText;
11518
11517
  } else {
11519
11518
  return context.options.decodeEntities(
11520
11519
  rawText,
11521
- mode === "4"
11520
+ mode === 4
11522
11521
  );
11523
11522
  }
11524
11523
  }
@@ -11574,7 +11573,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
11574
11573
  function isEnd(context, mode, ancestors) {
11575
11574
  const s = context.source;
11576
11575
  switch (mode) {
11577
- case "0":
11576
+ case 0:
11578
11577
  if (startsWith(s, "</")) {
11579
11578
  for (let i = ancestors.length - 1; i >= 0; --i) {
11580
11579
  if (startsWithEndTagOpen(s, ancestors[i].tag)) {
@@ -11583,15 +11582,15 @@ function isEnd(context, mode, ancestors) {
11583
11582
  }
11584
11583
  }
11585
11584
  break;
11586
- case "1":
11587
- case "2": {
11585
+ case 1:
11586
+ case 2: {
11588
11587
  const parent = last(ancestors);
11589
11588
  if (parent && startsWithEndTagOpen(s, parent.tag)) {
11590
11589
  return true;
11591
11590
  }
11592
11591
  break;
11593
11592
  }
11594
- case "3":
11593
+ case 3:
11595
11594
  if (startsWith(s, "]]>")) {
11596
11595
  return true;
11597
11596
  }
@@ -11614,7 +11613,7 @@ function hoistStatic(root, context) {
11614
11613
  }
11615
11614
  function isSingleElementRoot(root, child) {
11616
11615
  const { children } = root;
11617
- return children.length === 1 && child.type === "1" && !isSlotOutlet(child);
11616
+ return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
11618
11617
  }
11619
11618
  function walk(node, context, doNotHoistNode = false) {
11620
11619
  const { children } = node;
@@ -11622,10 +11621,10 @@ function walk(node, context, doNotHoistNode = false) {
11622
11621
  let hoistedCount = 0;
11623
11622
  for (let i = 0; i < children.length; i++) {
11624
11623
  const child = children[i];
11625
- if (child.type === "1" && child.tagType === "0") {
11624
+ if (child.type === 1 && child.tagType === 0) {
11626
11625
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
11627
11626
  if (constantType > 0) {
11628
- if (constantType >= "2") {
11627
+ if (constantType >= 2) {
11629
11628
  child.codegenNode.patchFlag = -1 + (``);
11630
11629
  child.codegenNode = context.hoist(child.codegenNode);
11631
11630
  hoistedCount++;
@@ -11633,9 +11632,9 @@ function walk(node, context, doNotHoistNode = false) {
11633
11632
  }
11634
11633
  } else {
11635
11634
  const codegenNode = child.codegenNode;
11636
- if (codegenNode.type === "13") {
11635
+ if (codegenNode.type === 13) {
11637
11636
  const flag = getPatchFlag(codegenNode);
11638
- if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= "2") {
11637
+ if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
11639
11638
  const props = getNodeProps(child);
11640
11639
  if (props) {
11641
11640
  codegenNode.props = context.hoist(props);
@@ -11647,8 +11646,8 @@ function walk(node, context, doNotHoistNode = false) {
11647
11646
  }
11648
11647
  }
11649
11648
  }
11650
- if (child.type === "1") {
11651
- const isComponent = child.tagType === "1";
11649
+ if (child.type === 1) {
11650
+ const isComponent = child.tagType === 1;
11652
11651
  if (isComponent) {
11653
11652
  context.scopes.vSlot++;
11654
11653
  }
@@ -11656,9 +11655,9 @@ function walk(node, context, doNotHoistNode = false) {
11656
11655
  if (isComponent) {
11657
11656
  context.scopes.vSlot--;
11658
11657
  }
11659
- } else if (child.type === "11") {
11658
+ } else if (child.type === 11) {
11660
11659
  walk(child, context, child.children.length === 1);
11661
- } else if (child.type === "9") {
11660
+ } else if (child.type === 9) {
11662
11661
  for (let i2 = 0; i2 < child.branches.length; i2++) {
11663
11662
  walk(
11664
11663
  child.branches[i2],
@@ -11671,7 +11670,7 @@ function walk(node, context, doNotHoistNode = false) {
11671
11670
  if (hoistedCount && context.transformHoist) {
11672
11671
  context.transformHoist(children, context, node);
11673
11672
  }
11674
- if (hoistedCount && hoistedCount === originalCount && node.type === "1" && node.tagType === "0" && node.codegenNode && node.codegenNode.type === "13" && isArray(node.codegenNode.children)) {
11673
+ if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
11675
11674
  node.codegenNode.children = context.hoist(
11676
11675
  createArrayExpression(node.codegenNode.children)
11677
11676
  );
@@ -11680,8 +11679,8 @@ function walk(node, context, doNotHoistNode = false) {
11680
11679
  function getConstantType(node, context) {
11681
11680
  const { constantCache } = context;
11682
11681
  switch (node.type) {
11683
- case "1":
11684
- if (node.tagType !== "0") {
11682
+ case 1:
11683
+ if (node.tagType !== 0) {
11685
11684
  return 0;
11686
11685
  }
11687
11686
  const cached = constantCache.get(node);
@@ -11689,7 +11688,7 @@ function getConstantType(node, context) {
11689
11688
  return cached;
11690
11689
  }
11691
11690
  const codegenNode = node.codegenNode;
11692
- if (codegenNode.type !== "13") {
11691
+ if (codegenNode.type !== 13) {
11693
11692
  return 0;
11694
11693
  }
11695
11694
  if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
@@ -11697,7 +11696,7 @@ function getConstantType(node, context) {
11697
11696
  }
11698
11697
  const flag = getPatchFlag(codegenNode);
11699
11698
  if (!flag) {
11700
- let returnType2 = "3";
11699
+ let returnType2 = 3;
11701
11700
  const generatedPropsType = getGeneratedPropsConstantType(node, context);
11702
11701
  if (generatedPropsType === 0) {
11703
11702
  constantCache.set(node, 0);
@@ -11716,10 +11715,10 @@ function getConstantType(node, context) {
11716
11715
  returnType2 = childType;
11717
11716
  }
11718
11717
  }
11719
- if (returnType2 > "1") {
11718
+ if (returnType2 > 1) {
11720
11719
  for (let i = 0; i < node.props.length; i++) {
11721
11720
  const p = node.props[i];
11722
- if (p.type === "7" && p.name === "bind" && p.exp) {
11721
+ if (p.type === 7 && p.name === "bind" && p.exp) {
11723
11722
  const expType = getConstantType(p.exp, context);
11724
11723
  if (expType === 0) {
11725
11724
  constantCache.set(node, 0);
@@ -11734,7 +11733,7 @@ function getConstantType(node, context) {
11734
11733
  if (codegenNode.isBlock) {
11735
11734
  for (let i = 0; i < node.props.length; i++) {
11736
11735
  const p = node.props[i];
11737
- if (p.type === "7") {
11736
+ if (p.type === 7) {
11738
11737
  constantCache.set(node, 0);
11739
11738
  return 0;
11740
11739
  }
@@ -11752,20 +11751,20 @@ function getConstantType(node, context) {
11752
11751
  constantCache.set(node, 0);
11753
11752
  return 0;
11754
11753
  }
11755
- case "2":
11756
- case "3":
11757
- return "3";
11758
- case "9":
11759
- case "11":
11760
- case "10":
11754
+ case 2:
11755
+ case 3:
11756
+ return 3;
11757
+ case 9:
11758
+ case 11:
11759
+ case 10:
11761
11760
  return 0;
11762
- case "5":
11763
- case "12":
11761
+ case 5:
11762
+ case 12:
11764
11763
  return getConstantType(node.content, context);
11765
- case "4":
11764
+ case 4:
11766
11765
  return node.constType;
11767
- case "8":
11768
- let returnType = "3";
11766
+ case 8:
11767
+ let returnType = 3;
11769
11768
  for (let i = 0; i < node.children.length; i++) {
11770
11769
  const child = node.children[i];
11771
11770
  if (isString(child) || isSymbol(child)) {
@@ -11790,20 +11789,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
11790
11789
  GUARD_REACTIVE_PROPS
11791
11790
  ]);
11792
11791
  function getConstantTypeOfHelperCall(value, context) {
11793
- if (value.type === "14" && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
11792
+ if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
11794
11793
  const arg = value.arguments[0];
11795
- if (arg.type === "4") {
11794
+ if (arg.type === 4) {
11796
11795
  return getConstantType(arg, context);
11797
- } else if (arg.type === "14") {
11796
+ } else if (arg.type === 14) {
11798
11797
  return getConstantTypeOfHelperCall(arg, context);
11799
11798
  }
11800
11799
  }
11801
11800
  return 0;
11802
11801
  }
11803
11802
  function getGeneratedPropsConstantType(node, context) {
11804
- let returnType = "3";
11803
+ let returnType = 3;
11805
11804
  const props = getNodeProps(node);
11806
- if (props && props.type === "15") {
11805
+ if (props && props.type === 15) {
11807
11806
  const { properties } = props;
11808
11807
  for (let i = 0; i < properties.length; i++) {
11809
11808
  const { key, value } = properties[i];
@@ -11815,9 +11814,9 @@ function getGeneratedPropsConstantType(node, context) {
11815
11814
  returnType = keyType;
11816
11815
  }
11817
11816
  let valueType;
11818
- if (value.type === "4") {
11817
+ if (value.type === 4) {
11819
11818
  valueType = getConstantType(value, context);
11820
- } else if (value.type === "14") {
11819
+ } else if (value.type === 14) {
11821
11820
  valueType = getConstantTypeOfHelperCall(value, context);
11822
11821
  } else {
11823
11822
  valueType = 0;
@@ -11834,7 +11833,7 @@ function getGeneratedPropsConstantType(node, context) {
11834
11833
  }
11835
11834
  function getNodeProps(node) {
11836
11835
  const codegenNode = node.codegenNode;
11837
- if (codegenNode.type === "13") {
11836
+ if (codegenNode.type === 13) {
11838
11837
  return codegenNode.props;
11839
11838
  }
11840
11839
  }
@@ -11956,7 +11955,7 @@ function createTransformContext(root, {
11956
11955
  addId(exp);
11957
11956
  } else if (exp.identifiers) {
11958
11957
  exp.identifiers.forEach(addId);
11959
- } else if (exp.type === "4") {
11958
+ } else if (exp.type === 4) {
11960
11959
  addId(exp.content);
11961
11960
  }
11962
11961
  }
@@ -11967,7 +11966,7 @@ function createTransformContext(root, {
11967
11966
  removeId(exp);
11968
11967
  } else if (exp.identifiers) {
11969
11968
  exp.identifiers.forEach(removeId);
11970
- } else if (exp.type === "4") {
11969
+ } else if (exp.type === 4) {
11971
11970
  removeId(exp.content);
11972
11971
  }
11973
11972
  }
@@ -11980,7 +11979,7 @@ function createTransformContext(root, {
11980
11979
  `_hoisted_${context.hoists.length}`,
11981
11980
  false,
11982
11981
  exp.loc,
11983
- "2"
11982
+ 2
11984
11983
  );
11985
11984
  identifier.hoisted = exp;
11986
11985
  return identifier;
@@ -12031,8 +12030,8 @@ function createRootCodegen(root, context) {
12031
12030
  const child = children[0];
12032
12031
  if (isSingleElementRoot(root, child) && child.codegenNode) {
12033
12032
  const codegenNode = child.codegenNode;
12034
- if (codegenNode.type === "13") {
12035
- makeBlock(codegenNode, context);
12033
+ if (codegenNode.type === 13) {
12034
+ convertToBlock(codegenNode, context);
12036
12035
  }
12037
12036
  root.codegenNode = codegenNode;
12038
12037
  } else {
@@ -12040,7 +12039,6 @@ function createRootCodegen(root, context) {
12040
12039
  }
12041
12040
  } else if (children.length > 1) {
12042
12041
  let patchFlag = 64;
12043
- PatchFlagNames[64];
12044
12042
  root.codegenNode = createVNodeCall(
12045
12043
  context,
12046
12044
  helper(FRAGMENT),
@@ -12091,25 +12089,25 @@ function traverseNode(node, context) {
12091
12089
  }
12092
12090
  }
12093
12091
  switch (node.type) {
12094
- case "3":
12092
+ case 3:
12095
12093
  if (!context.ssr) {
12096
12094
  context.helper(CREATE_COMMENT);
12097
12095
  }
12098
12096
  break;
12099
- case "5":
12097
+ case 5:
12100
12098
  if (!context.ssr) {
12101
12099
  context.helper(TO_DISPLAY_STRING);
12102
12100
  }
12103
12101
  break;
12104
- case "9":
12102
+ case 9:
12105
12103
  for (let i2 = 0; i2 < node.branches.length; i2++) {
12106
12104
  traverseNode(node.branches[i2], context);
12107
12105
  }
12108
12106
  break;
12109
- case "10":
12110
- case "11":
12111
- case "1":
12112
- case "0":
12107
+ case 10:
12108
+ case 11:
12109
+ case 1:
12110
+ case 0:
12113
12111
  traverseChildren(node, context);
12114
12112
  break;
12115
12113
  }
@@ -12122,15 +12120,15 @@ function traverseNode(node, context) {
12122
12120
  function createStructuralDirectiveTransform(name, fn) {
12123
12121
  const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
12124
12122
  return (node, context) => {
12125
- if (node.type === "1") {
12123
+ if (node.type === 1) {
12126
12124
  const { props } = node;
12127
- if (node.tagType === "3" && props.some(isVSlot)) {
12125
+ if (node.tagType === 3 && props.some(isVSlot)) {
12128
12126
  return;
12129
12127
  }
12130
12128
  const exitFns = [];
12131
12129
  for (let i = 0; i < props.length; i++) {
12132
12130
  const prop = props[i];
12133
- if (prop.type === "7" && matches(prop.name)) {
12131
+ if (prop.type === 7 && matches(prop.name)) {
12134
12132
  props.splice(i, 1);
12135
12133
  i--;
12136
12134
  const onExit = fn(node, prop, context);
@@ -12188,7 +12186,7 @@ function createCodegenContext(ast, {
12188
12186
  if (context.map) {
12189
12187
  if (node) {
12190
12188
  let name;
12191
- if (node.type === "4" && !node.isStatic) {
12189
+ if (node.type === 4 && !node.isStatic) {
12192
12190
  const content = node.content.replace(/^_ctx\./, "");
12193
12191
  if (content !== node.content && isSimpleIdentifier(content)) {
12194
12192
  name = content;
@@ -12464,7 +12462,7 @@ function genHoists(hoists, context) {
12464
12462
  for (let i = 0; i < hoists.length; i++) {
12465
12463
  const exp = hoists[i];
12466
12464
  if (exp) {
12467
- const needScopeIdWrapper = genScopeId && exp.type === "13";
12465
+ const needScopeIdWrapper = genScopeId && exp.type === 13;
12468
12466
  push(
12469
12467
  `const _hoisted_${i + 1} = ${needScopeIdWrapper ? `${PURE_ANNOTATION} _withScopeId(() => ` : ``}`
12470
12468
  );
@@ -12489,7 +12487,7 @@ function genImports(importsOptions, context) {
12489
12487
  });
12490
12488
  }
12491
12489
  function isText(n) {
12492
- return isString(n) || n.type === "4" || n.type === "2" || n.type === "5" || n.type === "8";
12490
+ return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
12493
12491
  }
12494
12492
  function genNodeListAsArray(nodes, context) {
12495
12493
  const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
@@ -12530,66 +12528,66 @@ function genNode(node, context) {
12530
12528
  return;
12531
12529
  }
12532
12530
  switch (node.type) {
12533
- case "1":
12534
- case "9":
12535
- case "11":
12531
+ case 1:
12532
+ case 9:
12533
+ case 11:
12536
12534
  genNode(node.codegenNode, context);
12537
12535
  break;
12538
- case "2":
12536
+ case 2:
12539
12537
  genText(node, context);
12540
12538
  break;
12541
- case "4":
12539
+ case 4:
12542
12540
  genExpression(node, context);
12543
12541
  break;
12544
- case "5":
12542
+ case 5:
12545
12543
  genInterpolation(node, context);
12546
12544
  break;
12547
- case "12":
12545
+ case 12:
12548
12546
  genNode(node.codegenNode, context);
12549
12547
  break;
12550
- case "8":
12548
+ case 8:
12551
12549
  genCompoundExpression(node, context);
12552
12550
  break;
12553
- case "3":
12551
+ case 3:
12554
12552
  genComment(node, context);
12555
12553
  break;
12556
- case "13":
12554
+ case 13:
12557
12555
  genVNodeCall(node, context);
12558
12556
  break;
12559
- case "14":
12557
+ case 14:
12560
12558
  genCallExpression(node, context);
12561
12559
  break;
12562
- case "15":
12560
+ case 15:
12563
12561
  genObjectExpression(node, context);
12564
12562
  break;
12565
- case "17":
12563
+ case 17:
12566
12564
  genArrayExpression(node, context);
12567
12565
  break;
12568
- case "18":
12566
+ case 18:
12569
12567
  genFunctionExpression(node, context);
12570
12568
  break;
12571
- case "19":
12569
+ case 19:
12572
12570
  genConditionalExpression(node, context);
12573
12571
  break;
12574
- case "20":
12572
+ case 20:
12575
12573
  genCacheExpression(node, context);
12576
12574
  break;
12577
- case "21":
12575
+ case 21:
12578
12576
  genNodeList(node.body, context, true, false);
12579
12577
  break;
12580
- case "22":
12578
+ case 22:
12581
12579
  genTemplateLiteral(node, context);
12582
12580
  break;
12583
- case "23":
12581
+ case 23:
12584
12582
  genIfStatement(node, context);
12585
12583
  break;
12586
- case "24":
12584
+ case 24:
12587
12585
  genAssignmentExpression(node, context);
12588
12586
  break;
12589
- case "25":
12587
+ case 25:
12590
12588
  genSequenceExpression(node, context);
12591
12589
  break;
12592
- case "26":
12590
+ case 26:
12593
12591
  genReturnStatement(node, context);
12594
12592
  break;
12595
12593
  }
@@ -12621,7 +12619,7 @@ function genCompoundExpression(node, context) {
12621
12619
  }
12622
12620
  function genExpressionAsPropertyKey(node, context) {
12623
12621
  const { push } = context;
12624
- if (node.type === "8") {
12622
+ if (node.type === 8) {
12625
12623
  push(`[`);
12626
12624
  genCompoundExpression(node, context);
12627
12625
  push(`]`);
@@ -12702,7 +12700,7 @@ function genObjectExpression(node, context) {
12702
12700
  push(`{}`, node);
12703
12701
  return;
12704
12702
  }
12705
- const multilines = properties.length > 1 || properties.some((p) => p.value.type !== "4");
12703
+ const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
12706
12704
  push(multilines ? `{` : `{ `);
12707
12705
  multilines && indent();
12708
12706
  for (let i = 0; i < properties.length; i++) {
@@ -12764,7 +12762,7 @@ function genFunctionExpression(node, context) {
12764
12762
  function genConditionalExpression(node, context) {
12765
12763
  const { test, consequent, alternate, newline: needNewline } = node;
12766
12764
  const { push, indent, deindent, newline } = context;
12767
- if (test.type === "4") {
12765
+ if (test.type === 4) {
12768
12766
  const needsParens = !isSimpleIdentifier(test.content);
12769
12767
  needsParens && push(`(`);
12770
12768
  genExpression(test, context);
@@ -12783,7 +12781,7 @@ function genConditionalExpression(node, context) {
12783
12781
  needNewline && newline();
12784
12782
  needNewline || push(` `);
12785
12783
  push(`: `);
12786
- const isNested = alternate.type === "19";
12784
+ const isNested = alternate.type === 19;
12787
12785
  if (!isNested) {
12788
12786
  context.indentLevel++;
12789
12787
  }
@@ -12849,7 +12847,7 @@ function genIfStatement(node, context) {
12849
12847
  push(`}`);
12850
12848
  if (alternate) {
12851
12849
  push(` else `);
12852
- if (alternate.type === "23") {
12850
+ if (alternate.type === 23) {
12853
12851
  genIfStatement(alternate, context);
12854
12852
  } else {
12855
12853
  push(`{`);
@@ -13118,18 +13116,18 @@ function isReferenced(node, parent, grandparent) {
13118
13116
 
13119
13117
  const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
13120
13118
  const transformExpression = (node, context) => {
13121
- if (node.type === "5") {
13119
+ if (node.type === 5) {
13122
13120
  node.content = processExpression(
13123
13121
  node.content,
13124
13122
  context
13125
13123
  );
13126
- } else if (node.type === "1") {
13124
+ } else if (node.type === 1) {
13127
13125
  for (let i = 0; i < node.props.length; i++) {
13128
13126
  const dir = node.props[i];
13129
- if (dir.type === "7" && dir.name !== "for") {
13127
+ if (dir.type === 7 && dir.name !== "for") {
13130
13128
  const exp = dir.exp;
13131
13129
  const arg = dir.arg;
13132
- if (exp && exp.type === "4" && !(dir.name === "on" && arg)) {
13130
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
13133
13131
  dir.exp = processExpression(
13134
13132
  exp,
13135
13133
  context,
@@ -13137,7 +13135,7 @@ const transformExpression = (node, context) => {
13137
13135
  dir.name === "slot"
13138
13136
  );
13139
13137
  }
13140
- if (arg && arg.type === "4" && !arg.isStatic) {
13138
+ if (arg && arg.type === 4 && !arg.isStatic) {
13141
13139
  dir.arg = processExpression(arg, context);
13142
13140
  }
13143
13141
  }
@@ -13213,14 +13211,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13213
13211
  const isLiteral = isLiteralWhitelisted(rawExp);
13214
13212
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
13215
13213
  if (bindingMetadata[node.content] === "setup-const") {
13216
- node.constType = "1";
13214
+ node.constType = 1;
13217
13215
  }
13218
13216
  node.content = rewriteIdentifier(rawExp);
13219
13217
  } else if (!isScopeVarReference) {
13220
13218
  if (isLiteral) {
13221
- node.constType = "3";
13219
+ node.constType = 3;
13222
13220
  } else {
13223
- node.constType = "2";
13221
+ node.constType = 2;
13224
13222
  }
13225
13223
  }
13226
13224
  return node;
@@ -13234,7 +13232,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13234
13232
  } catch (e) {
13235
13233
  context.onError(
13236
13234
  createCompilerError(
13237
- "45",
13235
+ 45,
13238
13236
  node.loc,
13239
13237
  void 0,
13240
13238
  e.message
@@ -13293,7 +13291,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13293
13291
  start: advancePositionWithClone(node.loc.start, source2, start),
13294
13292
  end: advancePositionWithClone(node.loc.start, source2, end)
13295
13293
  },
13296
- id.isConstant ? "3" : 0
13294
+ id.isConstant ? 3 : 0
13297
13295
  )
13298
13296
  );
13299
13297
  if (i === ids.length - 1 && end < rawExp.length) {
@@ -13305,7 +13303,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
13305
13303
  ret = createCompoundExpression(children, node.loc);
13306
13304
  } else {
13307
13305
  ret = node;
13308
- ret.constType = bailConstant ? 0 : "3";
13306
+ ret.constType = bailConstant ? 0 : 3;
13309
13307
  }
13310
13308
  ret.identifiers = Object.keys(knownIds);
13311
13309
  return ret;
@@ -13322,7 +13320,7 @@ function canPrefix(id) {
13322
13320
  function stringifyExpression(exp) {
13323
13321
  if (isString(exp)) {
13324
13322
  return exp;
13325
- } else if (exp.type === "4") {
13323
+ } else if (exp.type === 4) {
13326
13324
  return exp.content;
13327
13325
  } else {
13328
13326
  return exp.children.map(stringifyExpression).join("");
@@ -13338,7 +13336,7 @@ const transformIf = createStructuralDirectiveTransform(
13338
13336
  let key = 0;
13339
13337
  while (i-- >= 0) {
13340
13338
  const sibling = siblings[i];
13341
- if (sibling && sibling.type === "9") {
13339
+ if (sibling && sibling.type === 9) {
13342
13340
  key += sibling.branches.length;
13343
13341
  }
13344
13342
  }
@@ -13365,7 +13363,7 @@ function processIf(node, dir, context, processCodegen) {
13365
13363
  if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
13366
13364
  const loc = dir.exp ? dir.exp.loc : node.loc;
13367
13365
  context.onError(
13368
- createCompilerError("28", dir.loc)
13366
+ createCompilerError(28, dir.loc)
13369
13367
  );
13370
13368
  dir.exp = createSimpleExpression(`true`, false, loc);
13371
13369
  }
@@ -13375,7 +13373,7 @@ function processIf(node, dir, context, processCodegen) {
13375
13373
  if (dir.name === "if") {
13376
13374
  const branch = createIfBranch(node, dir);
13377
13375
  const ifNode = {
13378
- type: "9",
13376
+ type: 9,
13379
13377
  loc: node.loc,
13380
13378
  branches: [branch]
13381
13379
  };
@@ -13388,18 +13386,18 @@ function processIf(node, dir, context, processCodegen) {
13388
13386
  let i = siblings.indexOf(node);
13389
13387
  while (i-- >= -1) {
13390
13388
  const sibling = siblings[i];
13391
- if (sibling && sibling.type === "3") {
13389
+ if (sibling && sibling.type === 3) {
13392
13390
  context.removeNode(sibling);
13393
13391
  continue;
13394
13392
  }
13395
- if (sibling && sibling.type === "2" && !sibling.content.trim().length) {
13393
+ if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
13396
13394
  context.removeNode(sibling);
13397
13395
  continue;
13398
13396
  }
13399
- if (sibling && sibling.type === "9") {
13397
+ if (sibling && sibling.type === 9) {
13400
13398
  if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
13401
13399
  context.onError(
13402
- createCompilerError("30", node.loc)
13400
+ createCompilerError(30, node.loc)
13403
13401
  );
13404
13402
  }
13405
13403
  context.removeNode();
@@ -13411,7 +13409,7 @@ function processIf(node, dir, context, processCodegen) {
13411
13409
  if (isSameKey(userKey, key)) {
13412
13410
  context.onError(
13413
13411
  createCompilerError(
13414
- "29",
13412
+ 29,
13415
13413
  branch.userKey.loc
13416
13414
  )
13417
13415
  );
@@ -13427,7 +13425,7 @@ function processIf(node, dir, context, processCodegen) {
13427
13425
  context.currentNode = null;
13428
13426
  } else {
13429
13427
  context.onError(
13430
- createCompilerError("30", node.loc)
13428
+ createCompilerError(30, node.loc)
13431
13429
  );
13432
13430
  }
13433
13431
  break;
@@ -13435,9 +13433,9 @@ function processIf(node, dir, context, processCodegen) {
13435
13433
  }
13436
13434
  }
13437
13435
  function createIfBranch(node, dir) {
13438
- const isTemplateIf = node.tagType === "3";
13436
+ const isTemplateIf = node.tagType === 3;
13439
13437
  return {
13440
- type: "10",
13438
+ type: 10,
13441
13439
  loc: node.loc,
13442
13440
  condition: dir.name === "else" ? void 0 : dir.exp,
13443
13441
  children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
@@ -13469,14 +13467,14 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
13469
13467
  `${keyIndex}`,
13470
13468
  false,
13471
13469
  locStub,
13472
- "2"
13470
+ 2
13473
13471
  )
13474
13472
  );
13475
13473
  const { children } = branch;
13476
13474
  const firstChild = children[0];
13477
- const needFragmentWrapper = children.length !== 1 || firstChild.type !== "1";
13475
+ const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
13478
13476
  if (needFragmentWrapper) {
13479
- if (children.length === 1 && firstChild.type === "11") {
13477
+ if (children.length === 1 && firstChild.type === 11) {
13480
13478
  const vnodeCall = firstChild.codegenNode;
13481
13479
  injectProp(vnodeCall, keyProperty, context);
13482
13480
  return vnodeCall;
@@ -13499,8 +13497,8 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
13499
13497
  } else {
13500
13498
  const ret = firstChild.codegenNode;
13501
13499
  const vnodeCall = getMemoedVNodeCall(ret);
13502
- if (vnodeCall.type === "13") {
13503
- makeBlock(vnodeCall, context);
13500
+ if (vnodeCall.type === 13) {
13501
+ convertToBlock(vnodeCall, context);
13504
13502
  }
13505
13503
  injectProp(vnodeCall, keyProperty, context);
13506
13504
  return ret;
@@ -13510,7 +13508,7 @@ function isSameKey(a, b) {
13510
13508
  if (!a || a.type !== b.type) {
13511
13509
  return false;
13512
13510
  }
13513
- if (a.type === "6") {
13511
+ if (a.type === 6) {
13514
13512
  if (a.value.content !== b.value.content) {
13515
13513
  return false;
13516
13514
  }
@@ -13520,7 +13518,7 @@ function isSameKey(a, b) {
13520
13518
  if (exp.type !== branchExp.type) {
13521
13519
  return false;
13522
13520
  }
13523
- if (exp.type !== "4" || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
13521
+ if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
13524
13522
  return false;
13525
13523
  }
13526
13524
  }
@@ -13528,13 +13526,13 @@ function isSameKey(a, b) {
13528
13526
  }
13529
13527
  function getParentCondition(node) {
13530
13528
  while (true) {
13531
- if (node.type === "19") {
13532
- if (node.alternate.type === "19") {
13529
+ if (node.type === 19) {
13530
+ if (node.alternate.type === 19) {
13533
13531
  node = node.alternate;
13534
13532
  } else {
13535
13533
  return node;
13536
13534
  }
13537
- } else if (node.type === "20") {
13535
+ } else if (node.type === 20) {
13538
13536
  node = node.value;
13539
13537
  }
13540
13538
  }
@@ -13551,7 +13549,7 @@ const transformFor = createStructuralDirectiveTransform(
13551
13549
  const isTemplate = isTemplateNode(node);
13552
13550
  const memo = findDir(node, "memo");
13553
13551
  const keyProp = findProp(node, `key`);
13554
- const keyExp = keyProp && (keyProp.type === "6" ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
13552
+ const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
13555
13553
  const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
13556
13554
  if (isTemplate) {
13557
13555
  if (memo) {
@@ -13560,14 +13558,14 @@ const transformFor = createStructuralDirectiveTransform(
13560
13558
  context
13561
13559
  );
13562
13560
  }
13563
- if (keyProperty && keyProp.type !== "6") {
13561
+ if (keyProperty && keyProp.type !== 6) {
13564
13562
  keyProperty.value = processExpression(
13565
13563
  keyProperty.value,
13566
13564
  context
13567
13565
  );
13568
13566
  }
13569
13567
  }
13570
- const isStableFragment = forNode.source.type === "4" && forNode.source.constType > 0;
13568
+ const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
13571
13569
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
13572
13570
  forNode.codegenNode = createVNodeCall(
13573
13571
  context,
@@ -13587,12 +13585,12 @@ const transformFor = createStructuralDirectiveTransform(
13587
13585
  const { children } = forNode;
13588
13586
  if (isTemplate) {
13589
13587
  node.children.some((c) => {
13590
- if (c.type === "1") {
13588
+ if (c.type === 1) {
13591
13589
  const key = findProp(c, "key");
13592
13590
  if (key) {
13593
13591
  context.onError(
13594
13592
  createCompilerError(
13595
- "33",
13593
+ 33,
13596
13594
  key.loc
13597
13595
  )
13598
13596
  );
@@ -13601,7 +13599,7 @@ const transformFor = createStructuralDirectiveTransform(
13601
13599
  }
13602
13600
  });
13603
13601
  }
13604
- const needFragmentWrapper = children.length !== 1 || children[0].type !== "1";
13602
+ const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
13605
13603
  const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
13606
13604
  if (slotOutlet) {
13607
13605
  childBlock = slotOutlet.codegenNode;
@@ -13688,7 +13686,7 @@ const transformFor = createStructuralDirectiveTransform(
13688
13686
  function processFor(node, dir, context, processCodegen) {
13689
13687
  if (!dir.exp) {
13690
13688
  context.onError(
13691
- createCompilerError("31", dir.loc)
13689
+ createCompilerError(31, dir.loc)
13692
13690
  );
13693
13691
  return;
13694
13692
  }
@@ -13700,14 +13698,14 @@ function processFor(node, dir, context, processCodegen) {
13700
13698
  );
13701
13699
  if (!parseResult) {
13702
13700
  context.onError(
13703
- createCompilerError("32", dir.loc)
13701
+ createCompilerError(32, dir.loc)
13704
13702
  );
13705
13703
  return;
13706
13704
  }
13707
13705
  const { addIdentifiers, removeIdentifiers, scopes } = context;
13708
13706
  const { source, value, key, index } = parseResult;
13709
13707
  const forNode = {
13710
- type: "11",
13708
+ type: 11,
13711
13709
  loc: dir.loc,
13712
13710
  source,
13713
13711
  valueAlias: value,
@@ -13821,7 +13819,7 @@ function createParamsList(args) {
13821
13819
 
13822
13820
  const defaultFallback = createSimpleExpression(`undefined`, false);
13823
13821
  const trackSlotScopes = (node, context) => {
13824
- if (node.type === "1" && (node.tagType === "1" || node.tagType === "3")) {
13822
+ if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
13825
13823
  const vSlot = findDir(node, "slot");
13826
13824
  if (vSlot) {
13827
13825
  const slotProps = vSlot.exp;
@@ -13897,14 +13895,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13897
13895
  const slotElement = children[i];
13898
13896
  let slotDir;
13899
13897
  if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
13900
- if (slotElement.type !== "3") {
13898
+ if (slotElement.type !== 3) {
13901
13899
  implicitDefaultChildren.push(slotElement);
13902
13900
  }
13903
13901
  continue;
13904
13902
  }
13905
13903
  if (onComponentSlot) {
13906
13904
  context.onError(
13907
- createCompilerError("37", slotDir.loc)
13905
+ createCompilerError(37, slotDir.loc)
13908
13906
  );
13909
13907
  break;
13910
13908
  }
@@ -13944,7 +13942,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13944
13942
  let prev;
13945
13943
  while (j--) {
13946
13944
  prev = children[j];
13947
- if (prev.type !== "3") {
13945
+ if (prev.type !== 3) {
13948
13946
  break;
13949
13947
  }
13950
13948
  }
@@ -13952,7 +13950,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13952
13950
  children.splice(i, 1);
13953
13951
  i--;
13954
13952
  let conditional = dynamicSlots[dynamicSlots.length - 1];
13955
- while (conditional.alternate.type === "19") {
13953
+ while (conditional.alternate.type === 19) {
13956
13954
  conditional = conditional.alternate;
13957
13955
  }
13958
13956
  conditional.alternate = vElse.exp ? createConditionalExpression(
@@ -13966,7 +13964,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13966
13964
  ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
13967
13965
  } else {
13968
13966
  context.onError(
13969
- createCompilerError("30", vElse.loc)
13967
+ createCompilerError(30, vElse.loc)
13970
13968
  );
13971
13969
  }
13972
13970
  } else if (vFor = findDir(slotElement, "for")) {
@@ -13986,7 +13984,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13986
13984
  );
13987
13985
  } else {
13988
13986
  context.onError(
13989
- createCompilerError("32", vFor.loc)
13987
+ createCompilerError(32, vFor.loc)
13990
13988
  );
13991
13989
  }
13992
13990
  } else {
@@ -13994,7 +13992,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13994
13992
  if (seenSlotNames.has(staticSlotName)) {
13995
13993
  context.onError(
13996
13994
  createCompilerError(
13997
- "38",
13995
+ 38,
13998
13996
  dirLoc
13999
13997
  )
14000
13998
  );
@@ -14025,7 +14023,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14025
14023
  if (hasNamedDefaultSlot) {
14026
14024
  context.onError(
14027
14025
  createCompilerError(
14028
- "39",
14026
+ 39,
14029
14027
  implicitDefaultChildren[0].loc
14030
14028
  )
14031
14029
  );
@@ -14078,17 +14076,17 @@ function hasForwardedSlots(children) {
14078
14076
  for (let i = 0; i < children.length; i++) {
14079
14077
  const child = children[i];
14080
14078
  switch (child.type) {
14081
- case "1":
14082
- if (child.tagType === "2" || hasForwardedSlots(child.children)) {
14079
+ case 1:
14080
+ if (child.tagType === 2 || hasForwardedSlots(child.children)) {
14083
14081
  return true;
14084
14082
  }
14085
14083
  break;
14086
- case "9":
14084
+ case 9:
14087
14085
  if (hasForwardedSlots(child.branches))
14088
14086
  return true;
14089
14087
  break;
14090
- case "10":
14091
- case "11":
14088
+ case 10:
14089
+ case 11:
14092
14090
  if (hasForwardedSlots(child.children))
14093
14091
  return true;
14094
14092
  break;
@@ -14097,20 +14095,20 @@ function hasForwardedSlots(children) {
14097
14095
  return false;
14098
14096
  }
14099
14097
  function isNonWhitespaceContent(node) {
14100
- if (node.type !== "2" && node.type !== "12")
14098
+ if (node.type !== 2 && node.type !== 12)
14101
14099
  return true;
14102
- return node.type === "2" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
14100
+ return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
14103
14101
  }
14104
14102
 
14105
14103
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
14106
14104
  const transformElement = (node, context) => {
14107
14105
  return function postTransformElement() {
14108
14106
  node = context.currentNode;
14109
- if (!(node.type === "1" && (node.tagType === "0" || node.tagType === "1"))) {
14107
+ if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
14110
14108
  return;
14111
14109
  }
14112
14110
  const { tag, props } = node;
14113
- const isComponent = node.tagType === "1";
14111
+ const isComponent = node.tagType === 1;
14114
14112
  let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
14115
14113
  const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
14116
14114
  let vnodeProps;
@@ -14164,11 +14162,11 @@ const transformElement = (node, context) => {
14164
14162
  } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
14165
14163
  const child = node.children[0];
14166
14164
  const type = child.type;
14167
- const hasDynamicTextChild = type === "5" || type === "8";
14165
+ const hasDynamicTextChild = type === 5 || type === 8;
14168
14166
  if (hasDynamicTextChild && getConstantType(child, context) === 0) {
14169
14167
  patchFlag |= 1;
14170
14168
  }
14171
- if (hasDynamicTextChild || type === "2") {
14169
+ if (hasDynamicTextChild || type === 2) {
14172
14170
  vnodeChildren = child;
14173
14171
  } else {
14174
14172
  vnodeChildren = node.children;
@@ -14209,13 +14207,13 @@ function resolveComponentType(node, context, ssr = false) {
14209
14207
  "COMPILER_IS_ON_ELEMENT",
14210
14208
  context
14211
14209
  )) {
14212
- const exp = isProp.type === "6" ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
14210
+ const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
14213
14211
  if (exp) {
14214
14212
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
14215
14213
  exp
14216
14214
  ]);
14217
14215
  }
14218
- } else if (isProp.type === "6" && isProp.value.content.startsWith("vue:")) {
14216
+ } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
14219
14217
  tag = isProp.value.content.slice(4);
14220
14218
  }
14221
14219
  }
@@ -14325,7 +14323,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14325
14323
  if (isEventHandler && isReservedProp(name)) {
14326
14324
  hasVnodeHook = true;
14327
14325
  }
14328
- if (value.type === "20" || (value.type === "4" || value.type === "8") && getConstantType(value, context) > 0) {
14326
+ if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
14329
14327
  return;
14330
14328
  }
14331
14329
  if (name === "ref") {
@@ -14346,7 +14344,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14346
14344
  };
14347
14345
  for (let i = 0; i < props.length; i++) {
14348
14346
  const prop = props[i];
14349
- if (prop.type === "6") {
14347
+ if (prop.type === 6) {
14350
14348
  const { loc, name, value } = prop;
14351
14349
  let isStatic = true;
14352
14350
  if (name === "ref") {
@@ -14399,7 +14397,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14399
14397
  if (name === "slot") {
14400
14398
  if (!isComponent) {
14401
14399
  context.onError(
14402
- createCompilerError("40", loc)
14400
+ createCompilerError(40, loc)
14403
14401
  );
14404
14402
  }
14405
14403
  continue;
@@ -14449,7 +14447,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14449
14447
  mergeArgs.push(exp);
14450
14448
  } else {
14451
14449
  pushMergeArg({
14452
- type: "14",
14450
+ type: 14,
14453
14451
  loc,
14454
14452
  callee: context.helper(TO_HANDLERS),
14455
14453
  arguments: isComponent ? [exp] : [exp, `true`]
@@ -14458,7 +14456,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14458
14456
  } else {
14459
14457
  context.onError(
14460
14458
  createCompilerError(
14461
- isVBind ? "34" : "35",
14459
+ isVBind ? 34 : 35,
14462
14460
  loc
14463
14461
  )
14464
14462
  );
@@ -14527,7 +14525,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14527
14525
  }
14528
14526
  if (!context.inSSR && propsExpression) {
14529
14527
  switch (propsExpression.type) {
14530
- case "15":
14528
+ case 15:
14531
14529
  let classKeyIndex = -1;
14532
14530
  let styleKeyIndex = -1;
14533
14531
  let hasDynamicKey = false;
@@ -14554,9 +14552,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14554
14552
  }
14555
14553
  if (styleProp && // the static style is compiled into an object,
14556
14554
  // so use `hasStyleBinding` to ensure that it is a dynamic style binding
14557
- (hasStyleBinding || styleProp.value.type === "4" && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
14555
+ (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
14558
14556
  // v-bind:style with static literal object
14559
- styleProp.value.type === "17")) {
14557
+ styleProp.value.type === 17)) {
14560
14558
  styleProp.value = createCallExpression(
14561
14559
  context.helper(NORMALIZE_STYLE),
14562
14560
  [styleProp.value]
@@ -14569,7 +14567,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14569
14567
  );
14570
14568
  }
14571
14569
  break;
14572
- case "14":
14570
+ case 14:
14573
14571
  break;
14574
14572
  default:
14575
14573
  propsExpression = createCallExpression(
@@ -14596,7 +14594,7 @@ function dedupeProperties(properties) {
14596
14594
  const deduped = [];
14597
14595
  for (let i = 0; i < properties.length; i++) {
14598
14596
  const prop = properties[i];
14599
- if (prop.key.type === "8" || !prop.key.isStatic) {
14597
+ if (prop.key.type === 8 || !prop.key.isStatic) {
14600
14598
  deduped.push(prop);
14601
14599
  continue;
14602
14600
  }
@@ -14614,7 +14612,7 @@ function dedupeProperties(properties) {
14614
14612
  return deduped;
14615
14613
  }
14616
14614
  function mergeAsArray(existing, incoming) {
14617
- if (existing.value.type === "17") {
14615
+ if (existing.value.type === 17) {
14618
14616
  existing.value.elements.push(incoming.value);
14619
14617
  } else {
14620
14618
  existing.value = createArrayExpression(
@@ -14716,7 +14714,7 @@ function processSlotOutlet(node, context) {
14716
14714
  const nonNameProps = [];
14717
14715
  for (let i = 0; i < node.props.length; i++) {
14718
14716
  const p = node.props[i];
14719
- if (p.type === "6") {
14717
+ if (p.type === 6) {
14720
14718
  if (p.value) {
14721
14719
  if (p.name === "name") {
14722
14720
  slotName = JSON.stringify(p.value.content);
@@ -14749,7 +14747,7 @@ function processSlotOutlet(node, context) {
14749
14747
  if (directives.length) {
14750
14748
  context.onError(
14751
14749
  createCompilerError(
14752
- "36",
14750
+ 36,
14753
14751
  directives[0].loc
14754
14752
  )
14755
14753
  );
@@ -14765,16 +14763,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
14765
14763
  const transformOn$1 = (dir, node, context, augmentor) => {
14766
14764
  const { loc, modifiers, arg } = dir;
14767
14765
  if (!dir.exp && !modifiers.length) {
14768
- context.onError(createCompilerError("35", loc));
14766
+ context.onError(createCompilerError(35, loc));
14769
14767
  }
14770
14768
  let eventName;
14771
- if (arg.type === "4") {
14769
+ if (arg.type === 4) {
14772
14770
  if (arg.isStatic) {
14773
14771
  let rawName = arg.content;
14774
14772
  if (rawName.startsWith("vue:")) {
14775
14773
  rawName = `vnode-${rawName.slice(4)}`;
14776
14774
  }
14777
- const eventString = node.tagType !== "0" || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
14775
+ const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
14778
14776
  // for non-element and vnode lifecycle event listeners, auto convert
14779
14777
  // it to camelCase. See issue #2249
14780
14778
  toHandlerKey(camelize(rawName))
@@ -14817,16 +14815,16 @@ const transformOn$1 = (dir, node, context, augmentor) => {
14817
14815
  shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once
14818
14816
  !context.inVOnce && // runtime constants don't need to be cached
14819
14817
  // (this is analyzed by compileScript in SFC <script setup>)
14820
- !(exp.type === "4" && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -
14818
+ !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -
14821
14819
  // we need to use the original function to preserve arity,
14822
14820
  // e.g. <transition> relies on checking cb.length to determine
14823
14821
  // transition end handling. Inline function is ok since its arity
14824
14822
  // is preserved even when cached.
14825
- !(isMemberExp && node.tagType === "1") && // bail if the function references closure variables (v-for, v-slot)
14823
+ !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot)
14826
14824
  // it must be passed fresh to avoid stale values.
14827
14825
  !hasScopeRef(exp, context.identifiers);
14828
14826
  if (shouldCache && isMemberExp) {
14829
- if (exp.type === "4") {
14827
+ if (exp.type === 4) {
14830
14828
  exp.content = `${exp.content} && ${exp.content}(...args)`;
14831
14829
  } else {
14832
14830
  exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`];
@@ -14864,14 +14862,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
14864
14862
  const transformBind = (dir, _node, context) => {
14865
14863
  const { exp, modifiers, loc } = dir;
14866
14864
  const arg = dir.arg;
14867
- if (arg.type !== "4") {
14865
+ if (arg.type !== 4) {
14868
14866
  arg.children.unshift(`(`);
14869
14867
  arg.children.push(`) || ""`);
14870
14868
  } else if (!arg.isStatic) {
14871
14869
  arg.content = `${arg.content} || ""`;
14872
14870
  }
14873
14871
  if (modifiers.includes("camel")) {
14874
- if (arg.type === "4") {
14872
+ if (arg.type === 4) {
14875
14873
  if (arg.isStatic) {
14876
14874
  arg.content = camelize(arg.content);
14877
14875
  } else {
@@ -14890,8 +14888,8 @@ const transformBind = (dir, _node, context) => {
14890
14888
  injectPrefix(arg, "^");
14891
14889
  }
14892
14890
  }
14893
- if (!exp || exp.type === "4" && !exp.content.trim()) {
14894
- context.onError(createCompilerError("34", loc));
14891
+ if (!exp || exp.type === 4 && !exp.content.trim()) {
14892
+ context.onError(createCompilerError(34, loc));
14895
14893
  return {
14896
14894
  props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
14897
14895
  };
@@ -14901,7 +14899,7 @@ const transformBind = (dir, _node, context) => {
14901
14899
  };
14902
14900
  };
14903
14901
  const injectPrefix = (arg, prefix) => {
14904
- if (arg.type === "4") {
14902
+ if (arg.type === 4) {
14905
14903
  if (arg.isStatic) {
14906
14904
  arg.content = prefix + arg.content;
14907
14905
  } else {
@@ -14914,7 +14912,7 @@ const injectPrefix = (arg, prefix) => {
14914
14912
  };
14915
14913
 
14916
14914
  const transformText = (node, context) => {
14917
- if (node.type === "0" || node.type === "1" || node.type === "11" || node.type === "10") {
14915
+ if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
14918
14916
  return () => {
14919
14917
  const children = node.children;
14920
14918
  let currentContainer = void 0;
@@ -14946,13 +14944,13 @@ const transformText = (node, context) => {
14946
14944
  // as-is since the runtime has dedicated fast path for this by directly
14947
14945
  // setting textContent of the element.
14948
14946
  // for component root it's always normalized anyway.
14949
- children.length === 1 && (node.type === "0" || node.type === "1" && node.tagType === "0" && // #3756
14947
+ children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
14950
14948
  // custom directives can potentially add DOM elements arbitrarily,
14951
14949
  // we need to avoid setting textContent of the element at runtime
14952
14950
  // to avoid accidentally overwriting the DOM elements added
14953
14951
  // by the user through custom directives.
14954
14952
  !node.props.find(
14955
- (p) => p.type === "7" && !context.directiveTransforms[p.name]
14953
+ (p) => p.type === 7 && !context.directiveTransforms[p.name]
14956
14954
  ) && // in compat mode, <template> tags with no special directives
14957
14955
  // will be rendered as a fragment so its children must be
14958
14956
  // converted into vnodes.
@@ -14961,9 +14959,9 @@ const transformText = (node, context) => {
14961
14959
  }
14962
14960
  for (let i = 0; i < children.length; i++) {
14963
14961
  const child = children[i];
14964
- if (isText$1(child) || child.type === "8") {
14962
+ if (isText$1(child) || child.type === 8) {
14965
14963
  const callArgs = [];
14966
- if (child.type !== "2" || child.content !== " ") {
14964
+ if (child.type !== 2 || child.content !== " ") {
14967
14965
  callArgs.push(child);
14968
14966
  }
14969
14967
  if (!context.ssr && getConstantType(child, context) === 0) {
@@ -14972,7 +14970,7 @@ const transformText = (node, context) => {
14972
14970
  );
14973
14971
  }
14974
14972
  children[i] = {
14975
- type: "12",
14973
+ type: 12,
14976
14974
  content: child,
14977
14975
  loc: child.loc,
14978
14976
  codegenNode: createCallExpression(
@@ -14988,7 +14986,7 @@ const transformText = (node, context) => {
14988
14986
 
14989
14987
  const seen$1 = /* @__PURE__ */ new WeakSet();
14990
14988
  const transformOnce = (node, context) => {
14991
- if (node.type === "1" && findDir(node, "once", true)) {
14989
+ if (node.type === 1 && findDir(node, "once", true)) {
14992
14990
  if (seen$1.has(node) || context.inVOnce) {
14993
14991
  return;
14994
14992
  }
@@ -15013,27 +15011,27 @@ const transformModel$1 = (dir, node, context) => {
15013
15011
  const { exp, arg } = dir;
15014
15012
  if (!exp) {
15015
15013
  context.onError(
15016
- createCompilerError("41", dir.loc)
15014
+ createCompilerError(41, dir.loc)
15017
15015
  );
15018
15016
  return createTransformProps();
15019
15017
  }
15020
15018
  const rawExp = exp.loc.source;
15021
- const expString = exp.type === "4" ? exp.content : rawExp;
15019
+ const expString = exp.type === 4 ? exp.content : rawExp;
15022
15020
  const bindingType = context.bindingMetadata[rawExp];
15023
15021
  if (bindingType === "props" || bindingType === "props-aliased") {
15024
- context.onError(createCompilerError("44", exp.loc));
15022
+ context.onError(createCompilerError(44, exp.loc));
15025
15023
  return createTransformProps();
15026
15024
  }
15027
15025
  const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
15028
15026
  if (!expString.trim() || !isMemberExpression(expString, context) && !maybeRef) {
15029
15027
  context.onError(
15030
- createCompilerError("42", exp.loc)
15028
+ createCompilerError(42, exp.loc)
15031
15029
  );
15032
15030
  return createTransformProps();
15033
15031
  }
15034
15032
  if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) {
15035
15033
  context.onError(
15036
- createCompilerError("43", exp.loc)
15034
+ createCompilerError(43, exp.loc)
15037
15035
  );
15038
15036
  return createTransformProps();
15039
15037
  }
@@ -15072,7 +15070,7 @@ const transformModel$1 = (dir, node, context) => {
15072
15070
  if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) {
15073
15071
  props[1].value = context.cache(props[1].value);
15074
15072
  }
15075
- if (dir.modifiers.length && node.tagType === "1") {
15073
+ if (dir.modifiers.length && node.tagType === 1) {
15076
15074
  const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
15077
15075
  const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
15078
15076
  props.push(
@@ -15082,7 +15080,7 @@ const transformModel$1 = (dir, node, context) => {
15082
15080
  `{ ${modifiers} }`,
15083
15081
  false,
15084
15082
  dir.loc,
15085
- "2"
15083
+ 2
15086
15084
  )
15087
15085
  )
15088
15086
  );
@@ -15098,30 +15096,30 @@ const transformFilter = (node, context) => {
15098
15096
  if (!isCompatEnabled("COMPILER_FILTER", context)) {
15099
15097
  return;
15100
15098
  }
15101
- if (node.type === "5") {
15099
+ if (node.type === 5) {
15102
15100
  rewriteFilter(node.content, context);
15103
15101
  }
15104
- if (node.type === "1") {
15102
+ if (node.type === 1) {
15105
15103
  node.props.forEach((prop) => {
15106
- if (prop.type === "7" && prop.name !== "for" && prop.exp) {
15104
+ if (prop.type === 7 && prop.name !== "for" && prop.exp) {
15107
15105
  rewriteFilter(prop.exp, context);
15108
15106
  }
15109
15107
  });
15110
15108
  }
15111
15109
  };
15112
15110
  function rewriteFilter(node, context) {
15113
- if (node.type === "4") {
15111
+ if (node.type === 4) {
15114
15112
  parseFilter(node, context);
15115
15113
  } else {
15116
15114
  for (let i = 0; i < node.children.length; i++) {
15117
15115
  const child = node.children[i];
15118
15116
  if (typeof child !== "object")
15119
15117
  continue;
15120
- if (child.type === "4") {
15118
+ if (child.type === 4) {
15121
15119
  parseFilter(child, context);
15122
- } else if (child.type === "8") {
15120
+ } else if (child.type === 8) {
15123
15121
  rewriteFilter(node, context);
15124
- } else if (child.type === "5") {
15122
+ } else if (child.type === 5) {
15125
15123
  rewriteFilter(child.content, context);
15126
15124
  }
15127
15125
  }
@@ -15237,7 +15235,7 @@ function wrapFilter(exp, filter, context) {
15237
15235
 
15238
15236
  const seen = /* @__PURE__ */ new WeakSet();
15239
15237
  const transformMemo = (node, context) => {
15240
- if (node.type === "1") {
15238
+ if (node.type === 1) {
15241
15239
  const dir = findDir(node, "memo");
15242
15240
  if (!dir || seen.has(node)) {
15243
15241
  return;
@@ -15245,9 +15243,9 @@ const transformMemo = (node, context) => {
15245
15243
  seen.add(node);
15246
15244
  return () => {
15247
15245
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
15248
- if (codegenNode && codegenNode.type === "13") {
15249
- if (node.tagType !== "1") {
15250
- makeBlock(codegenNode, context);
15246
+ if (codegenNode && codegenNode.type === 13) {
15247
+ if (node.tagType !== 1) {
15248
+ convertToBlock(codegenNode, context);
15251
15249
  }
15252
15250
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
15253
15251
  dir.exp,
@@ -15290,10 +15288,10 @@ function baseCompile(template, options = {}) {
15290
15288
  const isModuleMode = options.mode === "module";
15291
15289
  const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
15292
15290
  if (!prefixIdentifiers && options.cacheHandlers) {
15293
- onError(createCompilerError("49"));
15291
+ onError(createCompilerError(49));
15294
15292
  }
15295
15293
  if (options.scopeId && !isModuleMode) {
15296
- onError(createCompilerError("50"));
15294
+ onError(createCompilerError(50));
15297
15295
  }
15298
15296
  const ast = isString(template) ? baseParse(template, options) : template;
15299
15297
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
@@ -17711,30 +17709,30 @@ const parserOptions = {
17711
17709
  // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
17712
17710
  getNamespace(tag, parent) {
17713
17711
  let ns = parent ? parent.ns : 0;
17714
- if (parent && ns === "2") {
17712
+ if (parent && ns === 2) {
17715
17713
  if (parent.tag === "annotation-xml") {
17716
17714
  if (tag === "svg") {
17717
- return "1";
17715
+ return 1;
17718
17716
  }
17719
17717
  if (parent.props.some(
17720
- (a) => a.type === "6" && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
17718
+ (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
17721
17719
  )) {
17722
17720
  ns = 0;
17723
17721
  }
17724
17722
  } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
17725
17723
  ns = 0;
17726
17724
  }
17727
- } else if (parent && ns === "1") {
17725
+ } else if (parent && ns === 1) {
17728
17726
  if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
17729
17727
  ns = 0;
17730
17728
  }
17731
17729
  }
17732
17730
  if (ns === 0) {
17733
17731
  if (tag === "svg") {
17734
- return "1";
17732
+ return 1;
17735
17733
  }
17736
17734
  if (tag === "math") {
17737
- return "2";
17735
+ return 2;
17738
17736
  }
17739
17737
  }
17740
17738
  return ns;
@@ -17743,22 +17741,22 @@ const parserOptions = {
17743
17741
  getTextMode({ tag, ns }) {
17744
17742
  if (ns === 0) {
17745
17743
  if (tag === "textarea" || tag === "title") {
17746
- return "1";
17744
+ return 1;
17747
17745
  }
17748
17746
  if (isRawTextContainer(tag)) {
17749
- return "2";
17747
+ return 2;
17750
17748
  }
17751
17749
  }
17752
- return "0";
17750
+ return 0;
17753
17751
  }
17754
17752
  };
17755
17753
 
17756
17754
  const transformStyle = (node) => {
17757
- if (node.type === "1") {
17755
+ if (node.type === 1) {
17758
17756
  node.props.forEach((p, i) => {
17759
- if (p.type === "6" && p.name === "style" && p.value) {
17757
+ if (p.type === 6 && p.name === "style" && p.value) {
17760
17758
  node.props[i] = {
17761
- type: "7",
17759
+ type: 7,
17762
17760
  name: `bind`,
17763
17761
  arg: createSimpleExpression(`style`, true, p.loc),
17764
17762
  exp: parseInlineCSS(p.value.content, p.loc),
@@ -17775,7 +17773,7 @@ const parseInlineCSS = (cssText, loc) => {
17775
17773
  JSON.stringify(normalized),
17776
17774
  false,
17777
17775
  loc,
17778
- "3"
17776
+ 3
17779
17777
  );
17780
17778
  };
17781
17779
 
@@ -17788,16 +17786,16 @@ function createDOMCompilerError(code, loc) {
17788
17786
  }
17789
17787
  const DOMErrorMessages = {
17790
17788
  [51]: `v-html is missing expression.`,
17791
- ["52"]: `v-html will override element children.`,
17792
- ["53"]: `v-text is missing expression.`,
17793
- ["54"]: `v-text will override element children.`,
17794
- ["55"]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
17795
- ["56"]: `v-model argument is not supported on plain elements.`,
17796
- ["57"]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
17797
- ["58"]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
17798
- ["59"]: `v-show is missing expression.`,
17799
- ["60"]: `<Transition> expects exactly one child element or component.`,
17800
- ["61"]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
17789
+ [52]: `v-html will override element children.`,
17790
+ [53]: `v-text is missing expression.`,
17791
+ [54]: `v-text will override element children.`,
17792
+ [55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
17793
+ [56]: `v-model argument is not supported on plain elements.`,
17794
+ [57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
17795
+ [58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
17796
+ [59]: `v-show is missing expression.`,
17797
+ [60]: `<Transition> expects exactly one child element or component.`,
17798
+ [61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
17801
17799
  };
17802
17800
 
17803
17801
  const transformVHtml = (dir, node, context) => {
@@ -17809,7 +17807,7 @@ const transformVHtml = (dir, node, context) => {
17809
17807
  }
17810
17808
  if (node.children.length) {
17811
17809
  context.onError(
17812
- createDOMCompilerError("52", loc)
17810
+ createDOMCompilerError(52, loc)
17813
17811
  );
17814
17812
  node.children.length = 0;
17815
17813
  }
@@ -17827,12 +17825,12 @@ const transformVText = (dir, node, context) => {
17827
17825
  const { exp, loc } = dir;
17828
17826
  if (!exp) {
17829
17827
  context.onError(
17830
- createDOMCompilerError("53", loc)
17828
+ createDOMCompilerError(53, loc)
17831
17829
  );
17832
17830
  }
17833
17831
  if (node.children.length) {
17834
17832
  context.onError(
17835
- createDOMCompilerError("54", loc)
17833
+ createDOMCompilerError(54, loc)
17836
17834
  );
17837
17835
  node.children.length = 0;
17838
17836
  }
@@ -17852,13 +17850,13 @@ const transformVText = (dir, node, context) => {
17852
17850
 
17853
17851
  const transformModel = (dir, node, context) => {
17854
17852
  const baseResult = transformModel$1(dir, node, context);
17855
- if (!baseResult.props.length || node.tagType === "1") {
17853
+ if (!baseResult.props.length || node.tagType === 1) {
17856
17854
  return baseResult;
17857
17855
  }
17858
17856
  if (dir.arg) {
17859
17857
  context.onError(
17860
17858
  createDOMCompilerError(
17861
- "56",
17859
+ 56,
17862
17860
  dir.arg.loc
17863
17861
  )
17864
17862
  );
@@ -17871,7 +17869,7 @@ const transformModel = (dir, node, context) => {
17871
17869
  if (tag === "input" || isCustomElement) {
17872
17870
  const type = findProp(node, `type`);
17873
17871
  if (type) {
17874
- if (type.type === "7") {
17872
+ if (type.type === 7) {
17875
17873
  directiveToUse = V_MODEL_DYNAMIC;
17876
17874
  } else if (type.value) {
17877
17875
  switch (type.value.content) {
@@ -17885,7 +17883,7 @@ const transformModel = (dir, node, context) => {
17885
17883
  isInvalidType = true;
17886
17884
  context.onError(
17887
17885
  createDOMCompilerError(
17888
- "57",
17886
+ 57,
17889
17887
  dir.loc
17890
17888
  )
17891
17889
  );
@@ -17904,13 +17902,13 @@ const transformModel = (dir, node, context) => {
17904
17902
  } else {
17905
17903
  context.onError(
17906
17904
  createDOMCompilerError(
17907
- "55",
17905
+ 55,
17908
17906
  dir.loc
17909
17907
  )
17910
17908
  );
17911
17909
  }
17912
17910
  baseResult.props = baseResult.props.filter(
17913
- (p) => !(p.key.type === "4" && p.key.content === "modelValue")
17911
+ (p) => !(p.key.type === 4 && p.key.content === "modelValue")
17914
17912
  );
17915
17913
  return baseResult;
17916
17914
  };
@@ -17966,7 +17964,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
17966
17964
  };
17967
17965
  const transformClick = (key, event) => {
17968
17966
  const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
17969
- return isStaticClick ? createSimpleExpression(event, true) : key.type !== "4" ? createCompoundExpression([
17967
+ return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
17970
17968
  `(`,
17971
17969
  key,
17972
17970
  `) === "onClick" ? "${event}" : (`,
@@ -18014,7 +18012,7 @@ const transformShow = (dir, node, context) => {
18014
18012
  const { exp, loc } = dir;
18015
18013
  if (!exp) {
18016
18014
  context.onError(
18017
- createDOMCompilerError("59", loc)
18015
+ createDOMCompilerError(59, loc)
18018
18016
  );
18019
18017
  }
18020
18018
  return {
@@ -18074,10 +18072,10 @@ const stringifyStatic = (children, context, parent) => {
18074
18072
  }
18075
18073
  stringifyCurrentChunk(i);
18076
18074
  };
18077
- const getHoistedNode = (node) => (node.type === "1" && node.tagType === "0" || node.type == "12") && node.codegenNode && node.codegenNode.type === "4" && node.codegenNode.hoisted;
18075
+ const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted;
18078
18076
  const dataAriaRE = /^(data|aria)-/;
18079
18077
  const isStringifiableAttr = (name, ns) => {
18080
- return (ns === 0 ? isKnownHtmlAttr(name) : ns === "1" ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
18078
+ return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
18081
18079
  };
18082
18080
  const replaceHoist = (node, replacement, context) => {
18083
18081
  const hoistToReplace = node.codegenNode.hoisted;
@@ -18087,10 +18085,10 @@ const isNonStringifiable = /* @__PURE__ */ makeMap(
18087
18085
  `caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
18088
18086
  );
18089
18087
  function analyzeNode(node) {
18090
- if (node.type === "1" && isNonStringifiable(node.tag)) {
18088
+ if (node.type === 1 && isNonStringifiable(node.tag)) {
18091
18089
  return false;
18092
18090
  }
18093
- if (node.type === "12") {
18091
+ if (node.type === 12) {
18094
18092
  return [1, 0];
18095
18093
  }
18096
18094
  let nc = 1;
@@ -18103,14 +18101,14 @@ function analyzeNode(node) {
18103
18101
  function walk(node2) {
18104
18102
  for (let i = 0; i < node2.props.length; i++) {
18105
18103
  const p = node2.props[i];
18106
- if (p.type === "6" && !isStringifiableAttr(p.name, node2.ns)) {
18104
+ if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
18107
18105
  return bail();
18108
18106
  }
18109
- if (p.type === "7" && p.name === "bind") {
18110
- if (p.arg && (p.arg.type === "8" || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
18107
+ if (p.type === 7 && p.name === "bind") {
18108
+ if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
18111
18109
  return bail();
18112
18110
  }
18113
- if (p.exp && (p.exp.type === "8" || p.exp.constType < "3")) {
18111
+ if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
18114
18112
  return bail();
18115
18113
  }
18116
18114
  }
@@ -18118,7 +18116,7 @@ function analyzeNode(node) {
18118
18116
  for (let i = 0; i < node2.children.length; i++) {
18119
18117
  nc++;
18120
18118
  const child = node2.children[i];
18121
- if (child.type === "1") {
18119
+ if (child.type === 1) {
18122
18120
  if (child.props.length > 0) {
18123
18121
  ec++;
18124
18122
  }
@@ -18140,17 +18138,17 @@ function stringifyNode(node, context) {
18140
18138
  return ``;
18141
18139
  }
18142
18140
  switch (node.type) {
18143
- case "1":
18141
+ case 1:
18144
18142
  return stringifyElement(node, context);
18145
- case "2":
18143
+ case 2:
18146
18144
  return escapeHtml(node.content);
18147
- case "3":
18145
+ case 3:
18148
18146
  return `<!--${escapeHtml(node.content)}-->`;
18149
- case "5":
18147
+ case 5:
18150
18148
  return escapeHtml(toDisplayString(evaluateConstant(node.content)));
18151
- case "8":
18149
+ case 8:
18152
18150
  return escapeHtml(evaluateConstant(node));
18153
- case "12":
18151
+ case 12:
18154
18152
  return stringifyNode(node.content, context);
18155
18153
  default:
18156
18154
  return "";
@@ -18161,12 +18159,12 @@ function stringifyElement(node, context) {
18161
18159
  let innerHTML = "";
18162
18160
  for (let i = 0; i < node.props.length; i++) {
18163
18161
  const p = node.props[i];
18164
- if (p.type === "6") {
18162
+ if (p.type === 6) {
18165
18163
  res += ` ${p.name}`;
18166
18164
  if (p.value) {
18167
18165
  res += `="${escapeHtml(p.value.content)}"`;
18168
18166
  }
18169
- } else if (p.type === "7") {
18167
+ } else if (p.type === 7) {
18170
18168
  if (p.name === "bind") {
18171
18169
  const exp = p.exp;
18172
18170
  if (exp.content[0] === "_") {
@@ -18214,7 +18212,7 @@ function stringifyElement(node, context) {
18214
18212
  return res;
18215
18213
  }
18216
18214
  function evaluateConstant(exp) {
18217
- if (exp.type === "4") {
18215
+ if (exp.type === 4) {
18218
18216
  return new Function(`return ${exp.content}`)();
18219
18217
  } else {
18220
18218
  let res = ``;
@@ -18222,9 +18220,9 @@ function evaluateConstant(exp) {
18222
18220
  if (isString(c) || isSymbol(c)) {
18223
18221
  return;
18224
18222
  }
18225
- if (c.type === "2") {
18223
+ if (c.type === 2) {
18226
18224
  res += c.content;
18227
- } else if (c.type === "5") {
18225
+ } else if (c.type === 5) {
18228
18226
  res += toDisplayString(evaluateConstant(c.content));
18229
18227
  } else {
18230
18228
  res += evaluateConstant(c);
@@ -18235,9 +18233,9 @@ function evaluateConstant(exp) {
18235
18233
  }
18236
18234
 
18237
18235
  const ignoreSideEffectTags = (node, context) => {
18238
- if (node.type === "1" && node.tagType === "0" && (node.tag === "script" || node.tag === "style")) {
18236
+ if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
18239
18237
  context.onError(
18240
- createDOMCompilerError("61", node.loc)
18238
+ createDOMCompilerError(61, node.loc)
18241
18239
  );
18242
18240
  context.removeNode();
18243
18241
  }