@vue/compiler-core 3.3.0-alpha.1 → 3.3.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,63 +16,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
16
16
  }
17
17
  const errorMessages = {
18
18
  // parse errors
19
- [0]: "Illegal comment.",
20
- [1]: "CDATA section is allowed only in XML context.",
21
- [2]: "Duplicate attribute.",
22
- [3]: "End tag cannot have attributes.",
23
- [4]: "Illegal '/' in tags.",
24
- [5]: "Unexpected EOF in tag.",
25
- [6]: "Unexpected EOF in CDATA section.",
26
- [7]: "Unexpected EOF in comment.",
27
- [8]: "Unexpected EOF in script.",
28
- [9]: "Unexpected EOF in tag.",
29
- [10]: "Incorrectly closed comment.",
30
- [11]: "Incorrectly opened comment.",
31
- [12]: "Illegal tag name. Use '&lt;' to print '<'.",
32
- [13]: "Attribute value was expected.",
33
- [14]: "End tag name was expected.",
34
- [15]: "Whitespace was expected.",
35
- [16]: "Unexpected '<!--' in comment.",
36
- [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
37
- [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
38
- [19]: "Attribute name cannot start with '='.",
39
- [21]: "'<?' is allowed only in XML context.",
40
- [20]: `Unexpected null character.`,
41
- [22]: "Illegal '/' in tags.",
19
+ ["0"]: "Illegal comment.",
20
+ ["1"]: "CDATA section is allowed only in XML context.",
21
+ ["2"]: "Duplicate attribute.",
22
+ ["3"]: "End tag cannot have attributes.",
23
+ ["4"]: "Illegal '/' in tags.",
24
+ ["5"]: "Unexpected EOF in tag.",
25
+ ["6"]: "Unexpected EOF in CDATA section.",
26
+ ["7"]: "Unexpected EOF in comment.",
27
+ ["8"]: "Unexpected EOF in script.",
28
+ ["9"]: "Unexpected EOF in tag.",
29
+ ["10"]: "Incorrectly closed comment.",
30
+ ["11"]: "Incorrectly opened comment.",
31
+ ["12"]: "Illegal tag name. Use '&lt;' to print '<'.",
32
+ ["13"]: "Attribute value was expected.",
33
+ ["14"]: "End tag name was expected.",
34
+ ["15"]: "Whitespace was expected.",
35
+ ["16"]: "Unexpected '<!--' in comment.",
36
+ ["17"]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
37
+ ["18"]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
38
+ ["19"]: "Attribute name cannot start with '='.",
39
+ ["21"]: "'<?' is allowed only in XML context.",
40
+ ["20"]: `Unexpected null character.`,
41
+ ["22"]: "Illegal '/' in tags.",
42
42
  // Vue-specific parse errors
43
- [23]: "Invalid end tag.",
44
- [24]: "Element is missing end tag.",
45
- [25]: "Interpolation end sign was not found.",
46
- [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
47
- [26]: "Legal directive name was expected.",
43
+ ["23"]: "Invalid end tag.",
44
+ ["24"]: "Element is missing end tag.",
45
+ ["25"]: "Interpolation end sign was not found.",
46
+ ["27"]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
47
+ ["26"]: "Legal directive name was expected.",
48
48
  // transform errors
49
- [28]: `v-if/v-else-if is missing expression.`,
50
- [29]: `v-if/else branches must use unique keys.`,
51
- [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
52
- [31]: `v-for is missing expression.`,
53
- [32]: `v-for has invalid expression.`,
54
- [33]: `<template v-for> key should be placed on the <template> tag.`,
55
- [34]: `v-bind is missing expression.`,
56
- [35]: `v-on is missing expression.`,
57
- [36]: `Unexpected custom directive on <slot> outlet.`,
58
- [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.`,
59
- [38]: `Duplicate slot names found. `,
60
- [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
61
- [40]: `v-slot can only be used on components or <template> tags.`,
62
- [41]: `v-model is missing expression.`,
63
- [42]: `v-model value must be a valid JavaScript member expression.`,
64
- [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
65
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
49
+ ["28"]: `v-if/v-else-if is missing expression.`,
50
+ ["29"]: `v-if/else branches must use unique keys.`,
51
+ ["30"]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
52
+ ["31"]: `v-for is missing expression.`,
53
+ ["32"]: `v-for has invalid expression.`,
54
+ ["33"]: `<template v-for> key should be placed on the <template> tag.`,
55
+ ["34"]: `v-bind is missing expression.`,
56
+ ["35"]: `v-on is missing expression.`,
57
+ ["36"]: `Unexpected custom directive on <slot> outlet.`,
58
+ ["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.`,
59
+ ["38"]: `Duplicate slot names found. `,
60
+ ["39"]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
61
+ ["40"]: `v-slot can only be used on components or <template> tags.`,
62
+ ["41"]: `v-model is missing expression.`,
63
+ ["42"]: `v-model value must be a valid JavaScript member expression.`,
64
+ ["43"]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
65
+ ["44"]: `v-model cannot be used on a prop, because local prop bindings are not writable.
66
66
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
67
- [45]: `Error parsing JavaScript expression: `,
68
- [46]: `<KeepAlive> expects exactly one child component.`,
67
+ ["45"]: `Error parsing JavaScript expression: `,
68
+ ["46"]: `<KeepAlive> expects exactly one child component.`,
69
69
  // generic errors
70
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
71
- [48]: `ES module mode is not supported in this build of compiler.`,
72
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
73
- [50]: `"scopeId" option is only supported in module mode.`,
70
+ ["47"]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
71
+ ["48"]: `ES module mode is not supported in this build of compiler.`,
72
+ ["49"]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
73
+ ["50"]: `"scopeId" option is only supported in module mode.`,
74
74
  // just to fulfill types
75
- [51]: ``
75
+ ["51"]: ``
76
76
  };
77
77
 
78
78
  const FRAGMENT = Symbol(process.env.NODE_ENV !== "production" ? `Fragment` : ``);
@@ -170,7 +170,7 @@ const locStub = {
170
170
  };
171
171
  function createRoot(children, loc = locStub) {
172
172
  return {
173
- type: 0,
173
+ type: "0",
174
174
  children,
175
175
  helpers: /* @__PURE__ */ new Set(),
176
176
  components: [],
@@ -196,7 +196,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
196
196
  }
197
197
  }
198
198
  return {
199
- type: 13,
199
+ type: "13",
200
200
  tag,
201
201
  props,
202
202
  children,
@@ -211,21 +211,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
211
211
  }
212
212
  function createArrayExpression(elements, loc = locStub) {
213
213
  return {
214
- type: 17,
214
+ type: "17",
215
215
  loc,
216
216
  elements
217
217
  };
218
218
  }
219
219
  function createObjectExpression(properties, loc = locStub) {
220
220
  return {
221
- type: 15,
221
+ type: "15",
222
222
  loc,
223
223
  properties
224
224
  };
225
225
  }
226
226
  function createObjectProperty(key, value) {
227
227
  return {
228
- type: 16,
228
+ type: "16",
229
229
  loc: locStub,
230
230
  key: isString(key) ? createSimpleExpression(key, true) : key,
231
231
  value
@@ -233,30 +233,30 @@ function createObjectProperty(key, value) {
233
233
  }
234
234
  function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
235
235
  return {
236
- type: 4,
236
+ type: "4",
237
237
  loc,
238
238
  content,
239
239
  isStatic,
240
- constType: isStatic ? 3 : constType
240
+ constType: isStatic ? "3" : constType
241
241
  };
242
242
  }
243
243
  function createInterpolation(content, loc) {
244
244
  return {
245
- type: 5,
245
+ type: "5",
246
246
  loc,
247
247
  content: isString(content) ? createSimpleExpression(content, false, loc) : content
248
248
  };
249
249
  }
250
250
  function createCompoundExpression(children, loc = locStub) {
251
251
  return {
252
- type: 8,
252
+ type: "8",
253
253
  loc,
254
254
  children
255
255
  };
256
256
  }
257
257
  function createCallExpression(callee, args = [], loc = locStub) {
258
258
  return {
259
- type: 14,
259
+ type: "14",
260
260
  loc,
261
261
  callee,
262
262
  arguments: args
@@ -264,7 +264,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
264
264
  }
265
265
  function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
266
266
  return {
267
- type: 18,
267
+ type: "18",
268
268
  params,
269
269
  returns,
270
270
  newline,
@@ -274,7 +274,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
274
274
  }
275
275
  function createConditionalExpression(test, consequent, alternate, newline = true) {
276
276
  return {
277
- type: 19,
277
+ type: "19",
278
278
  test,
279
279
  consequent,
280
280
  alternate,
@@ -284,7 +284,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
284
284
  }
285
285
  function createCacheExpression(index, value, isVNode = false) {
286
286
  return {
287
- type: 20,
287
+ type: "20",
288
288
  index,
289
289
  value,
290
290
  isVNode,
@@ -293,21 +293,21 @@ function createCacheExpression(index, value, isVNode = false) {
293
293
  }
294
294
  function createBlockStatement(body) {
295
295
  return {
296
- type: 21,
296
+ type: "21",
297
297
  body,
298
298
  loc: locStub
299
299
  };
300
300
  }
301
301
  function createTemplateLiteral(elements) {
302
302
  return {
303
- type: 22,
303
+ type: "22",
304
304
  elements,
305
305
  loc: locStub
306
306
  };
307
307
  }
308
308
  function createIfStatement(test, consequent, alternate) {
309
309
  return {
310
- type: 23,
310
+ type: "23",
311
311
  test,
312
312
  consequent,
313
313
  alternate,
@@ -316,7 +316,7 @@ function createIfStatement(test, consequent, alternate) {
316
316
  }
317
317
  function createAssignmentExpression(left, right) {
318
318
  return {
319
- type: 24,
319
+ type: "24",
320
320
  left,
321
321
  right,
322
322
  loc: locStub
@@ -324,20 +324,20 @@ function createAssignmentExpression(left, right) {
324
324
  }
325
325
  function createSequenceExpression(expressions) {
326
326
  return {
327
- type: 25,
327
+ type: "25",
328
328
  expressions,
329
329
  loc: locStub
330
330
  };
331
331
  }
332
332
  function createReturnStatement(returns) {
333
333
  return {
334
- type: 26,
334
+ type: "26",
335
335
  returns,
336
336
  loc: locStub
337
337
  };
338
338
  }
339
339
 
340
- const isStaticExp = (p) => p.type === 4 && p.isStatic;
340
+ const isStaticExp = (p) => p.type === "4" && p.isStatic;
341
341
  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
342
342
  function isCoreComponent(tag) {
343
343
  if (isBuiltInType(tag, "Teleport")) {
@@ -464,7 +464,7 @@ function assert(condition, msg) {
464
464
  function findDir(node, name, allowEmpty = false) {
465
465
  for (let i = 0; i < node.props.length; i++) {
466
466
  const p = node.props[i];
467
- if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
467
+ if (p.type === "7" && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
468
468
  return p;
469
469
  }
470
470
  }
@@ -472,7 +472,7 @@ function findDir(node, name, allowEmpty = false) {
472
472
  function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
473
473
  for (let i = 0; i < node.props.length; i++) {
474
474
  const p = node.props[i];
475
- if (p.type === 6) {
475
+ if (p.type === "6") {
476
476
  if (dynamicOnly)
477
477
  continue;
478
478
  if (p.name === name && (p.value || allowEmpty)) {
@@ -488,23 +488,23 @@ function isStaticArgOf(arg, name) {
488
488
  }
489
489
  function hasDynamicKeyVBind(node) {
490
490
  return node.props.some(
491
- (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
492
- p.arg.type !== 4 || // v-bind:[_ctx.foo]
491
+ (p) => p.type === "7" && p.name === "bind" && (!p.arg || // v-bind="obj"
492
+ p.arg.type !== "4" || // v-bind:[_ctx.foo]
493
493
  !p.arg.isStatic)
494
494
  // v-bind:[foo]
495
495
  );
496
496
  }
497
497
  function isText$1(node) {
498
- return node.type === 5 || node.type === "text";
498
+ return node.type === "5" || node.type === "2";
499
499
  }
500
500
  function isVSlot(p) {
501
- return p.type === 7 && p.name === "slot";
501
+ return p.type === "7" && p.name === "slot";
502
502
  }
503
503
  function isTemplateNode(node) {
504
- return node.type === "element" && node.tagType === 3;
504
+ return node.type === "1" && node.tagType === "3";
505
505
  }
506
506
  function isSlotOutlet(node) {
507
- return node.type === "element" && node.tagType === 2;
507
+ return node.type === "1" && node.tagType === "2";
508
508
  }
509
509
  function getVNodeHelper(ssr, isComponent) {
510
510
  return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
@@ -514,7 +514,7 @@ function getVNodeBlockHelper(ssr, isComponent) {
514
514
  }
515
515
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
516
516
  function getUnnormalizedProps(props, callPath = []) {
517
- if (props && !isString(props) && props.type === 14) {
517
+ if (props && !isString(props) && props.type === "14") {
518
518
  const callee = props.callee;
519
519
  if (!isString(callee) && propsHelperSet.has(callee)) {
520
520
  return getUnnormalizedProps(
@@ -527,10 +527,10 @@ function getUnnormalizedProps(props, callPath = []) {
527
527
  }
528
528
  function injectProp(node, prop, context) {
529
529
  let propsWithInjection;
530
- let props = node.type === 13 ? node.props : node.arguments[2];
530
+ let props = node.type === "13" ? node.props : node.arguments[2];
531
531
  let callPath = [];
532
532
  let parentCall;
533
- if (props && !isString(props) && props.type === 14) {
533
+ if (props && !isString(props) && props.type === "14") {
534
534
  const ret = getUnnormalizedProps(props);
535
535
  props = ret[0];
536
536
  callPath = ret[1];
@@ -538,9 +538,9 @@ function injectProp(node, prop, context) {
538
538
  }
539
539
  if (props == null || isString(props)) {
540
540
  propsWithInjection = createObjectExpression([prop]);
541
- } else if (props.type === 14) {
541
+ } else if (props.type === "14") {
542
542
  const first = props.arguments[0];
543
- if (!isString(first) && first.type === 15) {
543
+ if (!isString(first) && first.type === "15") {
544
544
  if (!hasProp(prop, first)) {
545
545
  first.properties.unshift(prop);
546
546
  }
@@ -555,7 +555,7 @@ function injectProp(node, prop, context) {
555
555
  }
556
556
  }
557
557
  !propsWithInjection && (propsWithInjection = props);
558
- } else if (props.type === 15) {
558
+ } else if (props.type === "15") {
559
559
  if (!hasProp(prop, props)) {
560
560
  props.properties.unshift(prop);
561
561
  }
@@ -569,7 +569,7 @@ function injectProp(node, prop, context) {
569
569
  parentCall = callPath[callPath.length - 2];
570
570
  }
571
571
  }
572
- if (node.type === 13) {
572
+ if (node.type === "13") {
573
573
  if (parentCall) {
574
574
  parentCall.arguments[0] = propsWithInjection;
575
575
  } else {
@@ -585,10 +585,10 @@ function injectProp(node, prop, context) {
585
585
  }
586
586
  function hasProp(prop, props) {
587
587
  let result = false;
588
- if (prop.key.type === 4) {
588
+ if (prop.key.type === "4") {
589
589
  const propKeyName = prop.key.content;
590
590
  result = props.properties.some(
591
- (p) => p.key.type === 4 && p.key.content === propKeyName
591
+ (p) => p.key.type === "4" && p.key.content === propKeyName
592
592
  );
593
593
  }
594
594
  return result;
@@ -603,35 +603,35 @@ function hasScopeRef(node, ids) {
603
603
  return false;
604
604
  }
605
605
  switch (node.type) {
606
- case "element":
606
+ case "1":
607
607
  for (let i = 0; i < node.props.length; i++) {
608
608
  const p = node.props[i];
609
- if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
609
+ if (p.type === "7" && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
610
610
  return true;
611
611
  }
612
612
  }
613
613
  return node.children.some((c) => hasScopeRef(c, ids));
614
- case 11:
614
+ case "11":
615
615
  if (hasScopeRef(node.source, ids)) {
616
616
  return true;
617
617
  }
618
618
  return node.children.some((c) => hasScopeRef(c, ids));
619
- case 9:
619
+ case "9":
620
620
  return node.branches.some((b) => hasScopeRef(b, ids));
621
- case 10:
621
+ case "10":
622
622
  if (hasScopeRef(node.condition, ids)) {
623
623
  return true;
624
624
  }
625
625
  return node.children.some((c) => hasScopeRef(c, ids));
626
- case 4:
626
+ case "4":
627
627
  return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];
628
- case 8:
628
+ case "8":
629
629
  return node.children.some((c) => isObject(c) && hasScopeRef(c, ids));
630
- case 5:
631
- case 12:
630
+ case "5":
631
+ case "12":
632
632
  return hasScopeRef(node.content, ids);
633
- case "text":
634
- case "comment":
633
+ case "2":
634
+ case "3":
635
635
  return false;
636
636
  default:
637
637
  if (process.env.NODE_ENV !== "production") ;
@@ -639,7 +639,7 @@ function hasScopeRef(node, ids) {
639
639
  }
640
640
  }
641
641
  function getMemoedVNodeCall(node) {
642
- if (node.type === 14 && node.callee === WITH_MEMO) {
642
+ if (node.type === "14" && node.callee === WITH_MEMO) {
643
643
  return node.arguments[1].returns;
644
644
  } else {
645
645
  return node;
@@ -736,8 +736,8 @@ const decodeMap = {
736
736
  };
737
737
  const defaultParserOptions = {
738
738
  delimiters: [`{{`, `}}`],
739
- getNamespace: () => 0,
740
- getTextMode: () => 0,
739
+ getNamespace: () => "0",
740
+ getTextMode: () => "0",
741
741
  isVoidTag: NO,
742
742
  isPreTag: NO,
743
743
  isCustomElement: NO,
@@ -750,7 +750,7 @@ function baseParse(content, options = {}) {
750
750
  const context = createParserContext(content, options);
751
751
  const start = getCursor(context);
752
752
  return createRoot(
753
- parseChildren(context, 0, []),
753
+ parseChildren(context, "0", []),
754
754
  getSelection(context, start)
755
755
  );
756
756
  }
@@ -774,48 +774,48 @@ function createParserContext(content, rawOptions) {
774
774
  }
775
775
  function parseChildren(context, mode, ancestors) {
776
776
  const parent = last(ancestors);
777
- const ns = parent ? parent.ns : 0;
777
+ const ns = parent ? parent.ns : "0";
778
778
  const nodes = [];
779
779
  while (!isEnd(context, mode, ancestors)) {
780
780
  const s = context.source;
781
781
  let node = void 0;
782
- if (mode === 0 || mode === 1) {
782
+ if (mode === "0" || mode === "1") {
783
783
  if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
784
784
  node = parseInterpolation(context, mode);
785
- } else if (mode === 0 && s[0] === "<") {
785
+ } else if (mode === "0" && s[0] === "<") {
786
786
  if (s.length === 1) {
787
- emitError(context, 5, 1);
787
+ emitError(context, "5", 1);
788
788
  } else if (s[1] === "!") {
789
789
  if (startsWith(s, "<!--")) {
790
790
  node = parseComment(context);
791
791
  } else if (startsWith(s, "<!DOCTYPE")) {
792
792
  node = parseBogusComment(context);
793
793
  } else if (startsWith(s, "<![CDATA[")) {
794
- if (ns !== 0) {
794
+ if (ns !== "0") {
795
795
  node = parseCDATA(context, ancestors);
796
796
  } else {
797
- emitError(context, 1);
797
+ emitError(context, "1");
798
798
  node = parseBogusComment(context);
799
799
  }
800
800
  } else {
801
- emitError(context, 11);
801
+ emitError(context, "11");
802
802
  node = parseBogusComment(context);
803
803
  }
804
804
  } else if (s[1] === "/") {
805
805
  if (s.length === 2) {
806
- emitError(context, 5, 2);
806
+ emitError(context, "5", 2);
807
807
  } else if (s[2] === ">") {
808
- emitError(context, 14, 2);
808
+ emitError(context, "14", 2);
809
809
  advanceBy(context, 3);
810
810
  continue;
811
811
  } else if (/[a-z]/i.test(s[2])) {
812
- emitError(context, 23);
812
+ emitError(context, "23");
813
813
  parseTag(context, TagType.End, parent);
814
814
  continue;
815
815
  } else {
816
816
  emitError(
817
817
  context,
818
- 12,
818
+ "12",
819
819
  2
820
820
  );
821
821
  node = parseBogusComment(context);
@@ -826,7 +826,7 @@ function parseChildren(context, mode, ancestors) {
826
826
  "COMPILER_NATIVE_TEMPLATE",
827
827
  context
828
828
  ) && node && node.tag === "template" && !node.props.some(
829
- (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
829
+ (p) => p.type === "7" && isSpecialTemplateDirective(p.name)
830
830
  )) {
831
831
  process.env.NODE_ENV !== "production" && warnDeprecation(
832
832
  "COMPILER_NATIVE_TEMPLATE",
@@ -838,12 +838,12 @@ function parseChildren(context, mode, ancestors) {
838
838
  } else if (s[1] === "?") {
839
839
  emitError(
840
840
  context,
841
- 21,
841
+ "21",
842
842
  1
843
843
  );
844
844
  node = parseBogusComment(context);
845
845
  } else {
846
- emitError(context, 12, 1);
846
+ emitError(context, "12", 1);
847
847
  }
848
848
  }
849
849
  }
@@ -859,16 +859,16 @@ function parseChildren(context, mode, ancestors) {
859
859
  }
860
860
  }
861
861
  let removedWhitespace = false;
862
- if (mode !== 2 && mode !== 1) {
862
+ if (mode !== "2" && mode !== "1") {
863
863
  const shouldCondense = context.options.whitespace !== "preserve";
864
864
  for (let i = 0; i < nodes.length; i++) {
865
865
  const node = nodes[i];
866
- if (node.type === "text") {
866
+ if (node.type === "2") {
867
867
  if (!context.inPre) {
868
868
  if (!/[^\t\r\n\f ]/.test(node.content)) {
869
869
  const prev = nodes[i - 1];
870
870
  const next = nodes[i + 1];
871
- if (!prev || !next || shouldCondense && (prev.type === "comment" && next.type === "comment" || prev.type === "comment" && next.type === "element" || prev.type === "element" && next.type === "comment" || prev.type === "element" && next.type === "element" && /[\r\n]/.test(node.content))) {
871
+ 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))) {
872
872
  removedWhitespace = true;
873
873
  nodes[i] = null;
874
874
  } else {
@@ -880,14 +880,14 @@ function parseChildren(context, mode, ancestors) {
880
880
  } else {
881
881
  node.content = node.content.replace(/\r\n/g, "\n");
882
882
  }
883
- } else if (node.type === "comment" && !context.options.comments) {
883
+ } else if (node.type === "3" && !context.options.comments) {
884
884
  removedWhitespace = true;
885
885
  nodes[i] = null;
886
886
  }
887
887
  }
888
888
  if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
889
889
  const first = nodes[0];
890
- if (first && first.type === "text") {
890
+ if (first && first.type === "2") {
891
891
  first.content = first.content.replace(/^\r?\n/, "");
892
892
  }
893
893
  }
@@ -895,9 +895,9 @@ function parseChildren(context, mode, ancestors) {
895
895
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
896
896
  }
897
897
  function pushNode(nodes, node) {
898
- if (node.type === "text") {
898
+ if (node.type === "2") {
899
899
  const prev = last(nodes);
900
- if (prev && prev.type === "text" && prev.loc.end.offset === node.loc.start.offset) {
900
+ if (prev && prev.type === "2" && prev.loc.end.offset === node.loc.start.offset) {
901
901
  prev.content += node.content;
902
902
  prev.loc.end = node.loc.end;
903
903
  prev.loc.source += node.loc.source;
@@ -908,9 +908,9 @@ function pushNode(nodes, node) {
908
908
  }
909
909
  function parseCDATA(context, ancestors) {
910
910
  advanceBy(context, 9);
911
- const nodes = parseChildren(context, 3, ancestors);
911
+ const nodes = parseChildren(context, "3", ancestors);
912
912
  if (context.source.length === 0) {
913
- emitError(context, 6);
913
+ emitError(context, "6");
914
914
  } else {
915
915
  advanceBy(context, 3);
916
916
  }
@@ -923,13 +923,13 @@ function parseComment(context) {
923
923
  if (!match) {
924
924
  content = context.source.slice(4);
925
925
  advanceBy(context, context.source.length);
926
- emitError(context, 7);
926
+ emitError(context, "7");
927
927
  } else {
928
928
  if (match.index <= 3) {
929
- emitError(context, 0);
929
+ emitError(context, "0");
930
930
  }
931
931
  if (match[1]) {
932
- emitError(context, 10);
932
+ emitError(context, "10");
933
933
  }
934
934
  content = context.source.slice(4, match.index);
935
935
  const s = context.source.slice(0, match.index);
@@ -937,14 +937,14 @@ function parseComment(context) {
937
937
  while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
938
938
  advanceBy(context, nestedIndex - prevIndex + 1);
939
939
  if (nestedIndex + 4 < s.length) {
940
- emitError(context, 16);
940
+ emitError(context, "16");
941
941
  }
942
942
  prevIndex = nestedIndex + 1;
943
943
  }
944
944
  advanceBy(context, match.index + match[0].length - prevIndex + 1);
945
945
  }
946
946
  return {
947
- type: "comment",
947
+ type: "3",
948
948
  content,
949
949
  loc: getSelection(context, start)
950
950
  };
@@ -962,7 +962,7 @@ function parseBogusComment(context) {
962
962
  advanceBy(context, closeIndex + 1);
963
963
  }
964
964
  return {
965
- type: "comment",
965
+ type: "3",
966
966
  content,
967
967
  loc: getSelection(context, start)
968
968
  };
@@ -989,7 +989,7 @@ function parseElement(context, ancestors) {
989
989
  ancestors.pop();
990
990
  {
991
991
  const inlineTemplateProp = element.props.find(
992
- (p) => p.type === 6 && p.name === "inline-template"
992
+ (p) => p.type === "6" && p.name === "inline-template"
993
993
  );
994
994
  if (inlineTemplateProp && checkCompatEnabled(
995
995
  "COMPILER_INLINE_TEMPLATE",
@@ -998,7 +998,7 @@ function parseElement(context, ancestors) {
998
998
  )) {
999
999
  const loc = getSelection(context, element.loc.end);
1000
1000
  inlineTemplateProp.value = {
1001
- type: "text",
1001
+ type: "2",
1002
1002
  content: loc.source,
1003
1003
  loc
1004
1004
  };
@@ -1008,11 +1008,11 @@ function parseElement(context, ancestors) {
1008
1008
  if (startsWithEndTagOpen(context.source, element.tag)) {
1009
1009
  parseTag(context, TagType.End, parent);
1010
1010
  } else {
1011
- emitError(context, 24, 0, element.loc.start);
1011
+ emitError(context, "24", 0, element.loc.start);
1012
1012
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
1013
1013
  const first = children[0];
1014
1014
  if (first && startsWith(first.loc.source, "<!--")) {
1015
- emitError(context, 8);
1015
+ emitError(context, "8");
1016
1016
  }
1017
1017
  }
1018
1018
  }
@@ -1046,7 +1046,7 @@ function parseTag(context, type, parent) {
1046
1046
  context.inPre = true;
1047
1047
  }
1048
1048
  let props = parseAttributes(context, type);
1049
- if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
1049
+ if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === "7" && p.name === "pre")) {
1050
1050
  context.inVPre = true;
1051
1051
  extend(context, cursor);
1052
1052
  context.source = currentSource;
@@ -1054,11 +1054,11 @@ function parseTag(context, type, parent) {
1054
1054
  }
1055
1055
  let isSelfClosing = false;
1056
1056
  if (context.source.length === 0) {
1057
- emitError(context, 9);
1057
+ emitError(context, "9");
1058
1058
  } else {
1059
1059
  isSelfClosing = startsWith(context.source, "/>");
1060
1060
  if (type === 1 /* End */ && isSelfClosing) {
1061
- emitError(context, 4);
1061
+ emitError(context, "4");
1062
1062
  }
1063
1063
  advanceBy(context, isSelfClosing ? 2 : 1);
1064
1064
  }
@@ -1073,7 +1073,7 @@ function parseTag(context, type, parent) {
1073
1073
  let hasFor = false;
1074
1074
  for (let i = 0; i < props.length; i++) {
1075
1075
  const p = props[i];
1076
- if (p.type === 7) {
1076
+ if (p.type === "7") {
1077
1077
  if (p.name === "if") {
1078
1078
  hasIf = true;
1079
1079
  } else if (p.name === "for") {
@@ -1090,22 +1090,22 @@ function parseTag(context, type, parent) {
1090
1090
  }
1091
1091
  }
1092
1092
  }
1093
- let tagType = 0;
1093
+ let tagType = "0";
1094
1094
  if (!context.inVPre) {
1095
1095
  if (tag === "slot") {
1096
- tagType = 2;
1096
+ tagType = "2";
1097
1097
  } else if (tag === "template") {
1098
1098
  if (props.some(
1099
- (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
1099
+ (p) => p.type === "7" && isSpecialTemplateDirective(p.name)
1100
1100
  )) {
1101
- tagType = 3;
1101
+ tagType = "3";
1102
1102
  }
1103
1103
  } else if (isComponent(tag, props, context)) {
1104
- tagType = 1;
1104
+ tagType = "1";
1105
1105
  }
1106
1106
  }
1107
1107
  return {
1108
- type: "element",
1108
+ type: "1",
1109
1109
  ns,
1110
1110
  tag,
1111
1111
  tagType,
@@ -1127,7 +1127,7 @@ function isComponent(tag, props, context) {
1127
1127
  }
1128
1128
  for (let i = 0; i < props.length; i++) {
1129
1129
  const p = props[i];
1130
- if (p.type === 6) {
1130
+ if (p.type === "6") {
1131
1131
  if (p.name === "is" && p.value) {
1132
1132
  if (p.value.content.startsWith("vue:")) {
1133
1133
  return true;
@@ -1160,23 +1160,23 @@ function parseAttributes(context, type) {
1160
1160
  const attributeNames = /* @__PURE__ */ new Set();
1161
1161
  while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
1162
1162
  if (startsWith(context.source, "/")) {
1163
- emitError(context, 22);
1163
+ emitError(context, "22");
1164
1164
  advanceBy(context, 1);
1165
1165
  advanceSpaces(context);
1166
1166
  continue;
1167
1167
  }
1168
1168
  if (type === 1 /* End */) {
1169
- emitError(context, 3);
1169
+ emitError(context, "3");
1170
1170
  }
1171
1171
  const attr = parseAttribute(context, attributeNames);
1172
- if (attr.type === 6 && attr.value && attr.name === "class") {
1172
+ if (attr.type === "6" && attr.value && attr.name === "class") {
1173
1173
  attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
1174
1174
  }
1175
1175
  if (type === 0 /* Start */) {
1176
1176
  props.push(attr);
1177
1177
  }
1178
1178
  if (/^[^\t\r\n\f />]/.test(context.source)) {
1179
- emitError(context, 15);
1179
+ emitError(context, "15");
1180
1180
  }
1181
1181
  advanceSpaces(context);
1182
1182
  }
@@ -1187,11 +1187,11 @@ function parseAttribute(context, nameSet) {
1187
1187
  const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
1188
1188
  const name = match[0];
1189
1189
  if (nameSet.has(name)) {
1190
- emitError(context, 2);
1190
+ emitError(context, "2");
1191
1191
  }
1192
1192
  nameSet.add(name);
1193
1193
  if (name[0] === "=") {
1194
- emitError(context, 19);
1194
+ emitError(context, "19");
1195
1195
  }
1196
1196
  {
1197
1197
  const pattern = /["'<]/g;
@@ -1199,7 +1199,7 @@ function parseAttribute(context, nameSet) {
1199
1199
  while (m = pattern.exec(name)) {
1200
1200
  emitError(
1201
1201
  context,
1202
- 17,
1202
+ "17",
1203
1203
  m.index
1204
1204
  );
1205
1205
  }
@@ -1212,7 +1212,7 @@ function parseAttribute(context, nameSet) {
1212
1212
  advanceSpaces(context);
1213
1213
  value = parseAttributeValue(context);
1214
1214
  if (!value) {
1215
- emitError(context, 13);
1215
+ emitError(context, "13");
1216
1216
  }
1217
1217
  }
1218
1218
  const loc = getSelection(context, start);
@@ -1242,7 +1242,7 @@ function parseAttribute(context, nameSet) {
1242
1242
  if (!content.endsWith("]")) {
1243
1243
  emitError(
1244
1244
  context,
1245
- 27
1245
+ "27"
1246
1246
  );
1247
1247
  content = content.slice(1);
1248
1248
  } else {
@@ -1252,10 +1252,10 @@ function parseAttribute(context, nameSet) {
1252
1252
  content += match2[3] || "";
1253
1253
  }
1254
1254
  arg = {
1255
- type: 4,
1255
+ type: "4",
1256
1256
  content,
1257
1257
  isStatic,
1258
- constType: isStatic ? 3 : 0,
1258
+ constType: isStatic ? "3" : 0,
1259
1259
  loc: loc2
1260
1260
  };
1261
1261
  }
@@ -1288,10 +1288,10 @@ function parseAttribute(context, nameSet) {
1288
1288
  }
1289
1289
  }
1290
1290
  return {
1291
- type: 7,
1291
+ type: "7",
1292
1292
  name: dirName,
1293
1293
  exp: value && {
1294
- type: 4,
1294
+ type: "4",
1295
1295
  content: value.content,
1296
1296
  isStatic: false,
1297
1297
  // Treat as non-constant by default. This can be potentially set to
@@ -1305,13 +1305,13 @@ function parseAttribute(context, nameSet) {
1305
1305
  };
1306
1306
  }
1307
1307
  if (!context.inVPre && startsWith(name, "v-")) {
1308
- emitError(context, 26);
1308
+ emitError(context, "26");
1309
1309
  }
1310
1310
  return {
1311
- type: 6,
1311
+ type: "6",
1312
1312
  name,
1313
1313
  value: value && {
1314
- type: "text",
1314
+ type: "2",
1315
1315
  content: value.content,
1316
1316
  loc: value.loc
1317
1317
  },
@@ -1330,10 +1330,10 @@ function parseAttributeValue(context) {
1330
1330
  content = parseTextData(
1331
1331
  context,
1332
1332
  context.source.length,
1333
- 4
1333
+ "4"
1334
1334
  );
1335
1335
  } else {
1336
- content = parseTextData(context, endIndex, 4);
1336
+ content = parseTextData(context, endIndex, "4");
1337
1337
  advanceBy(context, 1);
1338
1338
  }
1339
1339
  } else {
@@ -1346,11 +1346,11 @@ function parseAttributeValue(context) {
1346
1346
  while (m = unexpectedChars.exec(match[0])) {
1347
1347
  emitError(
1348
1348
  context,
1349
- 18,
1349
+ "18",
1350
1350
  m.index
1351
1351
  );
1352
1352
  }
1353
- content = parseTextData(context, match[0].length, 4);
1353
+ content = parseTextData(context, match[0].length, "4");
1354
1354
  }
1355
1355
  return { content, isQuoted, loc: getSelection(context, start) };
1356
1356
  }
@@ -1358,7 +1358,7 @@ function parseInterpolation(context, mode) {
1358
1358
  const [open, close] = context.options.delimiters;
1359
1359
  const closeIndex = context.source.indexOf(close, open.length);
1360
1360
  if (closeIndex === -1) {
1361
- emitError(context, 25);
1361
+ emitError(context, "25");
1362
1362
  return void 0;
1363
1363
  }
1364
1364
  const start = getCursor(context);
@@ -1377,9 +1377,9 @@ function parseInterpolation(context, mode) {
1377
1377
  advancePositionWithMutation(innerEnd, rawContent, endOffset);
1378
1378
  advanceBy(context, close.length);
1379
1379
  return {
1380
- type: 5,
1380
+ type: "5",
1381
1381
  content: {
1382
- type: 4,
1382
+ type: "4",
1383
1383
  isStatic: false,
1384
1384
  // Set `isConstant` to false by default and will decide in transformExpression
1385
1385
  constType: 0,
@@ -1390,7 +1390,7 @@ function parseInterpolation(context, mode) {
1390
1390
  };
1391
1391
  }
1392
1392
  function parseText(context, mode) {
1393
- const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
1393
+ const endTokens = mode === "3" ? ["]]>"] : ["<", context.options.delimiters[0]];
1394
1394
  let endIndex = context.source.length;
1395
1395
  for (let i = 0; i < endTokens.length; i++) {
1396
1396
  const index = context.source.indexOf(endTokens[i], 1);
@@ -1401,7 +1401,7 @@ function parseText(context, mode) {
1401
1401
  const start = getCursor(context);
1402
1402
  const content = parseTextData(context, endIndex, mode);
1403
1403
  return {
1404
- type: "text",
1404
+ type: "2",
1405
1405
  content,
1406
1406
  loc: getSelection(context, start)
1407
1407
  };
@@ -1409,12 +1409,12 @@ function parseText(context, mode) {
1409
1409
  function parseTextData(context, length, mode) {
1410
1410
  const rawText = context.source.slice(0, length);
1411
1411
  advanceBy(context, length);
1412
- if (mode === 2 || mode === 3 || !rawText.includes("&")) {
1412
+ if (mode === "2" || mode === "3" || !rawText.includes("&")) {
1413
1413
  return rawText;
1414
1414
  } else {
1415
1415
  return context.options.decodeEntities(
1416
1416
  rawText,
1417
- mode === 4
1417
+ mode === "4"
1418
1418
  );
1419
1419
  }
1420
1420
  }
@@ -1470,7 +1470,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
1470
1470
  function isEnd(context, mode, ancestors) {
1471
1471
  const s = context.source;
1472
1472
  switch (mode) {
1473
- case 0:
1473
+ case "0":
1474
1474
  if (startsWith(s, "</")) {
1475
1475
  for (let i = ancestors.length - 1; i >= 0; --i) {
1476
1476
  if (startsWithEndTagOpen(s, ancestors[i].tag)) {
@@ -1479,15 +1479,15 @@ function isEnd(context, mode, ancestors) {
1479
1479
  }
1480
1480
  }
1481
1481
  break;
1482
- case 1:
1483
- case 2: {
1482
+ case "1":
1483
+ case "2": {
1484
1484
  const parent = last(ancestors);
1485
1485
  if (parent && startsWithEndTagOpen(s, parent.tag)) {
1486
1486
  return true;
1487
1487
  }
1488
1488
  break;
1489
1489
  }
1490
- case 3:
1490
+ case "3":
1491
1491
  if (startsWith(s, "]]>")) {
1492
1492
  return true;
1493
1493
  }
@@ -1510,7 +1510,7 @@ function hoistStatic(root, context) {
1510
1510
  }
1511
1511
  function isSingleElementRoot(root, child) {
1512
1512
  const { children } = root;
1513
- return children.length === 1 && child.type === "element" && !isSlotOutlet(child);
1513
+ return children.length === 1 && child.type === "1" && !isSlotOutlet(child);
1514
1514
  }
1515
1515
  function walk(node, context, doNotHoistNode = false) {
1516
1516
  const { children } = node;
@@ -1518,10 +1518,10 @@ function walk(node, context, doNotHoistNode = false) {
1518
1518
  let hoistedCount = 0;
1519
1519
  for (let i = 0; i < children.length; i++) {
1520
1520
  const child = children[i];
1521
- if (child.type === "element" && child.tagType === 0) {
1521
+ if (child.type === "1" && child.tagType === "0") {
1522
1522
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
1523
1523
  if (constantType > 0) {
1524
- if (constantType >= 2) {
1524
+ if (constantType >= "2") {
1525
1525
  child.codegenNode.patchFlag = -1 + (process.env.NODE_ENV !== "production" ? ` /* HOISTED */` : ``);
1526
1526
  child.codegenNode = context.hoist(child.codegenNode);
1527
1527
  hoistedCount++;
@@ -1529,9 +1529,9 @@ function walk(node, context, doNotHoistNode = false) {
1529
1529
  }
1530
1530
  } else {
1531
1531
  const codegenNode = child.codegenNode;
1532
- if (codegenNode.type === 13) {
1532
+ if (codegenNode.type === "13") {
1533
1533
  const flag = getPatchFlag(codegenNode);
1534
- if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
1534
+ if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= "2") {
1535
1535
  const props = getNodeProps(child);
1536
1536
  if (props) {
1537
1537
  codegenNode.props = context.hoist(props);
@@ -1543,8 +1543,8 @@ function walk(node, context, doNotHoistNode = false) {
1543
1543
  }
1544
1544
  }
1545
1545
  }
1546
- if (child.type === "element") {
1547
- const isComponent = child.tagType === 1;
1546
+ if (child.type === "1") {
1547
+ const isComponent = child.tagType === "1";
1548
1548
  if (isComponent) {
1549
1549
  context.scopes.vSlot++;
1550
1550
  }
@@ -1552,9 +1552,9 @@ function walk(node, context, doNotHoistNode = false) {
1552
1552
  if (isComponent) {
1553
1553
  context.scopes.vSlot--;
1554
1554
  }
1555
- } else if (child.type === 11) {
1555
+ } else if (child.type === "11") {
1556
1556
  walk(child, context, child.children.length === 1);
1557
- } else if (child.type === 9) {
1557
+ } else if (child.type === "9") {
1558
1558
  for (let i2 = 0; i2 < child.branches.length; i2++) {
1559
1559
  walk(
1560
1560
  child.branches[i2],
@@ -1567,7 +1567,7 @@ function walk(node, context, doNotHoistNode = false) {
1567
1567
  if (hoistedCount && context.transformHoist) {
1568
1568
  context.transformHoist(children, context, node);
1569
1569
  }
1570
- if (hoistedCount && hoistedCount === originalCount && node.type === "element" && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
1570
+ if (hoistedCount && hoistedCount === originalCount && node.type === "1" && node.tagType === "0" && node.codegenNode && node.codegenNode.type === "13" && isArray(node.codegenNode.children)) {
1571
1571
  node.codegenNode.children = context.hoist(
1572
1572
  createArrayExpression(node.codegenNode.children)
1573
1573
  );
@@ -1576,8 +1576,8 @@ function walk(node, context, doNotHoistNode = false) {
1576
1576
  function getConstantType(node, context) {
1577
1577
  const { constantCache } = context;
1578
1578
  switch (node.type) {
1579
- case "element":
1580
- if (node.tagType !== 0) {
1579
+ case "1":
1580
+ if (node.tagType !== "0") {
1581
1581
  return 0;
1582
1582
  }
1583
1583
  const cached = constantCache.get(node);
@@ -1585,7 +1585,7 @@ function getConstantType(node, context) {
1585
1585
  return cached;
1586
1586
  }
1587
1587
  const codegenNode = node.codegenNode;
1588
- if (codegenNode.type !== 13) {
1588
+ if (codegenNode.type !== "13") {
1589
1589
  return 0;
1590
1590
  }
1591
1591
  if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
@@ -1593,7 +1593,7 @@ function getConstantType(node, context) {
1593
1593
  }
1594
1594
  const flag = getPatchFlag(codegenNode);
1595
1595
  if (!flag) {
1596
- let returnType2 = 3;
1596
+ let returnType2 = "3";
1597
1597
  const generatedPropsType = getGeneratedPropsConstantType(node, context);
1598
1598
  if (generatedPropsType === 0) {
1599
1599
  constantCache.set(node, 0);
@@ -1612,10 +1612,10 @@ function getConstantType(node, context) {
1612
1612
  returnType2 = childType;
1613
1613
  }
1614
1614
  }
1615
- if (returnType2 > 1) {
1615
+ if (returnType2 > "1") {
1616
1616
  for (let i = 0; i < node.props.length; i++) {
1617
1617
  const p = node.props[i];
1618
- if (p.type === 7 && p.name === "bind" && p.exp) {
1618
+ if (p.type === "7" && p.name === "bind" && p.exp) {
1619
1619
  const expType = getConstantType(p.exp, context);
1620
1620
  if (expType === 0) {
1621
1621
  constantCache.set(node, 0);
@@ -1630,7 +1630,7 @@ function getConstantType(node, context) {
1630
1630
  if (codegenNode.isBlock) {
1631
1631
  for (let i = 0; i < node.props.length; i++) {
1632
1632
  const p = node.props[i];
1633
- if (p.type === 7) {
1633
+ if (p.type === "7") {
1634
1634
  constantCache.set(node, 0);
1635
1635
  return 0;
1636
1636
  }
@@ -1648,20 +1648,20 @@ function getConstantType(node, context) {
1648
1648
  constantCache.set(node, 0);
1649
1649
  return 0;
1650
1650
  }
1651
- case "text":
1652
- case "comment":
1653
- return 3;
1654
- case 9:
1655
- case 11:
1656
- case 10:
1651
+ case "2":
1652
+ case "3":
1653
+ return "3";
1654
+ case "9":
1655
+ case "11":
1656
+ case "10":
1657
1657
  return 0;
1658
- case 5:
1659
- case 12:
1658
+ case "5":
1659
+ case "12":
1660
1660
  return getConstantType(node.content, context);
1661
- case 4:
1661
+ case "4":
1662
1662
  return node.constType;
1663
- case 8:
1664
- let returnType = 3;
1663
+ case "8":
1664
+ let returnType = "3";
1665
1665
  for (let i = 0; i < node.children.length; i++) {
1666
1666
  const child = node.children[i];
1667
1667
  if (isString(child) || isSymbol(child)) {
@@ -1687,20 +1687,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
1687
1687
  GUARD_REACTIVE_PROPS
1688
1688
  ]);
1689
1689
  function getConstantTypeOfHelperCall(value, context) {
1690
- if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
1690
+ if (value.type === "14" && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
1691
1691
  const arg = value.arguments[0];
1692
- if (arg.type === 4) {
1692
+ if (arg.type === "4") {
1693
1693
  return getConstantType(arg, context);
1694
- } else if (arg.type === 14) {
1694
+ } else if (arg.type === "14") {
1695
1695
  return getConstantTypeOfHelperCall(arg, context);
1696
1696
  }
1697
1697
  }
1698
1698
  return 0;
1699
1699
  }
1700
1700
  function getGeneratedPropsConstantType(node, context) {
1701
- let returnType = 3;
1701
+ let returnType = "3";
1702
1702
  const props = getNodeProps(node);
1703
- if (props && props.type === 15) {
1703
+ if (props && props.type === "15") {
1704
1704
  const { properties } = props;
1705
1705
  for (let i = 0; i < properties.length; i++) {
1706
1706
  const { key, value } = properties[i];
@@ -1712,9 +1712,9 @@ function getGeneratedPropsConstantType(node, context) {
1712
1712
  returnType = keyType;
1713
1713
  }
1714
1714
  let valueType;
1715
- if (value.type === 4) {
1715
+ if (value.type === "4") {
1716
1716
  valueType = getConstantType(value, context);
1717
- } else if (value.type === 14) {
1717
+ } else if (value.type === "14") {
1718
1718
  valueType = getConstantTypeOfHelperCall(value, context);
1719
1719
  } else {
1720
1720
  valueType = 0;
@@ -1731,7 +1731,7 @@ function getGeneratedPropsConstantType(node, context) {
1731
1731
  }
1732
1732
  function getNodeProps(node) {
1733
1733
  const codegenNode = node.codegenNode;
1734
- if (codegenNode.type === 13) {
1734
+ if (codegenNode.type === "13") {
1735
1735
  return codegenNode.props;
1736
1736
  }
1737
1737
  }
@@ -1873,7 +1873,7 @@ function createTransformContext(root, {
1873
1873
  `_hoisted_${context.hoists.length}`,
1874
1874
  false,
1875
1875
  exp.loc,
1876
- 2
1876
+ "2"
1877
1877
  );
1878
1878
  identifier.hoisted = exp;
1879
1879
  return identifier;
@@ -1914,7 +1914,7 @@ function createRootCodegen(root, context) {
1914
1914
  const child = children[0];
1915
1915
  if (isSingleElementRoot(root, child) && child.codegenNode) {
1916
1916
  const codegenNode = child.codegenNode;
1917
- if (codegenNode.type === 13) {
1917
+ if (codegenNode.type === "13") {
1918
1918
  makeBlock(codegenNode, context);
1919
1919
  }
1920
1920
  root.codegenNode = codegenNode;
@@ -1924,7 +1924,7 @@ function createRootCodegen(root, context) {
1924
1924
  } else if (children.length > 1) {
1925
1925
  let patchFlag = 64;
1926
1926
  let patchFlagText = PatchFlagNames[64];
1927
- if (process.env.NODE_ENV !== "production" && children.filter((c) => c.type !== "comment").length === 1) {
1927
+ if (process.env.NODE_ENV !== "production" && children.filter((c) => c.type !== "3").length === 1) {
1928
1928
  patchFlag |= 2048;
1929
1929
  patchFlagText += `, ${PatchFlagNames[2048]}`;
1930
1930
  }
@@ -1978,25 +1978,25 @@ function traverseNode(node, context) {
1978
1978
  }
1979
1979
  }
1980
1980
  switch (node.type) {
1981
- case "comment":
1981
+ case "3":
1982
1982
  if (!context.ssr) {
1983
1983
  context.helper(CREATE_COMMENT);
1984
1984
  }
1985
1985
  break;
1986
- case 5:
1986
+ case "5":
1987
1987
  if (!context.ssr) {
1988
1988
  context.helper(TO_DISPLAY_STRING);
1989
1989
  }
1990
1990
  break;
1991
- case 9:
1991
+ case "9":
1992
1992
  for (let i2 = 0; i2 < node.branches.length; i2++) {
1993
1993
  traverseNode(node.branches[i2], context);
1994
1994
  }
1995
1995
  break;
1996
- case 10:
1997
- case 11:
1998
- case "element":
1999
- case 0:
1996
+ case "10":
1997
+ case "11":
1998
+ case "1":
1999
+ case "0":
2000
2000
  traverseChildren(node, context);
2001
2001
  break;
2002
2002
  }
@@ -2009,15 +2009,15 @@ function traverseNode(node, context) {
2009
2009
  function createStructuralDirectiveTransform(name, fn) {
2010
2010
  const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
2011
2011
  return (node, context) => {
2012
- if (node.type === "element") {
2012
+ if (node.type === "1") {
2013
2013
  const { props } = node;
2014
- if (node.tagType === 3 && props.some(isVSlot)) {
2014
+ if (node.tagType === "3" && props.some(isVSlot)) {
2015
2015
  return;
2016
2016
  }
2017
2017
  const exitFns = [];
2018
2018
  for (let i = 0; i < props.length; i++) {
2019
2019
  const prop = props[i];
2020
- if (prop.type === 7 && matches(prop.name)) {
2020
+ if (prop.type === "7" && matches(prop.name)) {
2021
2021
  props.splice(i, 1);
2022
2022
  i--;
2023
2023
  const onExit = fn(node, prop, context);
@@ -2252,7 +2252,7 @@ function genHoists(hoists, context) {
2252
2252
  context.pure = false;
2253
2253
  }
2254
2254
  function isText(n) {
2255
- return isString(n) || n.type === 4 || n.type === "text" || n.type === 5 || n.type === 8;
2255
+ return isString(n) || n.type === "4" || n.type === "2" || n.type === "5" || n.type === "8";
2256
2256
  }
2257
2257
  function genNodeListAsArray(nodes, context) {
2258
2258
  const multilines = nodes.length > 3 || process.env.NODE_ENV !== "production" && nodes.some((n) => isArray(n) || !isText(n));
@@ -2293,68 +2293,68 @@ function genNode(node, context) {
2293
2293
  return;
2294
2294
  }
2295
2295
  switch (node.type) {
2296
- case "element":
2297
- case 9:
2298
- case 11:
2296
+ case "1":
2297
+ case "9":
2298
+ case "11":
2299
2299
  process.env.NODE_ENV !== "production" && assert(
2300
2300
  node.codegenNode != null,
2301
2301
  `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
2302
2302
  );
2303
2303
  genNode(node.codegenNode, context);
2304
2304
  break;
2305
- case "text":
2305
+ case "2":
2306
2306
  genText(node, context);
2307
2307
  break;
2308
- case 4:
2308
+ case "4":
2309
2309
  genExpression(node, context);
2310
2310
  break;
2311
- case 5:
2311
+ case "5":
2312
2312
  genInterpolation(node, context);
2313
2313
  break;
2314
- case 12:
2314
+ case "12":
2315
2315
  genNode(node.codegenNode, context);
2316
2316
  break;
2317
- case 8:
2317
+ case "8":
2318
2318
  genCompoundExpression(node, context);
2319
2319
  break;
2320
- case "comment":
2320
+ case "3":
2321
2321
  genComment(node, context);
2322
2322
  break;
2323
- case 13:
2323
+ case "13":
2324
2324
  genVNodeCall(node, context);
2325
2325
  break;
2326
- case 14:
2326
+ case "14":
2327
2327
  genCallExpression(node, context);
2328
2328
  break;
2329
- case 15:
2329
+ case "15":
2330
2330
  genObjectExpression(node, context);
2331
2331
  break;
2332
- case 17:
2332
+ case "17":
2333
2333
  genArrayExpression(node, context);
2334
2334
  break;
2335
- case 18:
2335
+ case "18":
2336
2336
  genFunctionExpression(node, context);
2337
2337
  break;
2338
- case 19:
2338
+ case "19":
2339
2339
  genConditionalExpression(node, context);
2340
2340
  break;
2341
- case 20:
2341
+ case "20":
2342
2342
  genCacheExpression(node, context);
2343
2343
  break;
2344
- case 21:
2344
+ case "21":
2345
2345
  genNodeList(node.body, context, true, false);
2346
2346
  break;
2347
- case 22:
2347
+ case "22":
2348
2348
  break;
2349
- case 23:
2349
+ case "23":
2350
2350
  break;
2351
- case 24:
2351
+ case "24":
2352
2352
  break;
2353
- case 25:
2353
+ case "25":
2354
2354
  break;
2355
- case 26:
2355
+ case "26":
2356
2356
  break;
2357
- case 10:
2357
+ case "10":
2358
2358
  break;
2359
2359
  default:
2360
2360
  if (process.env.NODE_ENV !== "production") {
@@ -2391,7 +2391,7 @@ function genCompoundExpression(node, context) {
2391
2391
  }
2392
2392
  function genExpressionAsPropertyKey(node, context) {
2393
2393
  const { push } = context;
2394
- if (node.type === 8) {
2394
+ if (node.type === "8") {
2395
2395
  push(`[`);
2396
2396
  genCompoundExpression(node, context);
2397
2397
  push(`]`);
@@ -2472,7 +2472,7 @@ function genObjectExpression(node, context) {
2472
2472
  push(`{}`, node);
2473
2473
  return;
2474
2474
  }
2475
- const multilines = properties.length > 1 || process.env.NODE_ENV !== "production" && properties.some((p) => p.value.type !== 4);
2475
+ const multilines = properties.length > 1 || process.env.NODE_ENV !== "production" && properties.some((p) => p.value.type !== "4");
2476
2476
  push(multilines ? `{` : `{ `);
2477
2477
  multilines && indent();
2478
2478
  for (let i = 0; i < properties.length; i++) {
@@ -2534,7 +2534,7 @@ function genFunctionExpression(node, context) {
2534
2534
  function genConditionalExpression(node, context) {
2535
2535
  const { test, consequent, alternate, newline: needNewline } = node;
2536
2536
  const { push, indent, deindent, newline } = context;
2537
- if (test.type === 4) {
2537
+ if (test.type === "4") {
2538
2538
  const needsParens = !isSimpleIdentifier(test.content);
2539
2539
  needsParens && push(`(`);
2540
2540
  genExpression(test, context);
@@ -2553,7 +2553,7 @@ function genConditionalExpression(node, context) {
2553
2553
  needNewline && newline();
2554
2554
  needNewline || push(` `);
2555
2555
  push(`: `);
2556
- const isNested = alternate.type === 19;
2556
+ const isNested = alternate.type === "19";
2557
2557
  if (!isNested) {
2558
2558
  context.indentLevel++;
2559
2559
  }
@@ -2698,7 +2698,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
2698
2698
  }
2699
2699
  context.onError(
2700
2700
  createCompilerError(
2701
- 45,
2701
+ "45",
2702
2702
  node.loc,
2703
2703
  void 0,
2704
2704
  message
@@ -2708,18 +2708,18 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
2708
2708
  }
2709
2709
 
2710
2710
  const transformExpression = (node, context) => {
2711
- if (node.type === 5) {
2711
+ if (node.type === "5") {
2712
2712
  node.content = processExpression(
2713
2713
  node.content,
2714
2714
  context
2715
2715
  );
2716
- } else if (node.type === "element") {
2716
+ } else if (node.type === "1") {
2717
2717
  for (let i = 0; i < node.props.length; i++) {
2718
2718
  const dir = node.props[i];
2719
- if (dir.type === 7 && dir.name !== "for") {
2719
+ if (dir.type === "7" && dir.name !== "for") {
2720
2720
  const exp = dir.exp;
2721
2721
  const arg = dir.arg;
2722
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
2722
+ if (exp && exp.type === "4" && !(dir.name === "on" && arg)) {
2723
2723
  dir.exp = processExpression(
2724
2724
  exp,
2725
2725
  context,
@@ -2727,7 +2727,7 @@ const transformExpression = (node, context) => {
2727
2727
  dir.name === "slot"
2728
2728
  );
2729
2729
  }
2730
- if (arg && arg.type === 4 && !arg.isStatic) {
2730
+ if (arg && arg.type === "4" && !arg.isStatic) {
2731
2731
  dir.arg = processExpression(arg, context);
2732
2732
  }
2733
2733
  }
@@ -2745,7 +2745,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
2745
2745
  function stringifyExpression(exp) {
2746
2746
  if (isString(exp)) {
2747
2747
  return exp;
2748
- } else if (exp.type === 4) {
2748
+ } else if (exp.type === "4") {
2749
2749
  return exp.content;
2750
2750
  } else {
2751
2751
  return exp.children.map(stringifyExpression).join("");
@@ -2761,7 +2761,7 @@ const transformIf = createStructuralDirectiveTransform(
2761
2761
  let key = 0;
2762
2762
  while (i-- >= 0) {
2763
2763
  const sibling = siblings[i];
2764
- if (sibling && sibling.type === 9) {
2764
+ if (sibling && sibling.type === "9") {
2765
2765
  key += sibling.branches.length;
2766
2766
  }
2767
2767
  }
@@ -2788,7 +2788,7 @@ function processIf(node, dir, context, processCodegen) {
2788
2788
  if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
2789
2789
  const loc = dir.exp ? dir.exp.loc : node.loc;
2790
2790
  context.onError(
2791
- createCompilerError(28, dir.loc)
2791
+ createCompilerError("28", dir.loc)
2792
2792
  );
2793
2793
  dir.exp = createSimpleExpression(`true`, false, loc);
2794
2794
  }
@@ -2798,7 +2798,7 @@ function processIf(node, dir, context, processCodegen) {
2798
2798
  if (dir.name === "if") {
2799
2799
  const branch = createIfBranch(node, dir);
2800
2800
  const ifNode = {
2801
- type: 9,
2801
+ type: "9",
2802
2802
  loc: node.loc,
2803
2803
  branches: [branch]
2804
2804
  };
@@ -2812,24 +2812,25 @@ function processIf(node, dir, context, processCodegen) {
2812
2812
  let i = siblings.indexOf(node);
2813
2813
  while (i-- >= -1) {
2814
2814
  const sibling = siblings[i];
2815
- if (sibling && sibling.type === "comment") {
2816
- context.removeNode(sibling)(process.env.NODE_ENV !== "production") && comments.unshift(sibling);
2815
+ if (sibling && sibling.type === "3") {
2816
+ context.removeNode(sibling);
2817
+ process.env.NODE_ENV !== "production" && comments.unshift(sibling);
2817
2818
  continue;
2818
2819
  }
2819
- if (sibling && sibling.type === "text" && !sibling.content.trim().length) {
2820
+ if (sibling && sibling.type === "2" && !sibling.content.trim().length) {
2820
2821
  context.removeNode(sibling);
2821
2822
  continue;
2822
2823
  }
2823
- if (sibling && sibling.type === 9) {
2824
+ if (sibling && sibling.type === "9") {
2824
2825
  if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
2825
2826
  context.onError(
2826
- createCompilerError(30, node.loc)
2827
+ createCompilerError("30", node.loc)
2827
2828
  );
2828
2829
  }
2829
2830
  context.removeNode();
2830
2831
  const branch = createIfBranch(node, dir);
2831
2832
  if (process.env.NODE_ENV !== "production" && comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
2832
- !(context.parent && context.parent.type === "element" && isBuiltInType(context.parent.tag, "transition"))) {
2833
+ !(context.parent && context.parent.type === "1" && isBuiltInType(context.parent.tag, "transition"))) {
2833
2834
  branch.children = [...comments, ...branch.children];
2834
2835
  }
2835
2836
  if (process.env.NODE_ENV !== "production" || false) {
@@ -2839,7 +2840,7 @@ function processIf(node, dir, context, processCodegen) {
2839
2840
  if (isSameKey(userKey, key)) {
2840
2841
  context.onError(
2841
2842
  createCompilerError(
2842
- 29,
2843
+ "29",
2843
2844
  branch.userKey.loc
2844
2845
  )
2845
2846
  );
@@ -2855,7 +2856,7 @@ function processIf(node, dir, context, processCodegen) {
2855
2856
  context.currentNode = null;
2856
2857
  } else {
2857
2858
  context.onError(
2858
- createCompilerError(30, node.loc)
2859
+ createCompilerError("30", node.loc)
2859
2860
  );
2860
2861
  }
2861
2862
  break;
@@ -2863,9 +2864,9 @@ function processIf(node, dir, context, processCodegen) {
2863
2864
  }
2864
2865
  }
2865
2866
  function createIfBranch(node, dir) {
2866
- const isTemplateIf = node.tagType === 3;
2867
+ const isTemplateIf = node.tagType === "3";
2867
2868
  return {
2868
- type: 10,
2869
+ type: "10",
2869
2870
  loc: node.loc,
2870
2871
  condition: dir.name === "else" ? void 0 : dir.exp,
2871
2872
  children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
@@ -2897,21 +2898,21 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
2897
2898
  `${keyIndex}`,
2898
2899
  false,
2899
2900
  locStub,
2900
- 2
2901
+ "2"
2901
2902
  )
2902
2903
  );
2903
2904
  const { children } = branch;
2904
2905
  const firstChild = children[0];
2905
- const needFragmentWrapper = children.length !== 1 || firstChild.type !== "element";
2906
+ const needFragmentWrapper = children.length !== 1 || firstChild.type !== "1";
2906
2907
  if (needFragmentWrapper) {
2907
- if (children.length === 1 && firstChild.type === 11) {
2908
+ if (children.length === 1 && firstChild.type === "11") {
2908
2909
  const vnodeCall = firstChild.codegenNode;
2909
2910
  injectProp(vnodeCall, keyProperty, context);
2910
2911
  return vnodeCall;
2911
2912
  } else {
2912
2913
  let patchFlag = 64;
2913
2914
  let patchFlagText = PatchFlagNames[64];
2914
- if (process.env.NODE_ENV !== "production" && !branch.isTemplateIf && children.filter((c) => c.type !== "comment").length === 1) {
2915
+ if (process.env.NODE_ENV !== "production" && !branch.isTemplateIf && children.filter((c) => c.type !== "3").length === 1) {
2915
2916
  patchFlag |= 2048;
2916
2917
  patchFlagText += `, ${PatchFlagNames[2048]}`;
2917
2918
  }
@@ -2932,7 +2933,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
2932
2933
  } else {
2933
2934
  const ret = firstChild.codegenNode;
2934
2935
  const vnodeCall = getMemoedVNodeCall(ret);
2935
- if (vnodeCall.type === 13) {
2936
+ if (vnodeCall.type === "13") {
2936
2937
  makeBlock(vnodeCall, context);
2937
2938
  }
2938
2939
  injectProp(vnodeCall, keyProperty, context);
@@ -2943,7 +2944,7 @@ function isSameKey(a, b) {
2943
2944
  if (!a || a.type !== b.type) {
2944
2945
  return false;
2945
2946
  }
2946
- if (a.type === 6) {
2947
+ if (a.type === "6") {
2947
2948
  if (a.value.content !== b.value.content) {
2948
2949
  return false;
2949
2950
  }
@@ -2953,7 +2954,7 @@ function isSameKey(a, b) {
2953
2954
  if (exp.type !== branchExp.type) {
2954
2955
  return false;
2955
2956
  }
2956
- if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
2957
+ if (exp.type !== "4" || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
2957
2958
  return false;
2958
2959
  }
2959
2960
  }
@@ -2961,13 +2962,13 @@ function isSameKey(a, b) {
2961
2962
  }
2962
2963
  function getParentCondition(node) {
2963
2964
  while (true) {
2964
- if (node.type === 19) {
2965
- if (node.alternate.type === 19) {
2965
+ if (node.type === "19") {
2966
+ if (node.alternate.type === "19") {
2966
2967
  node = node.alternate;
2967
2968
  } else {
2968
2969
  return node;
2969
2970
  }
2970
- } else if (node.type === 20) {
2971
+ } else if (node.type === "20") {
2971
2972
  node = node.value;
2972
2973
  }
2973
2974
  }
@@ -2984,9 +2985,9 @@ const transformFor = createStructuralDirectiveTransform(
2984
2985
  const isTemplate = isTemplateNode(node);
2985
2986
  const memo = findDir(node, "memo");
2986
2987
  const keyProp = findProp(node, `key`);
2987
- const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
2988
+ const keyExp = keyProp && (keyProp.type === "6" ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
2988
2989
  const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
2989
- const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
2990
+ const isStableFragment = forNode.source.type === "4" && forNode.source.constType > 0;
2990
2991
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
2991
2992
  forNode.codegenNode = createVNodeCall(
2992
2993
  context,
@@ -3006,12 +3007,12 @@ const transformFor = createStructuralDirectiveTransform(
3006
3007
  const { children } = forNode;
3007
3008
  if ((process.env.NODE_ENV !== "production" || false) && isTemplate) {
3008
3009
  node.children.some((c) => {
3009
- if (c.type === "element") {
3010
+ if (c.type === "1") {
3010
3011
  const key = findProp(c, "key");
3011
3012
  if (key) {
3012
3013
  context.onError(
3013
3014
  createCompilerError(
3014
- 33,
3015
+ "33",
3015
3016
  key.loc
3016
3017
  )
3017
3018
  );
@@ -3020,7 +3021,7 @@ const transformFor = createStructuralDirectiveTransform(
3020
3021
  }
3021
3022
  });
3022
3023
  }
3023
- const needFragmentWrapper = children.length !== 1 || children[0].type !== "element";
3024
+ const needFragmentWrapper = children.length !== 1 || children[0].type !== "1";
3024
3025
  const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
3025
3026
  if (slotOutlet) {
3026
3027
  childBlock = slotOutlet.codegenNode;
@@ -3107,7 +3108,7 @@ const transformFor = createStructuralDirectiveTransform(
3107
3108
  function processFor(node, dir, context, processCodegen) {
3108
3109
  if (!dir.exp) {
3109
3110
  context.onError(
3110
- createCompilerError(31, dir.loc)
3111
+ createCompilerError("31", dir.loc)
3111
3112
  );
3112
3113
  return;
3113
3114
  }
@@ -3119,14 +3120,14 @@ function processFor(node, dir, context, processCodegen) {
3119
3120
  );
3120
3121
  if (!parseResult) {
3121
3122
  context.onError(
3122
- createCompilerError(32, dir.loc)
3123
+ createCompilerError("32", dir.loc)
3123
3124
  );
3124
3125
  return;
3125
3126
  }
3126
3127
  const { addIdentifiers, removeIdentifiers, scopes } = context;
3127
3128
  const { source, value, key, index } = parseResult;
3128
3129
  const forNode = {
3129
- type: 11,
3130
+ type: "11",
3130
3131
  loc: dir.loc,
3131
3132
  source,
3132
3133
  valueAlias: value,
@@ -3239,7 +3240,7 @@ function createParamsList(args) {
3239
3240
 
3240
3241
  const defaultFallback = createSimpleExpression(`undefined`, false);
3241
3242
  const trackSlotScopes = (node, context) => {
3242
- if (node.type === "element" && (node.tagType === 1 || node.tagType === 3)) {
3243
+ if (node.type === "1" && (node.tagType === "1" || node.tagType === "3")) {
3243
3244
  const vSlot = findDir(node, "slot");
3244
3245
  if (vSlot) {
3245
3246
  vSlot.exp;
@@ -3306,14 +3307,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3306
3307
  const slotElement = children[i];
3307
3308
  let slotDir;
3308
3309
  if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
3309
- if (slotElement.type !== "comment") {
3310
+ if (slotElement.type !== "3") {
3310
3311
  implicitDefaultChildren.push(slotElement);
3311
3312
  }
3312
3313
  continue;
3313
3314
  }
3314
3315
  if (onComponentSlot) {
3315
3316
  context.onError(
3316
- createCompilerError(37, slotDir.loc)
3317
+ createCompilerError("37", slotDir.loc)
3317
3318
  );
3318
3319
  break;
3319
3320
  }
@@ -3353,7 +3354,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3353
3354
  let prev;
3354
3355
  while (j--) {
3355
3356
  prev = children[j];
3356
- if (prev.type !== "comment") {
3357
+ if (prev.type !== "3") {
3357
3358
  break;
3358
3359
  }
3359
3360
  }
@@ -3361,7 +3362,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3361
3362
  children.splice(i, 1);
3362
3363
  i--;
3363
3364
  let conditional = dynamicSlots[dynamicSlots.length - 1];
3364
- while (conditional.alternate.type === 19) {
3365
+ while (conditional.alternate.type === "19") {
3365
3366
  conditional = conditional.alternate;
3366
3367
  }
3367
3368
  conditional.alternate = vElse.exp ? createConditionalExpression(
@@ -3375,7 +3376,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3375
3376
  ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
3376
3377
  } else {
3377
3378
  context.onError(
3378
- createCompilerError(30, vElse.loc)
3379
+ createCompilerError("30", vElse.loc)
3379
3380
  );
3380
3381
  }
3381
3382
  } else if (vFor = findDir(slotElement, "for")) {
@@ -3395,7 +3396,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3395
3396
  );
3396
3397
  } else {
3397
3398
  context.onError(
3398
- createCompilerError(32, vFor.loc)
3399
+ createCompilerError("32", vFor.loc)
3399
3400
  );
3400
3401
  }
3401
3402
  } else {
@@ -3403,7 +3404,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3403
3404
  if (seenSlotNames.has(staticSlotName)) {
3404
3405
  context.onError(
3405
3406
  createCompilerError(
3406
- 38,
3407
+ "38",
3407
3408
  dirLoc
3408
3409
  )
3409
3410
  );
@@ -3434,7 +3435,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3434
3435
  if (hasNamedDefaultSlot) {
3435
3436
  context.onError(
3436
3437
  createCompilerError(
3437
- 39,
3438
+ "39",
3438
3439
  implicitDefaultChildren[0].loc
3439
3440
  )
3440
3441
  );
@@ -3487,17 +3488,17 @@ function hasForwardedSlots(children) {
3487
3488
  for (let i = 0; i < children.length; i++) {
3488
3489
  const child = children[i];
3489
3490
  switch (child.type) {
3490
- case "element":
3491
- if (child.tagType === 2 || hasForwardedSlots(child.children)) {
3491
+ case "1":
3492
+ if (child.tagType === "2" || hasForwardedSlots(child.children)) {
3492
3493
  return true;
3493
3494
  }
3494
3495
  break;
3495
- case 9:
3496
+ case "9":
3496
3497
  if (hasForwardedSlots(child.branches))
3497
3498
  return true;
3498
3499
  break;
3499
- case 10:
3500
- case 11:
3500
+ case "10":
3501
+ case "11":
3501
3502
  if (hasForwardedSlots(child.children))
3502
3503
  return true;
3503
3504
  break;
@@ -3506,20 +3507,20 @@ function hasForwardedSlots(children) {
3506
3507
  return false;
3507
3508
  }
3508
3509
  function isNonWhitespaceContent(node) {
3509
- if (node.type !== "text" && node.type !== 12)
3510
+ if (node.type !== "2" && node.type !== "12")
3510
3511
  return true;
3511
- return node.type === "text" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
3512
+ return node.type === "2" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
3512
3513
  }
3513
3514
 
3514
3515
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
3515
3516
  const transformElement = (node, context) => {
3516
3517
  return function postTransformElement() {
3517
3518
  node = context.currentNode;
3518
- if (!(node.type === "element" && (node.tagType === 0 || node.tagType === 1))) {
3519
+ if (!(node.type === "1" && (node.tagType === "0" || node.tagType === "1"))) {
3519
3520
  return;
3520
3521
  }
3521
3522
  const { tag, props } = node;
3522
- const isComponent = node.tagType === 1;
3523
+ const isComponent = node.tagType === "1";
3523
3524
  let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
3524
3525
  const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
3525
3526
  let vnodeProps;
@@ -3562,7 +3563,7 @@ const transformElement = (node, context) => {
3562
3563
  patchFlag |= 1024;
3563
3564
  if (process.env.NODE_ENV !== "production" && node.children.length > 1) {
3564
3565
  context.onError(
3565
- createCompilerError(46, {
3566
+ createCompilerError("46", {
3566
3567
  start: node.children[0].loc.start,
3567
3568
  end: node.children[node.children.length - 1].loc.end,
3568
3569
  source: ""
@@ -3582,11 +3583,11 @@ const transformElement = (node, context) => {
3582
3583
  } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
3583
3584
  const child = node.children[0];
3584
3585
  const type = child.type;
3585
- const hasDynamicTextChild = type === 5 || type === 8;
3586
+ const hasDynamicTextChild = type === "5" || type === "8";
3586
3587
  if (hasDynamicTextChild && getConstantType(child, context) === 0) {
3587
3588
  patchFlag |= 1;
3588
3589
  }
3589
- if (hasDynamicTextChild || type === "text") {
3590
+ if (hasDynamicTextChild || type === "2") {
3590
3591
  vnodeChildren = child;
3591
3592
  } else {
3592
3593
  vnodeChildren = node.children;
@@ -3634,13 +3635,13 @@ function resolveComponentType(node, context, ssr = false) {
3634
3635
  "COMPILER_IS_ON_ELEMENT",
3635
3636
  context
3636
3637
  )) {
3637
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
3638
+ const exp = isProp.type === "6" ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
3638
3639
  if (exp) {
3639
3640
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
3640
3641
  exp
3641
3642
  ]);
3642
3643
  }
3643
- } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
3644
+ } else if (isProp.type === "6" && isProp.value.content.startsWith("vue:")) {
3644
3645
  tag = isProp.value.content.slice(4);
3645
3646
  }
3646
3647
  }
@@ -3699,7 +3700,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3699
3700
  if (isEventHandler && isReservedProp(name)) {
3700
3701
  hasVnodeHook = true;
3701
3702
  }
3702
- if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
3703
+ if (value.type === "20" || (value.type === "4" || value.type === "8") && getConstantType(value, context) > 0) {
3703
3704
  return;
3704
3705
  }
3705
3706
  if (name === "ref") {
@@ -3720,7 +3721,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3720
3721
  };
3721
3722
  for (let i = 0; i < props.length; i++) {
3722
3723
  const prop = props[i];
3723
- if (prop.type === 6) {
3724
+ if (prop.type === "6") {
3724
3725
  const { loc, name, value } = prop;
3725
3726
  let isStatic = true;
3726
3727
  if (name === "ref") {
@@ -3761,7 +3762,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3761
3762
  if (name === "slot") {
3762
3763
  if (!isComponent) {
3763
3764
  context.onError(
3764
- createCompilerError(40, loc)
3765
+ createCompilerError("40", loc)
3765
3766
  );
3766
3767
  }
3767
3768
  continue;
@@ -3802,9 +3803,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3802
3803
  {
3803
3804
  if (process.env.NODE_ENV !== "production") {
3804
3805
  const hasOverridableKeys = mergeArgs.some((arg2) => {
3805
- if (arg2.type === 15) {
3806
+ if (arg2.type === "15") {
3806
3807
  return arg2.properties.some(({ key }) => {
3807
- if (key.type !== 4 || !key.isStatic) {
3808
+ if (key.type !== "4" || !key.isStatic) {
3808
3809
  return true;
3809
3810
  }
3810
3811
  return key.content !== "class" && key.content !== "style" && !isOn(key.content);
@@ -3832,7 +3833,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3832
3833
  mergeArgs.push(exp);
3833
3834
  } else {
3834
3835
  pushMergeArg({
3835
- type: 14,
3836
+ type: "14",
3836
3837
  loc,
3837
3838
  callee: context.helper(TO_HANDLERS),
3838
3839
  arguments: isComponent ? [exp] : [exp, `true`]
@@ -3841,7 +3842,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3841
3842
  } else {
3842
3843
  context.onError(
3843
3844
  createCompilerError(
3844
- isVBind ? 34 : 35,
3845
+ isVBind ? "34" : "35",
3845
3846
  loc
3846
3847
  )
3847
3848
  );
@@ -3910,7 +3911,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3910
3911
  }
3911
3912
  if (!context.inSSR && propsExpression) {
3912
3913
  switch (propsExpression.type) {
3913
- case 15:
3914
+ case "15":
3914
3915
  let classKeyIndex = -1;
3915
3916
  let styleKeyIndex = -1;
3916
3917
  let hasDynamicKey = false;
@@ -3937,9 +3938,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3937
3938
  }
3938
3939
  if (styleProp && // the static style is compiled into an object,
3939
3940
  // so use `hasStyleBinding` to ensure that it is a dynamic style binding
3940
- (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
3941
+ (hasStyleBinding || styleProp.value.type === "4" && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
3941
3942
  // v-bind:style with static literal object
3942
- styleProp.value.type === 17)) {
3943
+ styleProp.value.type === "17")) {
3943
3944
  styleProp.value = createCallExpression(
3944
3945
  context.helper(NORMALIZE_STYLE),
3945
3946
  [styleProp.value]
@@ -3952,7 +3953,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3952
3953
  );
3953
3954
  }
3954
3955
  break;
3955
- case 14:
3956
+ case "14":
3956
3957
  break;
3957
3958
  default:
3958
3959
  propsExpression = createCallExpression(
@@ -3979,7 +3980,7 @@ function dedupeProperties(properties) {
3979
3980
  const deduped = [];
3980
3981
  for (let i = 0; i < properties.length; i++) {
3981
3982
  const prop = properties[i];
3982
- if (prop.key.type === 8 || !prop.key.isStatic) {
3983
+ if (prop.key.type === "8" || !prop.key.isStatic) {
3983
3984
  deduped.push(prop);
3984
3985
  continue;
3985
3986
  }
@@ -3997,7 +3998,7 @@ function dedupeProperties(properties) {
3997
3998
  return deduped;
3998
3999
  }
3999
4000
  function mergeAsArray(existing, incoming) {
4000
- if (existing.value.type === 17) {
4001
+ if (existing.value.type === "17") {
4001
4002
  existing.value.elements.push(incoming.value);
4002
4003
  } else {
4003
4004
  existing.value = createArrayExpression(
@@ -4096,7 +4097,7 @@ function processSlotOutlet(node, context) {
4096
4097
  const nonNameProps = [];
4097
4098
  for (let i = 0; i < node.props.length; i++) {
4098
4099
  const p = node.props[i];
4099
- if (p.type === 6) {
4100
+ if (p.type === "6") {
4100
4101
  if (p.value) {
4101
4102
  if (p.name === "name") {
4102
4103
  slotName = JSON.stringify(p.value.content);
@@ -4129,7 +4130,7 @@ function processSlotOutlet(node, context) {
4129
4130
  if (directives.length) {
4130
4131
  context.onError(
4131
4132
  createCompilerError(
4132
- 36,
4133
+ "36",
4133
4134
  directives[0].loc
4134
4135
  )
4135
4136
  );
@@ -4145,16 +4146,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
4145
4146
  const transformOn = (dir, node, context, augmentor) => {
4146
4147
  const { loc, modifiers, arg } = dir;
4147
4148
  if (!dir.exp && !modifiers.length) {
4148
- context.onError(createCompilerError(35, loc));
4149
+ context.onError(createCompilerError("35", loc));
4149
4150
  }
4150
4151
  let eventName;
4151
- if (arg.type === 4) {
4152
+ if (arg.type === "4") {
4152
4153
  if (arg.isStatic) {
4153
4154
  let rawName = arg.content;
4154
4155
  if (rawName.startsWith("vue:")) {
4155
4156
  rawName = `vnode-${rawName.slice(4)}`;
4156
4157
  }
4157
- const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
4158
+ const eventString = node.tagType !== "0" || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
4158
4159
  // for non-element and vnode lifecycle event listeners, auto convert
4159
4160
  // it to camelCase. See issue #2249
4160
4161
  toHandlerKey(camelize(rawName))
@@ -4222,14 +4223,14 @@ const transformOn = (dir, node, context, augmentor) => {
4222
4223
  const transformBind = (dir, _node, context) => {
4223
4224
  const { exp, modifiers, loc } = dir;
4224
4225
  const arg = dir.arg;
4225
- if (arg.type !== 4) {
4226
+ if (arg.type !== "4") {
4226
4227
  arg.children.unshift(`(`);
4227
4228
  arg.children.push(`) || ""`);
4228
4229
  } else if (!arg.isStatic) {
4229
4230
  arg.content = `${arg.content} || ""`;
4230
4231
  }
4231
4232
  if (modifiers.includes("camel")) {
4232
- if (arg.type === 4) {
4233
+ if (arg.type === "4") {
4233
4234
  if (arg.isStatic) {
4234
4235
  arg.content = camelize(arg.content);
4235
4236
  } else {
@@ -4248,8 +4249,8 @@ const transformBind = (dir, _node, context) => {
4248
4249
  injectPrefix(arg, "^");
4249
4250
  }
4250
4251
  }
4251
- if (!exp || exp.type === 4 && !exp.content.trim()) {
4252
- context.onError(createCompilerError(34, loc));
4252
+ if (!exp || exp.type === "4" && !exp.content.trim()) {
4253
+ context.onError(createCompilerError("34", loc));
4253
4254
  return {
4254
4255
  props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
4255
4256
  };
@@ -4259,7 +4260,7 @@ const transformBind = (dir, _node, context) => {
4259
4260
  };
4260
4261
  };
4261
4262
  const injectPrefix = (arg, prefix) => {
4262
- if (arg.type === 4) {
4263
+ if (arg.type === "4") {
4263
4264
  if (arg.isStatic) {
4264
4265
  arg.content = prefix + arg.content;
4265
4266
  } else {
@@ -4272,7 +4273,7 @@ const injectPrefix = (arg, prefix) => {
4272
4273
  };
4273
4274
 
4274
4275
  const transformText = (node, context) => {
4275
- if (node.type === 0 || node.type === "element" || node.type === 11 || node.type === 10) {
4276
+ if (node.type === "0" || node.type === "1" || node.type === "11" || node.type === "10") {
4276
4277
  return () => {
4277
4278
  const children = node.children;
4278
4279
  let currentContainer = void 0;
@@ -4304,13 +4305,13 @@ const transformText = (node, context) => {
4304
4305
  // as-is since the runtime has dedicated fast path for this by directly
4305
4306
  // setting textContent of the element.
4306
4307
  // for component root it's always normalized anyway.
4307
- children.length === 1 && (node.type === 0 || node.type === "element" && node.tagType === 0 && // #3756
4308
+ children.length === 1 && (node.type === "0" || node.type === "1" && node.tagType === "0" && // #3756
4308
4309
  // custom directives can potentially add DOM elements arbitrarily,
4309
4310
  // we need to avoid setting textContent of the element at runtime
4310
4311
  // to avoid accidentally overwriting the DOM elements added
4311
4312
  // by the user through custom directives.
4312
4313
  !node.props.find(
4313
- (p) => p.type === 7 && !context.directiveTransforms[p.name]
4314
+ (p) => p.type === "7" && !context.directiveTransforms[p.name]
4314
4315
  ) && // in compat mode, <template> tags with no special directives
4315
4316
  // will be rendered as a fragment so its children must be
4316
4317
  // converted into vnodes.
@@ -4319,9 +4320,9 @@ const transformText = (node, context) => {
4319
4320
  }
4320
4321
  for (let i = 0; i < children.length; i++) {
4321
4322
  const child = children[i];
4322
- if (isText$1(child) || child.type === 8) {
4323
+ if (isText$1(child) || child.type === "8") {
4323
4324
  const callArgs = [];
4324
- if (child.type !== "text" || child.content !== " ") {
4325
+ if (child.type !== "2" || child.content !== " ") {
4325
4326
  callArgs.push(child);
4326
4327
  }
4327
4328
  if (!context.ssr && getConstantType(child, context) === 0) {
@@ -4330,7 +4331,7 @@ const transformText = (node, context) => {
4330
4331
  );
4331
4332
  }
4332
4333
  children[i] = {
4333
- type: 12,
4334
+ type: "12",
4334
4335
  content: child,
4335
4336
  loc: child.loc,
4336
4337
  codegenNode: createCallExpression(
@@ -4346,7 +4347,7 @@ const transformText = (node, context) => {
4346
4347
 
4347
4348
  const seen$1 = /* @__PURE__ */ new WeakSet();
4348
4349
  const transformOnce = (node, context) => {
4349
- if (node.type === "element" && findDir(node, "once", true)) {
4350
+ if (node.type === "1" && findDir(node, "once", true)) {
4350
4351
  if (seen$1.has(node) || context.inVOnce) {
4351
4352
  return;
4352
4353
  }
@@ -4371,21 +4372,21 @@ const transformModel = (dir, node, context) => {
4371
4372
  const { exp, arg } = dir;
4372
4373
  if (!exp) {
4373
4374
  context.onError(
4374
- createCompilerError(41, dir.loc)
4375
+ createCompilerError("41", dir.loc)
4375
4376
  );
4376
4377
  return createTransformProps();
4377
4378
  }
4378
4379
  const rawExp = exp.loc.source;
4379
- const expString = exp.type === 4 ? exp.content : rawExp;
4380
+ const expString = exp.type === "4" ? exp.content : rawExp;
4380
4381
  const bindingType = context.bindingMetadata[rawExp];
4381
4382
  if (bindingType === "props" || bindingType === "props-aliased") {
4382
- context.onError(createCompilerError(44, exp.loc));
4383
+ context.onError(createCompilerError("44", exp.loc));
4383
4384
  return createTransformProps();
4384
4385
  }
4385
4386
  const maybeRef = false;
4386
4387
  if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
4387
4388
  context.onError(
4388
- createCompilerError(42, exp.loc)
4389
+ createCompilerError("42", exp.loc)
4389
4390
  );
4390
4391
  return createTransformProps();
4391
4392
  }
@@ -4406,7 +4407,7 @@ const transformModel = (dir, node, context) => {
4406
4407
  // "onUpdate:modelValue": $event => (foo = $event)
4407
4408
  createObjectProperty(eventName, assignmentExp)
4408
4409
  ];
4409
- if (dir.modifiers.length && node.tagType === 1) {
4410
+ if (dir.modifiers.length && node.tagType === "1") {
4410
4411
  const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
4411
4412
  const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
4412
4413
  props.push(
@@ -4416,7 +4417,7 @@ const transformModel = (dir, node, context) => {
4416
4417
  `{ ${modifiers} }`,
4417
4418
  false,
4418
4419
  dir.loc,
4419
- 2
4420
+ "2"
4420
4421
  )
4421
4422
  )
4422
4423
  );
@@ -4432,30 +4433,30 @@ const transformFilter = (node, context) => {
4432
4433
  if (!isCompatEnabled("COMPILER_FILTER", context)) {
4433
4434
  return;
4434
4435
  }
4435
- if (node.type === 5) {
4436
+ if (node.type === "5") {
4436
4437
  rewriteFilter(node.content, context);
4437
4438
  }
4438
- if (node.type === "element") {
4439
+ if (node.type === "1") {
4439
4440
  node.props.forEach((prop) => {
4440
- if (prop.type === 7 && prop.name !== "for" && prop.exp) {
4441
+ if (prop.type === "7" && prop.name !== "for" && prop.exp) {
4441
4442
  rewriteFilter(prop.exp, context);
4442
4443
  }
4443
4444
  });
4444
4445
  }
4445
4446
  };
4446
4447
  function rewriteFilter(node, context) {
4447
- if (node.type === 4) {
4448
+ if (node.type === "4") {
4448
4449
  parseFilter(node, context);
4449
4450
  } else {
4450
4451
  for (let i = 0; i < node.children.length; i++) {
4451
4452
  const child = node.children[i];
4452
4453
  if (typeof child !== "object")
4453
4454
  continue;
4454
- if (child.type === 4) {
4455
+ if (child.type === "4") {
4455
4456
  parseFilter(child, context);
4456
- } else if (child.type === 8) {
4457
+ } else if (child.type === "8") {
4457
4458
  rewriteFilter(node, context);
4458
- } else if (child.type === 5) {
4459
+ } else if (child.type === "5") {
4459
4460
  rewriteFilter(child.content, context);
4460
4461
  }
4461
4462
  }
@@ -4576,7 +4577,7 @@ function wrapFilter(exp, filter, context) {
4576
4577
 
4577
4578
  const seen = /* @__PURE__ */ new WeakSet();
4578
4579
  const transformMemo = (node, context) => {
4579
- if (node.type === "element") {
4580
+ if (node.type === "1") {
4580
4581
  const dir = findDir(node, "memo");
4581
4582
  if (!dir || seen.has(node)) {
4582
4583
  return;
@@ -4584,8 +4585,8 @@ const transformMemo = (node, context) => {
4584
4585
  seen.add(node);
4585
4586
  return () => {
4586
4587
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
4587
- if (codegenNode && codegenNode.type === 13) {
4588
- if (node.tagType !== 1) {
4588
+ if (codegenNode && codegenNode.type === "13") {
4589
+ if (node.tagType !== "1") {
4589
4590
  makeBlock(codegenNode, context);
4590
4591
  }
4591
4592
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
@@ -4625,17 +4626,17 @@ function baseCompile(template, options = {}) {
4625
4626
  const isModuleMode = options.mode === "module";
4626
4627
  {
4627
4628
  if (options.prefixIdentifiers === true) {
4628
- onError(createCompilerError(47));
4629
+ onError(createCompilerError("47"));
4629
4630
  } else if (isModuleMode) {
4630
- onError(createCompilerError(48));
4631
+ onError(createCompilerError("48"));
4631
4632
  }
4632
4633
  }
4633
4634
  const prefixIdentifiers = false;
4634
4635
  if (options.cacheHandlers) {
4635
- onError(createCompilerError(49));
4636
+ onError(createCompilerError("49"));
4636
4637
  }
4637
4638
  if (options.scopeId && !isModuleMode) {
4638
- onError(createCompilerError(50));
4639
+ onError(createCompilerError("50"));
4639
4640
  }
4640
4641
  const ast = isString(template) ? baseParse(template, options) : template;
4641
4642
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();