@systemfsoftware/stryker-js 10.0.1 → 10.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/tags.mjs
1
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/tags.mjs
2
2
  /**
3
3
  * @license
4
4
  * Copyright Google LLC All Rights Reserved.
@@ -15,8 +15,10 @@ let TagContentType = /* @__PURE__ */ function(TagContentType) {
15
15
  function splitNsName(elementName, fatal = true) {
16
16
  if (elementName[0] != ":") return [null, elementName];
17
17
  const colonIndex = elementName.indexOf(":", 1);
18
- if (colonIndex === -1) if (fatal) throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
19
- else return [null, elementName];
18
+ if (colonIndex === -1) {
19
+ if (fatal) throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
20
+ else return [null, elementName];
21
+ }
20
22
  return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
21
23
  }
22
24
  function isNgContainer(tagName) {
@@ -32,21 +34,156 @@ function mergeNsAndName(prefix, localName) {
32
34
  return prefix ? `:${prefix}:${localName}` : localName;
33
35
  }
34
36
  //#endregion
35
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/core.mjs
37
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/schema/dom_security_schema.mjs
38
+ /**
39
+ * @license
40
+ * Copyright Google LLC All Rights Reserved.
41
+ *
42
+ * Use of this source code is governed by an MIT-style license that can be
43
+ * found in the LICENSE file at https://angular.dev/license
44
+ */
45
+ let _SECURITY_SCHEMA;
46
+ const MATH_ML_NAMESPACE = "math";
47
+ const NO_NAMESPACE = "";
48
+ const MATCH_ALL_ELEMENTS = "*";
49
+ const createNullObj = () => Object.create(null);
50
+ /**
51
+ * @remarks Keep is a copy of DOM Security Schema.
52
+ * @see [SECURITY_SCHEMA](../../../compiler/src/schema/dom_security_schema.ts)
53
+ */
54
+ function SECURITY_SCHEMA() {
55
+ if (_SECURITY_SCHEMA) return _SECURITY_SCHEMA;
56
+ _SECURITY_SCHEMA = createNullObj();
57
+ registerContext(
58
+ 1,
59
+ /** Namespace */
60
+ void 0,
61
+ [["iframe", ["srcdoc"]], ["*", ["innerHTML", "outerHTML"]]]
62
+ );
63
+ registerContext(
64
+ 2,
65
+ /** Namespace */
66
+ void 0,
67
+ [["*", ["style"]]]
68
+ );
69
+ registerContext(
70
+ 4,
71
+ /** Namespace */
72
+ void 0,
73
+ [
74
+ ["*", ["formAction"]],
75
+ ["area", ["href"]],
76
+ ["a", ["href", "xlink:href"]],
77
+ ["form", ["action"]],
78
+ ["img", ["src"]],
79
+ ["video", ["src"]]
80
+ ]
81
+ );
82
+ registerContext(4, MATH_ML_NAMESPACE, [["*", ["href", "xlink:href"]]]);
83
+ registerContext(
84
+ 5,
85
+ /** Namespace */
86
+ void 0,
87
+ [
88
+ ["base", ["href"]],
89
+ ["embed", ["src"]],
90
+ ["frame", ["src"]],
91
+ ["iframe", ["src"]],
92
+ ["link", ["href"]],
93
+ ["object", ["codebase", "data"]]
94
+ ]
95
+ );
96
+ registerContext(4, "svg", [["a", ["href", "xlink:href"]]]);
97
+ registerContext(6, "svg", [
98
+ ["animate", [
99
+ "attributeName",
100
+ "values",
101
+ "to",
102
+ "from"
103
+ ]],
104
+ ["set", ["to", "attributeName"]],
105
+ ["animateMotion", ["attributeName"]],
106
+ ["animateTransform", ["attributeName"]]
107
+ ]);
108
+ registerContext(
109
+ 6,
110
+ /** Namespace */
111
+ void 0,
112
+ [["unknown", [
113
+ "attributeName",
114
+ "values",
115
+ "to",
116
+ "from",
117
+ "sandbox",
118
+ "allow",
119
+ "allowFullscreen",
120
+ "referrerPolicy",
121
+ "csp",
122
+ "fetchPriority",
123
+ "credentialless"
124
+ ]], ["iframe", [
125
+ "sandbox",
126
+ "allow",
127
+ "allowFullscreen",
128
+ "referrerPolicy",
129
+ "csp",
130
+ "fetchPriority",
131
+ "credentialless"
132
+ ]]]
133
+ );
134
+ return _SECURITY_SCHEMA;
135
+ }
136
+ function registerContext(ctx, namespace, specs) {
137
+ const nsKey = namespace ?? NO_NAMESPACE;
138
+ for (const [element, attributeNames] of specs) {
139
+ const tagName = element.toLowerCase();
140
+ for (const attr of attributeNames) {
141
+ var _SECURITY_SCHEMA2;
142
+ const attrLower = attr.toLowerCase();
143
+ const attrSchema = (_SECURITY_SCHEMA2 = _SECURITY_SCHEMA)[attrLower] ?? (_SECURITY_SCHEMA2[attrLower] = createNullObj());
144
+ const nsSchema = attrSchema[nsKey] ?? (attrSchema[nsKey] = createNullObj());
145
+ nsSchema[tagName] = ctx;
146
+ }
147
+ }
148
+ }
149
+ /**
150
+ * Checks the SecurityContext for a given tag and property.
151
+ * @param tagName The tag name (e.g. 'div', or 'a')
152
+ * @param propName The property or attribute name
153
+ * @param namespace The namespace of the element, if any (e.g. 'svg' or 'math')
154
+ */
155
+ function checkSecurityContext(tagName, propName, namespace) {
156
+ const attrSchema = SECURITY_SCHEMA()[propName.toLowerCase()];
157
+ if (!attrSchema) return 0;
158
+ const tagLower = tagName.toLowerCase();
159
+ let context;
160
+ if (namespace) {
161
+ const nsSchema = attrSchema[namespace];
162
+ if (nsSchema) context = nsSchema[tagLower] ?? nsSchema[MATCH_ALL_ELEMENTS];
163
+ }
164
+ if (context === void 0) {
165
+ const defaultSchema = attrSchema[NO_NAMESPACE];
166
+ if (defaultSchema) context = defaultSchema[tagLower] ?? defaultSchema[MATCH_ALL_ELEMENTS];
167
+ }
168
+ if (context === void 0 && (!namespace || namespace === NO_NAMESPACE)) {
169
+ const svgSchema = attrSchema["svg"];
170
+ if (svgSchema) context = svgSchema[tagLower];
171
+ }
172
+ return context ?? 0;
173
+ }
174
+ //#endregion
175
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/core.mjs
176
+ /**
177
+ * @license
178
+ * Copyright Google LLC All Rights Reserved.
179
+ *
180
+ * Use of this source code is governed by an MIT-style license that can be
181
+ * found in the LICENSE file at https://angular.dev/license
182
+ */
36
183
  const CUSTOM_ELEMENTS_SCHEMA = { name: "custom-elements" };
37
184
  const NO_ERRORS_SCHEMA = { name: "no-errors-schema" };
38
- let SecurityContext = /* @__PURE__ */ function(SecurityContext) {
39
- SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
40
- SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
41
- SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
42
- SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
43
- SecurityContext[SecurityContext["URL"] = 4] = "URL";
44
- SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
45
- SecurityContext[SecurityContext["ATTRIBUTE_NO_BINDING"] = 6] = "ATTRIBUTE_NO_BINDING";
46
- return SecurityContext;
47
- }({});
48
185
  //#endregion
49
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/util.mjs
186
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/util.mjs
50
187
  /**
51
188
  * @license
52
189
  * Copyright Google LLC All Rights Reserved.
@@ -59,7 +196,7 @@ function dashCaseToCamelCase(input) {
59
196
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
60
197
  }
61
198
  //#endregion
62
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/schema/dom_security_schema.mjs
199
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/schema/element_schema_registry.mjs
63
200
  /**
64
201
  * @license
65
202
  * Copyright Google LLC All Rights Reserved.
@@ -67,134 +204,9 @@ function dashCaseToCamelCase(input) {
67
204
  * Use of this source code is governed by an MIT-style license that can be
68
205
  * found in the LICENSE file at https://angular.dev/license
69
206
  */
70
- /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
71
- let _SECURITY_SCHEMA;
72
- function SECURITY_SCHEMA() {
73
- if (!_SECURITY_SCHEMA) {
74
- _SECURITY_SCHEMA = {};
75
- registerContext(SecurityContext.HTML, [
76
- "iframe|srcdoc",
77
- "*|innerHTML",
78
- "*|outerHTML"
79
- ]);
80
- registerContext(SecurityContext.STYLE, ["*|style"]);
81
- registerContext(SecurityContext.URL, [
82
- "*|formAction",
83
- "area|href",
84
- "a|href",
85
- "a|xlink:href",
86
- "form|action",
87
- "annotation|href",
88
- "annotation|xlink:href",
89
- "annotation-xml|href",
90
- "annotation-xml|xlink:href",
91
- "maction|href",
92
- "maction|xlink:href",
93
- "malignmark|href",
94
- "malignmark|xlink:href",
95
- "math|href",
96
- "math|xlink:href",
97
- "mroot|href",
98
- "mroot|xlink:href",
99
- "msqrt|href",
100
- "msqrt|xlink:href",
101
- "merror|href",
102
- "merror|xlink:href",
103
- "mfrac|href",
104
- "mfrac|xlink:href",
105
- "mglyph|href",
106
- "mglyph|xlink:href",
107
- "msub|href",
108
- "msub|xlink:href",
109
- "msup|href",
110
- "msup|xlink:href",
111
- "msubsup|href",
112
- "msubsup|xlink:href",
113
- "mmultiscripts|href",
114
- "mmultiscripts|xlink:href",
115
- "mprescripts|href",
116
- "mprescripts|xlink:href",
117
- "mi|href",
118
- "mi|xlink:href",
119
- "mn|href",
120
- "mn|xlink:href",
121
- "mo|href",
122
- "mo|xlink:href",
123
- "mpadded|href",
124
- "mpadded|xlink:href",
125
- "mphantom|href",
126
- "mphantom|xlink:href",
127
- "mrow|href",
128
- "mrow|xlink:href",
129
- "ms|href",
130
- "ms|xlink:href",
131
- "mspace|href",
132
- "mspace|xlink:href",
133
- "mstyle|href",
134
- "mstyle|xlink:href",
135
- "mtable|href",
136
- "mtable|xlink:href",
137
- "mtd|href",
138
- "mtd|xlink:href",
139
- "mtr|href",
140
- "mtr|xlink:href",
141
- "mtext|href",
142
- "mtext|xlink:href",
143
- "mover|href",
144
- "mover|xlink:href",
145
- "munder|href",
146
- "munder|xlink:href",
147
- "munderover|href",
148
- "munderover|xlink:href",
149
- "semantics|href",
150
- "semantics|xlink:href",
151
- "none|href",
152
- "none|xlink:href",
153
- "img|src",
154
- "video|src"
155
- ]);
156
- registerContext(SecurityContext.RESOURCE_URL, [
157
- "base|href",
158
- "embed|src",
159
- "frame|src",
160
- "iframe|src",
161
- "link|href",
162
- "object|codebase",
163
- "object|data",
164
- "script|src",
165
- "script|href",
166
- "script|xlink:href"
167
- ]);
168
- registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, [
169
- "animate|attributeName",
170
- "set|attributeName",
171
- "animateMotion|attributeName",
172
- "animateTransform|attributeName",
173
- "unknown|attributeName",
174
- "iframe|sandbox",
175
- "iframe|allow",
176
- "iframe|allowFullscreen",
177
- "iframe|referrerPolicy",
178
- "iframe|csp",
179
- "iframe|fetchPriority",
180
- "unknown|sandbox",
181
- "unknown|allow",
182
- "unknown|allowFullscreen",
183
- "unknown|referrerPolicy",
184
- "unknown|csp",
185
- "unknown|fetchPriority"
186
- ]);
187
- }
188
- return _SECURITY_SCHEMA;
189
- }
190
- function registerContext(ctx, specs) {
191
- for (const spec of specs) _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
192
- }
193
- //#endregion
194
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/schema/element_schema_registry.mjs
195
207
  var ElementSchemaRegistry = class {};
196
208
  //#endregion
197
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/schema/dom_element_schema_registry.mjs
209
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/schema/dom_element_schema_registry.mjs
198
210
  /**
199
211
  * @license
200
212
  * Copyright Google LLC All Rights Reserved.
@@ -206,6 +218,10 @@ const BOOLEAN = "boolean";
206
218
  const NUMBER = "number";
207
219
  const STRING = "string";
208
220
  const OBJECT = "object";
221
+ function normalizeTagName(tagName) {
222
+ const [ns, name] = splitNsName(tagName.toLowerCase(), false);
223
+ return ns === "svg" || ns === "math" ? `:${ns}:${name}` : name;
224
+ }
209
225
  /**
210
226
  * This array represents the DOM schema. It encodes inheritance, properties, and events.
211
227
  *
@@ -283,11 +299,12 @@ const SCHEMA = [
283
299
  "form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target",
284
300
  "frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src",
285
301
  "frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows",
302
+ "geolocation^[HTMLElement]|accuracymode,!autolocate,*location,*promptaction,*promptdismiss,*validationstatuschange,!watch",
286
303
  "hr^[HTMLElement]|align,color,!noShade,size,width",
287
304
  "head^[HTMLElement]|",
288
305
  "h1,h2,h3,h4,h5,h6^[HTMLElement]|align",
289
306
  "html^[HTMLElement]|version",
290
- "iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width",
307
+ "iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,!credentialless,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width",
291
308
  "img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width",
292
309
  "input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width",
293
310
  "li^[HTMLElement]|type,#value",
@@ -535,19 +552,21 @@ var DomElementSchemaRegistry = class extends ElementSchemaRegistry {
535
552
  }
536
553
  hasProperty(tagName, propName, schemaMetas) {
537
554
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) return true;
538
- if (tagName.indexOf("-") > -1) {
539
- if (isNgContainer(tagName) || isNgContent(tagName)) return false;
555
+ const normalizedTag = normalizeTagName(tagName);
556
+ if (normalizedTag.includes("-")) {
557
+ if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) return false;
540
558
  if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) return true;
541
559
  }
542
- return (this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown")).has(propName);
560
+ return (this._schema.get(normalizedTag) || this._schema.get("unknown")).has(propName);
543
561
  }
544
562
  hasElement(tagName, schemaMetas) {
545
563
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) return true;
546
- if (tagName.indexOf("-") > -1) {
547
- if (isNgContainer(tagName) || isNgContent(tagName)) return true;
564
+ const normalizedTag = normalizeTagName(tagName);
565
+ if (normalizedTag.includes("-")) {
566
+ if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) return true;
548
567
  if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) return true;
549
568
  }
550
- return this._schema.has(tagName.toLowerCase());
569
+ return this._schema.has(normalizedTag);
551
570
  }
552
571
  /**
553
572
  * securityContext returns the security context for the given property on the given DOM tag.
@@ -561,12 +580,8 @@ var DomElementSchemaRegistry = class extends ElementSchemaRegistry {
561
580
  */
562
581
  securityContext(tagName, propName, isAttribute) {
563
582
  if (isAttribute) propName = this.getMappedPropName(propName);
564
- tagName = tagName.toLowerCase();
565
- propName = propName.toLowerCase();
566
- let ctx = SECURITY_SCHEMA()[tagName + "|" + propName];
567
- if (ctx) return ctx;
568
- ctx = SECURITY_SCHEMA()["*|" + propName];
569
- return ctx ? ctx : SecurityContext.NONE;
583
+ const [ns, name] = splitNsName(tagName, false);
584
+ return checkSecurityContext(name, propName, ns);
570
585
  }
571
586
  getMappedPropName(propName) {
572
587
  return _ATTR_TO_PROP.get(propName) ?? propName;
@@ -592,11 +607,13 @@ var DomElementSchemaRegistry = class extends ElementSchemaRegistry {
592
607
  return Array.from(this._schema.keys());
593
608
  }
594
609
  allKnownAttributesOfElement(tagName) {
595
- const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown");
610
+ const normalizedTag = normalizeTagName(tagName);
611
+ const elementProperties = this._schema.get(normalizedTag) || this._schema.get("unknown");
596
612
  return Array.from(elementProperties.keys()).map((prop) => _PROP_TO_ATTR.get(prop) ?? prop);
597
613
  }
598
614
  allKnownEventsOfElement(tagName) {
599
- return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
615
+ const normalizedTag = normalizeTagName(tagName);
616
+ return Array.from(this._eventSchema.get(normalizedTag) ?? []);
600
617
  }
601
618
  normalizeAnimationStyleProperty(propName) {
602
619
  return dashCaseToCamelCase(propName);
@@ -605,10 +622,12 @@ var DomElementSchemaRegistry = class extends ElementSchemaRegistry {
605
622
  let unit = "";
606
623
  const strVal = val.toString().trim();
607
624
  let errorMsg = null;
608
- if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== "0") if (typeof val === "number") unit = "px";
609
- else {
610
- const valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/);
611
- if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) errorMsg = `Please provide a CSS unit value for ${userProvidedProp}:${val}`;
625
+ if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== "0") {
626
+ if (typeof val === "number") unit = "px";
627
+ else {
628
+ const valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/);
629
+ if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) errorMsg = `Please provide a CSS unit value for ${userProvidedProp}:${val}`;
630
+ }
612
631
  }
613
632
  return {
614
633
  error: errorMsg,
@@ -650,7 +669,7 @@ function _isPixelDimensionStyle(prop) {
650
669
  }
651
670
  }
652
671
  //#endregion
653
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/html_tags.mjs
672
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/html_tags.mjs
654
673
  /**
655
674
  * @license
656
675
  * Copyright Google LLC All Rights Reserved.
@@ -667,7 +686,7 @@ var HtmlTagDefinition = class {
667
686
  ignoreFirstLf;
668
687
  canSelfClose;
669
688
  preventNamespaceInheritance;
670
- constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
689
+ constructor({ closedByChildren, implicitNamespacePrefix, contentType = 2, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
671
690
  if (closedByChildren && closedByChildren.length > 0) closedByChildren.forEach((tagName) => this.closedByChildren[tagName] = true);
672
691
  this.isVoid = isVoid;
673
692
  this.closedByParent = closedByParent || isVoid;
@@ -817,14 +836,14 @@ function getHtmlTagDefinition(tagName) {
817
836
  }),
818
837
  "pre": new HtmlTagDefinition({ ignoreFirstLf: true }),
819
838
  "listing": new HtmlTagDefinition({ ignoreFirstLf: true }),
820
- "style": new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
821
- "script": new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
839
+ "style": new HtmlTagDefinition({ contentType: 0 }),
840
+ "script": new HtmlTagDefinition({ contentType: 0 }),
822
841
  "title": new HtmlTagDefinition({ contentType: {
823
- default: TagContentType.ESCAPABLE_RAW_TEXT,
824
- svg: TagContentType.PARSABLE_DATA
842
+ default: 1,
843
+ svg: 2
825
844
  } }),
826
845
  "textarea": new HtmlTagDefinition({
827
- contentType: TagContentType.ESCAPABLE_RAW_TEXT,
846
+ contentType: 1,
828
847
  ignoreFirstLf: true
829
848
  })
830
849
  });
@@ -834,41 +853,8 @@ function getHtmlTagDefinition(tagName) {
834
853
  }
835
854
  return TAG_DEFINITIONS[tagName] ?? DEFAULT_TAG_DEFINITION;
836
855
  }
837
- /**
838
- * @license
839
- * Copyright Google LLC All Rights Reserved.
840
- *
841
- * Use of this source code is governed by an MIT-style license that can be
842
- * found in the LICENSE file at https://angular.dev/license
843
- */
844
- const $SPACE = 32;
845
- const $7 = 55;
846
- const $F = 70;
847
- const $NBSP = 160;
848
- const $BT = 96;
849
- function isWhitespace(code) {
850
- return code >= 9 && code <= $SPACE || code == $NBSP;
851
- }
852
- function isDigit(code) {
853
- return 48 <= code && code <= 57;
854
- }
855
- function isAsciiLetter(code) {
856
- return code >= 97 && code <= 122 || code >= 65 && code <= 90;
857
- }
858
- function isAsciiHexDigit(code) {
859
- return code >= 97 && code <= 102 || code >= 65 && code <= $F || isDigit(code);
860
- }
861
- function isNewLine(code) {
862
- return code === 10 || code === 13;
863
- }
864
- function isOctalDigit(code) {
865
- return 48 <= code && code <= $7;
866
- }
867
- function isQuote(code) {
868
- return code === 39 || code === 34 || code === $BT;
869
- }
870
856
  //#endregion
871
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/parse_util.mjs
857
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/parse_util.mjs
872
858
  /**
873
859
  * @license
874
860
  * Copyright Google LLC All Rights Reserved.
@@ -877,6 +863,10 @@ function isQuote(code) {
877
863
  * found in the LICENSE file at https://angular.dev/license
878
864
  */
879
865
  var ParseLocation = class ParseLocation {
866
+ file;
867
+ offset;
868
+ line;
869
+ col;
880
870
  constructor(file, offset, line, col) {
881
871
  this.file = file;
882
872
  this.offset = offset;
@@ -945,12 +935,18 @@ var ParseLocation = class ParseLocation {
945
935
  }
946
936
  };
947
937
  var ParseSourceFile = class {
938
+ content;
939
+ url;
948
940
  constructor(content, url) {
949
941
  this.content = content;
950
942
  this.url = url;
951
943
  }
952
944
  };
953
945
  var ParseSourceSpan = class {
946
+ start;
947
+ end;
948
+ fullStart;
949
+ details;
954
950
  /**
955
951
  * Create an object that holds information about spans of tokens/nodes captured during
956
952
  * lexing/parsing of text.
@@ -990,7 +986,11 @@ let ParseErrorLevel = /* @__PURE__ */ function(ParseErrorLevel) {
990
986
  return ParseErrorLevel;
991
987
  }({});
992
988
  var ParseError = class extends Error {
993
- constructor(span, msg, level = ParseErrorLevel.ERROR, relatedError) {
989
+ span;
990
+ msg;
991
+ level;
992
+ relatedError;
993
+ constructor(span, msg, level = 1, relatedError) {
994
994
  super(msg);
995
995
  this.span = span;
996
996
  this.msg = msg;
@@ -1008,14 +1008,25 @@ var ParseError = class extends Error {
1008
1008
  }
1009
1009
  };
1010
1010
  //#endregion
1011
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/ast.mjs
1011
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/ast.mjs
1012
+ /**
1013
+ * @license
1014
+ * Copyright Google LLC All Rights Reserved.
1015
+ *
1016
+ * Use of this source code is governed by an MIT-style license that can be
1017
+ * found in the LICENSE file at https://angular.dev/license
1018
+ */
1012
1019
  var NodeWithI18n = class {
1020
+ sourceSpan;
1021
+ i18n;
1013
1022
  constructor(sourceSpan, i18n) {
1014
1023
  this.sourceSpan = sourceSpan;
1015
1024
  this.i18n = i18n;
1016
1025
  }
1017
1026
  };
1018
1027
  var Text = class extends NodeWithI18n {
1028
+ value;
1029
+ tokens;
1019
1030
  constructor(value, sourceSpan, tokens, i18n) {
1020
1031
  super(sourceSpan, i18n);
1021
1032
  this.value = value;
@@ -1027,6 +1038,8 @@ var Text = class extends NodeWithI18n {
1027
1038
  kind = "text";
1028
1039
  };
1029
1040
  var CDATA = class extends NodeWithI18n {
1041
+ value;
1042
+ tokens;
1030
1043
  constructor(value, sourceSpan, tokens, i18n) {
1031
1044
  super(sourceSpan, i18n);
1032
1045
  this.value = value;
@@ -1038,6 +1051,10 @@ var CDATA = class extends NodeWithI18n {
1038
1051
  kind = "cdata";
1039
1052
  };
1040
1053
  var Expansion = class extends NodeWithI18n {
1054
+ switchValue;
1055
+ type;
1056
+ cases;
1057
+ switchValueSourceSpan;
1041
1058
  constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n) {
1042
1059
  super(sourceSpan, i18n);
1043
1060
  this.switchValue = switchValue;
@@ -1051,6 +1068,11 @@ var Expansion = class extends NodeWithI18n {
1051
1068
  kind = "expansion";
1052
1069
  };
1053
1070
  var ExpansionCase = class {
1071
+ value;
1072
+ expression;
1073
+ sourceSpan;
1074
+ valueSourceSpan;
1075
+ expSourceSpan;
1054
1076
  constructor(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {
1055
1077
  this.value = value;
1056
1078
  this.expression = expression;
@@ -1064,6 +1086,11 @@ var ExpansionCase = class {
1064
1086
  kind = "expansionCase";
1065
1087
  };
1066
1088
  var Attribute = class extends NodeWithI18n {
1089
+ name;
1090
+ value;
1091
+ keySpan;
1092
+ valueSpan;
1093
+ valueTokens;
1067
1094
  constructor(name, value, sourceSpan, keySpan, valueSpan, valueTokens, i18n) {
1068
1095
  super(sourceSpan, i18n);
1069
1096
  this.name = name;
@@ -1080,8 +1107,32 @@ var Attribute = class extends NodeWithI18n {
1080
1107
  return this.keySpan;
1081
1108
  }
1082
1109
  };
1110
+ var StartTagComment = class {
1111
+ value;
1112
+ type;
1113
+ sourceSpan;
1114
+ constructor(value, type, sourceSpan) {
1115
+ this.value = value;
1116
+ this.type = type;
1117
+ this.sourceSpan = sourceSpan;
1118
+ }
1119
+ visit(visitor, context) {
1120
+ return visitor.visitStartTagComment ? visitor.visitStartTagComment(this, context) : void 0;
1121
+ }
1122
+ kind = "startTagComment";
1123
+ };
1083
1124
  var Element = class extends NodeWithI18n {
1084
- constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, nameSpan = null, isVoid, i18n) {
1125
+ name;
1126
+ attrs;
1127
+ directives;
1128
+ children;
1129
+ isSelfClosing;
1130
+ startSourceSpan;
1131
+ endSourceSpan;
1132
+ nameSpan;
1133
+ isVoid;
1134
+ comments;
1135
+ constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, nameSpan = null, isVoid, i18n, comments = []) {
1085
1136
  super(sourceSpan, i18n);
1086
1137
  this.name = name;
1087
1138
  this.attrs = attrs;
@@ -1092,6 +1143,7 @@ var Element = class extends NodeWithI18n {
1092
1143
  this.endSourceSpan = endSourceSpan;
1093
1144
  this.nameSpan = nameSpan;
1094
1145
  this.isVoid = isVoid;
1146
+ this.comments = comments;
1095
1147
  }
1096
1148
  visit(visitor, context) {
1097
1149
  return visitor.visitElement(this, context);
@@ -1099,6 +1151,8 @@ var Element = class extends NodeWithI18n {
1099
1151
  kind = "element";
1100
1152
  };
1101
1153
  var Comment = class {
1154
+ value;
1155
+ sourceSpan;
1102
1156
  constructor(value, sourceSpan) {
1103
1157
  this.value = value;
1104
1158
  this.sourceSpan = sourceSpan;
@@ -1109,6 +1163,8 @@ var Comment = class {
1109
1163
  kind = "comment";
1110
1164
  };
1111
1165
  var DocType = class {
1166
+ value;
1167
+ sourceSpan;
1112
1168
  constructor(value, sourceSpan) {
1113
1169
  this.value = value;
1114
1170
  this.sourceSpan = sourceSpan;
@@ -1119,6 +1175,12 @@ var DocType = class {
1119
1175
  kind = "docType";
1120
1176
  };
1121
1177
  var Block = class extends NodeWithI18n {
1178
+ name;
1179
+ parameters;
1180
+ children;
1181
+ nameSpan;
1182
+ startSourceSpan;
1183
+ endSourceSpan;
1122
1184
  constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n) {
1123
1185
  super(sourceSpan, i18n);
1124
1186
  this.name = name;
@@ -1134,7 +1196,17 @@ var Block = class extends NodeWithI18n {
1134
1196
  kind = "block";
1135
1197
  };
1136
1198
  var Component = class extends NodeWithI18n {
1137
- constructor(componentName, tagName, fullName, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
1199
+ componentName;
1200
+ tagName;
1201
+ fullName;
1202
+ attrs;
1203
+ directives;
1204
+ children;
1205
+ isSelfClosing;
1206
+ startSourceSpan;
1207
+ endSourceSpan;
1208
+ comments;
1209
+ constructor(componentName, tagName, fullName, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n, comments = []) {
1138
1210
  super(sourceSpan, i18n);
1139
1211
  this.componentName = componentName;
1140
1212
  this.tagName = tagName;
@@ -1145,6 +1217,7 @@ var Component = class extends NodeWithI18n {
1145
1217
  this.isSelfClosing = isSelfClosing;
1146
1218
  this.startSourceSpan = startSourceSpan;
1147
1219
  this.endSourceSpan = endSourceSpan;
1220
+ this.comments = comments;
1148
1221
  }
1149
1222
  visit(visitor, context) {
1150
1223
  return visitor.visitComponent(this, context);
@@ -1152,6 +1225,11 @@ var Component = class extends NodeWithI18n {
1152
1225
  kind = "component";
1153
1226
  };
1154
1227
  var Directive = class {
1228
+ name;
1229
+ attrs;
1230
+ sourceSpan;
1231
+ startSourceSpan;
1232
+ endSourceSpan;
1155
1233
  constructor(name, attrs, sourceSpan, startSourceSpan, endSourceSpan = null) {
1156
1234
  this.name = name;
1157
1235
  this.attrs = attrs;
@@ -1165,6 +1243,8 @@ var Directive = class {
1165
1243
  kind = "directive";
1166
1244
  };
1167
1245
  var BlockParameter = class {
1246
+ expression;
1247
+ sourceSpan;
1168
1248
  constructor(expression, sourceSpan) {
1169
1249
  this.expression = expression;
1170
1250
  this.sourceSpan = sourceSpan;
@@ -1177,6 +1257,11 @@ var BlockParameter = class {
1177
1257
  endSourceSpan = null;
1178
1258
  };
1179
1259
  var LetDeclaration = class {
1260
+ name;
1261
+ value;
1262
+ sourceSpan;
1263
+ nameSpan;
1264
+ valueSpan;
1180
1265
  constructor(name, value, sourceSpan, nameSpan, valueSpan) {
1181
1266
  this.name = name;
1182
1267
  this.value = value;
@@ -1206,10 +1291,12 @@ var RecursiveVisitor = class {
1206
1291
  this.visitChildren(context, (visit) => {
1207
1292
  visit(ast.attrs);
1208
1293
  visit(ast.directives);
1294
+ visit(ast.comments);
1209
1295
  visit(ast.children);
1210
1296
  });
1211
1297
  }
1212
1298
  visitAttribute(ast, context) {}
1299
+ visitStartTagComment(ast, context) {}
1213
1300
  visitText(ast, context) {}
1214
1301
  visitCdata(ast, context) {}
1215
1302
  visitComment(ast, context) {}
@@ -1231,6 +1318,7 @@ var RecursiveVisitor = class {
1231
1318
  visitComponent(component, context) {
1232
1319
  this.visitChildren(context, (visit) => {
1233
1320
  visit(component.attrs);
1321
+ visit(component.comments);
1234
1322
  visit(component.children);
1235
1323
  });
1236
1324
  }
@@ -1250,7 +1338,37 @@ var RecursiveVisitor = class {
1250
1338
  }
1251
1339
  };
1252
1340
  //#endregion
1253
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/entities.mjs
1341
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/chars.mjs
1342
+ /**
1343
+ * @license
1344
+ * Copyright Google LLC All Rights Reserved.
1345
+ *
1346
+ * Use of this source code is governed by an MIT-style license that can be
1347
+ * found in the LICENSE file at https://angular.dev/license
1348
+ */
1349
+ function isWhitespace(code) {
1350
+ return code >= 9 && code <= 32 || code == 160;
1351
+ }
1352
+ function isDigit(code) {
1353
+ return 48 <= code && code <= 57;
1354
+ }
1355
+ function isAsciiLetter(code) {
1356
+ return code >= 97 && code <= 122 || code >= 65 && code <= 90;
1357
+ }
1358
+ function isAsciiHexDigit(code) {
1359
+ return code >= 97 && code <= 102 || code >= 65 && code <= 70 || isDigit(code);
1360
+ }
1361
+ function isNewLine(code) {
1362
+ return code === 10 || code === 13;
1363
+ }
1364
+ function isOctalDigit(code) {
1365
+ return 48 <= code && code <= 55;
1366
+ }
1367
+ function isQuote(code) {
1368
+ return code === 39 || code === 34 || code === 96;
1369
+ }
1370
+ //#endregion
1371
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/entities.mjs
1254
1372
  /**
1255
1373
  * @license
1256
1374
  * Copyright Google LLC All Rights Reserved.
@@ -3387,55 +3505,7 @@ const NAMED_ENTITIES = {
3387
3505
  };
3388
3506
  NAMED_ENTITIES["ngsp"] = "";
3389
3507
  //#endregion
3390
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/tokens.mjs
3391
- let TokenType = /* @__PURE__ */ function(TokenType) {
3392
- TokenType[TokenType["TAG_OPEN_START"] = 0] = "TAG_OPEN_START";
3393
- TokenType[TokenType["TAG_OPEN_END"] = 1] = "TAG_OPEN_END";
3394
- TokenType[TokenType["TAG_OPEN_END_VOID"] = 2] = "TAG_OPEN_END_VOID";
3395
- TokenType[TokenType["TAG_CLOSE"] = 3] = "TAG_CLOSE";
3396
- TokenType[TokenType["INCOMPLETE_TAG_OPEN"] = 4] = "INCOMPLETE_TAG_OPEN";
3397
- TokenType[TokenType["TEXT"] = 5] = "TEXT";
3398
- TokenType[TokenType["ESCAPABLE_RAW_TEXT"] = 6] = "ESCAPABLE_RAW_TEXT";
3399
- TokenType[TokenType["RAW_TEXT"] = 7] = "RAW_TEXT";
3400
- TokenType[TokenType["INTERPOLATION"] = 8] = "INTERPOLATION";
3401
- TokenType[TokenType["ENCODED_ENTITY"] = 9] = "ENCODED_ENTITY";
3402
- TokenType[TokenType["COMMENT_START"] = 10] = "COMMENT_START";
3403
- TokenType[TokenType["COMMENT_END"] = 11] = "COMMENT_END";
3404
- TokenType[TokenType["CDATA_START"] = 12] = "CDATA_START";
3405
- TokenType[TokenType["CDATA_END"] = 13] = "CDATA_END";
3406
- TokenType[TokenType["ATTR_NAME"] = 14] = "ATTR_NAME";
3407
- TokenType[TokenType["ATTR_QUOTE"] = 15] = "ATTR_QUOTE";
3408
- TokenType[TokenType["ATTR_VALUE_TEXT"] = 16] = "ATTR_VALUE_TEXT";
3409
- TokenType[TokenType["ATTR_VALUE_INTERPOLATION"] = 17] = "ATTR_VALUE_INTERPOLATION";
3410
- TokenType[TokenType["DOC_TYPE_START"] = 18] = "DOC_TYPE_START";
3411
- TokenType[TokenType["DOC_TYPE_END"] = 19] = "DOC_TYPE_END";
3412
- TokenType[TokenType["EXPANSION_FORM_START"] = 20] = "EXPANSION_FORM_START";
3413
- TokenType[TokenType["EXPANSION_CASE_VALUE"] = 21] = "EXPANSION_CASE_VALUE";
3414
- TokenType[TokenType["EXPANSION_CASE_EXP_START"] = 22] = "EXPANSION_CASE_EXP_START";
3415
- TokenType[TokenType["EXPANSION_CASE_EXP_END"] = 23] = "EXPANSION_CASE_EXP_END";
3416
- TokenType[TokenType["EXPANSION_FORM_END"] = 24] = "EXPANSION_FORM_END";
3417
- TokenType[TokenType["BLOCK_OPEN_START"] = 25] = "BLOCK_OPEN_START";
3418
- TokenType[TokenType["BLOCK_OPEN_END"] = 26] = "BLOCK_OPEN_END";
3419
- TokenType[TokenType["BLOCK_CLOSE"] = 27] = "BLOCK_CLOSE";
3420
- TokenType[TokenType["BLOCK_PARAMETER"] = 28] = "BLOCK_PARAMETER";
3421
- TokenType[TokenType["INCOMPLETE_BLOCK_OPEN"] = 29] = "INCOMPLETE_BLOCK_OPEN";
3422
- TokenType[TokenType["LET_START"] = 30] = "LET_START";
3423
- TokenType[TokenType["LET_VALUE"] = 31] = "LET_VALUE";
3424
- TokenType[TokenType["LET_END"] = 32] = "LET_END";
3425
- TokenType[TokenType["INCOMPLETE_LET"] = 33] = "INCOMPLETE_LET";
3426
- TokenType[TokenType["COMPONENT_OPEN_START"] = 34] = "COMPONENT_OPEN_START";
3427
- TokenType[TokenType["COMPONENT_OPEN_END"] = 35] = "COMPONENT_OPEN_END";
3428
- TokenType[TokenType["COMPONENT_OPEN_END_VOID"] = 36] = "COMPONENT_OPEN_END_VOID";
3429
- TokenType[TokenType["COMPONENT_CLOSE"] = 37] = "COMPONENT_CLOSE";
3430
- TokenType[TokenType["INCOMPLETE_COMPONENT_OPEN"] = 38] = "INCOMPLETE_COMPONENT_OPEN";
3431
- TokenType[TokenType["DIRECTIVE_NAME"] = 39] = "DIRECTIVE_NAME";
3432
- TokenType[TokenType["DIRECTIVE_OPEN"] = 40] = "DIRECTIVE_OPEN";
3433
- TokenType[TokenType["DIRECTIVE_CLOSE"] = 41] = "DIRECTIVE_CLOSE";
3434
- TokenType[TokenType["EOF"] = 42] = "EOF";
3435
- return TokenType;
3436
- }({});
3437
- //#endregion
3438
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/lexer.mjs
3508
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/lexer.mjs
3439
3509
  /**
3440
3510
  * @license
3441
3511
  * Copyright Google LLC All Rights Reserved.
@@ -3444,6 +3514,9 @@ let TokenType = /* @__PURE__ */ function(TokenType) {
3444
3514
  * found in the LICENSE file at https://angular.dev/license
3445
3515
  */
3446
3516
  var TokenizeResult = class {
3517
+ tokens;
3518
+ errors;
3519
+ nonNormalizedIcuExpressions;
3447
3520
  constructor(tokens, errors, nonNormalizedIcuExpressions) {
3448
3521
  this.tokens = tokens;
3449
3522
  this.errors = errors;
@@ -3465,11 +3538,6 @@ function _unknownEntityErrorMsg(entitySrc) {
3465
3538
  function _unparsableEntityErrorMsg(type, entityStr) {
3466
3539
  return `Unable to parse entity "${entityStr}" - ${type} character reference entities must end with ";"`;
3467
3540
  }
3468
- var CharacterReferenceType = /* @__PURE__ */ function(CharacterReferenceType) {
3469
- CharacterReferenceType["HEX"] = "hexadecimal";
3470
- CharacterReferenceType["DEC"] = "decimal";
3471
- return CharacterReferenceType;
3472
- }(CharacterReferenceType || {});
3473
3541
  const SUPPORTED_BLOCKS = [
3474
3542
  "@if",
3475
3543
  "@else",
@@ -3481,18 +3549,24 @@ const SUPPORTED_BLOCKS = [
3481
3549
  "@defer",
3482
3550
  "@placeholder",
3483
3551
  "@loading",
3484
- "@error"
3552
+ "@boundary",
3553
+ "@error",
3554
+ "@content"
3485
3555
  ];
3486
3556
  const INTERPOLATION = {
3487
3557
  start: "{{",
3488
3558
  end: "}}"
3489
3559
  };
3560
+ const DEFAULT_NEVER_PATTERN = /^default[^\S\r\n]+never/;
3561
+ const ELSE_IF_PATTERN = /^else[^\S\r\n]+if/;
3490
3562
  var _Tokenizer = class {
3563
+ _getTagContentType;
3491
3564
  _cursor;
3492
3565
  _tokenizeIcu;
3493
3566
  _leadingTriviaCodePoints;
3494
3567
  _canSelfClose;
3495
3568
  _allowHtmComponentClosingTags;
3569
+ _allowStartTagComments;
3496
3570
  _currentTokenStart = null;
3497
3571
  _currentTokenType = null;
3498
3572
  _expansionCaseStack = [];
@@ -3519,6 +3593,7 @@ var _Tokenizer = class {
3519
3593
  this._leadingTriviaCodePoints = options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);
3520
3594
  this._canSelfClose = options.canSelfClose || false;
3521
3595
  this._allowHtmComponentClosingTags = options.allowHtmComponentClosingTags || false;
3596
+ this._allowStartTagComments = options.allowStartTagComments ?? true;
3522
3597
  const range = options.range || {
3523
3598
  endPos: _file.content.length,
3524
3599
  startPos: 0,
@@ -3545,27 +3620,29 @@ var _Tokenizer = class {
3545
3620
  while (this._cursor.peek() !== 0) {
3546
3621
  const start = this._cursor.clone();
3547
3622
  try {
3548
- if (this._attemptCharCode(60)) if (this._attemptCharCode(33)) if (this._attemptStr("[CDATA[")) this._consumeCdata(start);
3549
- else if (this._attemptStr("--")) this._consumeComment(start);
3550
- else if (this._attemptStrCaseInsensitive("doctype")) this._consumeDocType(start);
3551
- else this._consumeBogusComment(start);
3552
- else if (this._attemptCharCode(47)) this._consumeTagClose(start);
3553
- else {
3554
- const savedPos = this._cursor.clone();
3555
- if (this._attemptCharCode(63)) {
3556
- this._cursor = savedPos;
3557
- this._consumeBogusComment(start);
3558
- } else this._consumeTagOpen(start);
3559
- }
3560
- else if (this._tokenizeLet && this._cursor.peek() === 64 && !this._inInterpolation && this._isLetStart()) this._consumeLetDeclaration(start);
3623
+ if (this._attemptCharCode(60)) {
3624
+ if (this._attemptCharCode(33)) {
3625
+ if (this._attemptStr("[CDATA[")) this._consumeCdata(start);
3626
+ else if (this._attemptStr("--")) this._consumeComment(start);
3627
+ else if (this._attemptStrCaseInsensitive("doctype")) this._consumeDocType(start);
3628
+ else this._consumeBogusComment(start);
3629
+ } else if (this._attemptCharCode(47)) this._consumeTagClose(start);
3630
+ else {
3631
+ const savedPos = this._cursor.clone();
3632
+ if (this._attemptCharCode(63)) {
3633
+ this._cursor = savedPos;
3634
+ this._consumeBogusComment(start);
3635
+ } else this._consumeTagOpen(start);
3636
+ }
3637
+ } else if (this._tokenizeLet && this._cursor.peek() === 64 && !this._inInterpolation && this._isLetStart()) this._consumeLetDeclaration(start);
3561
3638
  else if (this._tokenizeBlocks && this._isBlockStart()) this._consumeBlockStart(start);
3562
3639
  else if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansionCase() && !this._isInExpansionForm() && this._attemptCharCode(125)) this._consumeBlockEnd(start);
3563
- else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) this._consumeWithInterpolation(TokenType.TEXT, TokenType.INTERPOLATION, () => this._isTextEnd(), () => this._isTagStart());
3640
+ else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) this._consumeWithInterpolation(5, 8, () => this._isTextEnd(), () => this._isTagStart());
3564
3641
  } catch (e) {
3565
3642
  this.handleError(e);
3566
3643
  }
3567
3644
  }
3568
- this._beginToken(TokenType.EOF);
3645
+ this._beginToken(44);
3569
3646
  this._endToken([]);
3570
3647
  }
3571
3648
  _getBlockName() {
@@ -3579,11 +3656,14 @@ var _Tokenizer = class {
3579
3656
  }
3580
3657
  return true;
3581
3658
  });
3582
- return this._cursor.getChars(nameCursor).trim();
3659
+ let result = this._cursor.getChars(nameCursor).trim();
3660
+ if (ELSE_IF_PATTERN.test(result)) result = "else if";
3661
+ else if (DEFAULT_NEVER_PATTERN.test(result)) result = "default never";
3662
+ return result;
3583
3663
  }
3584
3664
  _consumeBlockStart(start) {
3585
3665
  this._requireCharCode(64);
3586
- this._beginToken(TokenType.BLOCK_OPEN_START, start);
3666
+ this._beginToken(26, start);
3587
3667
  const startToken = this._endToken([this._getBlockName()]);
3588
3668
  if (this._cursor.peek() === 40) {
3589
3669
  this._cursor.advance();
@@ -3591,28 +3671,35 @@ var _Tokenizer = class {
3591
3671
  this._attemptCharCodeUntilFn(isNotWhitespace);
3592
3672
  if (this._attemptCharCode(41)) this._attemptCharCodeUntilFn(isNotWhitespace);
3593
3673
  else {
3594
- startToken.type = TokenType.INCOMPLETE_BLOCK_OPEN;
3674
+ startToken.type = 30;
3595
3675
  return;
3596
3676
  }
3597
3677
  }
3678
+ if (startToken.parts[0] === "default never" && this._attemptCharCode(59)) {
3679
+ this._beginToken(27);
3680
+ this._endToken([]);
3681
+ this._beginToken(28);
3682
+ this._endToken([]);
3683
+ return;
3684
+ }
3598
3685
  if (this._attemptCharCode(123)) {
3599
- this._beginToken(TokenType.BLOCK_OPEN_END);
3686
+ this._beginToken(27);
3600
3687
  this._endToken([]);
3601
3688
  } else if (this._isBlockStart() && (startToken.parts[0] === "case" || startToken.parts[0] === "default")) {
3602
- this._beginToken(TokenType.BLOCK_OPEN_END);
3689
+ this._beginToken(27);
3603
3690
  this._endToken([]);
3604
- this._beginToken(TokenType.BLOCK_CLOSE);
3691
+ this._beginToken(28);
3605
3692
  this._endToken([]);
3606
- } else startToken.type = TokenType.INCOMPLETE_BLOCK_OPEN;
3693
+ } else startToken.type = 30;
3607
3694
  }
3608
3695
  _consumeBlockEnd(start) {
3609
- this._beginToken(TokenType.BLOCK_CLOSE, start);
3696
+ this._beginToken(28, start);
3610
3697
  this._endToken([]);
3611
3698
  }
3612
3699
  _consumeBlockParameters() {
3613
3700
  this._attemptCharCodeUntilFn(isBlockParameterChar);
3614
3701
  while (this._cursor.peek() !== 41 && this._cursor.peek() !== 0) {
3615
- this._beginToken(TokenType.BLOCK_PARAMETER);
3702
+ this._beginToken(29);
3616
3703
  const start = this._cursor.clone();
3617
3704
  let inQuote = null;
3618
3705
  let openParens = 0;
@@ -3634,27 +3721,27 @@ var _Tokenizer = class {
3634
3721
  }
3635
3722
  _consumeLetDeclaration(start) {
3636
3723
  this._requireStr("@let");
3637
- this._beginToken(TokenType.LET_START, start);
3724
+ this._beginToken(31, start);
3638
3725
  if (isWhitespace(this._cursor.peek())) this._attemptCharCodeUntilFn(isNotWhitespace);
3639
3726
  else {
3640
3727
  const token = this._endToken([this._cursor.getChars(start)]);
3641
- token.type = TokenType.INCOMPLETE_LET;
3728
+ token.type = 34;
3642
3729
  return;
3643
3730
  }
3644
3731
  const startToken = this._endToken([this._getLetDeclarationName()]);
3645
3732
  this._attemptCharCodeUntilFn(isNotWhitespace);
3646
3733
  if (!this._attemptCharCode(61)) {
3647
- startToken.type = TokenType.INCOMPLETE_LET;
3734
+ startToken.type = 34;
3648
3735
  return;
3649
3736
  }
3650
3737
  this._attemptCharCodeUntilFn((code) => isNotWhitespace(code) && !isNewLine(code));
3651
3738
  this._consumeLetDeclarationValue();
3652
3739
  if (this._cursor.peek() === 59) {
3653
- this._beginToken(TokenType.LET_END);
3654
- this._endToken([]);
3740
+ this._beginToken(33);
3655
3741
  this._cursor.advance();
3742
+ this._endToken([]);
3656
3743
  } else {
3657
- startToken.type = TokenType.INCOMPLETE_LET;
3744
+ startToken.type = 34;
3658
3745
  startToken.sourceSpan = this._cursor.getSpan(start);
3659
3746
  }
3660
3747
  }
@@ -3672,22 +3759,8 @@ var _Tokenizer = class {
3672
3759
  }
3673
3760
  _consumeLetDeclarationValue() {
3674
3761
  const start = this._cursor.clone();
3675
- this._beginToken(TokenType.LET_VALUE, start);
3676
- while (this._cursor.peek() !== 0) {
3677
- const char = this._cursor.peek();
3678
- if (char === 59) break;
3679
- if (isQuote(char)) {
3680
- this._cursor.advance();
3681
- this._attemptCharCodeUntilFn((inner) => {
3682
- if (inner === 92) {
3683
- this._cursor.advance();
3684
- return false;
3685
- }
3686
- return inner === char;
3687
- });
3688
- }
3689
- this._cursor.advance();
3690
- }
3762
+ this._beginToken(32, start);
3763
+ this._attemptUntilIgnoreQuotes((char) => char === 59);
3691
3764
  this._endToken([this._cursor.getChars(start)]);
3692
3765
  }
3693
3766
  /**
@@ -3795,6 +3868,23 @@ var _Tokenizer = class {
3795
3868
  _attemptUntilChar(char) {
3796
3869
  while (this._cursor.peek() !== char) this._cursor.advance();
3797
3870
  }
3871
+ _attemptUntilIgnoreQuotes(predicate) {
3872
+ while (this._cursor.peek() !== 0) {
3873
+ const char = this._cursor.peek();
3874
+ if (predicate(char)) break;
3875
+ if (isQuote(char)) {
3876
+ this._cursor.advance();
3877
+ this._attemptCharCodeUntilFn((inner) => {
3878
+ if (inner === 92) {
3879
+ this._cursor.advance();
3880
+ return false;
3881
+ }
3882
+ return inner === char;
3883
+ });
3884
+ }
3885
+ this._cursor.advance();
3886
+ }
3887
+ }
3798
3888
  _readChar() {
3799
3889
  const char = String.fromCodePoint(this._cursor.peek());
3800
3890
  this._cursor.advance();
@@ -3817,7 +3907,7 @@ var _Tokenizer = class {
3817
3907
  return this._cursor.peek() === 64 && this._peekStr("@let");
3818
3908
  }
3819
3909
  _consumeEntity(textTokenType) {
3820
- this._beginToken(TokenType.ENCODED_ENTITY);
3910
+ this._beginToken(9);
3821
3911
  const start = this._cursor.clone();
3822
3912
  this._cursor.advance();
3823
3913
  if (this._attemptCharCode(35)) {
@@ -3826,7 +3916,7 @@ var _Tokenizer = class {
3826
3916
  this._attemptCharCodeUntilFn(isDigitEntityEnd);
3827
3917
  if (this._cursor.peek() != 59) {
3828
3918
  this._cursor.advance();
3829
- const entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC;
3919
+ const entityType = isHex ? "hexadecimal" : "decimal";
3830
3920
  throw this._createError(_unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)), this._cursor.getSpan());
3831
3921
  }
3832
3922
  const strNum = this._cursor.getChars(codeStart);
@@ -3847,14 +3937,14 @@ var _Tokenizer = class {
3847
3937
  } else {
3848
3938
  const name = this._cursor.getChars(nameStart);
3849
3939
  this._cursor.advance();
3850
- const char = NAMED_ENTITIES.hasOwnProperty(name) && NAMED_ENTITIES[name];
3940
+ const char = Object.hasOwn(NAMED_ENTITIES, name) && NAMED_ENTITIES[name];
3851
3941
  if (!char) throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start));
3852
3942
  this._endToken([char, `&${name};`]);
3853
3943
  }
3854
3944
  }
3855
3945
  }
3856
3946
  _consumeRawText(consumeEntities, endMarkerPredicate) {
3857
- this._beginToken(consumeEntities ? TokenType.ESCAPABLE_RAW_TEXT : TokenType.RAW_TEXT);
3947
+ this._beginToken(consumeEntities ? 6 : 7);
3858
3948
  const parts = [];
3859
3949
  while (true) {
3860
3950
  const tagCloseStart = this._cursor.clone();
@@ -3864,44 +3954,54 @@ var _Tokenizer = class {
3864
3954
  if (consumeEntities && this._cursor.peek() === 38) {
3865
3955
  this._endToken([this._processCarriageReturns(parts.join(""))]);
3866
3956
  parts.length = 0;
3867
- this._consumeEntity(TokenType.ESCAPABLE_RAW_TEXT);
3868
- this._beginToken(TokenType.ESCAPABLE_RAW_TEXT);
3957
+ this._consumeEntity(6);
3958
+ this._beginToken(6);
3869
3959
  } else parts.push(this._readChar());
3870
3960
  }
3871
3961
  this._endToken([this._processCarriageReturns(parts.join(""))]);
3872
3962
  }
3873
3963
  _consumeComment(start) {
3874
- this._beginToken(TokenType.COMMENT_START, start);
3964
+ this._beginToken(10, start);
3875
3965
  this._endToken([]);
3876
3966
  this._consumeRawText(false, () => this._attemptStr("-->"));
3877
- this._beginToken(TokenType.COMMENT_END);
3967
+ this._beginToken(11);
3878
3968
  this._requireStr("-->");
3879
3969
  this._endToken([]);
3880
3970
  }
3881
3971
  _consumeBogusComment(start) {
3882
- this._beginToken(TokenType.COMMENT_START, start);
3972
+ this._beginToken(10, start);
3883
3973
  this._endToken([]);
3884
3974
  this._consumeRawText(false, () => this._cursor.peek() === 62);
3885
- this._beginToken(TokenType.COMMENT_END);
3975
+ this._beginToken(11);
3886
3976
  this._cursor.advance();
3887
3977
  this._endToken([]);
3888
3978
  }
3889
3979
  _consumeCdata(start) {
3890
- this._beginToken(TokenType.CDATA_START, start);
3980
+ this._beginToken(13, start);
3891
3981
  this._endToken([]);
3892
3982
  this._consumeRawText(false, () => this._attemptStr("]]>"));
3893
- this._beginToken(TokenType.CDATA_END);
3983
+ this._beginToken(14);
3894
3984
  this._requireStr("]]>");
3895
3985
  this._endToken([]);
3896
3986
  }
3897
3987
  _consumeDocType(start) {
3898
- this._beginToken(TokenType.DOC_TYPE_START, start);
3988
+ this._beginToken(19, start);
3899
3989
  this._endToken([]);
3900
3990
  this._consumeRawText(false, () => this._cursor.peek() === 62);
3901
- this._beginToken(TokenType.DOC_TYPE_END);
3991
+ this._beginToken(20);
3902
3992
  this._cursor.advance();
3903
3993
  this._endToken([]);
3904
3994
  }
3995
+ _consumeProcessingInstruction(start) {
3996
+ this._beginToken(43, start);
3997
+ const contentStart = this._cursor.clone();
3998
+ this._attemptUntilIgnoreQuotes((char) => char === 63 || char === 62);
3999
+ const endChar = this._cursor.peek();
4000
+ const content = this._cursor.getChars(contentStart);
4001
+ this._cursor.advance();
4002
+ if (endChar === 63) this._requireCharCode(62);
4003
+ this._endToken([content]);
4004
+ }
3905
4005
  _consumePrefixAndName(endPredicate) {
3906
4006
  const nameOrPrefixStart = this._cursor.clone();
3907
4007
  let prefix = "";
@@ -3916,6 +4016,36 @@ var _Tokenizer = class {
3916
4016
  const name = this._cursor.getChars(nameStart);
3917
4017
  return [prefix, name];
3918
4018
  }
4019
+ _consumeSingleLineComment(start) {
4020
+ const contentStart = this._cursor.clone();
4021
+ this._attemptCharCodeUntilFn((code) => isNewLine(code) || code === 0);
4022
+ const spanEnd = this._cursor.clone();
4023
+ const content = spanEnd.getChars(contentStart);
4024
+ this._beginToken(12, start);
4025
+ this._endToken([content, "single"], spanEnd);
4026
+ this._attemptCharCodeUntilFn(isNotWhitespace);
4027
+ }
4028
+ _consumeMultiLineComment(start) {
4029
+ const contentStart = this._cursor.clone();
4030
+ this._attemptCharCodeUntilFn((code) => {
4031
+ if (code === 0) return true;
4032
+ if (code === 42) {
4033
+ const next = this._cursor.clone();
4034
+ next.advance();
4035
+ return next.peek() === 47;
4036
+ }
4037
+ return false;
4038
+ });
4039
+ const contentEnd = this._cursor.clone();
4040
+ const content = contentEnd.getChars(contentStart);
4041
+ let spanEnd = contentEnd;
4042
+ if (this._attemptStr("*/")) {
4043
+ spanEnd = this._cursor.clone();
4044
+ this._attemptCharCodeUntilFn(isNotWhitespace);
4045
+ }
4046
+ this._beginToken(12, start);
4047
+ this._endToken([content, "multi"], spanEnd);
4048
+ }
3919
4049
  _consumeTagOpen(start) {
3920
4050
  let tagName;
3921
4051
  let prefix;
@@ -3936,56 +4066,70 @@ var _Tokenizer = class {
3936
4066
  tagName = closingTagName = openToken.parts[1];
3937
4067
  this._attemptCharCodeUntilFn(isNotWhitespace);
3938
4068
  }
3939
- while (!isAttributeTerminator(this._cursor.peek())) if (this._selectorlessEnabled && this._cursor.peek() === 64) {
3940
- const start$1 = this._cursor.clone();
3941
- const nameStart = start$1.clone();
3942
- nameStart.advance();
3943
- if (isSelectorlessNameStart(nameStart.peek())) this._consumeDirective(start$1, nameStart);
3944
- } else {
3945
- const attr = this._consumeAttribute();
3946
- attrs.push(attr);
4069
+ while (true) {
4070
+ if (this._allowStartTagComments) {
4071
+ const commentStart = this._cursor.clone();
4072
+ if (this._attemptStr("//")) {
4073
+ this._consumeSingleLineComment(commentStart);
4074
+ continue;
4075
+ }
4076
+ if (this._attemptStr("/*")) {
4077
+ this._consumeMultiLineComment(commentStart);
4078
+ continue;
4079
+ }
4080
+ }
4081
+ if (isAttributeTerminator(this._cursor.peek())) break;
4082
+ if (this._selectorlessEnabled && this._cursor.peek() === 64) {
4083
+ const start = this._cursor.clone();
4084
+ const nameStart = start.clone();
4085
+ nameStart.advance();
4086
+ if (isSelectorlessNameStart(nameStart.peek())) this._consumeDirective(start, nameStart);
4087
+ } else {
4088
+ const attr = this._consumeAttribute();
4089
+ attrs.push(attr);
4090
+ }
3947
4091
  }
3948
- if (openToken.type === TokenType.COMPONENT_OPEN_START) this._consumeComponentOpenEnd();
4092
+ if (openToken.type === 35) this._consumeComponentOpenEnd();
3949
4093
  else this._consumeTagOpenEnd();
3950
4094
  } catch (e) {
3951
4095
  if (e instanceof ParseError) {
3952
- if (openToken) openToken.type = openToken.type === TokenType.COMPONENT_OPEN_START ? TokenType.INCOMPLETE_COMPONENT_OPEN : TokenType.INCOMPLETE_TAG_OPEN;
4096
+ if (openToken) openToken.type = openToken.type === 35 ? 39 : 4;
3953
4097
  else {
3954
- this._beginToken(TokenType.TEXT, start);
4098
+ this._beginToken(5, start);
3955
4099
  this._endToken(["<"]);
3956
4100
  }
3957
4101
  return;
3958
4102
  }
3959
4103
  throw e;
3960
4104
  }
3961
- if (this._canSelfClose && this.tokens[this.tokens.length - 1].type === TokenType.TAG_OPEN_END_VOID) return;
4105
+ if (this._canSelfClose && this.tokens[this.tokens.length - 1].type === 2) return;
3962
4106
  const contentTokenType = this._getTagContentType(tagName, prefix, this._fullNameStack.length > 0, attrs);
3963
4107
  this._handleFullNameStackForTagOpen(prefix, tagName);
3964
- if (contentTokenType === TagContentType.RAW_TEXT) this._consumeRawTextWithTagClose(prefix, openToken, closingTagName, false);
3965
- else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) this._consumeRawTextWithTagClose(prefix, openToken, closingTagName, true);
4108
+ if (contentTokenType === 0) this._consumeRawTextWithTagClose(prefix, openToken, closingTagName, false);
4109
+ else if (contentTokenType === 1) this._consumeRawTextWithTagClose(prefix, openToken, closingTagName, true);
3966
4110
  }
3967
4111
  _consumeRawTextWithTagClose(prefix, openToken, tagName, consumeEntities) {
3968
4112
  this._consumeRawText(consumeEntities, () => {
3969
4113
  if (!this._attemptCharCode(60)) return false;
3970
4114
  if (!this._attemptCharCode(47)) return false;
3971
4115
  this._attemptCharCodeUntilFn(isNotWhitespace);
3972
- if (!this._attemptStrCaseInsensitive(prefix && openToken.type !== TokenType.COMPONENT_OPEN_START ? `${prefix}:${tagName}` : tagName)) return false;
4116
+ if (!this._attemptStrCaseInsensitive(prefix && openToken.type !== 35 ? `${prefix}:${tagName}` : tagName)) return false;
3973
4117
  this._attemptCharCodeUntilFn(isNotWhitespace);
3974
4118
  return this._attemptCharCode(62);
3975
4119
  });
3976
- this._beginToken(openToken.type === TokenType.COMPONENT_OPEN_START ? TokenType.COMPONENT_CLOSE : TokenType.TAG_CLOSE);
4120
+ this._beginToken(openToken.type === 35 ? 38 : 3);
3977
4121
  this._requireCharCodeUntilFn((code) => code === 62, 3);
3978
4122
  this._cursor.advance();
3979
4123
  this._endToken(openToken.parts);
3980
4124
  this._handleFullNameStackForTagClose(prefix, tagName);
3981
4125
  }
3982
4126
  _consumeTagOpenStart(start) {
3983
- this._beginToken(TokenType.TAG_OPEN_START, start);
4127
+ this._beginToken(0, start);
3984
4128
  const parts = this._consumePrefixAndName(isNameEnd);
3985
4129
  return this._endToken(parts);
3986
4130
  }
3987
4131
  _consumeComponentOpenStart(start) {
3988
- this._beginToken(TokenType.COMPONENT_OPEN_START, start);
4132
+ this._beginToken(35, start);
3989
4133
  const parts = this._consumeComponentName();
3990
4134
  return this._endToken(parts);
3991
4135
  }
@@ -4023,7 +4167,7 @@ var _Tokenizer = class {
4023
4167
  _consumeAttributeName() {
4024
4168
  const attrNameStart = this._cursor.peek();
4025
4169
  if (attrNameStart === 39 || attrNameStart === 34) throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());
4026
- this._beginToken(TokenType.ATTR_NAME);
4170
+ this._beginToken(15);
4027
4171
  let nameEndPredicate;
4028
4172
  if (this._openDirectiveCount > 0) {
4029
4173
  let openParens = 0;
@@ -4055,27 +4199,27 @@ var _Tokenizer = class {
4055
4199
  const quoteChar = this._cursor.peek();
4056
4200
  this._consumeQuote(quoteChar);
4057
4201
  const endPredicate = () => this._cursor.peek() === quoteChar;
4058
- value = this._consumeWithInterpolation(TokenType.ATTR_VALUE_TEXT, TokenType.ATTR_VALUE_INTERPOLATION, endPredicate, endPredicate);
4202
+ value = this._consumeWithInterpolation(17, 18, endPredicate, endPredicate);
4059
4203
  this._consumeQuote(quoteChar);
4060
4204
  } else {
4061
4205
  const endPredicate = () => isNameEnd(this._cursor.peek());
4062
- value = this._consumeWithInterpolation(TokenType.ATTR_VALUE_TEXT, TokenType.ATTR_VALUE_INTERPOLATION, endPredicate, endPredicate);
4206
+ value = this._consumeWithInterpolation(17, 18, endPredicate, endPredicate);
4063
4207
  }
4064
4208
  return value;
4065
4209
  }
4066
4210
  _consumeQuote(quoteChar) {
4067
- this._beginToken(TokenType.ATTR_QUOTE);
4211
+ this._beginToken(16);
4068
4212
  this._requireCharCode(quoteChar);
4069
4213
  this._endToken([String.fromCodePoint(quoteChar)]);
4070
4214
  }
4071
4215
  _consumeTagOpenEnd() {
4072
- const tokenType = this._attemptCharCode(47) ? TokenType.TAG_OPEN_END_VOID : TokenType.TAG_OPEN_END;
4216
+ const tokenType = this._attemptCharCode(47) ? 2 : 1;
4073
4217
  this._beginToken(tokenType);
4074
4218
  this._requireCharCode(62);
4075
4219
  this._endToken([]);
4076
4220
  }
4077
4221
  _consumeComponentOpenEnd() {
4078
- const tokenType = this._attemptCharCode(47) ? TokenType.COMPONENT_OPEN_END_VOID : TokenType.COMPONENT_OPEN_END;
4222
+ const tokenType = this._attemptCharCode(47) ? 37 : 36;
4079
4223
  this._beginToken(tokenType);
4080
4224
  this._requireCharCode(62);
4081
4225
  this._endToken([]);
@@ -4085,7 +4229,7 @@ var _Tokenizer = class {
4085
4229
  const clone = start.clone();
4086
4230
  while (clone.peek() !== 62 && !isSelectorlessNameStart(clone.peek())) clone.advance();
4087
4231
  if (isSelectorlessNameStart(clone.peek())) {
4088
- this._beginToken(TokenType.COMPONENT_CLOSE, start);
4232
+ this._beginToken(38, start);
4089
4233
  const parts = this._consumeComponentName();
4090
4234
  this._attemptCharCodeUntilFn(isNotWhitespace);
4091
4235
  this._requireCharCode(62);
@@ -4093,7 +4237,7 @@ var _Tokenizer = class {
4093
4237
  return;
4094
4238
  }
4095
4239
  }
4096
- this._beginToken(TokenType.TAG_CLOSE, start);
4240
+ this._beginToken(3, start);
4097
4241
  this._attemptCharCodeUntilFn(isNotWhitespace);
4098
4242
  if (this._allowHtmComponentClosingTags && this._attemptCharCode(47)) {
4099
4243
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -4108,11 +4252,11 @@ var _Tokenizer = class {
4108
4252
  }
4109
4253
  }
4110
4254
  _consumeExpansionFormStart() {
4111
- this._beginToken(TokenType.EXPANSION_FORM_START);
4255
+ this._beginToken(21);
4112
4256
  this._requireCharCode(123);
4113
4257
  this._endToken([]);
4114
- this._expansionCaseStack.push(TokenType.EXPANSION_FORM_START);
4115
- this._beginToken(TokenType.RAW_TEXT);
4258
+ this._expansionCaseStack.push(21);
4259
+ this._beginToken(7);
4116
4260
  const condition = this._readUntil(44);
4117
4261
  const normalizedCondition = this._processCarriageReturns(condition);
4118
4262
  if (this._i18nNormalizeLineEndingsInICUs) this._endToken([normalizedCondition]);
@@ -4122,32 +4266,32 @@ var _Tokenizer = class {
4122
4266
  }
4123
4267
  this._requireCharCode(44);
4124
4268
  this._attemptCharCodeUntilFn(isNotWhitespace);
4125
- this._beginToken(TokenType.RAW_TEXT);
4269
+ this._beginToken(7);
4126
4270
  const type = this._readUntil(44);
4127
4271
  this._endToken([type]);
4128
4272
  this._requireCharCode(44);
4129
4273
  this._attemptCharCodeUntilFn(isNotWhitespace);
4130
4274
  }
4131
4275
  _consumeExpansionCaseStart() {
4132
- this._beginToken(TokenType.EXPANSION_CASE_VALUE);
4276
+ this._beginToken(22);
4133
4277
  const value = this._readUntil(123).trim();
4134
4278
  this._endToken([value]);
4135
4279
  this._attemptCharCodeUntilFn(isNotWhitespace);
4136
- this._beginToken(TokenType.EXPANSION_CASE_EXP_START);
4280
+ this._beginToken(23);
4137
4281
  this._requireCharCode(123);
4138
4282
  this._endToken([]);
4139
4283
  this._attemptCharCodeUntilFn(isNotWhitespace);
4140
- this._expansionCaseStack.push(TokenType.EXPANSION_CASE_EXP_START);
4284
+ this._expansionCaseStack.push(23);
4141
4285
  }
4142
4286
  _consumeExpansionCaseEnd() {
4143
- this._beginToken(TokenType.EXPANSION_CASE_EXP_END);
4287
+ this._beginToken(24);
4144
4288
  this._requireCharCode(125);
4145
4289
  this._endToken([]);
4146
4290
  this._attemptCharCodeUntilFn(isNotWhitespace);
4147
4291
  this._expansionCaseStack.pop();
4148
4292
  }
4149
4293
  _consumeExpansionFormEnd() {
4150
- this._beginToken(TokenType.EXPANSION_FORM_END);
4294
+ this._beginToken(25);
4151
4295
  this._requireCharCode(125);
4152
4296
  this._endToken([]);
4153
4297
  this._expansionCaseStack.pop();
@@ -4232,13 +4376,13 @@ var _Tokenizer = class {
4232
4376
  this._requireCharCode(64);
4233
4377
  this._cursor.advance();
4234
4378
  while (isSelectorlessNameChar(this._cursor.peek())) this._cursor.advance();
4235
- this._beginToken(TokenType.DIRECTIVE_NAME, start);
4379
+ this._beginToken(40, start);
4236
4380
  const name = this._cursor.getChars(nameStart);
4237
4381
  this._endToken([name]);
4238
4382
  this._attemptCharCodeUntilFn(isNotWhitespace);
4239
4383
  if (this._cursor.peek() !== 40) return;
4240
4384
  this._openDirectiveCount++;
4241
- this._beginToken(TokenType.DIRECTIVE_OPEN);
4385
+ this._beginToken(41);
4242
4386
  this._cursor.advance();
4243
4387
  this._endToken([]);
4244
4388
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -4249,7 +4393,7 @@ var _Tokenizer = class {
4249
4393
  if (this._cursor.peek() === 62 || this._cursor.peek() === 47) return;
4250
4394
  throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
4251
4395
  }
4252
- this._beginToken(TokenType.DIRECTIVE_CLOSE);
4396
+ this._beginToken(42);
4253
4397
  this._cursor.advance();
4254
4398
  this._endToken([]);
4255
4399
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -4275,7 +4419,7 @@ var _Tokenizer = class {
4275
4419
  const tmp = this._cursor.clone();
4276
4420
  tmp.advance();
4277
4421
  const code = tmp.peek();
4278
- if (97 <= code && code <= 122 || 65 <= code && code <= 90 || code === 47 || code === 33) return true;
4422
+ if (97 <= code && code <= 122 || 65 <= code && code <= 90 || code === 47 || code === 33 || code === 63) return true;
4279
4423
  }
4280
4424
  return false;
4281
4425
  }
@@ -4288,10 +4432,10 @@ var _Tokenizer = class {
4288
4432
  return this._isInExpansionCase() || this._isInExpansionForm();
4289
4433
  }
4290
4434
  _isInExpansionCase() {
4291
- return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === TokenType.EXPANSION_CASE_EXP_START;
4435
+ return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 23;
4292
4436
  }
4293
4437
  _isInExpansionForm() {
4294
- return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === TokenType.EXPANSION_FORM_START;
4438
+ return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 21;
4295
4439
  }
4296
4440
  isExpansionFormStart() {
4297
4441
  if (this._cursor.peek() !== 123) return false;
@@ -4322,7 +4466,7 @@ function isDigitEntityEnd(code) {
4322
4466
  return code === 59 || code === 0 || !isAsciiHexDigit(code);
4323
4467
  }
4324
4468
  function isNamedEntityEnd(code) {
4325
- return code === 59 || code === 0 || !isAsciiLetter(code);
4469
+ return code === 59 || code === 0 || !(isAsciiLetter(code) || isDigit(code));
4326
4470
  }
4327
4471
  function isExpansionCaseStart(peek) {
4328
4472
  return peek !== 125;
@@ -4353,7 +4497,7 @@ function mergeTextTokens(srcTokens) {
4353
4497
  let lastDstToken = void 0;
4354
4498
  for (let i = 0; i < srcTokens.length; i++) {
4355
4499
  const token = srcTokens[i];
4356
- if (lastDstToken && lastDstToken.type === TokenType.TEXT && token.type === TokenType.TEXT || lastDstToken && lastDstToken.type === TokenType.ATTR_VALUE_TEXT && token.type === TokenType.ATTR_VALUE_TEXT) {
4500
+ if (lastDstToken && lastDstToken.type === 5 && token.type === 5 || lastDstToken && lastDstToken.type === 17 && token.type === 17) {
4357
4501
  lastDstToken.parts[0] += token.parts[0];
4358
4502
  lastDstToken.sourceSpan.end = token.sourceSpan.end;
4359
4503
  } else {
@@ -4547,6 +4691,8 @@ var EscapedCharacterCursor = class EscapedCharacterCursor extends PlainCharacter
4547
4691
  }
4548
4692
  };
4549
4693
  var CursorError = class extends Error {
4694
+ msg;
4695
+ cursor;
4550
4696
  constructor(msg, cursor) {
4551
4697
  super(msg);
4552
4698
  this.msg = msg;
@@ -4555,7 +4701,7 @@ var CursorError = class extends Error {
4555
4701
  }
4556
4702
  };
4557
4703
  //#endregion
4558
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/parser.mjs
4704
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/parser.mjs
4559
4705
  /**
4560
4706
  * @license
4561
4707
  * Copyright Google LLC All Rights Reserved.
@@ -4564,6 +4710,7 @@ var CursorError = class extends Error {
4564
4710
  * found in the LICENSE file at https://angular.dev/license
4565
4711
  */
4566
4712
  var TreeError = class TreeError extends ParseError {
4713
+ elementName;
4567
4714
  static create(elementName, span, msg) {
4568
4715
  return new TreeError(elementName, span, msg);
4569
4716
  }
@@ -4573,12 +4720,15 @@ var TreeError = class TreeError extends ParseError {
4573
4720
  }
4574
4721
  };
4575
4722
  var ParseTreeResult = class {
4723
+ rootNodes;
4724
+ errors;
4576
4725
  constructor(rootNodes, errors) {
4577
4726
  this.rootNodes = rootNodes;
4578
4727
  this.errors = errors;
4579
4728
  }
4580
4729
  };
4581
4730
  var Parser = class {
4731
+ getTagDefinition;
4582
4732
  constructor(getTagDefinition) {
4583
4733
  this.getTagDefinition = getTagDefinition;
4584
4734
  }
@@ -4599,6 +4749,11 @@ var Parser = class {
4599
4749
  }
4600
4750
  };
4601
4751
  var _TreeBuilder = class _TreeBuilder {
4752
+ tokens;
4753
+ tagDefinitionResolver;
4754
+ canSelfClose;
4755
+ allowHtmComponentClosingTags;
4756
+ isTagNameCaseSensitive;
4602
4757
  _index = -1;
4603
4758
  _peek;
4604
4759
  _containerStack = [];
@@ -4613,38 +4768,38 @@ var _TreeBuilder = class _TreeBuilder {
4613
4768
  this._advance();
4614
4769
  }
4615
4770
  build() {
4616
- while (this._peek.type !== TokenType.EOF) if (this._peek.type === TokenType.TAG_OPEN_START || this._peek.type === TokenType.INCOMPLETE_TAG_OPEN) this._consumeElementStartTag(this._advance());
4617
- else if (this._peek.type === TokenType.TAG_CLOSE) {
4771
+ while (this._peek.type !== 44) if (this._peek.type === 0 || this._peek.type === 4) this._consumeElementStartTag(this._advance());
4772
+ else if (this._peek.type === 3) {
4618
4773
  this._closeVoidElement();
4619
4774
  this._consumeElementEndTag(this._advance());
4620
- } else if (this._peek.type === TokenType.CDATA_START) {
4775
+ } else if (this._peek.type === 13) {
4621
4776
  this._closeVoidElement();
4622
4777
  this._consumeCdata(this._advance());
4623
- } else if (this._peek.type === TokenType.COMMENT_START) {
4778
+ } else if (this._peek.type === 10) {
4624
4779
  this._closeVoidElement();
4625
4780
  this._consumeComment(this._advance());
4626
- } else if (this._peek.type === TokenType.TEXT || this._peek.type === TokenType.RAW_TEXT || this._peek.type === TokenType.ESCAPABLE_RAW_TEXT) {
4781
+ } else if (this._peek.type === 5 || this._peek.type === 7 || this._peek.type === 6) {
4627
4782
  this._closeVoidElement();
4628
4783
  this._consumeText(this._advance());
4629
- } else if (this._peek.type === TokenType.EXPANSION_FORM_START) this._consumeExpansion(this._advance());
4630
- else if (this._peek.type === TokenType.BLOCK_OPEN_START) {
4784
+ } else if (this._peek.type === 21) this._consumeExpansion(this._advance());
4785
+ else if (this._peek.type === 26) {
4631
4786
  this._closeVoidElement();
4632
4787
  this._consumeBlockOpen(this._advance());
4633
- } else if (this._peek.type === TokenType.BLOCK_CLOSE) {
4788
+ } else if (this._peek.type === 28) {
4634
4789
  this._closeVoidElement();
4635
4790
  this._consumeBlockClose(this._advance());
4636
- } else if (this._peek.type === TokenType.INCOMPLETE_BLOCK_OPEN) {
4791
+ } else if (this._peek.type === 30) {
4637
4792
  this._closeVoidElement();
4638
4793
  this._consumeIncompleteBlock(this._advance());
4639
- } else if (this._peek.type === TokenType.LET_START) {
4794
+ } else if (this._peek.type === 31) {
4640
4795
  this._closeVoidElement();
4641
4796
  this._consumeLet(this._advance());
4642
- } else if (this._peek.type === TokenType.DOC_TYPE_START) this._consumeDocType(this._advance());
4643
- else if (this._peek.type === TokenType.INCOMPLETE_LET) {
4797
+ } else if (this._peek.type === 19) this._consumeDocType(this._advance());
4798
+ else if (this._peek.type === 34) {
4644
4799
  this._closeVoidElement();
4645
4800
  this._consumeIncompleteLet(this._advance());
4646
- } else if (this._peek.type === TokenType.COMPONENT_OPEN_START || this._peek.type === TokenType.INCOMPLETE_COMPONENT_OPEN) this._consumeComponentStartTag(this._advance());
4647
- else if (this._peek.type === TokenType.COMPONENT_CLOSE) this._consumeComponentEndTag(this._advance());
4801
+ } else if (this._peek.type === 35 || this._peek.type === 39) this._consumeComponentStartTag(this._advance());
4802
+ else if (this._peek.type === 38) this._consumeComponentEndTag(this._advance());
4648
4803
  else this._advance();
4649
4804
  for (const leftoverContainer of this._containerStack) if (leftoverContainer instanceof Block) this.errors.push(TreeError.create(leftoverContainer.name, leftoverContainer.sourceSpan, `Unclosed block "${leftoverContainer.name}"`));
4650
4805
  }
@@ -4661,19 +4816,19 @@ var _TreeBuilder = class _TreeBuilder {
4661
4816
  _consumeCdata(startToken) {
4662
4817
  const text = this._advance();
4663
4818
  const value = this._getText(text);
4664
- const endToken = this._advanceIf(TokenType.CDATA_END);
4819
+ const endToken = this._advanceIf(14);
4665
4820
  this._addToParent(new CDATA(value, new ParseSourceSpan(startToken.sourceSpan.start, (endToken || text).sourceSpan.end), [text]));
4666
4821
  }
4667
4822
  _consumeComment(token) {
4668
- const text = this._advanceIf(TokenType.RAW_TEXT);
4669
- const endToken = this._advanceIf(TokenType.COMMENT_END);
4823
+ const text = this._advanceIf(7);
4824
+ const endToken = this._advanceIf(11);
4670
4825
  const value = text != null ? text.parts[0].trim() : null;
4671
4826
  const sourceSpan = endToken == null ? token.sourceSpan : new ParseSourceSpan(token.sourceSpan.start, endToken.sourceSpan.end, token.sourceSpan.fullStart);
4672
4827
  this._addToParent(new Comment(value, sourceSpan));
4673
4828
  }
4674
4829
  _consumeDocType(startToken) {
4675
- const text = this._advanceIf(TokenType.RAW_TEXT);
4676
- const endToken = this._advanceIf(TokenType.DOC_TYPE_END);
4830
+ const text = this._advanceIf(7);
4831
+ const endToken = this._advanceIf(20);
4677
4832
  const value = text != null ? text.parts[0].trim() : null;
4678
4833
  const sourceSpan = new ParseSourceSpan(startToken.sourceSpan.start, (endToken || text || startToken).sourceSpan.end);
4679
4834
  this._addToParent(new DocType(value, sourceSpan));
@@ -4682,12 +4837,12 @@ var _TreeBuilder = class _TreeBuilder {
4682
4837
  const switchValue = this._advance();
4683
4838
  const type = this._advance();
4684
4839
  const cases = [];
4685
- while (this._peek.type === TokenType.EXPANSION_CASE_VALUE) {
4840
+ while (this._peek.type === 22) {
4686
4841
  const expCase = this._parseExpansionCase();
4687
4842
  if (!expCase) return;
4688
4843
  cases.push(expCase);
4689
4844
  }
4690
- if (this._peek.type !== TokenType.EXPANSION_FORM_END) {
4845
+ if (this._peek.type !== 25) {
4691
4846
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
4692
4847
  return;
4693
4848
  }
@@ -4697,7 +4852,7 @@ var _TreeBuilder = class _TreeBuilder {
4697
4852
  }
4698
4853
  _parseExpansionCase() {
4699
4854
  const value = this._advance();
4700
- if (this._peek.type !== TokenType.EXPANSION_CASE_EXP_START) {
4855
+ if (this._peek.type !== 23) {
4701
4856
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));
4702
4857
  return null;
4703
4858
  }
@@ -4706,7 +4861,7 @@ var _TreeBuilder = class _TreeBuilder {
4706
4861
  if (!exp) return null;
4707
4862
  const end = this._advance();
4708
4863
  exp.push({
4709
- type: TokenType.EOF,
4864
+ type: 44,
4710
4865
  parts: [],
4711
4866
  sourceSpan: end.sourceSpan
4712
4867
  });
@@ -4722,22 +4877,26 @@ var _TreeBuilder = class _TreeBuilder {
4722
4877
  }
4723
4878
  _collectExpansionExpTokens(start) {
4724
4879
  const exp = [];
4725
- const expansionFormStack = [TokenType.EXPANSION_CASE_EXP_START];
4880
+ const expansionFormStack = [23];
4726
4881
  while (true) {
4727
- if (this._peek.type === TokenType.EXPANSION_FORM_START || this._peek.type === TokenType.EXPANSION_CASE_EXP_START) expansionFormStack.push(this._peek.type);
4728
- if (this._peek.type === TokenType.EXPANSION_CASE_EXP_END) if (lastOnStack(expansionFormStack, TokenType.EXPANSION_CASE_EXP_START)) {
4729
- expansionFormStack.pop();
4730
- if (expansionFormStack.length === 0) return exp;
4731
- } else {
4732
- this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
4733
- return null;
4882
+ if (this._peek.type === 21 || this._peek.type === 23) expansionFormStack.push(this._peek.type);
4883
+ if (this._peek.type === 24) {
4884
+ if (lastOnStack(expansionFormStack, 23)) {
4885
+ expansionFormStack.pop();
4886
+ if (expansionFormStack.length === 0) return exp;
4887
+ } else {
4888
+ this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
4889
+ return null;
4890
+ }
4734
4891
  }
4735
- if (this._peek.type === TokenType.EXPANSION_FORM_END) if (lastOnStack(expansionFormStack, TokenType.EXPANSION_FORM_START)) expansionFormStack.pop();
4736
- else {
4737
- this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
4738
- return null;
4892
+ if (this._peek.type === 25) {
4893
+ if (lastOnStack(expansionFormStack, 21)) expansionFormStack.pop();
4894
+ else {
4895
+ this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
4896
+ return null;
4897
+ }
4739
4898
  }
4740
- if (this._peek.type === TokenType.EOF) {
4899
+ if (this._peek.type === 44) {
4741
4900
  this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
4742
4901
  return null;
4743
4902
  }
@@ -4769,11 +4928,11 @@ var _TreeBuilder = class _TreeBuilder {
4769
4928
  };
4770
4929
  }
4771
4930
  }
4772
- while (this._peek.type === TokenType.INTERPOLATION || this._peek.type === TokenType.TEXT || this._peek.type === TokenType.ENCODED_ENTITY) {
4931
+ while (this._peek.type === 8 || this._peek.type === 5 || this._peek.type === 9) {
4773
4932
  token = this._advance();
4774
4933
  tokens.push(token);
4775
- if (token.type === TokenType.INTERPOLATION) text += token.parts.join("").replace(/&([^;]+);/g, decodeEntity);
4776
- else if (token.type === TokenType.ENCODED_ENTITY) text += token.parts[0];
4934
+ if (token.type === 8) text += token.parts.join("").replace(/&([^;]+);/g, decodeEntity);
4935
+ else if (token.type === 9) text += token.parts[0];
4777
4936
  else text += token.parts.join("");
4778
4937
  }
4779
4938
  if (text.length > 0) {
@@ -4790,16 +4949,17 @@ var _TreeBuilder = class _TreeBuilder {
4790
4949
  var _this$_getTagDefiniti4;
4791
4950
  const attrs = [];
4792
4951
  const directives = [];
4793
- this._consumeAttributesAndDirectives(attrs, directives);
4952
+ const comments = [];
4953
+ this._consumeAttributesAndDirectives(attrs, directives, comments);
4794
4954
  const fullName = this._getElementFullName(startTagToken, this._getClosestElementLikeParent());
4795
4955
  const tagDef = this._getTagDefinition(fullName);
4796
4956
  let selfClosing = false;
4797
- if (this._peek.type === TokenType.TAG_OPEN_END_VOID) {
4957
+ if (this._peek.type === 2) {
4798
4958
  this._advance();
4799
4959
  selfClosing = true;
4800
- const tagDef$1 = this._getTagDefinition(fullName);
4801
- if (!(this.canSelfClose || (tagDef$1 === null || tagDef$1 === void 0 ? void 0 : tagDef$1.canSelfClose) || getNsPrefix(fullName) !== null || (tagDef$1 === null || tagDef$1 === void 0 ? void 0 : tagDef$1.isVoid))) this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`));
4802
- } else if (this._peek.type === TokenType.TAG_OPEN_END) {
4960
+ const tagDef = this._getTagDefinition(fullName);
4961
+ if (!(this.canSelfClose || (tagDef === null || tagDef === void 0 ? void 0 : tagDef.canSelfClose) || getNsPrefix(fullName) !== null || (tagDef === null || tagDef === void 0 ? void 0 : tagDef.isVoid))) this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`));
4962
+ } else if (this._peek.type === 1) {
4803
4963
  this._advance();
4804
4964
  selfClosing = false;
4805
4965
  }
@@ -4807,12 +4967,12 @@ var _TreeBuilder = class _TreeBuilder {
4807
4967
  const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
4808
4968
  const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
4809
4969
  const nameSpan = new ParseSourceSpan(startTagToken.sourceSpan.start.moveBy(1), startTagToken.sourceSpan.end);
4810
- const el = new Element(fullName, attrs, directives, [], selfClosing, span, startSpan, void 0, nameSpan, (tagDef === null || tagDef === void 0 ? void 0 : tagDef.isVoid) ?? false);
4970
+ const el = new Element(fullName, attrs, directives, [], selfClosing, span, startSpan, void 0, nameSpan, (tagDef === null || tagDef === void 0 ? void 0 : tagDef.isVoid) ?? false, void 0, comments);
4811
4971
  const parent = this._getContainer();
4812
4972
  const isClosedByChild = parent !== null && !!((_this$_getTagDefiniti4 = this._getTagDefinition(parent)) === null || _this$_getTagDefiniti4 === void 0 ? void 0 : _this$_getTagDefiniti4.isClosedByChild(el.name));
4813
4973
  this._pushContainer(el, isClosedByChild);
4814
4974
  if (selfClosing) this._popContainer(fullName, Element, span);
4815
- else if (startTagToken.type === TokenType.INCOMPLETE_TAG_OPEN) {
4975
+ else if (startTagToken.type === 4) {
4816
4976
  this._popContainer(fullName, Element, null);
4817
4977
  this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
4818
4978
  }
@@ -4822,27 +4982,32 @@ var _TreeBuilder = class _TreeBuilder {
4822
4982
  const componentName = startToken.parts[0];
4823
4983
  const attrs = [];
4824
4984
  const directives = [];
4825
- this._consumeAttributesAndDirectives(attrs, directives);
4985
+ const comments = [];
4986
+ this._consumeAttributesAndDirectives(attrs, directives, comments);
4826
4987
  const closestElement = this._getClosestElementLikeParent();
4827
4988
  const tagName = this._getComponentTagName(startToken, closestElement);
4828
4989
  const fullName = this._getComponentFullName(startToken, closestElement);
4829
- const selfClosing = this._peek.type === TokenType.COMPONENT_OPEN_END_VOID;
4990
+ const selfClosing = this._peek.type === 37;
4830
4991
  this._advance();
4831
4992
  const end = this._peek.sourceSpan.fullStart;
4832
4993
  const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
4833
- const node = new Component(componentName, tagName, fullName, attrs, directives, [], selfClosing, span, new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart), void 0);
4994
+ const node = new Component(componentName, tagName, fullName, attrs, directives, [], selfClosing, span, new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart), void 0, void 0, comments);
4834
4995
  const parent = this._getContainer();
4835
4996
  const isClosedByChild = parent !== null && node.tagName !== null && !!((_this$_getTagDefiniti5 = this._getTagDefinition(parent)) === null || _this$_getTagDefiniti5 === void 0 ? void 0 : _this$_getTagDefiniti5.isClosedByChild(node.tagName));
4836
4997
  this._pushContainer(node, isClosedByChild);
4837
4998
  if (selfClosing) this._popContainer(fullName, Component, span);
4838
- else if (startToken.type === TokenType.INCOMPLETE_COMPONENT_OPEN) {
4999
+ else if (startToken.type === 39) {
4839
5000
  this._popContainer(fullName, Component, null);
4840
5001
  this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
4841
5002
  }
4842
5003
  }
4843
- _consumeAttributesAndDirectives(attributesResult, directivesResult) {
4844
- while (this._peek.type === TokenType.ATTR_NAME || this._peek.type === TokenType.DIRECTIVE_NAME) if (this._peek.type === TokenType.DIRECTIVE_NAME) directivesResult.push(this._consumeDirective(this._peek));
4845
- else attributesResult.push(this._consumeAttr(this._advance()));
5004
+ _consumeAttributesAndDirectives(attributesResult, directivesResult, commentsResult) {
5005
+ while (this._peek.type === 15 || this._peek.type === 40 || this._peek.type === 12) if (this._peek.type === 40) directivesResult.push(this._consumeDirective(this._peek));
5006
+ else if (this._peek.type === 15) attributesResult.push(this._consumeAttr(this._advance()));
5007
+ else {
5008
+ const commentToken = this._advance();
5009
+ commentsResult.push(new StartTagComment(commentToken.parts[0], commentToken.parts[1], commentToken.sourceSpan));
5010
+ }
4846
5011
  }
4847
5012
  _consumeComponentEndTag(endToken) {
4848
5013
  const fullName = this._getComponentFullName(endToken, this._getClosestElementLikeParent());
@@ -4901,24 +5066,24 @@ var _TreeBuilder = class _TreeBuilder {
4901
5066
  const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
4902
5067
  let attrEnd = attrName.sourceSpan.end;
4903
5068
  let startQuoteToken;
4904
- if (this._peek.type === TokenType.ATTR_QUOTE) startQuoteToken = this._advance();
5069
+ if (this._peek.type === 16) startQuoteToken = this._advance();
4905
5070
  let value = "";
4906
5071
  const valueTokens = [];
4907
5072
  let valueStartSpan = void 0;
4908
5073
  let valueEnd = void 0;
4909
- if (this._peek.type === TokenType.ATTR_VALUE_TEXT) {
5074
+ if (this._peek.type === 17) {
4910
5075
  valueStartSpan = this._peek.sourceSpan;
4911
5076
  valueEnd = this._peek.sourceSpan.end;
4912
- while (this._peek.type === TokenType.ATTR_VALUE_TEXT || this._peek.type === TokenType.ATTR_VALUE_INTERPOLATION || this._peek.type === TokenType.ENCODED_ENTITY) {
5077
+ while (this._peek.type === 17 || this._peek.type === 18 || this._peek.type === 9) {
4913
5078
  const valueToken = this._advance();
4914
5079
  valueTokens.push(valueToken);
4915
- if (valueToken.type === TokenType.ATTR_VALUE_INTERPOLATION) value += valueToken.parts.join("").replace(/&([^;]+);/g, decodeEntity);
4916
- else if (valueToken.type === TokenType.ENCODED_ENTITY) value += valueToken.parts[0];
5080
+ if (valueToken.type === 18) value += valueToken.parts.join("").replace(/&([^;]+);/g, decodeEntity);
5081
+ else if (valueToken.type === 9) value += valueToken.parts[0];
4917
5082
  else value += valueToken.parts.join("");
4918
5083
  valueEnd = attrEnd = valueToken.sourceSpan.end;
4919
5084
  }
4920
5085
  }
4921
- if (this._peek.type === TokenType.ATTR_QUOTE) valueEnd = attrEnd = this._advance().sourceSpan.end;
5086
+ if (this._peek.type === 16) valueEnd = attrEnd = this._advance().sourceSpan.end;
4922
5087
  const valueSpan = valueStartSpan && valueEnd && new ParseSourceSpan((startQuoteToken === null || startQuoteToken === void 0 ? void 0 : startQuoteToken.sourceSpan.start) ?? valueStartSpan.start, valueEnd, (startQuoteToken === null || startQuoteToken === void 0 ? void 0 : startQuoteToken.sourceSpan.fullStart) ?? valueStartSpan.fullStart);
4923
5088
  return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart), attrName.sourceSpan, valueSpan, valueTokens.length > 0 ? valueTokens : void 0, void 0);
4924
5089
  }
@@ -4927,11 +5092,11 @@ var _TreeBuilder = class _TreeBuilder {
4927
5092
  let startSourceSpanEnd = nameToken.sourceSpan.end;
4928
5093
  let endSourceSpan = null;
4929
5094
  this._advance();
4930
- if (this._peek.type === TokenType.DIRECTIVE_OPEN) {
5095
+ if (this._peek.type === 41) {
4931
5096
  startSourceSpanEnd = this._peek.sourceSpan.end;
4932
5097
  this._advance();
4933
- while (this._peek.type === TokenType.ATTR_NAME) attributes.push(this._consumeAttr(this._advance()));
4934
- if (this._peek.type === TokenType.DIRECTIVE_CLOSE) {
5098
+ while (this._peek.type === 15) attributes.push(this._consumeAttr(this._advance()));
5099
+ if (this._peek.type === 42) {
4935
5100
  endSourceSpan = this._peek.sourceSpan;
4936
5101
  this._advance();
4937
5102
  } else this.errors.push(TreeError.create(null, nameToken.sourceSpan, "Unterminated directive definition"));
@@ -4942,11 +5107,11 @@ var _TreeBuilder = class _TreeBuilder {
4942
5107
  }
4943
5108
  _consumeBlockOpen(token) {
4944
5109
  const parameters = [];
4945
- while (this._peek.type === TokenType.BLOCK_PARAMETER) {
5110
+ while (this._peek.type === 29) {
4946
5111
  const paramToken = this._advance();
4947
5112
  parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
4948
5113
  }
4949
- if (this._peek.type === TokenType.BLOCK_OPEN_END) this._advance();
5114
+ if (this._peek.type === 27) this._advance();
4950
5115
  const end = this._peek.sourceSpan.fullStart;
4951
5116
  const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
4952
5117
  const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
@@ -4954,11 +5119,20 @@ var _TreeBuilder = class _TreeBuilder {
4954
5119
  this._pushContainer(block, false);
4955
5120
  }
4956
5121
  _consumeBlockClose(token) {
4957
- if (!this._popContainer(null, Block, token.sourceSpan)) this.errors.push(TreeError.create(null, token.sourceSpan, "Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the \"&#125;\" HTML entity instead."));
5122
+ const initialStackLength = this._containerStack.length;
5123
+ const topNode = this._containerStack[initialStackLength - 1];
5124
+ if (!this._popContainer(null, Block, token.sourceSpan)) {
5125
+ if (this._containerStack.length < initialStackLength) {
5126
+ const nodeName = topNode instanceof Component ? topNode.fullName : topNode.name;
5127
+ this.errors.push(TreeError.create(null, token.sourceSpan, `Unexpected closing block. The block may have been closed earlier. Did you forget to close the <${nodeName}> element? If you meant to write the \`}\` character, you should use the "&#125;" HTML entity instead.`));
5128
+ return;
5129
+ }
5130
+ this.errors.push(TreeError.create(null, token.sourceSpan, "Unexpected closing block. The block may have been closed earlier. If you meant to write the `}` character, you should use the \"&#125;\" HTML entity instead."));
5131
+ }
4958
5132
  }
4959
5133
  _consumeIncompleteBlock(token) {
4960
5134
  const parameters = [];
4961
- while (this._peek.type === TokenType.BLOCK_PARAMETER) {
5135
+ while (this._peek.type === 29) {
4962
5136
  const paramToken = this._advance();
4963
5137
  parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
4964
5138
  }
@@ -4974,15 +5148,15 @@ var _TreeBuilder = class _TreeBuilder {
4974
5148
  const name = startToken.parts[0];
4975
5149
  let valueToken;
4976
5150
  let endToken;
4977
- if (this._peek.type !== TokenType.LET_VALUE) {
5151
+ if (this._peek.type !== 32) {
4978
5152
  this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Invalid @let declaration "${name}". Declaration must have a value.`));
4979
5153
  return;
4980
5154
  } else valueToken = this._advance();
4981
- if (this._peek.type !== TokenType.LET_END) {
5155
+ if (this._peek.type !== 33) {
4982
5156
  this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Unterminated @let declaration "${name}". Declaration must be terminated with a semicolon.`));
4983
5157
  return;
4984
5158
  } else endToken = this._advance();
4985
- const end = endToken.sourceSpan.fullStart;
5159
+ const end = endToken.sourceSpan.end;
4986
5160
  const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
4987
5161
  const startOffset = startToken.sourceSpan.toString().lastIndexOf(name);
4988
5162
  const nameSpan = new ParseSourceSpan(startToken.sourceSpan.start.moveBy(startOffset), startToken.sourceSpan.end);
@@ -5036,7 +5210,7 @@ var _TreeBuilder = class _TreeBuilder {
5036
5210
  var _this$_getTagDefiniti8;
5037
5211
  let prefix;
5038
5212
  let tagName;
5039
- if (token.type === TokenType.COMPONENT_OPEN_START || token.type === TokenType.INCOMPLETE_COMPONENT_OPEN || token.type === TokenType.COMPONENT_CLOSE) {
5213
+ if (token.type === 35 || token.type === 39 || token.type === 38) {
5040
5214
  prefix = token.parts[1];
5041
5215
  tagName = token.parts[2];
5042
5216
  } else {
@@ -5070,7 +5244,7 @@ function decodeEntity(match, entity) {
5070
5244
  return match;
5071
5245
  }
5072
5246
  //#endregion
5073
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/html_parser.mjs
5247
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/html_parser.mjs
5074
5248
  /**
5075
5249
  * @license
5076
5250
  * Copyright Google LLC All Rights Reserved.
@@ -5087,7 +5261,7 @@ var HtmlParser = class extends Parser {
5087
5261
  }
5088
5262
  };
5089
5263
  //#endregion
5090
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/xml_tags.mjs
5264
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/xml_tags.mjs
5091
5265
  /**
5092
5266
  * @license
5093
5267
  * Copyright Google LLC All Rights Reserved.
@@ -5109,7 +5283,7 @@ var XmlTagDefinition = class {
5109
5283
  return false;
5110
5284
  }
5111
5285
  getContentType() {
5112
- return TagContentType.PARSABLE_DATA;
5286
+ return 2;
5113
5287
  }
5114
5288
  };
5115
5289
  const _TAG_DEFINITION = new XmlTagDefinition();
@@ -5117,7 +5291,14 @@ function getXmlTagDefinition(tagName) {
5117
5291
  return _TAG_DEFINITION;
5118
5292
  }
5119
5293
  //#endregion
5120
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/xml_parser.mjs
5294
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/compiler/src/ml_parser/xml_parser.mjs
5295
+ /**
5296
+ * @license
5297
+ * Copyright Google LLC All Rights Reserved.
5298
+ *
5299
+ * Use of this source code is governed by an MIT-style license that can be
5300
+ * found in the LICENSE file at https://angular.dev/license
5301
+ */
5121
5302
  var XmlParser = class extends Parser {
5122
5303
  constructor() {
5123
5304
  super(getXmlTagDefinition);
@@ -5132,15 +5313,16 @@ var XmlParser = class extends Parser {
5132
5313
  }
5133
5314
  };
5134
5315
  //#endregion
5135
- //#region ../../node_modules/.pnpm/angular-html-parser@10.4.0/node_modules/angular-html-parser/dist/index.mjs
5316
+ //#region ../../node_modules/.pnpm/angular-html-parser@10.12.0/node_modules/angular-html-parser/dist/index.mjs
5136
5317
  let htmlParser;
5137
5318
  function parseHtml(input, options = {}) {
5138
- const { canSelfClose = false, allowHtmComponentClosingTags = false, isTagNameCaseSensitive = false, getTagContentType, tokenizeAngularBlocks = false, tokenizeAngularLetDeclaration = false, enableAngularSelectorlessSyntax = false } = options;
5319
+ const { canSelfClose = false, allowHtmComponentClosingTags = false, allowStartTagComments = false, isTagNameCaseSensitive = false, getTagContentType, tokenizeAngularBlocks = false, tokenizeAngularLetDeclaration = false, enableAngularSelectorlessSyntax = false } = options;
5139
5320
  htmlParser ?? (htmlParser = new HtmlParser());
5140
5321
  return htmlParser.parse(input, "angular-html-parser", {
5141
5322
  tokenizeExpansionForms: tokenizeAngularBlocks,
5142
5323
  canSelfClose,
5143
5324
  allowHtmComponentClosingTags,
5325
+ allowStartTagComments,
5144
5326
  tokenizeBlocks: tokenizeAngularBlocks,
5145
5327
  tokenizeLet: tokenizeAngularLetDeclaration,
5146
5328
  selectorlessEnabled: enableAngularSelectorlessSyntax
@@ -5152,4 +5334,4 @@ function parseXml(input) {
5152
5334
  return xmlParser.parse(input, "angular-xml-parser");
5153
5335
  }
5154
5336
  //#endregion
5155
- export { ParseLocation, ParseSourceFile, ParseSourceSpan, RecursiveVisitor, TagContentType, getHtmlTagDefinition, parseHtml as parse, parseHtml, parseXml, visitAll };
5337
+ export { ParseLocation, ParseSourceFile, ParseSourceSpan, RecursiveVisitor, SUPPORTED_BLOCKS as SUPPORTED_ANGULAR_BLOCKS, TagContentType, getHtmlTagDefinition, parseHtml as parse, parseHtml, parseXml, visitAll };